# nodes

node_type: n8n-nodes-base.Pipedrive
name: Pipedrive
display_name: Pipedrive
description: Create and edit data in Pipedrive
category: transform
icon: file:pipedrive.svg
code_hash: c964e69be5af2dffe6fcff880f45c47f440717ee0bba524f67cf30b0cfb8cbe2
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Pipedrive
documentation_title: Pipedrive node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"pipedrive","description":"Templates for pipedrive"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:26
updated_at: 2025-06-09 15:18:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Pipedrive = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utils_1 = require("./utils");
  function addAdditionalFields(body, additionalFields) {
      for (const key of Object.keys(additionalFields)) {
          if (key === 'customProperties' &&
              additionalFields.customProperties.property !== undefined) {
              for (const customProperty of additionalFields.customProperties
                  .property) {
                  body[customProperty.name] = customProperty.value;
              }
          }
          else {
              body[key] = additionalFields[key];
          }
      }
  }
  class Pipedrive {
      constructor() {
          this.description = {
              displayName: 'Pipedrive',
              name: 'pipedrive',
              icon: 'file:pipedrive.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Create and edit data in Pipedrive',
              defaults: {
                  name: 'Pipedrive',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pipedriveApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['apiToken'],
                          },
                      },
                      testedBy: {
                          request: {
                              method: 'GET',
                              url: '/users/me',
                          },
                      },
                  },
                  {
                      name: 'pipedriveOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              requestDefaults: {
                  baseURL: 'https://api.pipedrive.com/v1',
                  url: '',
              },
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'API Token',
                              value: 'apiToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'apiToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                          {
                              name: 'Deal',
                              value: 'deal',
                          },
                          {
                              name: 'Deal Activity',
                              value: 'dealActivity',
                          },
                          {
                              name: 'Deal Product',
                              value: 'dealProduct',
                          },
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Lead',
                              value: 'lead',
                          },
                          {
                              name: 'Note',
                              value: 'note',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Person',
                              value: 'person',
                          },
                          {
                              name: 'Product',
                              value: 'product',
                          },
                      ],
                      default: 'deal',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['activity'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create an activity',
                              action: 'Create an activity',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete an activity',
                              action: 'Delete an activity',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of an activity',
                              action: 'Get an activity',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many activities',
                              action: 'Get many activities',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update an activity',
                              action: 'Update an activity',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['deal'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a deal',
                              action: 'Create a deal',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a deal',
                              action: 'Delete a deal',
                          },
                          {
                              name: 'Duplicate',
                              value: 'duplicate',
                              description: 'Duplicate a deal',
                              action: 'Duplicate a deal',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a deal',
                              action: 'Get a deal',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many deals',
                              action: 'Get many deals',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search a deal',
                              action: 'Search a deal',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a deal',
                              action: 'Update a deal',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['dealActivity'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many activities of a deal',
                              action: 'Get many deal activities',
                          },
                      ],
                      default: 'getAll',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['dealProduct'],
                          },
                      },
                      options: [
                          {
                              name: 'Add',
                              value: 'add',
                              description: 'Add a product to a deal',
                              action: 'Add a deal product',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many products in a deal',
                              action: 'Get many deal products',
                          },
                          {
                              name: 'Remove',
                              value: 'remove',
                              description: 'Remove a product from a deal',
                              action: 'Remove a deal product',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a product in a deal',
                              action: 'Update a deal product',
                          },
                      ],
                      default: 'add',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a file',
                              action: 'Create a file',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a file',
                              action: 'Delete a file',
                          },
                          {
                              name: 'Download',
                              value: 'download',
                              description: 'Download a file',
                              action: 'Download a file',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a file',
                              action: 'Get a file',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update file details',
                              action: 'update details of a file',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a lead',
                              action: 'Create a lead',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a lead',
                              action: 'Delete a lead',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a lead',
                              action: 'Get a lead',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many leads',
                              action: 'Get many leads',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a lead',
                              action: 'Update a lead',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['note'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a note',
                              action: 'Create a note',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a note',
                              action: 'Delete a note',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a note',
                              action: 'Get a note',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many notes',
                              action: 'Get many notes',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a note',
                              action: 'Update a note',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['organization'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create an organization',
                              action: 'Create an organization',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete an organization',
                              action: 'Delete an organization',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of an organization',
                              action: 'Get an organization',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many organizations',
                              action: 'Get many organizations',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search organizations',
                              action: 'Search an organization',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update an organization',
                              action: 'Update an organization',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['person'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a person',
                              action: 'Create a person',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a person',
                              action: 'Delete a person',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a person',
                              action: 'Get a person',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many persons',
                              action: 'Get many people',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search all persons',
                              action: 'Search a person',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a person',
                              action: 'Update a person',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['product'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many products',
                              action: 'Get many products',
                          },
                      ],
                      default: 'getAll',
                  },
                  {
                      displayName: 'Subject',
                      name: 'subject',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['activity'],
                          },
                      },
                      description: 'The subject of the activity to create',
                  },
                  {
                      displayName: 'Done',
                      name: 'done',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['activity'],
                          },
                      },
                      options: [
                          {
                              name: 'Not Done',
                              value: '0',
                          },
                          {
                              name: 'Done',
                              value: '1',
                          },
                      ],
                      default: '0',
                      description: 'Whether the activity is done or not',
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['activity'],
                          },
                      },
                      placeholder: 'call',
                      description: 'Type of the activity like "call", "meeting", etc',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['activity'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this activity will be associated with',
                          },
                          {
                              displayName: 'Due Date',
                              name: 'due_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Due Date to activity be done YYYY-MM-DD',
                          },
                          {
                              displayName: 'Note',
                              name: 'note',
                              type: 'string',
                              typeOptions: {
                                  rows: 5,
                              },
                              default: '',
                              description: 'Note of the activity (HTML format)',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this activity will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this activity will be associated with',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the active user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Custom Properties',
                              name: 'customProperties',
                              placeholder: 'Add Custom Property',
                              description: 'Adds a custom property to set also values which have not been predefined',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'property',
                                      displayName: 'Property',
                                      values: [
                                          {
                                              displayName: 'Property Name',
                                              name: 'name',
                                              type: 'string',
                                              default: '',
                                              description: 'Name of the property to set',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Activity ID',
                      name: 'activityId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['activity'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the activity to delete',
                  },
                  {
                      displayName: 'Activity ID',
                      name: 'activityId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['activity'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the activity to get',
                  },
                  {
                      displayName: 'Activity ID',
                      name: 'activityId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['activity'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the activity to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['activity'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this activity will be associated with',
                          },
                          {
                              displayName: 'Due Date',
                              name: 'due_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Due Date to activity be done YYYY-MM-DD',
                          },
                          {
                              displayName: 'Done',
                              name: 'done',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Not Done',
                                      value: '0',
                                  },
                                  {
                                      name: 'Done',
                                      value: '1',
                                  },
                              ],
                              default: '0',
                              description: 'Whether the activity is done or not',
                          },
                          {
                              displayName: 'Note',
                              name: 'note',
                              type: 'string',
                              typeOptions: {
                                  rows: 5,
                              },
                              default: '',
                              description: 'Note of the activity (HTML format)',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this activity will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this activity will be associated with',
                          },
                          {
                              displayName: 'Subject',
                              name: 'subject',
                              type: 'string',
                              default: '',
                              description: 'The subject of the activity',
                          },
                          {
                              displayName: 'Type',
                              name: 'type',
                              type: 'string',
                              default: '',
                              placeholder: 'call',
                              description: 'Type of the activity like "call", "meeting", etc',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the active user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Custom Properties',
                              name: 'customProperties',
                              placeholder: 'Add Custom Property',
                              description: 'Adds a custom property to set also values which have not been predefined',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'property',
                                      displayName: 'Property',
                                      values: [
                                          {
                                              displayName: 'Property Name',
                                              name: 'name',
                                              type: 'string',
                                              default: '',
                                              description: 'Name of the property to set',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['deal'],
                          },
                      },
                      description: 'The title of the deal to create',
                  },
                  {
                      displayName: 'Associate With',
                      name: 'associateWith',
                      type: 'options',
                      options: [
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Person',
                              value: 'person',
                          },
                      ],
                      default: 'organization',
                      description: 'Type of entity to link to this deal',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['deal'],
                              operation: ['create'],
                          },
                      },
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'org_id',
                      type: 'number',
                      default: 0,
                      description: 'ID of the organization this deal will be associated with',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['deal'],
                              associateWith: ['organization'],
                          },
                      },
                  },
                  {
                      displayName: 'Person ID',
                      name: 'person_id',
                      type: 'number',
                      default: 0,
                      description: 'ID of the person this deal will be associated with',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['deal'],
                              associateWith: ['person'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['deal'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Currency',
                              name: 'currency',
                              type: 'string',
                              default: 'USD',
                              description: 'Currency of the deal. Accepts a 3-character currency code. Like EUR, USD, ...',
                          },
                          {
                              displayName: 'Custom Properties',
                              name: 'customProperties',
                              placeholder: 'Add Custom Property',
                              description: 'Adds a custom property to set also values which have not been predefined',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'property',
                                      displayName: 'Property',
                                      values: [
                                          {
                                              displayName: 'Property Name or ID',
                                              name: 'name',
                                              type: 'options',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getDealCustomFields',
                                              },
                                              default: '',
                                              description: 'Name of the property to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              type: 'options',
                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                              typeOptions: {
                                  loadOptionsMethod: 'getDealLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Lost Reason',
                              name: 'lost_reason',
                              type: 'string',
                              default: '',
                              description: 'Reason why the deal was lost',
                          },
                          {
                              displayName: 'Organization ID',
                              name: 'org_id',
                              type: 'number',
                              default: 0,
                              displayOptions: {
                                  show: {
                                      '/associateWith': ['person'],
                                  },
                              },
                              description: 'ID of the organization this deal will be associated with',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              displayOptions: {
                                  show: {
                                      '/associateWith': ['organization'],
                                  },
                              },
                              description: 'ID of the person this deal will be associated with',
                          },
                          {
                              displayName: 'Probability',
                              name: 'probability',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              default: 0,
                              description: 'Deal success probability percentage',
                          },
                          {
                              displayName: 'Stage Name or ID',
                              name: 'stage_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getStageIds',
                              },
                              default: '',
                              description: 'ID of the stage this deal will be placed in a pipeline. If omitted, the deal will be placed in the first stage of the default pipeline. (PIPELINE > STAGE). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Won',
                                      value: 'won',
                                  },
                                  {
                                      name: 'Lost',
                                      value: 'lost',
                                  },
                                  {
                                      name: 'Deleted',
                                      value: 'deleted',
                                  },
                              ],
                              default: 'open',
                              description: 'The status of the deal. If not provided it will automatically be set to "open".',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the active user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Value',
                              name: 'value',
                              type: 'number',
                              default: 0,
                              description: 'Value of the deal. If not set it will automatically be set to 0.',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Deal ID',
                      name: 'dealId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['deal'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the deal to delete',
                  },
                  {
                      displayName: 'Deal ID',
                      name: 'dealId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['duplicate'],
                              resource: ['deal'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the deal to duplicate',
                  },
                  {
                      displayName: 'Deal ID',
                      name: 'dealId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['deal'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the deal to get',
                  },
                  {
                      displayName: 'Deal ID',
                      name: 'dealId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['deal'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the deal to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['deal'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Currency',
                              name: 'currency',
                              type: 'string',
                              default: 'USD',
                              description: 'Currency of the deal. Accepts a 3-character currency code. Like EUR, USD, ...',
                          },
                          {
                              displayName: 'Custom Properties',
                              name: 'customProperties',
                              placeholder: 'Add Custom Property',
                              description: 'Adds a custom property to set also values which have not been predefined',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'property',
                                      displayName: 'Property',
                                      values: [
                                          {
                                              displayName: 'Property Name or ID',
                                              name: 'name',
                                              type: 'options',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getDealCustomFields',
                                              },
                                              default: '',
                                              description: 'Name of the custom field to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the active user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              type: 'options',
                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                              typeOptions: {
                                  loadOptionsMethod: 'getDealLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Lost Reason',
                              name: 'lost_reason',
                              type: 'string',
                              default: '',
                              description: 'Reason why the deal was lost',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this deal will be associated with',
                          },
                          {
                              displayName: 'Probability',
                              name: 'probability',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              default: 0,
                              description: 'Deal success probability percentage',
                          },
                          {
                              displayName: 'Stage Name or ID',
                              name: 'stage_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getStageIds',
                              },
                              default: '',
                              description: 'ID of the stage this deal will be placed in a pipeline. If omitted, the deal will be placed in the first stage of the default pipeline. (PIPELINE > STAGE). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Won',
                                      value: 'won',
                                  },
                                  {
                                      name: 'Lost',
                                      value: 'lost',
                                  },
                                  {
                                      name: 'Deleted',
                                      value: 'deleted',
                                  },
                              ],
                              default: 'open',
                              description: 'The status of the deal. If not provided it will automatically be set to "open".',
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'The title of the deal',
                          },
                          {
                              displayName: 'Value',
                              name: 'value',
                              type: 'number',
                              default: 0,
                              description: 'Value of the deal. If not set it will automatically be set to 0.',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the deal to add a product to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Product Name or ID',
                      name: 'productId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getProducts',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the product to add to a deal. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Item Price',
                      name: 'item_price',
                      type: 'number',
                      typeOptions: {
                          numberPrecision: 2,
                      },
                      default: 0.0,
                      required: true,
                      description: 'Price at which to add or update this product in a deal',
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                  },
                  {
                      displayName: 'Quantity',
                      name: 'quantity',
                      type: 'number',
                      default: 1,
                      typeOptions: {
                          minValue: 1,
                      },
                      required: true,
                      description: 'How many items of this product to add/update in a deal',
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Comments',
                              name: 'comments',
                              type: 'string',
                              typeOptions: {
                                  rows: 4,
                              },
                              default: '',
                              description: 'Text to describe this product-deal attachment',
                          },
                          {
                              displayName: 'Discount Percentage',
                              name: 'discount_percentage',
                              type: 'number',
                              default: 0,
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              description: 'Percentage of discount to apply',
                          },
                          {
                              displayName: 'Product Variation ID',
                              name: 'product_variation_id',
                              type: 'string',
                              default: '',
                              description: 'ID of the product variation to use',
                          },
                      ],
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the deal whose product to update. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Product Attachment Name or ID',
                      name: 'productAttachmentId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getProductsDeal',
                          loadOptionsDependsOn: ['dealId'],
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'ID of the deal-product (the ID of the product attached to the deal). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['dealProduct'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Comments',
                              name: 'comments',
                              type: 'string',
                              typeOptions: {
                                  rows: 4,
                              },
                              default: '',
                              description: 'Text to describe this product-deal attachment',
                          },
                          {
                              displayName: 'Discount Percentage',
                              name: 'discount_percentage',
                              type: 'number',
                              default: 0,
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              description: 'Percentage of discount to apply',
                          },
                          {
                              displayName: 'Item Price',
                              name: 'item_price',
                              type: 'number',
                              typeOptions: {
                                  numberPrecision: 2,
                              },
                              default: 0.0,
                              description: 'Price at which to add or update this product in a deal',
                          },
                          {
                              displayName: 'Quantity',
                              name: 'quantity',
                              type: 'number',
                              default: 1,
                              typeOptions: {
                                  minValue: 1,
                              },
                              description: 'How many items of this product to add/update in a deal',
                          },
                          {
                              displayName: 'Product Variation ID',
                              name: 'product_variation_id',
                              type: 'string',
                              default: '',
                              description: 'ID of the product variation to use',
                          },
                      ],
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['remove'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the deal whose product to remove. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Product Attachment Name or ID',
                      name: 'productAttachmentId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getProductsDeal',
                          loadOptionsDependsOn: ['dealId'],
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['remove'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'ID of the deal-product (the ID of the product attached to the deal). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the deal whose products to retrieve. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Term',
                      name: 'term',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['deal'],
                          },
                      },
                      default: '',
                      description: 'The search term to look for. Minimum 2 characters (or 1 if using exact_match).',
                  },
                  {
                      displayName: 'Exact Match',
                      name: 'exactMatch',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['deal'],
                          },
                      },
                      default: false,
                      description: 'Whether only full exact matches against the given term are returned. It is not case sensitive.',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 500,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['deal'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Include Fields',
                              name: 'includeFields',
                              type: 'string',
                              default: '',
                              description: 'Supports including optional fields in the results which are not provided by default. Example: deal.cc_email.',
                          },
                          {
                              displayName: 'Organization ID',
                              name: 'organizationId',
                              type: 'string',
                              default: '',
                              description: 'Will filter Deals by the provided Organization ID',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'personId',
                              type: 'string',
                              default: '',
                              description: 'Will filter Deals by the provided Person ID',
                          },
                          {
                              displayName: 'Search Fields',
                              name: 'fields',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Custom Fields',
                                      value: 'custom_fields',
                                  },
                                  {
                                      name: 'Notes',
                                      value: 'notes',
                                  },
                                  {
                                      name: 'Title',
                                      value: 'title',
                                  },
                              ],
                              default: ['custom_fields', 'notes', 'title'],
                              description: 'A comma-separated string array. The fields to perform the search from. Defaults to all of them.',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Won',
                                      value: 'won',
                                  },
                                  {
                                      name: 'Lost',
                                      value: 'lost',
                                  },
                              ],
                              default: 'open',
                              description: 'The status of the deal. If not provided it will automatically be set to "open".',
                          },
                      ],
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file to be created',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['file'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Activity ID',
                              name: 'activity_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the activite this file will be associated with',
                          },
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this file will be associated with',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this file will be associated with',
                          },
                          {
                              displayName: 'Product ID',
                              name: 'product_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this file will be associated with',
                          },
                      ],
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['file'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the file to delete',
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the file to download',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      description: 'Name of the binary property to which to write the data of the downloaded file',
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the file to get',
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['file'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the file to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['file'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'The updated visible name of the file',
                          },
                          {
                              displayName: 'Description',
                              name: 'description',
                              type: 'string',
                              default: '',
                              description: 'The updated description of the file',
                          },
                      ],
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      description: 'Name of the lead to create',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                          },
                      },
                  },
                  {
                      displayName: 'Associate With',
                      name: 'associateWith',
                      type: 'options',
                      options: [
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Person',
                              value: 'person',
                          },
                      ],
                      default: 'organization',
                      description: 'Type of entity to link to this lead',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                          },
                      },
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'organization_id',
                      type: 'number',
                      default: 0,
                      description: 'ID of the organization to link to this lead',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                              associateWith: ['organization'],
                          },
                      },
                  },
                  {
                      displayName: 'Person ID',
                      name: 'person_id',
                      type: 'number',
                      default: 0,
                      description: 'ID of the person to link to this lead',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                              associateWith: ['person'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Expected Close Date',
                              name: 'expected_close_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Date when the lead’s deal is expected to be closed, in ISO-8601 format',
                          },
                          {
                              displayName: 'Label Names or IDs',
                              name: 'label_ids',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getLeadLabels',
                              },
                              default: [],
                              description: 'ID of the labels to attach to the lead to create. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Organization ID',
                              name: 'organization_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the organization to link to this lead',
                              displayOptions: {
                                  show: {
                                      '/associateWith': ['person'],
                                  },
                              },
                          },
                          {
                              displayName: 'Owner Name or ID',
                              name: 'owner_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the user who will own the lead to create. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person to link to this lead',
                              displayOptions: {
                                  show: {
                                      '/associateWith': ['organization'],
                                  },
                              },
                          },
                          {
                              displayName: 'Value',
                              name: 'value',
                              type: 'fixedCollection',
                              description: 'Potential monetary value associated with the lead',
                              default: {},
                              options: [
                                  {
                                      displayName: 'Value Properties',
                                      name: 'valueProperties',
                                      values: [
                                          {
                                              displayName: 'Amount',
                                              name: 'amount',
                                              type: 'number',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Currency',
                                              name: 'currency',
                                              type: 'options',
                                              default: 'USD',
                                              options: utils_1.currencies.sort((a, b) => a.name.localeCompare(b.name)),
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Lead ID',
                      name: 'leadId',
                      description: 'ID of the lead to delete',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['delete'],
                          },
                      },
                  },
                  {
                      displayName: 'Lead ID',
                      name: 'leadId',
                      description: 'ID of the lead to retrieve',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Lead ID',
                      name: 'leadId',
                      description: 'ID of the lead to update',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['update'],
                          },
                      },
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['update'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'Name of the lead to update',
                          },
                          {
                              displayName: 'Owner Name or ID',
                              name: 'owner_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the user who will own the lead to update. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Label Names or IDs',
                              name: 'label_ids',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getLeadLabels',
                              },
                              default: [],
                              description: 'ID of the labels to attach to the lead to update. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person Name or ID',
                              name: 'person_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getPersons',
                              },
                              default: '',
                              description: 'ID of the person to link to this lead. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Value',
                              name: 'value',
                              type: 'fixedCollection',
                              description: 'Potential monetary value associated with the lead',
                              default: {},
                              options: [
                                  {
                                      displayName: 'Value Properties',
                                      name: 'valueProperties',
                                      values: [
                                          {
                                              displayName: 'Amount',
                                              name: 'amount',
                                              type: 'number',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Currency',
                                              name: 'currency',
                                              type: 'options',
                                              default: 'USD',
                                              options: utils_1.currencies.sort((a, b) => a.name.localeCompare(b.name)),
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Expected Close Date',
                              name: 'expected_close_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Date when the lead’s deal is expected to be closed, in ISO-8601 format',
                          },
                      ],
                  },
                  {
                      displayName: 'Content',
                      name: 'content',
                      typeOptions: {
                          rows: 5,
                      },
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['note'],
                          },
                      },
                      description: 'The content of the note to create',
                  },
                  {
                      displayName: 'Note ID',
                      name: 'noteId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['note'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the note to delete',
                  },
                  {
                      displayName: 'Note ID',
                      name: 'noteId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['note'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the note to get',
                  },
                  {
                      displayName: 'Note ID',
                      name: 'noteId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['note'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the note to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['note'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Content',
                              name: 'content',
                              typeOptions: {
                                  rows: 5,
                              },
                              type: 'string',
                              default: '',
                              description: 'The content of the note',
                          },
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this note will be associated with',
                          },
                          {
                              displayName: 'Lead ID',
                              name: 'lead_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the lead this note will be associated with',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this note will be associated with',
                          },
                      ],
                  },
                  {
                      displayName: 'Name',
                      name: 'name',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['organization'],
                          },
                      },
                      description: 'The name of the organization to create',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['organization'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Custom Properties',
                              name: 'customProperties',
                              placeholder: 'Add Custom Property',
                              description: 'Adds a custom property to set also values which have not been predefined',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'property',
                                      displayName: 'Property',
                                      values: [
                                          {
                                              displayName: 'Property Name',
                                              name: 'name',
                                              type: 'string',
                                              default: '',
                                              description: 'Name of the property to set',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              type: 'options',
                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'organizationId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['organization'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the organization to delete',
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'organizationId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['organization'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the organization to get',
                  },
                  {
                      displayName: 'Term',
                      name: 'term',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['organization'],
                          },
                      },
                      default: '',
                      description: 'The search term to look for. Minimum 2 characters (or 1 if using exact_match).',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['organization'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Exact Match',
                              name: 'exactMatch',
                              type: 'boolean',
                              default: false,
                              description: 'Whether only full exact matches against the given term are returned. It is not case sensitive.',
                          },
                          {
                              displayName: 'Fields',
                              name: 'fields',
                              type: 'multiOptions',
                              default: [],
                              description: 'Fields to the search in. Defaults to all of them.',
                              options: [
                                  {
                                      name: 'Address',
                                      value: 'address',
                                  },
                                  {
                                      name: 'Custom Fields',
                                      value: 'custom_fields',
                                  },
                                  {
                                      name: 'Name',
                                      value: 'name',
                                  },
                                  {
                                      name: 'Notes',
                                      value: 'notes',
                                  },
                              ],
                          },
                          {
                              displayName: 'RAW Data',
                              name: 'rawData',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to return the data exactly in the way it got received from the API',
                          },
                      ],
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'organizationId',
                      type: 'number',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['organization'],
                          },
                      },
                      description: 'The ID of the organization to create',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['organization'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Custom Properties',
                              name: 'customProperties',
                              placeholder: 'Add Custom Property',
                              description: 'Adds a custom property to set also values which have not been predefined',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'property',
                                      displayName: 'Property',
                                      values: [
                                          {
                                              displayName: 'Property Name',
                                              name: 'name',
                                              type: 'string',
                                              default: '',
                                              description: 'Name of the property to set',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              type: 'options',
                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'Organization name',
                          },
                          {
                              displayName: 'Owner ID',
                              name: 'owner_id',
                              type: 'number',
                              default: 0,
                              description: 'The ID of the user who will be marked as the owner of this Organization. When omitted, the authorized User ID will be used.',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Name',
                      name: 'name',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['person'],
                          },
                      },
                      description: 'The name of the person to create',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['person'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Custom Properties',
                              name: 'customProperties',
                              placeholder: 'Add Custom Property',
                              description: 'Adds a custom property to set also values which have not been predefined',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'property',
                                      displayName: 'Property',
                                      values: [
                                          {
                                              displayName: 'Property Name or ID',
                                              name: 'name',
                                              type: 'options',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getPersonCustomFields',
                                              },
                                              default: '',
                                              description: 'Name of the custom field to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Email',
                              name: 'email',
                              type: 'string',
                              placeholder: 'name@email.com',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: '',
                              description: 'Email of the person',
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              type: 'options',
                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                              typeOptions: {
                                  loadOptionsMethod: 'getPersonLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Marketing Status',
                              name: 'marketing_status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'No Consent',
                                      value: 'no_consent',
                                  },
                                  {
                                      name: 'Unsubscribed',
                                      value: 'unsubscribed',
                                  },
                                  {
                                      name: 'Subscribed',
                                      value: 'subscribed',
                                  },
                                  {
                                      name: 'Archived',
                                      value: 'archived',
                                  },
                              ],
                              default: 'subscribed',
                              description: 'Please be aware that it is only allowed once to change the marketing status from an old status to a new one',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Phone',
                              name: 'phone',
                              type: 'string',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: '',
                              description: 'Phone number of the person',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'owner_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the User this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'Person ID',
                      name: 'personId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['person'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the person to delete',
                  },
                  {
                      displayName: 'Person ID',
                      name: 'personId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['person'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the person to get',
                  },
                  {
                      displayName: 'Person ID',
                      name: 'personId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['person'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the person to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      description: 'The fields to update',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['person'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Custom Properties',
                              name: 'customProperties',
                              placeholder: 'Add Custom Property',
                              description: 'Adds a custom property to set also values which have not been predefined',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'property',
                                      displayName: 'Property',
                                      values: [
                                          {
                                              displayName: 'Property Name or ID',
                                              name: 'name',
                                              type: 'options',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getPersonCustomFields',
                                              },
                                              default: '',
                                              description: 'Name of the custom field to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Email',
                              name: 'email',
                              type: 'string',
                              placeholder: 'name@email.com',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: '',
                              description: 'Email of the person',
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              type: 'options',
                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                              typeOptions: {
                                  loadOptionsMethod: 'getPersonLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Marketing Status',
                              name: 'marketing_status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'No Consent',
                                      value: 'no_consent',
                                  },
                                  {
                                      name: 'Unsubscribed',
                                      value: 'unsubscribed',
                                  },
                                  {
                                      name: 'Subscribed',
                                      value: 'subscribed',
                                  },
                                  {
                                      name: 'Archived',
                                      value: 'archived',
                                  },
                              ],
                              default: 'subscribed',
                              description: 'Please be aware that it is only allowed once to change the marketing status from an old status to a new one',
                          },
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'The name of the person',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Phone',
                              name: 'phone',
                              type: 'string',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: '',
                              description: 'Phone number of the person',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'owner_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the User this person will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Resolve Properties',
                      name: 'resolveProperties',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['activity', 'deal', 'organization', 'person', 'product'],
                              operation: ['get', 'getAll'],
                          },
                      },
                      default: false,
                      description: 'By default do custom properties get returned only as ID instead of their actual name. Also option fields contain only the ID instead of their actual value. If this option gets set they get automatically resolved.',
                  },
                  {
                      displayName: 'Encode Properties',
                      name: 'encodeProperties',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['activity', 'deal', 'organization', 'person', 'product'],
                              operation: ['update'],
                          },
                      },
                      default: false,
                      description: 'By default do custom properties have to be set as ID instead of their actual name. Also option fields have to be set as ID instead of their actual value. If this option gets set they get automatically encoded.',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 500,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['dealActivity'],
                          },
                      },
                      description: 'The ID of the deal whose activity to retrieve. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['dealActivity'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Done',
                              name: 'done',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the activity is done or not',
                          },
                          {
                              displayName: 'Exclude Activity IDs',
                              name: 'exclude',
                              type: 'string',
                              default: '',
                              description: 'A comma-separated Activity IDs, to exclude from result. Ex. 4, 9, 11, ...',
                          },
                      ],
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['getAll'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Archived Status',
                              name: 'archived_status',
                              type: 'options',
                              default: 'all',
                              options: [
                                  {
                                      name: 'Archived',
                                      value: 'archived',
                                  },
                                  {
                                      name: 'All',
                                      value: 'all',
                                  },
                                  {
                                      name: 'Not Archived',
                                      value: 'not_archived',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['organization'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'First Char',
                              name: 'firstChar',
                              type: 'string',
                              default: '',
                              description: 'If supplied, only organizations whose name starts with the specified letter will be returned',
                          },
                          {
                              displayName: 'Predefined Filter Name or ID',
                              name: 'filterId',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getFilters',
                              },
                              default: '',
                              description: 'ID of the filter to use. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['person'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Predefined Filter Name or ID',
                              name: 'filterId',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getFilters',
                              },
                              default: '',
                              description: 'ID of the filter to use. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'First Char',
                              name: 'firstChar',
                              type: 'string',
                              default: '',
                              description: 'If supplied, only persons whose name starts with the specified letter will be returned',
                          },
                      ],
                  },
                  {
                      displayName: 'Term',
                      name: 'term',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['person'],
                          },
                      },
                      default: '',
                      description: 'The search term to look for. Minimum 2 characters (or 1 if using exact_match).',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['person'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Exact Match',
                              name: 'exactMatch',
                              type: 'boolean',
                              default: false,
                              description: 'Whether only full exact matches against the given term are returned. It is not case sensitive.',
                          },
                          {
                              displayName: 'Fields',
                              name: 'fields',
                              type: 'string',
                              default: '',
                              description: 'A comma-separated string array. The fields to perform the search from. Defaults to all of them.',
                          },
                          {
                              displayName: 'Include Fields',
                              name: 'includeFields',
                              type: 'string',
                              default: '',
                              description: 'Supports including optional fields in the results which are not provided by default',
                          },
                          {
                              displayName: 'Organization ID',
                              name: 'organizationId',
                              type: 'string',
                              default: '',
                              description: 'Will filter Deals by the provided Organization ID',
                          },
                          {
                              displayName: 'RAW Data',
                              name: 'rawData',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to return the data exactly in the way it got received from the API',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create', 'getAll'],
                              resource: ['note'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this note will be associated with',
                          },
                          {
                              displayName: 'Lead ID',
                              name: 'lead_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the lead this note will be associated with',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this note will be associated with',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['activity'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Done',
                              name: 'done',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the Activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities.',
                          },
                          {
                              displayName: 'End Date',
                              name: 'end_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Use the Activity due date where you wish to stop fetching Activities from. Insert due date in YYYY-MM-DD format.',
                          },
                          {
                              displayName: 'Predefined Filter Name or ID',
                              name: 'filterId',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getFilters',
                              },
                              default: '',
                              description: 'The ID of the Filter to use (will narrow down results if used together with user_id parameter). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Star Date',
                              name: 'start_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Use the Activity due date where you wish to begin fetching Activities from. Insert due date in YYYY-MM-DD format.',
                          },
                          {
                              displayName: 'Type Names or IDs',
                              name: 'type',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getActivityTypes',
                              },
                              default: [],
                              description: 'Type of the Activity. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'The ID of the User whose Activities will be fetched. If omitted, the User associated with the API token will be used. If 0, Activities for all company Users will be fetched based on the permission sets. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['deal'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Predefined Filter Name or ID',
                              name: 'filter_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getFilters',
                              },
                              default: '',
                              description: 'Predefined filter to apply to the deals to retrieve. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Stage Name or ID',
                              name: 'stage_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getStageIds',
                              },
                              default: '',
                              description: 'ID of the stage to filter deals by. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'All Not Deleted',
                                      value: 'all_not_deleted',
                                  },
                                  {
                                      name: 'Deleted',
                                      value: 'deleted',
                                  },
                                  {
                                      name: 'Lost',
                                      value: 'lost',
                                  },
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Won',
                                      value: 'won',
                                  },
                              ],
                              default: 'all_not_deleted',
                              description: 'Status to filter deals by. Defaults to <code>all_not_deleted</code>',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the user to filter deals by. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getActivityTypes() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/activityTypes', {});
                      for (const activity of data) {
                          returnData.push({
                              name: activity.name,
                              value: activity.key_string,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getFilters() {
                      const returnData = [];
                      const resource = this.getNodeParameter('resource');
                      const type = {
                          deal: 'deals',
                          activity: 'activity',
                          person: 'people',
                          organization: 'org',
                      };
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/filters', {}, { type: type[resource] });
                      for (const filter of data) {
                          returnData.push({
                              name: filter.name,
                              value: filter.id,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getOrganizationIds() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/organizations', {});
                      for (const org of data) {
                          returnData.push({
                              name: org.name,
                              value: org.id,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getUserIds() {
                      const returnData = [];
                      const resource = this.getCurrentNodeParameter('resource');
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/users', {});
                      for (const user of data) {
                          if (user.active_flag === true) {
                              returnData.push({
                                  name: user.name,
                                  value: user.id,
                              });
                          }
                      }
                      if (resource === 'activity') {
                          returnData.push({
                              name: 'All Users',
                              value: 0,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getDeals() {
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/deals', {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, title }) => ({ value: id, name: title })));
                  },
                  async getProducts() {
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/products', {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, name }) => ({ value: id, name })));
                  },
                  async getProductsDeal() {
                      const dealId = this.getCurrentNodeParameter('dealId');
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', `/deals/${dealId}/products`, {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, name }) => ({ value: id, name })));
                  },
                  async getStageIds() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/stages', {});
                      for (const stage of data) {
                          returnData.push({
                              name: `${stage.pipeline_name} > ${stage.name}`,
                              value: stage.id,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getOrganizationCustomFields() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/organizationFields', {});
                      for (const field of data) {
                          if (field.key.length === 40) {
                              returnData.push({
                                  name: field.name,
                                  value: field.key,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getDealCustomFields() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/dealFields', {});
                      for (const field of data) {
                          if (field.key.length === 40) {
                              returnData.push({
                                  name: field.name,
                                  value: field.key,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getPersonCustomFields() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/personFields', {});
                      for (const field of data) {
                          if (field.key.length === 40) {
                              returnData.push({
                                  name: field.name,
                                  value: field.key,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getPersonLabels() {
                      const returnData = [];
                      const operation = this.getCurrentNodeParameter('operation');
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/personFields', {});
                      for (const field of data) {
                          if (field.key === 'label') {
                              if (field.options) {
                                  for (const option of field.options) {
                                      returnData.push({
                                          name: option.label,
                                          value: option.id,
                                      });
                                  }
                              }
                          }
                      }
                      (0, GenericFunctions_1.sortOptionParameters)(returnData);
                      if (operation === 'update') {
                          returnData.push({
                              name: 'No Label',
                              value: 'null',
                          });
                      }
                      return returnData;
                  },
                  async getOrganizationLabels() {
                      const returnData = [];
                      const operation = this.getCurrentNodeParameter('operation');
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/organizationFields', {});
                      for (const field of data) {
                          if (field.key === 'label') {
                              if (field.options) {
                                  for (const option of field.options) {
                                      returnData.push({
                                          name: option.label,
                                          value: option.id,
                                      });
                                  }
                              }
                          }
                      }
                      (0, GenericFunctions_1.sortOptionParameters)(returnData);
                      if (operation === 'update') {
                          returnData.push({
                              name: 'No Label',
                              value: 'null',
                          });
                      }
                      return returnData;
                  },
                  async getPersons() {
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/persons', {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, name }) => ({ value: id, name })));
                  },
                  async getLeadLabels() {
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/leadLabels', {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, name }) => ({ value: id, name })));
                  },
                  async getDealLabels() {
                      const returnData = [];
                      const operation = this.getCurrentNodeParameter('operation');
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/dealFields', {});
                      for (const field of data) {
                          if (field.key === 'label') {
                              if (field.options) {
                                  for (const option of field.options) {
                                      returnData.push({
                                          name: option.label,
                                          value: option.id,
                                      });
                                  }
                              }
                          }
                      }
                      (0, GenericFunctions_1.sortOptionParameters)(returnData);
                      if (operation === 'update') {
                          returnData.push({
                              name: 'No Label',
                              value: 'null',
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          const items = this.getInputData();
          const returnData = [];
          let body;
          let formData;
          let qs;
          let downloadFile;
          let requestMethod;
          let endpoint;
          let returnAll = false;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let customProperties;
          if (['get', 'getAll', 'update'].includes(operation) &&
              ['activity', 'deal', 'organization', 'person', 'product'].includes(resource)) {
              let getCustomProperties = false;
              if (['update'].includes(operation)) {
                  getCustomProperties = this.getNodeParameter('encodeProperties', 0, false);
              }
              else {
                  getCustomProperties = this.getNodeParameter('resolveProperties', 0, false);
              }
              if (getCustomProperties) {
                  customProperties = await GenericFunctions_1.pipedriveGetCustomProperties.call(this, resource);
              }
          }
          for (let i = 0; i < items.length; i++) {
              requestMethod = 'GET';
              endpoint = '';
              downloadFile = false;
              body = {};
              formData = {};
              qs = {};
              try {
                  if (resource === 'activity') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/activities';
                          body.subject = this.getNodeParameter('subject', i);
                          body.done = this.getNodeParameter('done', i);
                          body.type = this.getNodeParameter('type', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const activityId = this.getNodeParameter('activityId', i);
                          endpoint = `/activities/${activityId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const activityId = this.getNodeParameter('activityId', i);
                          endpoint = `/activities/${activityId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(qs, additionalFields);
                          if (qs.filterId) {
                              qs.filter_id = qs.filterId;
                              delete qs.filterId;
                          }
                          if (qs.type) {
                              qs.type = qs.type.join(',');
                          }
                          endpoint = '/activities';
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const activityId = this.getNodeParameter('activityId', i);
                          endpoint = `/activities/${activityId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                      }
                  }
                  else if (resource === 'deal') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/deals';
                          body.title = this.getNodeParameter('title', i);
                          const associateWith = this.getNodeParameter('associateWith', i);
                          if (associateWith === 'organization') {
                              body.org_id = this.getNodeParameter('org_id', i);
                          }
                          else {
                              body.person_id = this.getNodeParameter('person_id', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}`;
                      }
                      else if (operation === 'duplicate') {
                          requestMethod = 'POST';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}/duplicate`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const filters = this.getNodeParameter('filters', i);
                          addAdditionalFields(qs, filters);
                          endpoint = '/deals';
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                          if (body.label === 'null') {
                              body.label = null;
                          }
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          qs.term = this.getNodeParameter('term', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          qs.exact_match = this.getNodeParameter('exactMatch', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.fields) {
                              qs.fields = additionalFields.fields.join(',');
                          }
                          if (additionalFields.organizationId) {
                              qs.organization_id = parseInt(additionalFields.organizationId, 10);
                          }
                          if (additionalFields.includeFields) {
                              qs.include_fields = additionalFields.includeFields;
                          }
                          if (additionalFields.personId) {
                              qs.person_id = parseInt(additionalFields.personId, 10);
                          }
                          if (additionalFields.status) {
                              qs.status = additionalFields.status;
                          }
                          endpoint = '/deals/search';
                      }
                  }
                  else if (resource === 'dealActivity') {
                      if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const dealId = this.getNodeParameter('dealId', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.exclude) {
                              qs.exclude = additionalFields.exclude;
                          }
                          if ((additionalFields === null || additionalFields === void 0 ? void 0 : additionalFields.done) !== undefined) {
                              qs.done = additionalFields.done === true ? 1 : 0;
                          }
                          endpoint = `/deals/${dealId}/activities`;
                      }
                  }
                  else if (resource === 'dealProduct') {
                      if (operation === 'add') {
                          requestMethod = 'POST';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}/products`;
                          body.product_id = this.getNodeParameter('productId', i);
                          body.item_price = this.getNodeParameter('item_price', i);
                          body.quantity = this.getNodeParameter('quantity', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}/products`;
                      }
                      else if (operation === 'remove') {
                          requestMethod = 'DELETE';
                          const dealId = this.getNodeParameter('dealId', i);
                          const productAttachmentId = this.getNodeParameter('productAttachmentId', i);
                          endpoint = `/deals/${dealId}/products/${productAttachmentId}`;
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const dealId = this.getNodeParameter('dealId', i);
                          const productAttachmentId = this.getNodeParameter('productAttachmentId', i);
                          endpoint = `/deals/${dealId}/products/${productAttachmentId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                      }
                  }
                  else if (resource === 'file') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/files';
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          const fileBufferData = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          formData.file = {
                              value: fileBufferData,
                              options: {
                                  contentType: binaryData.mimeType,
                                  filename: binaryData.fileName,
                              },
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(formData, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const fileId = this.getNodeParameter('fileId', i);
                          endpoint = `/files/${fileId}`;
                      }
                      else if (operation === 'download') {
                          requestMethod = 'GET';
                          downloadFile = true;
                          const fileId = this.getNodeParameter('fileId', i);
                          endpoint = `/files/${fileId}/download`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const fileId = this.getNodeParameter('fileId', i);
                          endpoint = `/files/${fileId}`;
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const fileId = this.getNodeParameter('fileId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          endpoint = `/files/${fileId}`;
                          addAdditionalFields(body, updateFields);
                      }
                  }
                  else if (resource === 'note') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/notes';
                          body.content = this.getNodeParameter('content', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const noteId = this.getNodeParameter('noteId', i);
                          endpoint = `/notes/${noteId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const noteId = this.getNodeParameter('noteId', i);
                          endpoint = `/notes/${noteId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          endpoint = '/notes';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(qs, additionalFields);
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const noteId = this.getNodeParameter('noteId', i);
                          endpoint = `/notes/${noteId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                      }
                  }
                  else if (resource === 'lead') {
                      if (operation === 'create') {
                          body = {
                              title: this.getNodeParameter('title', i),
                          };
                          const associateWith = this.getNodeParameter('associateWith', i);
                          if (associateWith === 'organization') {
                              body.organization_id = this.getNodeParameter('organization_id', i);
                          }
                          else {
                              body.person_id = this.getNodeParameter('person_id', i);
                          }
                          const { value, expected_close_date, ...rest } = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          if (value) {
                              Object.assign(body, { value: value.valueProperties });
                          }
                          if (expected_close_date) {
                              body.expected_close_date = expected_close_date.split('T')[0];
                          }
                          requestMethod = 'POST';
                          endpoint = '/leads';
                      }
                      else if (operation === 'delete') {
                          const leadId = this.getNodeParameter('leadId', i);
                          requestMethod = 'DELETE';
                          endpoint = `/leads/${leadId}`;
                      }
                      else if (operation === 'get') {
                          const leadId = this.getNodeParameter('leadId', i);
                          requestMethod = 'GET';
                          endpoint = `/leads/${leadId}`;
                      }
                      else if (operation === 'getAll') {
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          requestMethod = 'GET';
                          endpoint = '/leads';
                      }
                      else if (operation === 'update') {
                          const { value, expected_close_date, ...rest } = this.getNodeParameter('updateFields', i);
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          if (value) {
                              Object.assign(body, { value: value.valueProperties });
                          }
                          if (expected_close_date) {
                              body.expected_close_date = expected_close_date.split('T')[0];
                          }
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          const leadId = this.getNodeParameter('leadId', i);
                          requestMethod = 'PATCH';
                          endpoint = `/leads/${leadId}`;
                      }
                  }
                  else if (resource === 'organization') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/organizations';
                          body.name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const organizationId = this.getNodeParameter('organizationId', i);
                          endpoint = `/organizations/${organizationId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const organizationId = this.getNodeParameter('organizationId', i);
                          endpoint = `/organizations/${organizationId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const filters = this.getNodeParameter('filters', i);
                          if (filters.filterId) {
                              qs.filter_id = filters.filterId;
                          }
                          if (filters.firstChar) {
                              qs.first_char = filters.firstChar;
                              qs.first_char = qs.first_char.substring(0, 1);
                          }
                          endpoint = '/organizations';
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('organizationId', i);
                          requestMethod = 'PUT';
                          endpoint = `/organizations/${id}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                          if (body.label === 'null') {
                              body.label = null;
                          }
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          qs.term = this.getNodeParameter('term', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if ((_a = additionalFields === null || additionalFields === void 0 ? void 0 : additionalFields.fields) === null || _a === void 0 ? void 0 : _a.length) {
                              qs.fields = additionalFields.fields.join(',');
                          }
                          if (additionalFields.exactMatch) {
                              qs.exact_match = additionalFields.exactMatch;
                          }
                          endpoint = '/organizations/search';
                      }
                  }
                  else if (resource === 'person') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/persons';
                          body.name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const personId = this.getNodeParameter('personId', i);
                          endpoint = `/persons/${personId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const personId = this.getNodeParameter('personId', i);
                          endpoint = `/persons/${personId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.filterId) {
                              qs.filter_id = additionalFields.filterId;
                          }
                          if (additionalFields.firstChar) {
                              qs.first_char = additionalFields.firstChar;
                          }
                          endpoint = '/persons';
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          qs.term = this.getNodeParameter('term', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.fields) {
                              qs.fields = additionalFields.fields;
                          }
                          if (additionalFields.exactMatch) {
                              qs.exact_match = additionalFields.exactMatch;
                          }
                          if (additionalFields.organizationId) {
                              qs.organization_id = parseInt(additionalFields.organizationId, 10);
                          }
                          if (additionalFields.includeFields) {
                              qs.include_fields = additionalFields.includeFields;
                          }
                          endpoint = '/persons/search';
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const personId = this.getNodeParameter('personId', i);
                          endpoint = `/persons/${personId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                          if (body.label === 'null') {
                              body.label = null;
                          }
                      }
                  }
                  else if (resource === 'product') {
                      if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          endpoint = '/products';
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  let responseData;
                  if (returnAll) {
                      responseData = await GenericFunctions_1.pipedriveApiRequestAllItems.call(this, requestMethod, endpoint, body, qs);
                  }
                  else {
                      if (customProperties !== undefined) {
                          (0, GenericFunctions_1.pipedriveEncodeCustomProperties)(customProperties, body);
                      }
                      responseData = await GenericFunctions_1.pipedriveApiRequest.call(this, requestMethod, endpoint, body, qs, formData, downloadFile);
                  }
                  if (resource === 'file' && operation === 'download') {
                      const newItem = {
                          json: items[i].json,
                          pairedItem: { item: i },
                          binary: {},
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      items[i] = newItem;
                      const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                      items[i].binary[binaryPropertyName] = await this.helpers.prepareBinaryData(responseData.data);
                  }
                  else {
                      if (responseData.data === null) {
                          responseData.data = [];
                      }
                      if (operation === 'search' && ((_b = responseData.data) === null || _b === void 0 ? void 0 : _b.items)) {
                          responseData.data = responseData.data.items;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.rawData !== true) {
                              responseData.data = responseData.data.map((item) => {
                                  return {
                                      result_score: item.result_score,
                                      ...item.item,
                                  };
                              });
                          }
                      }
                      responseData = responseData.data;
                      if (responseData.data === true) {
                          responseData = { success: true };
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (resource === 'file' && operation === 'download') {
                          items[i].json = { error: error.message };
                      }
                      else {
                          returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (customProperties !== undefined) {
              for (const item of returnData) {
                  (0, GenericFunctions_1.pipedriveResolveCustomProperties)(customProperties, item);
              }
          }
          if (resource === 'file' && operation === 'download') {
              return [items];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.Pipedrive = Pipedrive;
  //# sourceMappingURL=Pipedrive.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PipedriveApi = void 0;
  class PipedriveApi {
      constructor() {
          this.name = 'pipedriveApi';
          this.displayName = 'Pipedrive API';
          this.documentationUrl = 'pipedrive';
          this.properties = [
              {
                  displayName: 'API Token',
                  name: 'apiToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  qs: {
                      api_token: '={{$credentials.apiToken}}',
                  },
              },
          };
      }
  }
  exports.PipedriveApi = PipedriveApi;
  //# sourceMappingURL=PipedriveApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PipedriveOAuth2Api = void 0;
  class PipedriveOAuth2Api {
      constructor() {
          this.name = 'pipedriveOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Pipedrive OAuth2 API';
          this.documentationUrl = 'pipedrive';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://oauth.pipedrive.com/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://oauth.pipedrive.com/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.PipedriveOAuth2Api = PipedriveOAuth2Api;
  //# sourceMappingURL=PipedriveOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PipedriveApi = void 0;
  class PipedriveApi {
      constructor() {
          this.name = 'pipedriveApi';
          this.displayName = 'Pipedrive API';
          this.documentationUrl = 'pipedrive';
          this.properties = [
              {
                  displayName: 'API Token',
                  name: 'apiToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  qs: {
                      api_token: '={{$credentials.apiToken}}',
                  },
              },
          };
      }
  }
  exports.PipedriveApi = PipedriveApi;
  //# sourceMappingURL=PipedriveApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PipedriveOAuth2Api = void 0;
  class PipedriveOAuth2Api {
      constructor() {
          this.name = 'pipedriveOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Pipedrive OAuth2 API';
          this.documentationUrl = 'pipedrive';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://oauth.pipedrive.com/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://oauth.pipedrive.com/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.PipedriveOAuth2Api = PipedriveOAuth2Api;
  //# sourceMappingURL=PipedriveOAuth2Api.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Pipedrive node documentation
  description: Learn how to use the Pipedrive node in n8n. Follow technical documentation to integrate Pipedrive node into your workflows.
  contentType: [integration, reference]
  priority: medium
  ---

  # Pipedrive node

  Use the Pipedrive node to automate work in Pipedrive, and integrate Pipedrive with other applications. n8n has built-in support for a wide range of Pipedrive features, including creating, updating, deleting, and getting activity, files, notes, organizations, and leads. 

  On this page, you'll find a list of operations the Pipedrive node supports and links to more resources.

  /// note | Credentials
  Refer to [Pipedrive credentials](/integrations/builtin/credentials/pipedrive.md) for guidance on setting up authentication. 
  ///

  --8<-- "_snippets/integrations/builtin/app-nodes/ai-tools.md"

  ## Operations

  * Activity
      * Create an activity
      * Delete an activity
      * Get data of an activity
      * Get data of all activities
      * Update an activity
  * Deal
      * Create a deal
      * Delete a deal
      * Duplicate a deal
      * Get data of a deal
      * Get data of all deals
      * Search a deal
      * Update a deal
  * Deal Activity
      * Get all activities of a deal
  * Deal Product
      * Add a product to a deal
      * Get all products in a deal
      * Remove a product from a deal
      * Update a product in a deal
  * File
      * Create a file
      * Delete a file
      * Download a file
      * Get data of a file
  * Lead
      * Create a lead
      * Delete a lead
      * Get data of a lead
      * Get data of all leads
      * Update a lead
  * Note
      * Create a note
      * Delete a note
      * Get data of a note
      * Get data of all notes
      * Update a note
  * Organization
      * Create an organization
      * Delete an organization
      * Get data of an organization
      * Get data of all organizations
      * Update an organization
      * Search organizations
  * Person
      * Create a person
      * Delete a person
      * Get data of a person
      * Get data of all persons
      * Search all persons
      * Update a person
  * Product
      * Get data of all products

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'pipedrive') ]]

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Pipedrive Example Workflow","nodes":[{"parameters":{},"id":"8e0c5h39odse99bqfd12","name":"Pipedrive","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.PhilipsHue
name: PhilipsHue
display_name: Philips Hue
description: Consume Philips Hue API
category: input
icon: file:philipshue.png
code_hash: 3e7b5b2ac3e8be6b7b2ca8768d73e9539b78488a21c39e00bcd2a1da7e368d8e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.PhilipsHue
documentation_title: Philips Hue node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"philips-hue","description":"Templates for philips-hue"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:26
updated_at: 2025-06-09 15:18:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PhilipsHue = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const LightDescription_1 = require("./LightDescription");
  class PhilipsHue {
      constructor() {
          this.description = {
              displayName: 'Philips Hue',
              name: 'philipsHue',
              icon: 'file:philipshue.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Philips Hue API',
              defaults: {
                  name: 'Philips Hue',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'philipsHueOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Light',
                              value: 'light',
                          },
                      ],
                      default: 'light',
                  },
                  ...LightDescription_1.lightOperations,
                  ...LightDescription_1.lightFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLights() {
                      const returnData = [];
                      const user = await GenericFunctions_1.getUser.call(this);
                      const lights = await GenericFunctions_1.philipsHueApiRequest.call(this, 'GET', `/api/${user}/lights`);
                      const groups = await GenericFunctions_1.philipsHueApiRequest.call(this, 'GET', `/api/${user}/groups`);
                      for (const light of Object.keys(lights)) {
                          let lightName = lights[light].name;
                          const lightId = light;
                          for (const groupId of Object.keys(groups)) {
                              if (groups[groupId].type === 'Room' && groups[groupId].lights.includes(lightId)) {
                                  lightName = `${groups[groupId].name}: ${lightName}`;
                              }
                          }
                          returnData.push({
                              name: lightName,
                              value: lightId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              if (resource === 'light') {
                  if (operation === 'update') {
                      const lightId = this.getNodeParameter('lightId', i);
                      const on = this.getNodeParameter('on', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          on,
                      };
                      if (additionalFields.transitiontime) {
                          additionalFields.transitiontime = additionalFields.transitiontime * 100;
                      }
                      if (additionalFields.xy) {
                          additionalFields.xy = additionalFields.xy
                              .split(',')
                              .map((e) => parseFloat(e));
                      }
                      if (additionalFields.xy_inc) {
                          additionalFields.xy_inc = additionalFields.xy_inc
                              .split(',')
                              .map((e) => parseFloat(e));
                      }
                      Object.assign(body, additionalFields);
                      const user = await GenericFunctions_1.getUser.call(this);
                      const data = await GenericFunctions_1.philipsHueApiRequest.call(this, 'PUT', `/api/${user}/lights/${lightId}/state`, body);
                      responseData = {};
                      for (const response of data) {
                          Object.assign(responseData, response.success);
                      }
                  }
                  if (operation === 'delete') {
                      const lightId = this.getNodeParameter('lightId', i);
                      const user = await GenericFunctions_1.getUser.call(this);
                      responseData = await GenericFunctions_1.philipsHueApiRequest.call(this, 'DELETE', `/api/${user}/lights/${lightId}`);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const user = await GenericFunctions_1.getUser.call(this);
                      const lights = await GenericFunctions_1.philipsHueApiRequest.call(this, 'GET', `/api/${user}/lights`);
                      responseData = Object.values(lights);
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', i);
                          responseData = responseData.splice(0, limit);
                      }
                  }
                  if (operation === 'get') {
                      const lightId = this.getNodeParameter('lightId', i);
                      const user = await GenericFunctions_1.getUser.call(this);
                      responseData = await GenericFunctions_1.philipsHueApiRequest.call(this, 'GET', `/api/${user}/lights/${lightId}`);
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.PhilipsHue = PhilipsHue;
  //# sourceMappingURL=PhilipsHue.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PhilipsHueOAuth2Api = void 0;
  class PhilipsHueOAuth2Api {
      constructor() {
          this.name = 'philipsHueOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'PhilipHue OAuth2 API';
          this.documentationUrl = 'philipsHue';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'APP ID',
                  name: 'appId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://api.meethue.com/v2/oauth2/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.meethue.com/v2/oauth2/token',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '={{"appid="+$self["appId"]}}',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.PhilipsHueOAuth2Api = PhilipsHueOAuth2Api;
  //# sourceMappingURL=PhilipsHueOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PhilipsHueOAuth2Api = void 0;
  class PhilipsHueOAuth2Api {
      constructor() {
          this.name = 'philipsHueOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'PhilipHue OAuth2 API';
          this.documentationUrl = 'philipsHue';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'APP ID',
                  name: 'appId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://api.meethue.com/v2/oauth2/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.meethue.com/v2/oauth2/token',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '={{"appid="+$self["appId"]}}',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.PhilipsHueOAuth2Api = PhilipsHueOAuth2Api;
  //# sourceMappingURL=PhilipsHueOAuth2Api.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Philips Hue node documentation
  description: Learn how to use the Philips Hue node in n8n. Follow technical documentation to integrate Philips Hue node into your workflows.
  contentType: [integration, reference]
  ---

  # Philips Hue node

  Use the Philips Hue node to automate work in Philips Hue, and integrate Philips Hue with other applications. n8n has built-in support for a wide range of Philips Hue features, including deleting, retrieving, and updating lights. 

  On this page, you'll find a list of operations the Philips Hue node supports and links to more resources.

  /// note | Credentials
  Refer to [Philips Hue credentials](/integrations/builtin/credentials/philipshue.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Light
      * Delete a light
      * Retrieve a light
      * Retrieve all lights
      * Update a light

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'philips-hue') ]]

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Philips Hue Example Workflow","nodes":[{"parameters":{},"id":"zw9bxx1ua2zbptv6l910d","name":"Philips Hue","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Phantombuster
name: Phantombuster
display_name: Phantombuster
description: Consume Phantombuster API
category: input
icon: file:phantombuster.png
code_hash: 75f694de00a8499a39f024ef57ca0c79526b4ea2590dd834c4fdc04f94c2266e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Phantombuster
documentation_title: PhantomBuster node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"phantombuster","description":"Templates for phantombuster"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:26
updated_at: 2025-06-09 15:18:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Phantombuster = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const AgentDescription_1 = require("./AgentDescription");
  class Phantombuster {
      constructor() {
          this.description = {
              displayName: 'Phantombuster',
              name: 'phantombuster',
              icon: 'file:phantombuster.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Phantombuster API',
              defaults: {
                  name: 'Phantombuster',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'phantombusterApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Agent',
                              value: 'agent',
                          },
                      ],
                      default: 'agent',
                  },
                  ...AgentDescription_1.agentOperations,
                  ...AgentDescription_1.agentFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getAgents() {
                      const returnData = [];
                      const responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/agents/fetch-all');
                      for (const item of responseData) {
                          returnData.push({
                              name: item.name,
                              value: item.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'agent') {
                      if (operation === 'delete') {
                          const agentId = this.getNodeParameter('agentId', i);
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'POST', '/agents/delete', {
                              id: agentId,
                          });
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const agentId = this.getNodeParameter('agentId', i);
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/agents/fetch', {}, { id: agentId });
                      }
                      if (operation === 'getOutput') {
                          const agentId = this.getNodeParameter('agentId', i);
                          const resolveData = this.getNodeParameter('resolveData', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          qs.id = agentId;
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/agents/fetch-output', {}, qs);
                          if (resolveData) {
                              const { resultObject } = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/containers/fetch-result-object', {}, { id: responseData.containerId });
                              if (resultObject === null) {
                                  responseData = {};
                              }
                              else {
                                  responseData = JSON.parse(resultObject);
                              }
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/agents/fetch-all');
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'launch') {
                          const agentId = this.getNodeParameter('agentId', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const resolveData = this.getNodeParameter('resolveData', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              id: agentId,
                          };
                          if (jsonParameters) {
                              if (additionalFields.argumentsJson) {
                                  body.arguments = (0, GenericFunctions_1.validateJSON)(this, additionalFields.argumentsJson, 'Arguments');
                                  delete additionalFields.argumentsJson;
                              }
                              if (additionalFields.bonusArgumentJson) {
                                  body.bonusArgument = (0, GenericFunctions_1.validateJSON)(this, additionalFields.bonusArgumentJson, 'Bonus Argument');
                                  delete additionalFields.bonusArgumentJson;
                              }
                          }
                          else {
                              const argumentParameters = ((_a = additionalFields.argumentsUi) === null || _a === void 0 ? void 0 : _a.argumentValues) ||
                                  [];
                              body.arguments = argumentParameters.reduce((object, currentValue) => {
                                  object[currentValue.key] = currentValue.value;
                                  return object;
                              }, {});
                              delete additionalFields.argumentsUi;
                              const bonusParameters = ((_b = additionalFields.bonusArgumentUi) === null || _b === void 0 ? void 0 : _b.bonusArgumentValue) || [];
                              body.bonusArgument = bonusParameters.reduce((object, currentValue) => {
                                  object[currentValue.key] = currentValue.value;
                                  return object;
                              }, {});
                              delete additionalFields.bonusArgumentUi;
                          }
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'POST', '/agents/launch', body);
                          if (resolveData) {
                              responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/containers/fetch', {}, { id: responseData.containerId });
                          }
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Phantombuster = Phantombuster;
  //# sourceMappingURL=Phantombuster.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PhantombusterApi = void 0;
  class PhantombusterApi {
      constructor() {
          this.name = 'phantombusterApi';
          this.displayName = 'Phantombuster API';
          this.documentationUrl = 'phantombuster';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      'X-Phantombuster-Key': '={{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://api.phantombuster.com/api/v2',
                  url: '/agents/fetch-all',
              },
          };
      }
  }
  exports.PhantombusterApi = PhantombusterApi;
  //# sourceMappingURL=PhantombusterApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PhantombusterApi = void 0;
  class PhantombusterApi {
      constructor() {
          this.name = 'phantombusterApi';
          this.displayName = 'Phantombuster API';
          this.documentationUrl = 'phantombuster';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      'X-Phantombuster-Key': '={{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://api.phantombuster.com/api/v2',
                  url: '/agents/fetch-all',
              },
          };
      }
  }
  exports.PhantombusterApi = PhantombusterApi;
  //# sourceMappingURL=PhantombusterApi.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: PhantomBuster node documentation
  description: Learn how to use the PhantomBuster node in n8n. Follow technical documentation to integrate PhantomBuster node into your workflows.
  contentType: [integration, reference]
  ---

  # PhantomBuster node

  Use the PhantomBuster node to automate work in PhantomBuster, and integrate PhantomBuster with other applications. n8n has built-in support for a wide range of PhantomBuster features, including adding, deleting, and getting agents. 

  On this page, you'll find a list of operations the PhantomBuster node supports and links to more resources.

  /// note | Credentials
  Refer to [PhantomBuster credentials](/integrations/builtin/credentials/phantombuster.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Agent
      * Delete an agent by ID.
      * Get an agent by ID.
      * Get all agents of the current user's organization.
      * Get the output of the most recent container of an agent.
      * Add an agent to the launch queue.

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'phantombuster') ]]

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Phantombuster Example Workflow","nodes":[{"parameters":{},"id":"j2omuk7ce8l0uk5hsm9k","name":"Phantombuster","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.PostBin
name: PostBin
display_name: PostBin
description: Consume PostBin API
category: transform
icon: file:postbin.svg
code_hash: d01bdc82f547c37c7bfdb49f1c686731effa08a49d92aef848e18de371f08995
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.PostBin
documentation_title: PostBin node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"postbin","description":"Templates for postbin"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:27
updated_at: 2025-06-09 15:18:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PostBin = void 0;
  const BinDescription_1 = require("./BinDescription");
  const RequestDescription_1 = require("./RequestDescription");
  class PostBin {
      constructor() {
          this.description = {
              displayName: 'PostBin',
              name: 'postBin',
              icon: 'file:postbin.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
              description: 'Consume PostBin API',
              defaults: {
                  name: 'PostBin',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [],
              requestDefaults: {
                  baseURL: 'https://www.toptal.com',
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Bin',
                              value: 'bin',
                          },
                          {
                              name: 'Request',
                              value: 'request',
                          },
                      ],
                      default: 'bin',
                      required: true,
                  },
                  ...BinDescription_1.binOperations,
                  ...BinDescription_1.binFields,
                  ...RequestDescription_1.requestOperations,
                  ...RequestDescription_1.requestFields,
              ],
          };
      }
  }
  exports.PostBin = PostBin;
  //# sourceMappingURL=PostBin.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: PostBin node documentation
  description: Learn how to use the PostBin node in n8n. Follow technical documentation to integrate PostBin node into your workflows.
  contentType: [integration, reference]
  priority: high
  ---

  # PostBin node

  PostBin is a service that helps you test API clients and webhooks. Use the PostBin node to automate work in PostBin, and integrate PostBin with other applications. n8n has built-in support for a wide range of PostBin features, including creating and deleting bins, and getting and sending requests. 

  On this page, you'll find a list of operations the PostBin node supports, and links to more resources.

  ## Operations

  * Bin
  	* Create
  	* Get
  	* Delete
  * Request
  	* Get
  	* Remove First
  	* Send

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'postbin') ]]

  ## Send requests

  To send requests to a PostBin bin:

  1. Go to [PostBin](https://www.toptal.com/developers/postbin/){:target=_blank .external-link} and follow the steps to generate a new bin. PostBin gives you a unique URL, including a bin ID.
  2. In the PostBin node, select the **Request** resource.
  3. Choose the type of **Operation** you want to perform.
  4. Enter your bin ID in **Bin ID**.

  ## Create and manage bins

  You can create and manage PostBin bins using the PostBin node. 

  1. In **Resource**, select **Bin**.
  2. Choose an **Operation**. You can create, delete, or get a bin.

example_workflow:
  {"name":"PostBin Example Workflow","nodes":[{"parameters":{},"id":"y0eutfrbq0lhl6ao2ih4aa","name":"PostBin","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Postgres
name: Postgres
display_name: Postgres
description: Get, add and update data in Postgres
category: input
icon: file:postgres.svg
code_hash: 6bdb276eca46056e106989dfd542127bc76e07d729529f072cb538f2e2e0d93f
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-09 15:18:27
updated_at: 2025-06-09 15:18:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Postgres = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const PostgresV1_node_1 = require("./v1/PostgresV1.node");
  const PostgresV2_node_1 = require("./v2/PostgresV2.node");
  class Postgres extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Postgres',
              name: 'postgres',
              icon: 'file:postgres.svg',
              group: ['input'],
              defaultVersion: 2.3,
              description: 'Get, add and update data in Postgres',
          };
          const nodeVersions = {
              1: new PostgresV1_node_1.PostgresV1(baseDescription),
              2: new PostgresV2_node_1.PostgresV2(baseDescription),
              2.1: new PostgresV2_node_1.PostgresV2(baseDescription),
              2.2: new PostgresV2_node_1.PostgresV2(baseDescription),
              2.3: new PostgresV2_node_1.PostgresV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Postgres = Postgres;
  //# sourceMappingURL=Postgres.node.js.map

example_workflow:
  {"name":"Postgres Example Workflow","nodes":[{"parameters":{},"id":"2jjzjwmxc2agjh9g7dmzkd","name":"Postgres","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Plivo
name: Plivo
display_name: Plivo
description: Send SMS/MMS messages or make phone calls
category: transform
icon: file:plivo.svg
code_hash: 59e0f9f644243d74ed88941e6038e4e863bd1fdf3166997922be2484773ead0c
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Plivo
documentation_title: Plivo node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"plivo","description":"Templates for plivo"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:27
updated_at: 2025-06-09 15:18:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Plivo = void 0;
  const SmsDescription_1 = require("./SmsDescription");
  const MmsDescription_1 = require("./MmsDescription");
  const CallDescription_1 = require("./CallDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Plivo {
      constructor() {
          this.description = {
              displayName: 'Plivo',
              name: 'plivo',
              icon: 'file:plivo.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Send SMS/MMS messages or make phone calls',
              defaults: {
                  name: 'Plivo',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'plivoApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Call',
                              value: 'call',
                          },
                          {
                              name: 'MMS',
                              value: 'mms',
                          },
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                      ],
                      default: 'sms',
                      required: true,
                  },
                  ...SmsDescription_1.smsOperations,
                  ...SmsDescription_1.smsFields,
                  ...MmsDescription_1.mmsOperations,
                  ...MmsDescription_1.mmsFields,
                  ...CallDescription_1.callOperations,
                  ...CallDescription_1.callFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              let responseData;
              if (resource === 'sms') {
                  if (operation === 'send') {
                      const body = {
                          src: this.getNodeParameter('from', i),
                          dst: this.getNodeParameter('to', i),
                          text: this.getNodeParameter('message', i),
                      };
                      responseData = await GenericFunctions_1.plivoApiRequest.call(this, 'POST', '/Message', body);
                  }
              }
              else if (resource === 'call') {
                  if (operation === 'make') {
                      const body = {
                          from: this.getNodeParameter('from', i),
                          to: this.getNodeParameter('to', i),
                          answer_url: this.getNodeParameter('answer_url', i),
                          answer_method: this.getNodeParameter('answer_method', i),
                      };
                      responseData = await GenericFunctions_1.plivoApiRequest.call(this, 'POST', '/Call', body);
                  }
              }
              else if (resource === 'mms') {
                  if (operation === 'send') {
                      const body = {
                          src: this.getNodeParameter('from', i),
                          dst: this.getNodeParameter('to', i),
                          text: this.getNodeParameter('message', i),
                          type: 'mms',
                          media_urls: this.getNodeParameter('media_urls', i),
                      };
                      responseData = await GenericFunctions_1.plivoApiRequest.call(this, 'POST', '/Message', body);
                  }
              }
              Array.isArray(responseData)
                  ? returnData.push(...responseData)
                  : returnData.push(responseData);
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Plivo = Plivo;
  //# sourceMappingURL=Plivo.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PlivoApi = void 0;
  class PlivoApi {
      constructor() {
          this.name = 'plivoApi';
          this.displayName = 'Plivo API';
          this.documentationUrl = 'plivo';
          this.properties = [
              {
                  displayName: 'Auth ID',
                  name: 'authId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Auth Token',
                  name: 'authToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.PlivoApi = PlivoApi;
  //# sourceMappingURL=PlivoApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PlivoApi = void 0;
  class PlivoApi {
      constructor() {
          this.name = 'plivoApi';
          this.displayName = 'Plivo API';
          this.documentationUrl = 'plivo';
          this.properties = [
              {
                  displayName: 'Auth ID',
                  name: 'authId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Auth Token',
                  name: 'authToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.PlivoApi = PlivoApi;
  //# sourceMappingURL=PlivoApi.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Plivo node documentation
  description: Learn how to use the Plivo node in n8n. Follow technical documentation to integrate Plivo node into your workflows.
  contentType: [integration, reference]
  ---

  # Plivo node

  Use the Plivo node to automate work in Plivo, and integrate Plivo with other applications. n8n has built-in support for a wide range of Plivo features, including making calls, and sending SMS/MMS. 

  On this page, you'll find a list of operations the Plivo node supports and links to more resources.

  /// note | Credentials
  Refer to [Plivo credentials](/integrations/builtin/credentials/plivo.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Call
      * Make a voice call
  * MMS
      * Send an MMS message (US/Canada only)
  * SMS
      * Send an SMS message.

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'plivo') ]]

example_workflow:
  {"name":"Plivo Example Workflow","nodes":[{"parameters":{},"id":"4tza5zf2e1ptkkltix1dz","name":"Plivo","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.PostHog
name: PostHog
display_name: PostHog
description: Consume PostHog API
category: input
icon: file:postHog.svg
code_hash: ab084fdded448bc9cbe6673f2443a4b06bd38e4ef43646e6448998cdf46905d1
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.PostHog
documentation_title: PostHog node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"posthog","description":"Templates for posthog"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:27
updated_at: 2025-06-09 15:18:27
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PostHog = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const AliasDescription_1 = require("./AliasDescription");
  const EventDescription_1 = require("./EventDescription");
  const TrackDescription_1 = require("./TrackDescription");
  const IdentityDescription_1 = require("./IdentityDescription");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class PostHog {
      constructor() {
          this.description = {
              displayName: 'PostHog',
              name: 'postHog',
              icon: 'file:postHog.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume PostHog API',
              defaults: {
                  name: 'PostHog',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'postHogApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Alias',
                              value: 'alias',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Identity',
                              value: 'identity',
                          },
                          {
                              name: 'Track',
                              value: 'track',
                          },
                      ],
                      default: 'event',
                  },
                  ...AliasDescription_1.aliasOperations,
                  ...AliasDescription_1.aliasFields,
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...IdentityDescription_1.identityOperations,
                  ...IdentityDescription_1.identityFields,
                  ...TrackDescription_1.trackOperations,
                  ...TrackDescription_1.trackFields,
              ],
          };
      }
      async execute() {
          var _a, _b, _c, _d, _e;
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          if (resource === 'alias') {
              if (operation === 'create') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const distinctId = this.getNodeParameter('distinctId', i);
                          const alias = this.getNodeParameter('alias', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const context = ((_a = additionalFields.contextUi) === null || _a === void 0 ? void 0 : _a.contextValues) || [];
                          const event = {
                              type: 'alias',
                              event: '$create_alias',
                              context: context.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                              properties: {
                                  distinct_id: distinctId,
                                  alias,
                              },
                          };
                          Object.assign(event, additionalFields);
                          if (additionalFields.timestamp) {
                              additionalFields.timestamp = (0, moment_timezone_1.default)(additionalFields.timestamp).toISOString();
                          }
                          responseData = await GenericFunctions_1.posthogApiRequest.call(this, 'POST', '/batch', event);
                          returnData.push(responseData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              returnData.push({ error: error.message });
                              continue;
                          }
                          throw error;
                      }
                  }
              }
          }
          if (resource === 'event') {
              if (operation === 'create') {
                  try {
                      const events = [];
                      for (let i = 0; i < length; i++) {
                          const eventName = this.getNodeParameter('eventName', i);
                          const distinctId = this.getNodeParameter('distinctId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const properties = ((_b = additionalFields.propertiesUi) === null || _b === void 0 ? void 0 : _b.propertyValues) ||
                              [];
                          const event = {
                              event: eventName,
                              properties: properties.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                          };
                          event.properties.distinct_id = distinctId;
                          Object.assign(event, additionalFields);
                          if (additionalFields.timestamp) {
                              additionalFields.timestamp = (0, moment_timezone_1.default)(additionalFields.timestamp).toISOString();
                          }
                          delete event.propertiesUi;
                          events.push(event);
                      }
                      responseData = await GenericFunctions_1.posthogApiRequest.call(this, 'POST', '/capture', { batch: events });
                      returnData.push(responseData);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          returnData.push({ error: error.message });
                      }
                      else {
                          throw error;
                      }
                  }
              }
          }
          if (resource === 'identity') {
              if (operation === 'create') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const distinctId = this.getNodeParameter('distinctId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const properties = ((_c = additionalFields.propertiesUi) === null || _c === void 0 ? void 0 : _c.propertyValues) ||
                              [];
                          const event = {
                              event: '$identify',
                              properties: properties.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                              distinct_id: distinctId,
                          };
                          Object.assign(event, additionalFields);
                          if (additionalFields.timestamp) {
                              additionalFields.timestamp = (0, moment_timezone_1.default)(additionalFields.timestamp).toISOString();
                          }
                          delete event.propertiesUi;
                          responseData = await GenericFunctions_1.posthogApiRequest.call(this, 'POST', '/batch', event);
                          returnData.push(responseData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              returnData.push({ error: error.message });
                              continue;
                          }
                          throw error;
                      }
                  }
              }
          }
          if (resource === 'track') {
              if (operation === 'page' || operation === 'screen') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const distinctId = this.getNodeParameter('distinctId', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const context = ((_d = additionalFields.contextUi) === null || _d === void 0 ? void 0 : _d.contextValues) || [];
                          const properties = ((_e = additionalFields.propertiesUi) === null || _e === void 0 ? void 0 : _e.propertyValues) ||
                              [];
                          const event = {
                              name,
                              type: operation,
                              event: `$${operation}`,
                              context: context.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                              distinct_id: distinctId,
                              properties: properties.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                          };
                          Object.assign(event, additionalFields);
                          if (additionalFields.timestamp) {
                              additionalFields.timestamp = (0, moment_timezone_1.default)(additionalFields.timestamp).toISOString();
                          }
                          delete event.propertiesUi;
                          responseData = await GenericFunctions_1.posthogApiRequest.call(this, 'POST', '/batch', event);
                          returnData.push(responseData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              returnData.push({ error: error.message });
                              continue;
                          }
                          throw error;
                      }
                  }
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.PostHog = PostHog;
  //# sourceMappingURL=PostHog.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PostHogApi = void 0;
  class PostHogApi {
      constructor() {
          this.name = 'postHogApi';
          this.displayName = 'PostHog API';
          this.documentationUrl = 'postHog';
          this.properties = [
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: 'https://app.posthog.com',
              },
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.PostHogApi = PostHogApi;
  //# sourceMappingURL=PostHogApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PostHogApi = void 0;
  class PostHogApi {
      constructor() {
          this.name = 'postHogApi';
          this.displayName = 'PostHog API';
          this.documentationUrl = 'postHog';
          this.properties = [
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: 'https://app.posthog.com',
              },
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.PostHogApi = PostHogApi;
  //# sourceMappingURL=PostHogApi.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: PostHog node documentation
  description: Learn how to use the PostHog node in n8n. Follow technical documentation to integrate PostHog node into your workflows.
  contentType: [integration, reference]
  ---

  # PostHog node

  Use the PostHog node to automate work in PostHog, and integrate PostHog with other applications. n8n has built-in support for a wide range of PostHog features, including creating aliases, events, and identity, as well as tracking pages.

  On this page, you'll find a list of operations the PostHog node supports and links to more resources.

  /// note | Credentials
  Refer to [PostHog credentials](/integrations/builtin/credentials/posthog.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Alias
      * Create an alias
  * Event
      * Create an event
  * Identity
      * Create
  * Track
      * Track a page
      * Track a screen

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'posthog') ]]

example_workflow:
  {"name":"PostHog Example Workflow","nodes":[{"parameters":{},"id":"xwbfknin7316bz41t2euz","name":"PostHog","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Pushbullet
name: Pushbullet
display_name: Pushbullet
description: Consume Pushbullet API
category: input
icon: file:pushbullet.svg
code_hash: 6352a9ed63d4fb5cd185cf85a29778fb67757992f84c8013c03bf4eab023e94a
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Pushbullet
documentation_title: Pushbullet node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"pushbullet","description":"Templates for pushbullet"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:27
updated_at: 2025-06-09 15:18:27
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Pushbullet = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Pushbullet {
      constructor() {
          this.description = {
              displayName: 'Pushbullet',
              name: 'pushbullet',
              icon: 'file:pushbullet.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Pushbullet API',
              defaults: {
                  name: 'Pushbullet',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pushbulletOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Push',
                              value: 'push',
                          },
                      ],
                      default: 'push',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a push',
                              action: 'Create a push',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a push',
                              action: 'Delete a push',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many pushes',
                              action: 'Get many pushes',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a push',
                              action: 'Update a push',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      type: 'options',
                      options: [
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Link',
                              value: 'link',
                          },
                          {
                              name: 'Note',
                              value: 'note',
                          },
                      ],
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                          },
                      },
                      default: 'note',
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              type: ['note', 'link'],
                          },
                      },
                      default: '',
                      description: 'Title of the push',
                  },
                  {
                      displayName: 'Body',
                      name: 'body',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              type: ['note', 'link', 'file'],
                          },
                      },
                      default: '',
                      description: 'Body of the push',
                  },
                  {
                      displayName: 'URL',
                      name: 'url',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              type: ['link'],
                          },
                      },
                      default: '',
                      description: 'URL of the push',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              type: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file to be created',
                  },
                  {
                      displayName: 'Target',
                      name: 'target',
                      type: 'options',
                      options: [
                          {
                              name: 'Channel Tag',
                              value: 'channel_tag',
                              description: 'Send the push to all subscribers to your channel that has this tag',
                          },
                          {
                              name: 'Default',
                              value: 'default',
                              description: "Broadcast it to all of the user's devices",
                          },
                          {
                              name: 'Device ID',
                              value: 'device_iden',
                              description: 'Send the push to a specific device',
                          },
                          {
                              name: 'Email',
                              value: 'email',
                              description: 'Send the push to this email address',
                          },
                      ],
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                          },
                      },
                      default: 'default',
                      description: 'Define the medium that will be used to send the push',
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                          },
                          hide: {
                              target: ['default', 'device_iden'],
                          },
                      },
                      default: '',
                      description: 'The value to be set depending on the target selected. For example, if the target selected is email then this field would take the email address of the person you are trying to send the push to.',
                  },
                  {
                      displayName: 'Value Name or ID',
                      name: 'value',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getDevices',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              target: ['device_iden'],
                          },
                      },
                      default: '',
                      description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                  },
                  {
                      displayName: 'Push ID',
                      name: 'pushId',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['delete'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['push'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['push'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 500,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['getAll'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Active',
                              name: 'active',
                              type: 'boolean',
                              default: false,
                              description: "Don't return deleted pushes",
                          },
                          {
                              displayName: 'Modified After',
                              name: 'modified_after',
                              type: 'dateTime',
                              default: '',
                              description: 'Request pushes modified after this timestamp',
                          },
                      ],
                  },
                  {
                      displayName: 'Push ID',
                      name: 'pushId',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['update'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Dismissed',
                      name: 'dismissed',
                      type: 'boolean',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['update'],
                          },
                      },
                      default: false,
                      description: 'Whether to mark a push as having been dismissed by the user, will cause any notifications for the push to be hidden if possible',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getDevices() {
                      const returnData = [];
                      const { devices } = await GenericFunctions_1.pushbulletApiRequest.call(this, 'GET', '/devices');
                      for (const device of devices) {
                          returnData.push({
                              name: device.nickname,
                              value: device.iden,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'push') {
                      if (operation === 'create') {
                          const type = this.getNodeParameter('type', i);
                          const message = this.getNodeParameter('body', i);
                          const target = this.getNodeParameter('target', i);
                          const body = {
                              type,
                              body: message,
                          };
                          if (target !== 'default') {
                              const value = this.getNodeParameter('value', i);
                              body[target] = value;
                          }
                          if (['note', 'link'].includes(type)) {
                              body.title = this.getNodeParameter('title', i);
                              if (type === 'link') {
                                  body.url = this.getNodeParameter('url', i);
                              }
                          }
                          if (type === 'file') {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              const { upload_url: uploadUrl, file_name, file_type, file_url, } = await GenericFunctions_1.pushbulletApiRequest.call(this, 'POST', '/upload-request', {
                                  file_name: binaryData.fileName,
                                  file_type: binaryData.mimeType,
                              });
                              await GenericFunctions_1.pushbulletApiRequest.call(this, 'POST', '', {}, {}, uploadUrl, {
                                  formData: {
                                      file: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                                  json: false,
                              });
                              body.file_name = file_name;
                              body.file_type = file_type;
                              body.file_url = file_url;
                          }
                          responseData = await GenericFunctions_1.pushbulletApiRequest.call(this, 'POST', '/pushes', body);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          if (qs.modified_after) {
                              qs.modified_after = (0, moment_timezone_1.default)(qs.modified_after).unix();
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.pushbulletApiRequestAllItems.call(this, 'pushes', 'GET', '/pushes', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.pushbulletApiRequest.call(this, 'GET', '/pushes', {}, qs);
                              responseData = responseData.pushes;
                          }
                      }
                      if (operation === 'delete') {
                          const pushId = this.getNodeParameter('pushId', i);
                          responseData = await GenericFunctions_1.pushbulletApiRequest.call(this, 'DELETE', `/pushes/${pushId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'update') {
                          const pushId = this.getNodeParameter('pushId', i);
                          const dismissed = this.getNodeParameter('dismissed', i);
                          responseData = await GenericFunctions_1.pushbulletApiRequest.call(this, 'POST', `/pushes/${pushId}`, {
                              dismissed,
                          });
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Pushbullet = Pushbullet;
  //# sourceMappingURL=Pushbullet.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PushbulletOAuth2Api = void 0;
  class PushbulletOAuth2Api {
      constructor() {
          this.name = 'pushbulletOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Pushbullet OAuth2 API';
          this.documentationUrl = 'pushbullet';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://www.pushbullet.com/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.pushbullet.com/oauth2/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.PushbulletOAuth2Api = PushbulletOAuth2Api;
  //# sourceMappingURL=PushbulletOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PushbulletOAuth2Api = void 0;
  class PushbulletOAuth2Api {
      constructor() {
          this.name = 'pushbulletOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Pushbullet OAuth2 API';
          this.documentationUrl = 'pushbullet';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://www.pushbullet.com/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.pushbullet.com/oauth2/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.PushbulletOAuth2Api = PushbulletOAuth2Api;
  //# sourceMappingURL=PushbulletOAuth2Api.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Pushbullet node documentation
  description: Learn how to use the Pushbullet node in n8n. Follow technical documentation to integrate Pushbullet node into your workflows.
  contentType: [integration, reference]
  ---

  # Pushbullet node

  Use the Pushbullet node to automate work in Pushbullet, and integrate Pushbullet with other applications. n8n has built-in support for a wide range of Pushbullet features, including creating, updating, deleting, and getting a push. 

  On this page, you'll find a list of operations the Pushbullet node supports and links to more resources.

  /// note | Credentials
  Refer to [Pushbullet credentials](/integrations/builtin/credentials/pushbullet.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Push
      * Create a push
      * Delete a push
      * Get all pushes
      * Update a push

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'pushbullet') ]]

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Pushbullet Example Workflow","nodes":[{"parameters":{},"id":"8gtbws4bfkmjw2vnq56c6","name":"Pushbullet","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.ProfitWell
name: ProfitWell
display_name: ProfitWell
description: Consume ProfitWell API
category: output
icon: file:profitwell.png
code_hash: 8d5fd3fd10d49adac3de5845568dad48b59fefc816b7de39f98c02e402fb38ae
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.ProfitWell
documentation_title: ProfitWell node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"profitwell","description":"Templates for profitwell"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:27
updated_at: 2025-06-09 15:18:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ProfitWell = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const CompanyDescription_1 = require("./CompanyDescription");
  const MetricDescription_1 = require("./MetricDescription");
  class ProfitWell {
      constructor() {
          this.description = {
              displayName: 'ProfitWell',
              name: 'profitWell',
              icon: 'file:profitwell.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume ProfitWell API',
              defaults: {
                  name: 'ProfitWell',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'profitWellApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Company',
                              value: 'company',
                          },
                          {
                              name: 'Metric',
                              value: 'metric',
                          },
                      ],
                      default: 'metric',
                  },
                  ...CompanyDescription_1.companyOperations,
                  ...MetricDescription_1.metricOperations,
                  ...MetricDescription_1.metricFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getPlanIds() {
                      const returnData = [];
                      const planIds = await GenericFunctions_1.profitWellApiRequest.call(this, 'GET', '/metrics/plans');
                      for (const planId of planIds.plan_ids) {
                          returnData.push({
                              name: planId,
                              value: planId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'company') {
                      if (operation === 'getSetting') {
                          responseData = await GenericFunctions_1.profitWellApiRequest.call(this, 'GET', '/company/settings/');
                      }
                  }
                  if (resource === 'metric') {
                      if (operation === 'get') {
                          const type = this.getNodeParameter('type', i);
                          const simple = this.getNodeParameter('simple', 0);
                          if (type === 'daily') {
                              qs.month = this.getNodeParameter('month', i);
                          }
                          const options = this.getNodeParameter('options', i);
                          Object.assign(qs, options);
                          if (qs.dailyMetrics) {
                              qs.metrics = qs.dailyMetrics.join(',');
                              delete qs.dailyMetrics;
                          }
                          if (qs.monthlyMetrics) {
                              qs.metrics = qs.monthlyMetrics.join(',');
                              delete qs.monthlyMetrics;
                          }
                          responseData = await GenericFunctions_1.profitWellApiRequest.call(this, 'GET', `/metrics/${type}`, {}, qs);
                          responseData = responseData.data;
                          if (simple) {
                              if (type === 'daily') {
                                  responseData = (0, GenericFunctions_1.simplifyDailyMetrics)(responseData);
                              }
                              else {
                                  responseData = (0, GenericFunctions_1.simplifyMontlyMetrics)(responseData);
                              }
                          }
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.ProfitWell = ProfitWell;
  //# sourceMappingURL=ProfitWell.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ProfitWellApi = void 0;
  class ProfitWellApi {
      constructor() {
          this.name = 'profitWellApi';
          this.displayName = 'ProfitWell API';
          this.documentationUrl = 'profitWell';
          this.properties = [
              {
                  displayName: 'API Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Your Private Token',
              },
          ];
      }
  }
  exports.ProfitWellApi = ProfitWellApi;
  //# sourceMappingURL=ProfitWellApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ProfitWellApi = void 0;
  class ProfitWellApi {
      constructor() {
          this.name = 'profitWellApi';
          this.displayName = 'ProfitWell API';
          this.documentationUrl = 'profitWell';
          this.properties = [
              {
                  displayName: 'API Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Your Private Token',
              },
          ];
      }
  }
  exports.ProfitWellApi = ProfitWellApi;
  //# sourceMappingURL=ProfitWellApi.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: ProfitWell node documentation
  description: Learn how to use the ProfitWell node in n8n. Follow technical documentation to integrate ProfitWell node into your workflows.
  contentType: [integration, reference]
  ---

  # ProfitWell node

  Use the ProfitWell node to automate work in ProfitWell, and integrate ProfitWell with other applications. n8n supports getting your company's account settings and retrieving financial metrics from ProfitWell.

  On this page, you'll find a list of operations the ProfitWell node supports and links to more resources.

  /// note | Credentials
  Refer to [ProfitWell credentials](/integrations/builtin/credentials/profitwell.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Company
      * Get your company's ProfitWell account settings
  * Metric
      * Retrieve financial metric broken down by day for either the current month or the last

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'profitwell') ]]

example_workflow:
  {"name":"ProfitWell Example Workflow","nodes":[{"parameters":{},"id":"xb58hxi2rqn3g2p9b9hz","name":"ProfitWell","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Pushcut
name: Pushcut
display_name: Pushcut
description: Consume Pushcut API
category: input
icon: file:pushcut.png
code_hash: 7b69beb7d523647571e05d593f709612aad72eb64f56b0f87ac030ea69eb03eb
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Pushcut
documentation_title: Pushcut node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"pushcut","description":"Templates for pushcut"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:27
updated_at: 2025-06-09 15:18:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Pushcut = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Pushcut {
      constructor() {
          this.description = {
              displayName: 'Pushcut',
              name: 'pushcut',
              icon: 'file:pushcut.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Pushcut API',
              defaults: {
                  name: 'Pushcut',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pushcutApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Notification',
                              value: 'notification',
                          },
                      ],
                      default: 'notification',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['notification'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send a notification',
                              action: 'Send a notification',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'Notification Name or ID',
                      name: 'notificationName',
                      type: 'options',
                      description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                      typeOptions: {
                          loadOptionsMethod: 'getNotifications',
                      },
                      displayOptions: {
                          show: {
                              resource: ['notification'],
                              operation: ['send'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['notification'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Device Names or IDs',
                              name: 'devices',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getDevices',
                              },
                              default: [],
                              description: 'List of devices this notification is sent to. (default is all devices). Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Input',
                              name: 'input',
                              type: 'string',
                              default: '',
                              description: 'Value that is passed as input to the notification action',
                          },
                          {
                              displayName: 'Text',
                              name: 'text',
                              type: 'string',
                              default: '',
                              description: 'Text that is used instead of the one defined in the app',
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'Title that is used instead of the one defined in the app',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getDevices() {
                      const returnData = [];
                      const devices = await GenericFunctions_1.pushcutApiRequest.call(this, 'GET', '/devices');
                      for (const device of devices) {
                          returnData.push({
                              name: device.id,
                              value: device.id,
                          });
                      }
                      return returnData;
                  },
                  async getNotifications() {
                      const returnData = [];
                      const notifications = await GenericFunctions_1.pushcutApiRequest.call(this, 'GET', '/notifications');
                      for (const notification of notifications) {
                          returnData.push({
                              name: notification.title,
                              value: notification.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              if (resource === 'notification') {
                  if (operation === 'send') {
                      const notificationName = this.getNodeParameter('notificationName', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {};
                      Object.assign(body, additionalFields);
                      responseData = await GenericFunctions_1.pushcutApiRequest.call(this, 'POST', `/notifications/${encodeURI(notificationName)}`, body);
                  }
              }
          }
          if (Array.isArray(responseData)) {
              returnData.push.apply(returnData, responseData);
          }
          else if (responseData !== undefined) {
              returnData.push(responseData);
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Pushcut = Pushcut;
  //# sourceMappingURL=Pushcut.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PushcutApi = void 0;
  class PushcutApi {
      constructor() {
          this.name = 'pushcutApi';
          this.displayName = 'Pushcut API';
          this.documentationUrl = 'pushcut';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.PushcutApi = PushcutApi;
  //# sourceMappingURL=PushcutApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PushcutApi = void 0;
  class PushcutApi {
      constructor() {
          this.name = 'pushcutApi';
          this.displayName = 'Pushcut API';
          this.documentationUrl = 'pushcut';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.PushcutApi = PushcutApi;
  //# sourceMappingURL=PushcutApi.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Pushcut node documentation
  description: Learn how to use the Pushcut node in n8n. Follow technical documentation to integrate Pushcut node into your workflows.
  contentType: [integration, reference]
  ---

  # Pushcut node

  Use the Pushcut node to automate work in Pushcut, and integrate Pushcut with other applications. n8n supports sending notifications with Pushcut.

  On this page, you'll find a list of operations the Pushcut node supports and links to more resources.

  /// note | Credentials
  Refer to [Pushcut credentials](/integrations/builtin/credentials/pushcut.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Notification
      * Send a notification

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'pushcut') ]]

example_workflow:
  {"name":"Pushcut Example Workflow","nodes":[{"parameters":{},"id":"15bmstdybwhsnlihj28z5k","name":"Pushcut","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.QuestDb
name: QuestDb
display_name: QuestDB
description: Get, add and update data in QuestDB
category: input
icon: file:questdb.png
code_hash: 574aabe37688781da940acac0261aa5557874f116089eed6b378a603b7580b71
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.QuestDb
documentation_title: QuestDB node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"questdb","description":"Templates for questdb"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:29
updated_at: 2025-06-09 15:18:29
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.QuestDb = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const pg_promise_1 = __importDefault(require("pg-promise"));
  const genericFunctions_1 = require("../Postgres/v1/genericFunctions");
  class QuestDb {
      constructor() {
          this.description = {
              displayName: 'QuestDB',
              name: 'questDb',
              icon: 'file:questdb.png',
              group: ['input'],
              version: 1,
              description: 'Get, add and update data in QuestDB',
              defaults: {
                  name: 'QuestDB',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'questDb',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Execute Query',
                              value: 'executeQuery',
                              description: 'Executes a SQL query',
                              action: 'Execute a SQL query',
                          },
                          {
                              name: 'Insert',
                              value: 'insert',
                              description: 'Insert rows in database',
                              action: 'Insert rows in database',
                          },
                      ],
                      default: 'insert',
                  },
                  {
                      displayName: 'Query',
                      name: 'query',
                      type: 'string',
                      noDataExpression: true,
                      typeOptions: {
                          editor: 'sqlEditor',
                          rows: 5,
                          sqlDialect: 'PostgreSQL',
                      },
                      displayOptions: {
                          show: {
                              operation: ['executeQuery'],
                          },
                      },
                      default: '',
                      placeholder: 'SELECT id, name FROM product WHERE quantity > $1 AND price <= $2',
                      required: true,
                      description: 'The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.',
                  },
                  {
                      displayName: 'Schema',
                      name: 'schema',
                      type: 'hidden',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      description: 'Name of the schema the table belongs to',
                  },
                  {
                      displayName: 'Table',
                      name: 'table',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the table in which to insert data to',
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      placeholder: 'id,name,description',
                      description: 'Comma-separated list of the properties which should used as columns for the new rows',
                  },
                  {
                      displayName: 'Return Fields',
                      name: 'returnFields',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '*',
                      description: 'Comma-separated list of the fields that the operation will return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['executeQuery'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Mode',
                              name: 'mode',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Independently',
                                      value: 'independently',
                                      description: 'Execute each query independently',
                                  },
                                  {
                                      name: 'Transaction',
                                      value: 'transaction',
                                      description: 'Executes all queries in a single transaction',
                                  },
                              ],
                              default: 'independently',
                              description: 'The way queries should be sent to database. Can be used in conjunction with <b>Continue on Fail</b>. See <a href="https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.questdb/">the docs</a> for more examples.',
                          },
                          {
                              displayName: 'Query Parameters',
                              name: 'queryParams',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['executeQuery'],
                                  },
                              },
                              default: '',
                              placeholder: 'quantity,price',
                              description: 'Comma-separated list of properties which should be used as query parameters',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'hidden',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const credentials = await this.getCredentials('questDb');
          const pgp = (0, pg_promise_1.default)();
          const config = {
              host: credentials.host,
              port: credentials.port,
              database: credentials.database,
              user: credentials.user,
              password: credentials.password,
              ssl: !['disable', undefined].includes(credentials.ssl),
              sslmode: credentials.ssl || 'disable',
          };
          const db = pgp(config);
          let returnItems = [];
          const items = this.getInputData();
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'executeQuery') {
              const additionalFields = this.getNodeParameter('additionalFields', 0);
              const mode = (additionalFields.mode || 'independently');
              const queryResult = await genericFunctions_1.pgQueryV2.call(this, pgp, db, items, this.continueOnFail(), {
                  overrideMode: mode,
                  resolveExpression: true,
              });
              returnItems = this.helpers.returnJsonArray(queryResult);
          }
          else if (operation === 'insert') {
              await (0, genericFunctions_1.pgInsert)(this.getNodeParameter, pgp, db, items, this.continueOnFail(), 'independently');
              const returnFields = this.getNodeParameter('returnFields', 0);
              const table = this.getNodeParameter('table', 0);
              const insertData = await db.any('SELECT ${columns:name} from ${table:name}', {
                  columns: returnFields
                      .split(',')
                      .map((value) => value.trim())
                      .filter((value) => !!value),
                  table,
              });
              returnItems = this.helpers.returnJsonArray(insertData);
          }
          else {
              await db.$pool.end();
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`);
          }
          await db.$pool.end();
          return [returnItems];
      }
  }
  exports.QuestDb = QuestDb;
  //# sourceMappingURL=QuestDb.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: QuestDB node documentation
  description: Learn how to use the QuestDB node in n8n. Follow technical documentation to integrate QuestDB node into your workflows.
  contentType: [integration, reference]
  ---

  # QuestDB node

  Use the QuestDB node to automate work in QuestDB, and integrate QuestDB with other applications. n8n supports executing an SQL query and inserting rows in a database with QuestDB.

  On this page, you'll find a list of operations the QuestDB node supports and links to more resources.

  /// note | Credentials
  Refer to [QuestDB credentials](/integrations/builtin/credentials/questdb.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Executes a SQL query.
  * Insert rows in database.

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'questdb') ]]

  ## Node reference

  ### Specify a column's data type

  To specify a column's data type, append the column name with `:type`, where `type` is the data type you want for column. For example, if you want to specify the type `int` for the column **id** and type `text` for the column **name**, you can use the following snippet in the **Columns** field: `id:int,name:text`.

example_workflow:
  {"name":"QuestDB Example Workflow","nodes":[{"parameters":{},"id":"gx196uflnjdkv7v3wnci0b","name":"QuestDB","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.ReadBinaryFile
name: ReadBinaryFile
display_name: Read Binary File
description: Reads a binary file from disk
category: input
icon: fa:file-import
code_hash: b25d91d1c599335bb399ef8f8b87952ebc8706ed057404aa453696513fd035f2
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:29
updated_at: 2025-06-09 15:18:29
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ReadBinaryFile = void 0;
  class ReadBinaryFile {
      constructor() {
          this.description = {
              displayName: 'Read Binary File',
              name: 'readBinaryFile',
              icon: 'fa:file-import',
              group: ['input'],
              version: 1,
              hidden: true,
              description: 'Reads a binary file from disk',
              defaults: {
                  name: 'Read Binary File',
                  color: '#449922',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'File Path',
                      name: 'filePath',
                      type: 'string',
                      default: '',
                      required: true,
                      placeholder: '/data/example.jpg',
                      description: 'Path of the file to read',
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      description: 'Name of the binary property to which to write the data of the read file',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let item;
          for (let itemIndex = 0; itemIndex < length; itemIndex++) {
              try {
                  item = items[itemIndex];
                  const newItem = {
                      json: item.json,
                      binary: {},
                      pairedItem: {
                          item: itemIndex,
                      },
                  };
                  if (item.binary !== undefined && newItem.binary) {
                      Object.assign(newItem.binary, item.binary);
                  }
                  const filePath = this.getNodeParameter('filePath', itemIndex);
                  const stream = await this.helpers.createReadStream(filePath);
                  const dataPropertyName = this.getNodeParameter('dataPropertyName', itemIndex);
                  newItem.binary[dataPropertyName] = await this.helpers.prepareBinaryData(stream, filePath);
                  returnData.push(newItem);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.ReadBinaryFile = ReadBinaryFile;
  //# sourceMappingURL=ReadBinaryFile.node.js.map

example_workflow:
  {"name":"Read Binary File Example Workflow","nodes":[{"parameters":{},"id":"b3j5j8psy5u7zgerbt5feg","name":"Read Binary File","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.QuickChart
name: QuickChart
display_name: QuickChart
description: Create a chart via QuickChart
category: output
icon: file:quickChart.svg
code_hash: 236f4209dd03f420a5ab72f3149e71a3c515733d510f60f8c2bc8db5baa6fbb8
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.QuickChart
documentation_title: QuickChart node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"quickchart","description":"Templates for quickchart"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:29
updated_at: 2025-06-09 15:18:29
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.QuickChart = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const constants_1 = require("./constants");
  class QuickChart {
      constructor() {
          this.description = {
              displayName: 'QuickChart',
              name: 'quickChart',
              icon: 'file:quickChart.svg',
              group: ['output'],
              description: 'Create a chart via QuickChart',
              version: 1,
              defaults: {
                  name: 'QuickChart',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Chart Type',
                      name: 'chartType',
                      type: 'options',
                      default: 'bar',
                      options: constants_1.CHART_TYPE_OPTIONS,
                      description: 'The type of chart to create',
                  },
                  {
                      displayName: 'Add Labels',
                      name: 'labelsMode',
                      type: 'options',
                      options: [
                          {
                              name: 'Manually',
                              value: 'manually',
                          },
                          {
                              name: 'From Array',
                              value: 'array',
                          },
                      ],
                      default: 'manually',
                  },
                  {
                      displayName: 'Labels',
                      name: 'labelsUi',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                          sortable: true,
                      },
                      default: {},
                      required: true,
                      description: 'Labels to use in the chart',
                      placeholder: 'Add Label',
                      options: [
                          {
                              name: 'labelsValues',
                              displayName: 'Labels',
                              values: [
                                  {
                                      displayName: 'Label',
                                      name: 'label',
                                      type: 'string',
                                      default: '',
                                  },
                              ],
                          },
                      ],
                      displayOptions: {
                          show: {
                              labelsMode: ['manually'],
                          },
                      },
                  },
                  {
                      displayName: 'Labels Array',
                      name: 'labelsArray',
                      type: 'string',
                      required: true,
                      default: '',
                      placeholder: 'e.g. ["Berlin", "Paris", "Rome", "New York"]',
                      displayOptions: {
                          show: {
                              labelsMode: ['array'],
                          },
                      },
                      description: 'The array of labels to be used in the chart',
                  },
                  {
                      displayName: 'Data',
                      name: 'data',
                      type: 'json',
                      default: '',
                      description: 'Data to use for the dataset, documentation and examples <a href="https://quickchart.io/documentation/chart-types/" target="_blank">here</a>',
                      placeholder: 'e.g. [60, 10, 12, 20]',
                      required: true,
                  },
                  {
                      displayName: 'Put Output In Field',
                      name: 'output',
                      type: 'string',
                      default: 'data',
                      required: true,
                      description: 'The binary data will be displayed in the Output panel on the right, under the Binary tab',
                      hint: 'The name of the output field to put the binary file data in',
                  },
                  {
                      displayName: 'Chart Options',
                      name: 'chartOptions',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Background Color',
                              name: 'backgroundColor',
                              type: 'color',
                              typeOptions: {
                                  showAlpha: true,
                              },
                              default: '',
                              description: 'Background color of the chart',
                          },
                          {
                              displayName: 'Device Pixel Ratio',
                              name: 'devicePixelRatio',
                              type: 'number',
                              default: 2,
                              typeOptions: {
                                  minValue: 1,
                                  maxValue: 2,
                              },
                              description: 'Pixel ratio of the chart',
                          },
                          {
                              displayName: 'Format',
                              name: 'format',
                              type: 'options',
                              default: 'png',
                              description: 'File format of the resulting chart',
                              options: [
                                  {
                                      name: 'PNG',
                                      value: 'png',
                                  },
                                  {
                                      name: 'PDF',
                                      value: 'pdf',
                                  },
                                  {
                                      name: 'SVG',
                                      value: 'svg',
                                  },
                                  {
                                      name: 'WebP',
                                      value: 'webp',
                                  },
                              ],
                          },
                          {
                              displayName: 'Height',
                              name: 'height',
                              type: 'number',
                              default: 300,
                              description: 'Height of the chart',
                          },
                          {
                              displayName: 'Horizontal',
                              name: 'horizontal',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the chart should use its Y axis horizontal',
                              displayOptions: {
                                  show: {
                                      '/chartType': constants_1.HORIZONTAL_CHARTS,
                                  },
                              },
                          },
                          {
                              displayName: 'Width',
                              name: 'width',
                              type: 'number',
                              default: 500,
                              description: 'Width of the chart',
                          },
                      ],
                  },
                  {
                      displayName: 'Dataset Options',
                      name: 'datasetOptions',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Background Color',
                              name: 'backgroundColor',
                              type: 'color',
                              default: '',
                              typeOptions: {
                                  showAlpha: true,
                              },
                              description: 'Color used for the background the dataset (area of a line graph, fill of a bar chart, etc.)',
                          },
                          {
                              displayName: 'Border Color',
                              name: 'borderColor',
                              type: 'color',
                              typeOptions: {
                                  showAlpha: true,
                              },
                              default: '',
                              description: 'Color used for lines of the dataset',
                          },
                          {
                              displayName: 'Fill',
                              name: 'fill',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to fill area of the dataset',
                              displayOptions: {
                                  show: {
                                      '/chartType': constants_1.Fill_CHARTS,
                                  },
                              },
                          },
                          {
                              displayName: 'Label',
                              name: 'label',
                              type: 'string',
                              default: '',
                              description: 'The label of the dataset',
                          },
                          {
                              displayName: 'Point Style',
                              name: 'pointStyle',
                              type: 'options',
                              default: 'circle',
                              description: 'Style to use for points of the dataset',
                              options: [
                                  {
                                      name: 'Circle',
                                      value: 'circle',
                                  },
                                  {
                                      name: 'Cross',
                                      value: 'cross',
                                  },
                                  {
                                      name: 'CrossRot',
                                      value: 'crossRot',
                                  },
                                  {
                                      name: 'Dash',
                                      value: 'dash',
                                  },
                                  {
                                      name: 'Line',
                                      value: 'line',
                                  },
                                  {
                                      name: 'Rect',
                                      value: 'rect',
                                  },
                                  {
                                      name: 'Rect Rot',
                                      value: 'rectRot',
                                  },
                                  {
                                      name: 'Rect Rounded',
                                      value: 'rectRounded',
                                  },
                                  {
                                      name: 'Star',
                                      value: 'star',
                                  },
                                  {
                                      name: 'Triangle',
                                      value: 'triangle',
                                  },
                              ],
                              displayOptions: {
                                  show: {
                                      '/chartType': constants_1.POINT_STYLE_CHARTS,
                                  },
                              },
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const datasets = [];
          let chartType = '';
          const labels = [];
          const labelsMode = this.getNodeParameter('labelsMode', 0);
          if (labelsMode === 'manually') {
              const labelsUi = this.getNodeParameter('labelsUi.labelsValues', 0, []);
              if (labelsUi.length) {
                  for (const labelValue of labelsUi) {
                      if (Array.isArray(labelValue.label)) {
                          labels === null || labels === void 0 ? void 0 : labels.push(...labelValue.label);
                      }
                      else {
                          labels === null || labels === void 0 ? void 0 : labels.push(labelValue.label);
                      }
                  }
              }
          }
          else {
              const labelsArray = this.getNodeParameter('labelsArray', 0, '');
              const errorMessage = 'Labels Array is not a valid array, use valid JSON format, or specify it by expressions';
              if (Array.isArray(labelsArray)) {
                  labels.push(...labelsArray);
              }
              else {
                  const labelsArrayParsed = (0, n8n_workflow_1.jsonParse)(labelsArray, {
                      errorMessage,
                  });
                  if (!Array.isArray(labelsArrayParsed)) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), errorMessage);
                  }
                  labels.push(...labelsArrayParsed);
              }
          }
          for (let i = 0; i < items.length; i++) {
              const data = this.getNodeParameter('data', i);
              const datasetOptions = this.getNodeParameter('datasetOptions', i);
              const backgroundColor = datasetOptions.backgroundColor;
              const borderColor = datasetOptions.borderColor;
              const fill = datasetOptions.fill;
              const label = datasetOptions.label || 'Chart';
              const pointStyle = datasetOptions.pointStyle;
              chartType = this.getNodeParameter('chartType', i);
              if (constants_1.HORIZONTAL_CHARTS.includes(chartType)) {
                  const horizontal = this.getNodeParameter('chartOptions.horizontal', i, false);
                  if (horizontal) {
                      chartType =
                          'horizontal' + chartType[0].toUpperCase() + chartType.substring(1, chartType.length);
                  }
              }
              let pointStyleName = 'pointStyle';
              if (constants_1.ITEM_STYLE_CHARTS.includes(chartType)) {
                  pointStyleName = 'itemStyle';
              }
              datasets.push({
                  label,
                  data,
                  backgroundColor,
                  borderColor,
                  type: chartType,
                  fill,
                  [pointStyleName]: pointStyle,
              });
          }
          const output = this.getNodeParameter('output', 0);
          const chartOptions = this.getNodeParameter('chartOptions', 0);
          const chart = {
              type: chartType,
              data: {
                  labels,
                  datasets,
              },
          };
          const options = {
              method: 'GET',
              url: 'https://quickchart.io/chart',
              qs: {
                  chart: JSON.stringify(chart),
                  ...chartOptions,
              },
              returnFullResponse: true,
              encoding: 'arraybuffer',
              json: false,
          };
          const response = (await this.helpers.httpRequest(options));
          let mimeType = response.headers['content-type'];
          mimeType = mimeType ? mimeType.split(';').find((value) => value.includes('/')) : undefined;
          return [
              [
                  {
                      binary: {
                          [output]: await this.helpers.prepareBinaryData(response.body, undefined, mimeType),
                      },
                      json: { chart },
                  },
              ],
          ];
      }
  }
  exports.QuickChart = QuickChart;
  //# sourceMappingURL=QuickChart.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: QuickChart node documentation
  description: Learn how to use the QuickChart node in n8n. Follow technical documentation to integrate QuickChart node into your workflows.
  contentType: [integration, reference]
  priority: medium
  ---

  # QuickChart node

  Use the QuickChart node to automate work in QuickChart, and integrate QuickChart with other applications. n8n has built-in support for a wide range of QuickChart chart types, including bar, doughnut, line, pie, and polar charts.

  On this page, you'll find a list of operations the QuickChart node supports and links to more resources.

  --8<-- "_snippets/integrations/builtin/app-nodes/ai-tools.md"

  ## Operations

  Create a chart by selecting the chart type:

  * Chart Type
  	* Bar Chart
  	* Doughnut Chart
  	* Line Chart
  	* Pie Chart
  	* Polar Chart

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'quickchart') ]]

  ## Related resources

  Refer to [QuickChart's API documentation](https://quickchart.io/documentation/){:target=_blank .external-link} for more information about the service.

related_resources:
  [{"title":"QuickChart's API documentation","url":"https://quickchart.io/documentation/","type":"external"}]

example_workflow:
  {"name":"QuickChart Example Workflow","nodes":[{"parameters":{},"id":"46xyq0l86zfr91vert9zd8","name":"QuickChart","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Pushover
name: Pushover
display_name: Pushover
description: Consume Pushover API
category: input
icon: file:pushover.svg
code_hash: 3a7a4089c5eeea56b94fe3d78b95dbf850e3eefb49b2255fd9e6a6a4de9cf4a9
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Pushover
documentation_title: Pushover node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"pushover","description":"Templates for pushover"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:29
updated_at: 2025-06-09 15:18:29
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Pushover = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Pushover {
      constructor() {
          this.description = {
              displayName: 'Pushover',
              name: 'pushover',
              icon: 'file:pushover.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Pushover API',
              defaults: {
                  name: 'Pushover',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pushoverApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Message',
                              value: 'message',
                          },
                      ],
                      default: 'message',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Push',
                              value: 'push',
                              action: 'Push a message',
                          },
                      ],
                      default: 'push',
                  },
                  {
                      displayName: 'User Key',
                      name: 'userKey',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                          },
                      },
                      default: '',
                      description: 'The user/group key (not e-mail address) of your user (or you), viewable when logged into the <a href="https://pushover.net/">dashboard</a> (often referred to as <code>USER_KEY</code> in the <a href="https://support.pushover.net/i44-example-code-and-pushover-libraries">libraries</a> and code examples)',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                          },
                      },
                      default: '',
                      description: 'Your message',
                  },
                  {
                      displayName: 'Priority',
                      name: 'priority',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                          },
                      },
                      options: [
                          {
                              name: 'Lowest Priority',
                              value: -2,
                          },
                          {
                              name: 'Low Priority',
                              value: -1,
                          },
                          {
                              name: 'Normal Priority',
                              value: 0,
                          },
                          {
                              name: 'High Priority',
                              value: 1,
                          },
                          {
                              name: 'Emergency Priority',
                              value: 2,
                          },
                      ],
                      default: -2,
                      description: "Send as -2 to generate no notification/alert, -1 to always send as a quiet notification, 1 to display as high-priority and bypass the user's quiet hours, or 2 to also require confirmation from the user",
                  },
                  {
                      displayName: 'Retry (Seconds)',
                      name: 'retry',
                      type: 'number',
                      typeOptions: {
                          minValue: 0,
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                              priority: [2],
                          },
                      },
                      default: 30,
                      description: 'Specifies how often (in seconds) the Pushover servers will send the same notification to the user. This parameter must have a value of at least 30 seconds between retries.',
                  },
                  {
                      displayName: 'Expire (Seconds)',
                      name: 'expire',
                      type: 'number',
                      typeOptions: {
                          minValue: 0,
                          maxValue: 10800,
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                              priority: [2],
                          },
                      },
                      default: 30,
                      description: 'Specifies how many seconds your notification will continue to be retried for (every retry seconds)',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Attachment',
                              name: 'attachmentsUi',
                              placeholder: 'Add Attachments',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: false,
                              },
                              options: [
                                  {
                                      name: 'attachmentsValues',
                                      displayName: 'Attachment Property',
                                      values: [
                                          {
                                              displayName: 'Binary Property',
                                              name: 'binaryPropertyName',
                                              type: 'string',
                                              default: '',
                                              placeholder: 'data',
                                              description: 'Name of the binary properties which contain data which should be added to email as attachment',
                                          },
                                      ],
                                  },
                              ],
                              default: {},
                          },
                          {
                              displayName: 'Device',
                              name: 'device',
                              type: 'string',
                              default: '',
                              description: "Your user's device name to send the message directly to that device, rather than all of the user's devices (multiple devices may be separated by a comma)",
                          },
                          {
                              displayName: 'HTML Formatting',
                              name: 'html',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable messages formatting with HTML tags',
                          },
                          {
                              displayName: 'Sound Name or ID',
                              name: 'sound',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getSounds',
                              },
                              default: '',
                              description: 'The name of one of the sounds supported by device clients to override the user\'s default sound choice. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Timestamp',
                              name: 'timestamp',
                              type: 'dateTime',
                              default: '',
                              description: "A Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API",
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: "Your message's title, otherwise your app's name is used",
                          },
                          {
                              displayName: 'Timestamp',
                              name: 'timestamp',
                              type: 'dateTime',
                              default: '',
                              description: "A Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API",
                          },
                          {
                              displayName: 'URL',
                              name: 'url',
                              type: 'string',
                              default: '',
                              description: 'A supplementary URL to show with your message',
                          },
                          {
                              displayName: 'URL Title',
                              name: 'url_title',
                              type: 'string',
                              default: '',
                              description: 'A title for your supplementary URL, otherwise just the URL is shown',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getSounds() {
                      const { sounds } = await GenericFunctions_1.pushoverApiRequest.call(this, 'GET', '/sounds.json', {});
                      const returnData = [];
                      for (const key of Object.keys(sounds)) {
                          returnData.push({
                              name: sounds[key],
                              value: key,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'message') {
                      if (operation === 'push') {
                          const userKey = this.getNodeParameter('userKey', i);
                          const message = this.getNodeParameter('message', i);
                          const priority = this.getNodeParameter('priority', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.html !== undefined) {
                              additionalFields.html = additionalFields.html ? '1' : '';
                          }
                          const body = {
                              user: userKey,
                              message,
                              priority,
                          };
                          if (priority === 2) {
                              body.retry = this.getNodeParameter('retry', i);
                              body.expire = this.getNodeParameter('expire', i);
                          }
                          Object.assign(body, additionalFields);
                          if (body.attachmentsUi) {
                              const attachment = body.attachmentsUi
                                  .attachmentsValues;
                              if (attachment) {
                                  const binaryPropertyName = attachment.binaryPropertyName;
                                  const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                  const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                                  body.attachment = {
                                      value: dataBuffer,
                                      options: {
                                          filename: binaryData.fileName,
                                      },
                                  };
                                  delete body.attachmentsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.pushoverApiRequest.call(this, 'POST', '/messages.json', body);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Pushover = Pushover;
  //# sourceMappingURL=Pushover.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PushoverApi = void 0;
  class PushoverApi {
      constructor() {
          this.name = 'pushoverApi';
          this.displayName = 'Pushover API';
          this.documentationUrl = 'pushover';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.test = {
              request: {
                  baseURL: 'https://api.pushover.net/1',
                  url: '=/licenses.json?token={{$credentials?.apiKey}}',
                  method: 'GET',
              },
          };
      }
      async authenticate(credentials, requestOptions) {
          if (requestOptions.method === 'GET' && requestOptions.qs) {
              Object.assign(requestOptions.qs, { token: credentials.apiKey });
          }
          else if (requestOptions.body) {
              Object.assign(requestOptions.body, { token: credentials.apiKey });
          }
          return requestOptions;
      }
  }
  exports.PushoverApi = PushoverApi;
  //# sourceMappingURL=PushoverApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PushoverApi = void 0;
  class PushoverApi {
      constructor() {
          this.name = 'pushoverApi';
          this.displayName = 'Pushover API';
          this.documentationUrl = 'pushover';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.test = {
              request: {
                  baseURL: 'https://api.pushover.net/1',
                  url: '=/licenses.json?token={{$credentials?.apiKey}}',
                  method: 'GET',
              },
          };
      }
      async authenticate(credentials, requestOptions) {
          if (requestOptions.method === 'GET' && requestOptions.qs) {
              Object.assign(requestOptions.qs, { token: credentials.apiKey });
          }
          else if (requestOptions.body) {
              Object.assign(requestOptions.body, { token: credentials.apiKey });
          }
          return requestOptions;
      }
  }
  exports.PushoverApi = PushoverApi;
  //# sourceMappingURL=PushoverApi.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Pushover node documentation
  description: Learn how to use the Pushover node in n8n. Follow technical documentation to integrate Pushover node into your workflows.
  contentType: [integration, reference]
  ---

  # Pushover node

  Use the Pushover node to automate work in Pushover, and integrate Pushover with other applications. n8n supports sending push notifications with Pushover.

  On this page, you'll find a list of operations the Pushover node supports and links to more resources.

  /// note | Credentials
  Refer to [Pushover credentials](/integrations/builtin/credentials/pushover.md) for guidance on setting up authentication. 
  ///

  --8<-- "_snippets/integrations/builtin/app-nodes/ai-tools.md"

  ## Operations

  * Message
      * Push

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'pushover') ]]

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Pushover Example Workflow","nodes":[{"parameters":{},"id":"a4qgnqgbvzjt2m0pubspn","name":"Pushover","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Raindrop
name: Raindrop
display_name: Raindrop
description: Consume the Raindrop API
category: transform
icon: file:raindrop.svg
code_hash: 2ffff5f78e6186206cef24c5dd2e380afdbdc2f5402ccc15b45f49cb45ac263e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Raindrop
documentation_title: Raindrop node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"raindrop","description":"Templates for raindrop"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:29
updated_at: 2025-06-09 15:18:29
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Raindrop = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  const omit_1 = __importDefault(require("lodash/omit"));
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Raindrop {
      constructor() {
          this.description = {
              displayName: 'Raindrop',
              name: 'raindrop',
              icon: 'file:raindrop.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Raindrop API',
              defaults: {
                  name: 'Raindrop',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'raindropOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Bookmark',
                              value: 'bookmark',
                          },
                          {
                              name: 'Collection',
                              value: 'collection',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'collection',
                  },
                  ...descriptions_1.bookmarkOperations,
                  ...descriptions_1.bookmarkFields,
                  ...descriptions_1.collectionOperations,
                  ...descriptions_1.collectionFields,
                  ...descriptions_1.tagOperations,
                  ...descriptions_1.tagFields,
                  ...descriptions_1.userOperations,
                  ...descriptions_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCollections() {
                      const responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', '/collections', {}, {});
                      return responseData.items.map((item) => ({
                          name: item.title,
                          value: item._id,
                      }));
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'bookmark') {
                      if (operation === 'create') {
                          const body = {
                              link: this.getNodeParameter('link', i),
                              collection: {
                                  $id: this.getNodeParameter('collectionId', i),
                              },
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          if (additionalFields.pleaseParse === true) {
                              body.pleaseParse = {};
                              delete additionalFields.pleaseParse;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags.split(',').map((tag) => tag.trim());
                          }
                          const endpoint = '/raindrop';
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData.item;
                      }
                      else if (operation === 'delete') {
                          const bookmarkId = this.getNodeParameter('bookmarkId', i);
                          const endpoint = `/raindrop/${bookmarkId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      }
                      else if (operation === 'get') {
                          const bookmarkId = this.getNodeParameter('bookmarkId', i);
                          const endpoint = `/raindrop/${bookmarkId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.item;
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const endpoint = `/raindrops/${collectionId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.items;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      else if (operation === 'update') {
                          const bookmarkId = this.getNodeParameter('bookmarkId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          Object.assign(body, updateFields);
                          if (updateFields.collectionId) {
                              body.collection = {
                                  $id: updateFields.collectionId,
                              };
                              delete updateFields.collectionId;
                          }
                          if (updateFields.pleaseParse === true) {
                              body.pleaseParse = {};
                              delete updateFields.pleaseParse;
                          }
                          if (updateFields.tags) {
                              body.tags = updateFields.tags.split(',').map((tag) => tag.trim());
                          }
                          const endpoint = `/raindrop/${bookmarkId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'PUT', endpoint, {}, body);
                          responseData = responseData.item;
                      }
                  }
                  else if (resource === 'collection') {
                      if (operation === 'create') {
                          const body = {
                              title: this.getNodeParameter('title', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          if (additionalFields.cover) {
                              body.cover = [body.cover];
                          }
                          if (additionalFields.parentId) {
                              body['parent.$id'] = parseInt(additionalFields.parentId, 10);
                              delete additionalFields.parentId;
                          }
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'POST', '/collection', {}, body);
                          responseData = responseData.item;
                      }
                      else if (operation === 'delete') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const endpoint = `/collection/${collectionId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      }
                      else if (operation === 'get') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const endpoint = `/collection/${collectionId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.item;
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const endpoint = this.getNodeParameter('type', i) === 'parent'
                              ? '/collections'
                              : '/collections/childrens';
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.items;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      else if (operation === 'update') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          if (updateFields.parentId) {
                              body['parent.$id'] = parseInt(updateFields.parentId, 10);
                              delete updateFields.parentId;
                          }
                          Object.assign(body, (0, omit_1.default)(updateFields, 'binaryPropertyName'));
                          const endpoint = `/collection/${collectionId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'PUT', endpoint, {}, body);
                          responseData = responseData.item;
                          if (updateFields.cover) {
                              const binaryPropertyName = updateFields.cover;
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              const formData = {
                                  cover: {
                                      value: dataBuffer,
                                      options: {
                                          filename: binaryData.fileName,
                                          contentType: binaryData.mimeType,
                                      },
                                  },
                              };
                              const requestEndpoint = `/collection/${collectionId}/cover`;
                              responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'PUT', requestEndpoint, {}, {}, { 'Content-Type': 'multipart/form-data', formData });
                              responseData = responseData.item;
                          }
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'get') {
                          const self = this.getNodeParameter('self', i);
                          let endpoint = '/user';
                          if (self === false) {
                              const userId = this.getNodeParameter('userId', i);
                              endpoint += `/${userId}`;
                          }
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.user;
                      }
                  }
                  else if (resource === 'tag') {
                      if (operation === 'delete') {
                          let endpoint = '/tags';
                          const body = {
                              tags: this.getNodeParameter('tags', i).split(','),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.collectionId) {
                              endpoint += `/${additionalFields.collectionId}`;
                          }
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'DELETE', endpoint, {}, body);
                      }
                      else if (operation === 'getAll') {
                          let endpoint = '/tags';
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filter = this.getNodeParameter('filters', i);
                          if (filter.collectionId) {
                              endpoint += `/${filter.collectionId}`;
                          }
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.items;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  Array.isArray(responseData)
                      ? returnData.push(...responseData)
                      : returnData.push(responseData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Raindrop = Raindrop;
  //# sourceMappingURL=Raindrop.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.RaindropOAuth2Api = void 0;
  class RaindropOAuth2Api {
      constructor() {
          this.name = 'raindropOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Raindrop OAuth2 API';
          this.documentationUrl = 'raindrop';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://raindrop.io/oauth/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.raindrop.io/v1/oauth/access_token',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
          ];
      }
  }
  exports.RaindropOAuth2Api = RaindropOAuth2Api;
  //# sourceMappingURL=RaindropOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.RaindropOAuth2Api = void 0;
  class RaindropOAuth2Api {
      constructor() {
          this.name = 'raindropOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Raindrop OAuth2 API';
          this.documentationUrl = 'raindrop';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://raindrop.io/oauth/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.raindrop.io/v1/oauth/access_token',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
          ];
      }
  }
  exports.RaindropOAuth2Api = RaindropOAuth2Api;
  //# sourceMappingURL=RaindropOAuth2Api.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Raindrop node documentation
  description: Learn how to use the Raindrop node in n8n. Follow technical documentation to integrate Raindrop node into your workflows.
  contentType: [integration, reference]
  ---

  # Raindrop node

  Use the Raindrop node to automate work in Raindrop, and integrate Raindrop with other applications. n8n has built-in support for a wide range of Raindrop features, including getting users, deleting tags, and creating, updating, deleting and getting collections and bookmarks. 

  On this page, you'll find a list of operations the Raindrop node supports and links to more resources.

  /// note | Credentials
  Refer to [Raindrop credentials](/integrations/builtin/credentials/raindrop.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Bookmark
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Collection
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Tag
      * Delete
      * Get All
  * User
      * Get

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'raindrop') ]]

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Raindrop Example Workflow","nodes":[{"parameters":{},"id":"859c7qsvddro34rl0urih","name":"Raindrop","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.QuickBooks
name: QuickBooks
display_name: QuickBooks Online
description: Consume the QuickBooks Online API
category: transform
icon: file:quickbooks.svg
code_hash: fec11a5217d27572bb5cc124a06c9011a104bab890905afe4e7c04e3abf95f7f
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.QuickBooks
documentation_title: QuickBooks Online node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"quickbooks-online","description":"Templates for quickbooks-online"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:29
updated_at: 2025-06-09 15:18:29
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.QuickBooks = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const change_case_1 = require("change-case");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  class QuickBooks {
      constructor() {
          this.description = {
              displayName: 'QuickBooks Online',
              name: 'quickbooks',
              icon: 'file:quickbooks.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the QuickBooks Online API',
              defaults: {
                  name: 'QuickBooks Online',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'quickBooksOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Bill',
                              value: 'bill',
                          },
                          {
                              name: 'Customer',
                              value: 'customer',
                          },
                          {
                              name: 'Employee',
                              value: 'employee',
                          },
                          {
                              name: 'Estimate',
                              value: 'estimate',
                          },
                          {
                              name: 'Invoice',
                              value: 'invoice',
                          },
                          {
                              name: 'Item',
                              value: 'item',
                          },
                          {
                              name: 'Payment',
                              value: 'payment',
                          },
                          {
                              name: 'Purchase',
                              value: 'purchase',
                          },
                          {
                              name: 'Transaction',
                              value: 'transaction',
                          },
                          {
                              name: 'Vendor',
                              value: 'vendor',
                          },
                      ],
                      default: 'customer',
                  },
                  ...descriptions_1.billOperations,
                  ...descriptions_1.billFields,
                  ...descriptions_1.customerOperations,
                  ...descriptions_1.customerFields,
                  ...descriptions_1.employeeOperations,
                  ...descriptions_1.employeeFields,
                  ...descriptions_1.estimateOperations,
                  ...descriptions_1.estimateFields,
                  ...descriptions_1.invoiceOperations,
                  ...descriptions_1.invoiceFields,
                  ...descriptions_1.itemOperations,
                  ...descriptions_1.itemFields,
                  ...descriptions_1.paymentOperations,
                  ...descriptions_1.paymentFields,
                  ...descriptions_1.purchaseOperations,
                  ...descriptions_1.purchaseFields,
                  ...descriptions_1.transactionOperations,
                  ...descriptions_1.transactionFields,
                  ...descriptions_1.vendorOperations,
                  ...descriptions_1.vendorFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCustomers() {
                      return GenericFunctions_1.loadResource.call(this, 'customer');
                  },
                  async getCustomFields() {
                      return GenericFunctions_1.loadResource.call(this, 'preferences');
                  },
                  async getDepartments() {
                      return GenericFunctions_1.loadResource.call(this, 'department');
                  },
                  async getItems() {
                      return GenericFunctions_1.loadResource.call(this, 'item');
                  },
                  async getMemos() {
                      return GenericFunctions_1.loadResource.call(this, 'CreditMemo');
                  },
                  async getPurchases() {
                      return GenericFunctions_1.loadResource.call(this, 'purchase');
                  },
                  async getTaxCodeRefs() {
                      return GenericFunctions_1.loadResource.call(this, 'TaxCode');
                  },
                  async getTerms() {
                      return GenericFunctions_1.loadResource.call(this, 'Term');
                  },
                  async getVendors() {
                      return GenericFunctions_1.loadResource.call(this, 'vendor');
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          const { oauthTokenData } = (await this.getCredentials('quickBooksOAuth2Api'));
          const companyId = oauthTokenData.callbackQueryString.realmId;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'bill') {
                      if (operation === 'create') {
                          const lines = this.getNodeParameter('Line', i);
                          if (!lines.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one line for the ${resource}.`, { itemIndex: i });
                          }
                          if (lines.some((line) => line.DetailType === undefined ||
                              line.Amount === undefined ||
                              line.Description === undefined)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter detail type, amount and description for every line.', { itemIndex: i });
                          }
                          lines.forEach((line) => {
                              if (line.DetailType === 'AccountBasedExpenseLineDetail' &&
                                  line.accountId === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter an account ID for the associated line.', { itemIndex: i });
                              }
                              else if (line.DetailType === 'ItemBasedExpenseLineDetail' &&
                                  line.itemId === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter an item ID for the associated line.', { itemIndex: i });
                              }
                          });
                          let body = {
                              VendorRef: {
                                  value: this.getNodeParameter('VendorRef', i),
                              },
                          };
                          body.Line = GenericFunctions_1.processLines.call(this, body, lines, resource);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'delete') {
                          const qs = {
                              operation: 'delete',
                          };
                          const body = {
                              Id: this.getNodeParameter('billId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const billId = this.getNodeParameter('billId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${billId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'update') {
                          const { ref, syncToken } = await GenericFunctions_1.getRefAndSyncToken.call(this, i, companyId, resource, 'VendorRef');
                          let body = {
                              Id: this.getNodeParameter('billId', i),
                              SyncToken: syncToken,
                              sparse: true,
                              VendorRef: {
                                  name: ref.name,
                                  value: ref.value,
                              },
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'customer') {
                      if (operation === 'create') {
                          let body = {
                              DisplayName: this.getNodeParameter('displayName', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${customerId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'update') {
                          let body = {
                              Id: this.getNodeParameter('customerId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              sparse: true,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'employee') {
                      if (operation === 'create') {
                          let body = {
                              FamilyName: this.getNodeParameter('FamilyName', i),
                              GivenName: this.getNodeParameter('GivenName', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const employeeId = this.getNodeParameter('employeeId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${employeeId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'update') {
                          let body = {
                              Id: this.getNodeParameter('employeeId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              sparse: true,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'estimate') {
                      if (operation === 'create') {
                          const lines = this.getNodeParameter('Line', i);
                          if (!lines.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one line for the ${resource}.`, { itemIndex: i });
                          }
                          if (lines.some((line) => line.DetailType === undefined ||
                              line.Amount === undefined ||
                              line.Description === undefined)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter detail type, amount and description for every line.', { itemIndex: i });
                          }
                          lines.forEach((line) => {
                              if (line.DetailType === 'SalesItemLineDetail' && line.itemId === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter an item ID for the associated line.', { itemIndex: i });
                              }
                          });
                          let body = {
                              CustomerRef: {
                                  value: this.getNodeParameter('CustomerRef', i),
                              },
                          };
                          body.Line = GenericFunctions_1.processLines.call(this, body, lines, resource);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'delete') {
                          const qs = {
                              operation: 'delete',
                          };
                          const body = {
                              Id: this.getNodeParameter('estimateId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const estimateId = this.getNodeParameter('estimateId', i);
                          const download = this.getNodeParameter('download', i);
                          if (download) {
                              responseData = await GenericFunctions_1.handleBinaryData.call(this, items, i, companyId, resource, estimateId);
                          }
                          else {
                              const endpoint = `/v3/company/${companyId}/${resource}/${estimateId}`;
                              responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                              responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                          }
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'send') {
                          const estimateId = this.getNodeParameter('estimateId', i);
                          const qs = {
                              sendTo: this.getNodeParameter('email', i),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}/${estimateId}/send`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'update') {
                          const { ref, syncToken } = await GenericFunctions_1.getRefAndSyncToken.call(this, i, companyId, resource, 'CustomerRef');
                          let body = {
                              Id: this.getNodeParameter('estimateId', i),
                              SyncToken: syncToken,
                              sparse: true,
                              CustomerRef: {
                                  name: ref.name,
                                  value: ref.value,
                              },
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'invoice') {
                      if (operation === 'create') {
                          const lines = this.getNodeParameter('Line', i);
                          if (!lines.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one line for the ${resource}.`, { itemIndex: i });
                          }
                          if (lines.some((line) => line.DetailType === undefined ||
                              line.Amount === undefined ||
                              line.Description === undefined)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter detail type, amount and description for every line.', { itemIndex: i });
                          }
                          lines.forEach((line) => {
                              if (line.DetailType === 'SalesItemLineDetail' && line.itemId === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter an item ID for the associated line.', { itemIndex: i });
                              }
                          });
                          let body = {
                              CustomerRef: {
                                  value: this.getNodeParameter('CustomerRef', i),
                              },
                          };
                          body.Line = GenericFunctions_1.processLines.call(this, body, lines, resource);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'delete') {
                          const qs = {
                              operation: 'delete',
                          };
                          const body = {
                              Id: this.getNodeParameter('invoiceId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          const download = this.getNodeParameter('download', i);
                          if (download) {
                              responseData = await GenericFunctions_1.handleBinaryData.call(this, items, i, companyId, resource, invoiceId);
                          }
                          else {
                              const endpoint = `/v3/company/${companyId}/${resource}/${invoiceId}`;
                              responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                              responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                          }
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'send') {
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          const qs = {
                              sendTo: this.getNodeParameter('email', i),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}/${invoiceId}/send`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'update') {
                          const { ref, syncToken } = await GenericFunctions_1.getRefAndSyncToken.call(this, i, companyId, resource, 'CustomerRef');
                          let body = {
                              Id: this.getNodeParameter('invoiceId', i),
                              SyncToken: syncToken,
                              sparse: true,
                              CustomerRef: {
                                  name: ref.name,
                                  value: ref.value,
                              },
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'void') {
                          const qs = {
                              Id: this.getNodeParameter('invoiceId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              operation: 'void',
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'item') {
                      if (operation === 'get') {
                          const item = this.getNodeParameter('itemId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${item}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                  }
                  else if (resource === 'payment') {
                      if (operation === 'create') {
                          let body = {
                              CustomerRef: {
                                  value: this.getNodeParameter('CustomerRef', i),
                              },
                              TotalAmt: this.getNodeParameter('TotalAmt', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'delete') {
                          const qs = {
                              operation: 'delete',
                          };
                          const body = {
                              Id: this.getNodeParameter('paymentId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const paymentId = this.getNodeParameter('paymentId', i);
                          const download = this.getNodeParameter('download', i);
                          if (download) {
                              responseData = await GenericFunctions_1.handleBinaryData.call(this, items, i, companyId, resource, paymentId);
                          }
                          else {
                              const endpoint = `/v3/company/${companyId}/${resource}/${paymentId}`;
                              responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                              responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                          }
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'send') {
                          const paymentId = this.getNodeParameter('paymentId', i);
                          const qs = {
                              sendTo: this.getNodeParameter('email', i),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}/${paymentId}/send`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'update') {
                          const { ref, syncToken } = await GenericFunctions_1.getRefAndSyncToken.call(this, i, companyId, resource, 'CustomerRef');
                          let body = {
                              Id: this.getNodeParameter('paymentId', i),
                              SyncToken: syncToken,
                              sparse: true,
                              CustomerRef: {
                                  name: ref.name,
                                  value: ref.value,
                              },
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'void') {
                          const qs = {
                              Id: this.getNodeParameter('paymentId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              operation: 'void',
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'purchase') {
                      if (operation === 'get') {
                          const purchaseId = this.getNodeParameter('purchaseId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${purchaseId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                  }
                  else if (resource === 'transaction') {
                      if (operation === 'getReport') {
                          const { columns, memo, term, customer, vendor, ...rest } = this.getNodeParameter('filters', i);
                          let qs = { ...rest };
                          if (columns === null || columns === void 0 ? void 0 : columns.length) {
                              qs.columns = columns.join(',');
                          }
                          if (memo === null || memo === void 0 ? void 0 : memo.length) {
                              qs.memo = memo.join(',');
                          }
                          if (term === null || term === void 0 ? void 0 : term.length) {
                              qs.term = term.join(',');
                          }
                          if (customer === null || customer === void 0 ? void 0 : customer.length) {
                              qs.customer = customer.join(',');
                          }
                          if (vendor === null || vendor === void 0 ? void 0 : vendor.length) {
                              qs.vendor = vendor.join(',');
                          }
                          qs = (0, GenericFunctions_1.adjustTransactionDates)(qs);
                          const endpoint = `/v3/company/${companyId}/reports/TransactionList`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, qs, {});
                          const simplifyResponse = this.getNodeParameter('simple', i, true);
                          if (!Object.keys(responseData === null || responseData === void 0 ? void 0 : responseData.Rows).length) {
                              responseData = [];
                          }
                          if (simplifyResponse && !Array.isArray(responseData)) {
                              responseData = (0, GenericFunctions_1.simplifyTransactionReport)(responseData);
                          }
                      }
                  }
                  else if (resource === 'vendor') {
                      if (operation === 'create') {
                          let body = {
                              DisplayName: this.getNodeParameter('displayName', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const vendorId = this.getNodeParameter('vendorId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${vendorId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'update') {
                          let body = {
                              Id: this.getNodeParameter('vendorId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              sparse: true,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const download = this.getNodeParameter('download', 0, false);
                      if (['invoice', 'estimate', 'payment'].includes(resource) &&
                          ['get'].includes(operation) &&
                          download) {
                          if (!responseData) {
                              items[i].json = { error: error.message };
                              responseData = items;
                          }
                          else {
                              responseData[i].json = { error: error.message };
                          }
                      }
                      else {
                          const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                          returnData.push(...executionErrorData);
                      }
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          const download = this.getNodeParameter('download', 0, false);
          if (['invoice', 'estimate', 'payment'].includes(resource) &&
              ['get'].includes(operation) &&
              download) {
              return [responseData];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.QuickBooks = QuickBooks;
  //# sourceMappingURL=QuickBooks.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.QuickBooksOAuth2Api = void 0;
  class QuickBooksOAuth2Api {
      constructor() {
          this.name = 'quickBooksOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'QuickBooks Online OAuth2 API';
          this.documentationUrl = 'quickbooks';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://appcenter.intuit.com/connect/oauth2',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'com.intuit.quickbooks.accounting',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
              {
                  displayName: 'Environment',
                  name: 'environment',
                  type: 'options',
                  default: 'production',
                  options: [
                      {
                          name: 'Production',
                          value: 'production',
                      },
                      {
                          name: 'Sandbox',
                          value: 'sandbox',
                      },
                  ],
              },
          ];
      }
  }
  exports.QuickBooksOAuth2Api = QuickBooksOAuth2Api;
  //# sourceMappingURL=QuickBooksOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.QuickBooksOAuth2Api = void 0;
  class QuickBooksOAuth2Api {
      constructor() {
          this.name = 'quickBooksOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'QuickBooks Online OAuth2 API';
          this.documentationUrl = 'quickbooks';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://appcenter.intuit.com/connect/oauth2',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'com.intuit.quickbooks.accounting',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
              {
                  displayName: 'Environment',
                  name: 'environment',
                  type: 'options',
                  default: 'production',
                  options: [
                      {
                          name: 'Production',
                          value: 'production',
                      },
                      {
                          name: 'Sandbox',
                          value: 'sandbox',
                      },
                  ],
              },
          ];
      }
  }
  exports.QuickBooksOAuth2Api = QuickBooksOAuth2Api;
  //# sourceMappingURL=QuickBooksOAuth2Api.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: QuickBooks Online node documentation
  description: Learn how to use the QuickBooks Online node in n8n. Follow technical documentation to integrate QuickBooks Online node into your workflows.
  contentType: [integration, reference]
  ---

  # QuickBooks Online node

  Use the QuickBooks node to automate work in QuickBooks, and integrate QuickBooks with other applications. n8n has built-in support for a wide range of QuickBooks features, including creating, updating, deleting, and getting bills, customers, employees, estimates, and invoices. 

  On this page, you'll find a list of operations the QuickBooks node supports and links to more resources.

  /// note | Credentials
  Refer to [QuickBooks credentials](/integrations/builtin/credentials/quickbooks.md) for guidance on setting up authentication. 
  ///

  --8<-- "_snippets/integrations/builtin/app-nodes/ai-tools.md"

  ## Operations

  * Bill
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Customer
      * Create
      * Get
      * Get All
      * Update
  * Employee
      * Create
      * Get
      * Get All
      * Update
  * Estimate
      * Create
      * Delete
      * Get
      * Get All
      * Send
      * Update
  * Invoice
      * Create
      * Delete
      * Get
      * Get All
      * Send
      * Update
      * Void
  * Item
      * Get
      * Get All
  * Payment
      * Create
      * Delete
      * Get
      * Get All
      * Send
      * Update
      * Void
  * Purchase
      * Get
      * Get All
  * Transaction
      * Get Report
  * Vendor
      * Create
      * Get
      * Get All
      * Update

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'quickbooks-online') ]]

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"QuickBooks Online Example Workflow","nodes":[{"parameters":{},"id":"ohgrb6k38hvt8q0i4c858","name":"QuickBooks Online","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


