# nodes

node_type: n8n-nodes-base.Orbit
name: Orbit
display_name: Orbit
description: Consume Orbit API
category: output
icon: file:orbit.svg
code_hash: a764c179c3c5124709b80cdb672b1ef5f68ca0d0116cd4dcb0f972b61cdee72e
example_parameters: {"resource":"activity","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:01
updated_at: 2025-06-12 08:59:01
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.Orbit = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ActivityDescription_1 = require("./ActivityDescription");
  const MemberDescription_1 = require("./MemberDescription");
  const NoteDescription_1 = require("./NoteDescription");
  const PostDescription_1 = require("./PostDescription");
  const moment_1 = __importDefault(require("moment"));
  class Orbit {
      constructor() {
          this.description = {
              displayName: 'Orbit',
              name: 'orbit',
              icon: 'file:orbit.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Orbit API',
              defaults: {
                  name: 'Orbit',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'orbitApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                          {
                              name: 'Member',
                              value: 'member',
                          },
                          {
                              name: 'Note',
                              value: 'note',
                          },
                          {
                              name: 'Post',
                              value: 'post',
                          },
                      ],
                      default: 'member',
                  },
                  ...ActivityDescription_1.activityOperations,
                  ...ActivityDescription_1.activityFields,
                  ...MemberDescription_1.memberOperations,
                  ...MemberDescription_1.memberFields,
                  ...NoteDescription_1.noteOperations,
                  ...NoteDescription_1.noteFields,
                  ...PostDescription_1.postOperations,
                  ...PostDescription_1.postFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getWorkspaces() {
                      const returnData = [];
                      const workspaces = await GenericFunctions_1.orbitApiRequest.call(this, 'GET', '/workspaces');
                      for (const workspace of workspaces.data) {
                          returnData.push({
                              name: workspace.attributes.name,
                              value: workspace.attributes.slug,
                          });
                      }
                      return returnData;
                  },
                  async getActivityTypes() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.orbitApiRequest.call(this, 'GET', '/activity_types');
                      for (const activityType of data) {
                          returnData.push({
                              name: activityType.attributes.short_name,
                              value: activityType.id,
                          });
                      }
                      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 === 'activity') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const title = this.getNodeParameter('title', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              title,
                          };
                          if (additionalFields.description) {
                              body.description = additionalFields.description;
                          }
                          if (additionalFields.link) {
                              body.link = additionalFields.link;
                          }
                          if (additionalFields.linkText) {
                              body.link_text = additionalFields.linkText;
                          }
                          if (additionalFields.activityType) {
                              body.activity_type = additionalFields.activityType;
                          }
                          if (additionalFields.key) {
                              body.key = additionalFields.key;
                          }
                          if (additionalFields.occurredAt) {
                              body.occurred_at = additionalFields.occurredAt;
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'POST', `/${workspaceId}/members/${memberId}/activities`, body);
                          responseData = responseData.data;
                      }
                      if (operation === 'getAll') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          let endpoint = `/${workspaceId}/activities`;
                          if (filters.memberId) {
                              endpoint = `/${workspaceId}/members/${filters.memberId}/activities`;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                  }
                  if (resource === 'member') {
                      if (operation === 'upsert') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const member = {};
                          const identity = {};
                          if (additionalFields.bio) {
                              member.bio = additionalFields.bio;
                          }
                          if (additionalFields.birthday) {
                              member.birthday = (0, moment_1.default)(additionalFields.birthday).format('MM-DD-YYYY');
                          }
                          if (additionalFields.company) {
                              member.company = additionalFields.company;
                          }
                          if (additionalFields.location) {
                              member.location = additionalFields.location;
                          }
                          if (additionalFields.name) {
                              member.name = additionalFields.name;
                          }
                          if (additionalFields.bio) {
                              member.bio = additionalFields.bio;
                          }
                          if (additionalFields.pronouns) {
                              member.pronouns = additionalFields.pronouns;
                          }
                          if (additionalFields.shippingAddress) {
                              member.shipping_address = additionalFields.shippingAddress;
                          }
                          if (additionalFields.slug) {
                              member.slug = additionalFields.slug;
                          }
                          if (additionalFields.tagsToAdd) {
                              member.tags_to_add = additionalFields.tagsToAdd;
                          }
                          if (additionalFields.tagList) {
                              member.tag_list = additionalFields.tagList;
                          }
                          if (additionalFields.tshirt) {
                              member.tshirt = additionalFields.tshirt;
                          }
                          if (additionalFields.hasOwnProperty('teammate')) {
                              member.teammate = additionalFields.teammate;
                          }
                          if (additionalFields.url) {
                              member.url = additionalFields.url;
                          }
                          const data = this.getNodeParameter('identityUi', i)
                              .identityValue;
                          if (data) {
                              if (['github', 'twitter', 'discourse'].includes(data.source)) {
                                  identity.source = data.source;
                                  const searchBy = data.searchBy;
                                  if (searchBy === 'id') {
                                      identity.uid = data.id;
                                  }
                                  else {
                                      identity.username = data.username;
                                  }
                                  if (data.source === 'discourse') {
                                      identity.source_host = data.host;
                                  }
                              }
                              else {
                                  identity.email = data.email;
                              }
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'POST', `/${workspaceId}/members`, {
                              member,
                              identity,
                          });
                          responseData = responseData.data;
                      }
                      if (operation === 'delete') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'DELETE', `/${workspaceId}/members/${memberId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const resolve = this.getNodeParameter('resolveIdentities', 0);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'GET', `/${workspaceId}/members/${memberId}`);
                          if (resolve) {
                              (0, GenericFunctions_1.resolveIdentities)(responseData);
                          }
                          responseData = responseData.data;
                      }
                      if (operation === 'getAll') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const options = this.getNodeParameter('options', i);
                          Object.assign(qs, options);
                          qs.resolveIdentities = this.getNodeParameter('resolveIdentities', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', `/${workspaceId}/members`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', `/${workspaceId}/members`, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'lookup') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const source = this.getNodeParameter('source', i);
                          if (['github', 'twitter', 'discourse'].includes(source)) {
                              qs.source = this.getNodeParameter('source', i);
                              const searchBy = this.getNodeParameter('searchBy', i);
                              if (searchBy === 'id') {
                                  qs.uid = this.getNodeParameter('id', i);
                              }
                              else {
                                  qs.username = this.getNodeParameter('username', i);
                              }
                              if (source === 'discourse') {
                                  qs.source_host = this.getNodeParameter('host', i);
                              }
                          }
                          else {
                              qs.email = this.getNodeParameter('email', i);
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'GET', `/${workspaceId}/members/find`, {}, qs);
                          responseData = responseData.data;
                      }
                      if (operation === 'update') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.bio) {
                              body.bio = updateFields.bio;
                          }
                          if (updateFields.birthday) {
                              body.birthday = (0, moment_1.default)(updateFields.birthday).format('MM-DD-YYYY');
                          }
                          if (updateFields.company) {
                              body.company = updateFields.company;
                          }
                          if (updateFields.location) {
                              body.location = updateFields.location;
                          }
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.bio) {
                              body.bio = updateFields.bio;
                          }
                          if (updateFields.pronouns) {
                              body.pronouns = updateFields.pronouns;
                          }
                          if (updateFields.shippingAddress) {
                              body.shipping_address = updateFields.shippingAddress;
                          }
                          if (updateFields.slug) {
                              body.slug = updateFields.slug;
                          }
                          if (updateFields.tagsToAdd) {
                              body.tags_to_add = updateFields.tagsToAdd;
                          }
                          if (updateFields.tagList) {
                              body.tag_list = updateFields.tagList;
                          }
                          if (updateFields.tshirt) {
                              body.tshirt = updateFields.tshirt;
                          }
                          if (updateFields.hasOwnProperty('teammate')) {
                              body.teammate = updateFields.teammate;
                          }
                          if (updateFields.url) {
                              body.url = updateFields.url;
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'PUT', `/${workspaceId}/members/${memberId}`, body);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'note') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const note = this.getNodeParameter('note', i);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'POST', `/${workspaceId}/members/${memberId}/notes`, { body: note });
                          responseData = responseData.data;
                      }
                      if (operation === 'getAll') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs.resolveMember = this.getNodeParameter('resolveMember', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', `/${workspaceId}/members/${memberId}/notes`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', `/${workspaceId}/members/${memberId}/notes`, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'update') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const noteId = this.getNodeParameter('noteId', i);
                          const note = this.getNodeParameter('note', i);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'PUT', `/${workspaceId}/members/${memberId}/notes/${noteId}`, { body: note });
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'post') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const url = this.getNodeParameter('url', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              type: 'post',
                              activity_type: 'post',
                              url,
                          };
                          if (additionalFields.publishedAt) {
                              body.occurred_at = additionalFields.publishedAt;
                              delete body.publishedAt;
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'POST', `/${workspaceId}/members/${memberId}/activities/`, body);
                          responseData = responseData.data;
                      }
                      if (operation === 'getAll') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          let endpoint = `/${workspaceId}/activities`;
                          qs.type = 'content';
                          if (filters.memberId) {
                              endpoint = `/${workspaceId}/members/${filters.memberId}/activities`;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'delete') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const postId = this.getNodeParameter('postId', i);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'DELETE', `/${workspaceId}/members/${memberId}/activities/${postId}`);
                          responseData = { success: true };
                      }
                  }
                  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.Orbit = Orbit;
  //# sourceMappingURL=Orbit.node.js.map

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

  // --- Next Credential File ---

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"member","options":[{"name":"Activity","value":"activity"},{"name":"Member","value":"member"},{"name":"Note","value":"note"},{"name":"Post","value":"post"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ActivityDescription_1.activityOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ActivityDescription_1.activityFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...MemberDescription_1.memberOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...MemberDescription_1.memberFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...NoteDescription_1.noteOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...NoteDescription_1.noteFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PostDescription_1.postOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PostDescription_1.postFields"}]


node_type: n8n-nodes-base.Oura
name: Oura
display_name: Oura
description: Consume Oura API
category: output
icon: file:oura.svg
code_hash: 3c4ad8b55a2145b2a84a4b817a39d16c29d21c18a75651654c38590046103429
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Oura
documentation_title: Oura node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"oura","description":"Templates for oura"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"profile","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:03
updated_at: 2025-06-12 08:59:03
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.Oura = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ProfileDescription_1 = require("./ProfileDescription");
  const SummaryDescription_1 = require("./SummaryDescription");
  const moment_1 = __importDefault(require("moment"));
  class Oura {
      constructor() {
          this.description = {
              displayName: 'Oura',
              name: 'oura',
              icon: 'file:oura.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Oura API',
              defaults: {
                  name: 'Oura',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'ouraApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Profile',
                              value: 'profile',
                          },
                          {
                              name: 'Summary',
                              value: 'summary',
                          },
                      ],
                      default: 'summary',
                  },
                  ...ProfileDescription_1.profileOperations,
                  ...SummaryDescription_1.summaryOperations,
                  ...SummaryDescription_1.summaryFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          let responseData;
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              if (resource === 'profile') {
                  if (operation === 'get') {
                      responseData = await GenericFunctions_1.ouraApiRequest.call(this, 'GET', '/userinfo');
                  }
              }
              else if (resource === 'summary') {
                  const qs = {};
                  const { start, end } = this.getNodeParameter('filters', i);
                  const returnAll = this.getNodeParameter('returnAll', 0);
                  if (start) {
                      qs.start = (0, moment_1.default)(start).format('YYYY-MM-DD');
                  }
                  if (end) {
                      qs.end = (0, moment_1.default)(end).format('YYYY-MM-DD');
                  }
                  if (operation === 'getActivity') {
                      responseData = await GenericFunctions_1.ouraApiRequest.call(this, 'GET', '/activity', {}, qs);
                      responseData = responseData.activity;
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', 0);
                          responseData = responseData.splice(0, limit);
                      }
                  }
                  else if (operation === 'getReadiness') {
                      responseData = await GenericFunctions_1.ouraApiRequest.call(this, 'GET', '/readiness', {}, qs);
                      responseData = responseData.readiness;
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', 0);
                          responseData = responseData.splice(0, limit);
                      }
                  }
                  else if (operation === 'getSleep') {
                      responseData = await GenericFunctions_1.ouraApiRequest.call(this, 'GET', '/sleep', {}, qs);
                      responseData = responseData.sleep;
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', 0);
                          responseData = responseData.splice(0, limit);
                      }
                  }
              }
              Array.isArray(responseData)
                  ? returnData.push(...responseData)
                  : returnData.push(responseData);
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Oura = Oura;
  //# sourceMappingURL=Oura.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.OuraApi = void 0;
  class OuraApi {
      constructor() {
          this.name = 'ouraApi';
          this.displayName = 'Oura API';
          this.documentationUrl = 'oura';
          this.properties = [
              {
                  displayName: 'Personal Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.OuraApi = OuraApi;
  //# sourceMappingURL=OuraApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.OuraApi = void 0;
  class OuraApi {
      constructor() {
          this.name = 'ouraApi';
          this.displayName = 'Oura API';
          this.documentationUrl = 'oura';
          this.properties = [
              {
                  displayName: 'Personal Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.OuraApi = OuraApi;
  //# sourceMappingURL=OuraApi.credentials.js.map

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

  # Oura node

  Use the Oura node to automate work in Oura, and integrate Oura with other applications. n8n has built-in support for a wide range of Oura features, including getting profiles, and summaries. 

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

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

  ## Operations

  * Profile
      * Get the user's personal information.
  * Summary
      * Get the user's activity summary.
      * Get the user's readiness summary.
      * Get the user's sleep summary

  ## Templates and examples

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"summary","options":[{"name":"Profile","value":"profile"},{"name":"Summary","value":"summary"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ProfileDescription_1.profileOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SummaryDescription_1.summaryOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SummaryDescription_1.summaryFields"}]


node_type: n8n-nodes-base.Peekalink
name: Peekalink
display_name: Peekalink
description: Consume the Peekalink API
category: output
icon: file:peekalink.png
code_hash: 68e4409200b2213e37b6cc5bf382084ddb13163d47649a3d75b775e266d27916
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Peekalink
documentation_title: Peekalink node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"peekalink","description":"Templates for peekalink"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"operation":"isAvailable","url":"https://example.com"}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:03
updated_at: 2025-06-12 08:59:03
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Peekalink = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Peekalink {
      constructor() {
          this.description = {
              displayName: 'Peekalink',
              name: 'peekalink',
              icon: 'file:peekalink.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"]',
              description: 'Consume the Peekalink API',
              defaults: {
                  name: 'Peekalink',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'peekalinkApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Is Available',
                              value: 'isAvailable',
                              description: 'Check whether preview for a given link is available',
                              action: 'Check whether the preview for a given link is available',
                          },
                          {
                              name: 'Preview',
                              value: 'preview',
                              description: 'Return the preview for a link',
                              action: 'Return the preview for a link',
                          },
                      ],
                      default: 'preview',
                  },
                  {
                      displayName: 'URL',
                      name: 'url',
                      type: 'string',
                      default: '',
                      required: true,
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (operation === 'isAvailable') {
                      const url = this.getNodeParameter('url', i);
                      const body = {
                          link: url,
                      };
                      responseData = await GenericFunctions_1.peekalinkApiRequest.call(this, 'POST', '/is-available/', body);
                  }
                  if (operation === 'preview') {
                      const url = this.getNodeParameter('url', i);
                      const body = {
                          link: url,
                      };
                      responseData = await GenericFunctions_1.peekalinkApiRequest.call(this, 'POST', '/', body);
                  }
                  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.Peekalink = Peekalink;
  //# sourceMappingURL=Peekalink.node.js.map

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

  // --- Next Credential File ---

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

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

  # Peekalink node

  Use the Peekalink node to automate work in Peekalink, and integrate Peekalink with other applications. n8n supports checking, and reviewing links with Peekalink.

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

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

  ## Operations

  * Check whether preview for a given link is available
  * Return the preview for a link

  ## Templates and examples

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

example_workflow:
  {"name":"Peekalink Example Workflow","nodes":[{"parameters":{"operation":"isAvailable","url":"https://example.com"},"id":"sc7bgjogxl9927ca507ek","name":"Peekalink","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Operation","name":"operation","type":"options","default":"preview","description":"Check whether preview for a given link is available","options":[{"name":"Is Available","value":"isAvailable","description":"Check whether preview for a given link is available"},{"name":"Preview","value":"preview","description":"Return the preview for a link"}]},{"displayName":"URL","name":"url","type":"string","default":"","required":true}]


node_type: n8n-nodes-base.Paddle
name: Paddle
display_name: Paddle
description: Consume Paddle API
category: output
icon: file:paddle.png
code_hash: 1deeb98d7a1bb1beaadc71f7e095853f024a41d1c330db6150a79906ac486135
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Paddle
documentation_title: Paddle node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"paddle","description":"Templates for paddle"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"coupon","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:03
updated_at: 2025-06-12 08:59:03
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.Paddle = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const CouponDescription_1 = require("./CouponDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  const PaymentDescription_1 = require("./PaymentDescription");
  const PlanDescription_1 = require("./PlanDescription");
  const ProductDescription_1 = require("./ProductDescription");
  const UserDescription_1 = require("./UserDescription");
  const moment_1 = __importDefault(require("moment"));
  class Paddle {
      constructor() {
          this.description = {
              displayName: 'Paddle',
              name: 'paddle',
              icon: 'file:paddle.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Paddle API',
              defaults: {
                  name: 'Paddle',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'paddleApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Coupon',
                              value: 'coupon',
                          },
                          {
                              name: 'Payment',
                              value: 'payment',
                          },
                          {
                              name: 'Plan',
                              value: 'plan',
                          },
                          {
                              name: 'Product',
                              value: 'product',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'coupon',
                  },
                  ...CouponDescription_1.couponOperations,
                  ...CouponDescription_1.couponFields,
                  ...PaymentDescription_1.paymentOperations,
                  ...PaymentDescription_1.paymentFields,
                  ...PlanDescription_1.planOperations,
                  ...PlanDescription_1.planFields,
                  ...ProductDescription_1.productOperations,
                  ...ProductDescription_1.productFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getPayments() {
                      const returnData = [];
                      const endpoint = '/2.0/subscription/payments';
                      const paymentResponse = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', {});
                      if (paymentResponse.response === undefined || paymentResponse.response.length === 0) {
                          throw new n8n_workflow_1.NodeApiError(this.getNode(), paymentResponse, {
                              message: 'No payments on account.',
                          });
                      }
                      for (const payment of paymentResponse.response) {
                          const id = payment.id;
                          returnData.push({
                              name: id,
                              value: id,
                          });
                      }
                      return returnData;
                  },
                  async getProducts() {
                      const returnData = [];
                      const endpoint = '/2.0/product/get_products';
                      const products = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', {});
                      if (products.length === 0) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No products on account.');
                      }
                      for (const product of products) {
                          const name = product.name;
                          const id = product.id;
                          returnData.push({
                              name,
                              value: id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const body = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'coupon') {
                      if (operation === 'create') {
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const discountType = this.getNodeParameter('discountType', i);
                              const couponType = this.getNodeParameter('couponType', i);
                              const discountAmount = this.getNodeParameter('discountAmount', i);
                              if (couponType === 'product') {
                                  body.product_ids = this.getNodeParameter('productIds', i);
                              }
                              if (discountType === 'flat') {
                                  body.currency = this.getNodeParameter('currency', i);
                              }
                              body.coupon_type = couponType;
                              body.discount_type = discountType;
                              body.discount_amount = discountAmount;
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.allowedUses) {
                                  body.allowed_uses = additionalFields.allowedUses;
                              }
                              if (additionalFields.couponCode) {
                                  body.coupon_code = additionalFields.couponCode;
                              }
                              if (additionalFields.couponPrefix) {
                                  body.coupon_prefix = additionalFields.couponPrefix;
                              }
                              if (additionalFields.expires) {
                                  body.expires = (0, moment_1.default)(additionalFields.expires).format('YYYY-MM-DD');
                              }
                              if (additionalFields.group) {
                                  body.group = additionalFields.group;
                              }
                              if (additionalFields.recurring) {
                                  body.recurring = 1;
                              }
                              else {
                                  body.recurring = 0;
                              }
                              if (additionalFields.numberOfCoupons) {
                                  body.num_coupons = additionalFields.numberOfCoupons;
                              }
                              if (additionalFields.description) {
                                  body.description = additionalFields.description;
                              }
                              const endpoint = '/2.1/product/create_coupon';
                              responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                              responseData = responseData.response.coupon_codes.map((coupon) => ({
                                  coupon,
                              }));
                          }
                      }
                      if (operation === 'getAll') {
                          const productId = this.getNodeParameter('productId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const endpoint = '/2.0/product/list_coupons';
                          body.product_id = productId;
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          if (returnAll) {
                              responseData = responseData.response;
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.response.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const updateBy = this.getNodeParameter('updateBy', i);
                              if (updateBy === 'group') {
                                  body.group = this.getNodeParameter('group', i);
                              }
                              else {
                                  body.coupon_code = this.getNodeParameter('couponCode', i);
                              }
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.allowedUses) {
                                  body.allowed_uses = additionalFields.allowedUses;
                              }
                              if (additionalFields.currency) {
                                  body.currency = additionalFields.currency;
                              }
                              if (additionalFields.newCouponCode) {
                                  body.new_coupon_code = additionalFields.newCouponCode;
                              }
                              if (additionalFields.expires) {
                                  body.expires = (0, moment_1.default)(additionalFields.expires).format('YYYY-MM-DD');
                              }
                              if (additionalFields.newGroup) {
                                  body.new_group = additionalFields.newGroup;
                              }
                              if (additionalFields.recurring === true) {
                                  body.recurring = 1;
                              }
                              else if (additionalFields.recurring === false) {
                                  body.recurring = 0;
                              }
                              if (additionalFields.productIds) {
                                  body.product_ids = additionalFields.productIds;
                              }
                              if (additionalFields.discountAmount) {
                                  body.discount_amount = additionalFields.discountAmount;
                              }
                              if (additionalFields.discount) {
                                  if (additionalFields.discount.discountProperties.discountType === 'percentage') {
                                      body.discount_amount = additionalFields.discount.discountProperties
                                          .discountAmount;
                                  }
                                  else {
                                      body.currency = additionalFields.discount.discountProperties.currency;
                                      body.discount_amount = additionalFields.discount.discountProperties
                                          .discountAmount;
                                  }
                              }
                          }
                          const endpoint = '/2.1/product/update_coupon';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          responseData = responseData.response;
                      }
                  }
                  if (resource === 'payment') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.subscriptionId) {
                                  body.subscription_id = additionalFields.subscriptionId;
                              }
                              if (additionalFields.plan) {
                                  body.plan = additionalFields.plan;
                              }
                              if (additionalFields.state) {
                                  body.state = additionalFields.state;
                              }
                              if (additionalFields.isPaid) {
                                  body.is_paid = 1;
                              }
                              else {
                                  body.is_paid = 0;
                              }
                              if (additionalFields.from) {
                                  body.from = (0, moment_1.default)(additionalFields.from).format('YYYY-MM-DD');
                              }
                              if (additionalFields.to) {
                                  body.to = (0, moment_1.default)(additionalFields.to).format('YYYY-MM-DD');
                              }
                              if (additionalFields.isOneOffCharge) {
                                  body.is_one_off_charge = additionalFields.isOneOffCharge;
                              }
                          }
                          const endpoint = '/2.0/subscription/payments';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          if (returnAll) {
                              responseData = responseData.response;
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.response.splice(0, limit);
                          }
                      }
                      if (operation === 'reschedule') {
                          const paymentId = this.getNodeParameter('paymentId', i);
                          const date = this.getNodeParameter('date', i);
                          body.payment_id = paymentId;
                          body.date = body.to = (0, moment_1.default)(date).format('YYYY-MM-DD');
                          const endpoint = '/2.0/subscription/payments_reschedule';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                      }
                  }
                  if (resource === 'plan') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const endpoint = '/2.0/subscription/plans';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          if (returnAll) {
                              responseData = responseData.response;
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.response.splice(0, limit);
                          }
                      }
                      if (operation === 'get') {
                          const planId = this.getNodeParameter('planId', i);
                          body.plan = planId;
                          const endpoint = '/2.0/subscription/plans';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          responseData = responseData.response;
                      }
                  }
                  if (resource === 'product') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const endpoint = '/2.0/product/get_products';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          if (returnAll) {
                              responseData = responseData.response.products;
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.response.products.splice(0, limit);
                          }
                      }
                  }
                  if (resource === 'order') {
                      if (operation === 'get') {
                          const endpoint = '/1.0/order';
                          const checkoutId = this.getNodeParameter('checkoutId', i);
                          body.checkout_id = checkoutId;
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'GET', body);
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.state) {
                                  body.state = additionalFields.state;
                              }
                              if (additionalFields.planId) {
                                  body.plan_id = additionalFields.planId;
                              }
                              if (additionalFields.subscriptionId) {
                                  body.subscription_id = additionalFields.subscriptionId;
                              }
                          }
                          const endpoint = '/2.0/subscription/users';
                          if (returnAll) {
                              responseData = await GenericFunctions_1.paddleApiRequestAllItems.call(this, 'response', endpoint, 'POST', body);
                          }
                          else {
                              body.results_per_page = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                              responseData = responseData.response;
                          }
                      }
                  }
              }
              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;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Paddle = Paddle;
  //# sourceMappingURL=Paddle.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PaddleApi = void 0;
  class PaddleApi {
      constructor() {
          this.name = 'paddleApi';
          this.displayName = 'Paddle API';
          this.documentationUrl = 'paddle';
          this.properties = [
              {
                  displayName: 'Vendor Auth Code',
                  name: 'vendorAuthCode',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Vendor ID',
                  name: 'vendorId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Use Sandbox Environment API',
                  name: 'sandbox',
                  type: 'boolean',
                  default: false,
              },
          ];
      }
  }
  exports.PaddleApi = PaddleApi;
  //# sourceMappingURL=PaddleApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PaddleApi = void 0;
  class PaddleApi {
      constructor() {
          this.name = 'paddleApi';
          this.displayName = 'Paddle API';
          this.documentationUrl = 'paddle';
          this.properties = [
              {
                  displayName: 'Vendor Auth Code',
                  name: 'vendorAuthCode',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Vendor ID',
                  name: 'vendorId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Use Sandbox Environment API',
                  name: 'sandbox',
                  type: 'boolean',
                  default: false,
              },
          ];
      }
  }
  exports.PaddleApi = PaddleApi;
  //# sourceMappingURL=PaddleApi.credentials.js.map

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

  # Paddle node

  Use the Paddle node to automate work in Paddle, and integrate Paddle with other applications. n8n has built-in support for a wide range of Paddle features, including creating, updating, and getting coupons, as well as getting plans, products, and users. 

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

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

  ## Operations

  * Coupon
      * Create a coupon.
      * Get all coupons.
      * Update a coupon.
  * Payment
      * Get all payment.
      * Reschedule payment.
  * Plan
      * Get a plan.
      * Get all plans.
  * Product
      * Get all products.
  * User
      * Get all users

  ## Templates and examples

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"coupon","options":[{"name":"Coupon","value":"coupon"},{"name":"Payment","value":"payment"},{"name":"Plan","value":"plan"},{"name":"Product","value":"product"},{"name":"User","value":"user"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CouponDescription_1.couponOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CouponDescription_1.couponFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PaymentDescription_1.paymentOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PaymentDescription_1.paymentFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PlanDescription_1.planOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PlanDescription_1.planFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ProductDescription_1.productOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ProductDescription_1.productFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserDescription_1.userOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserDescription_1.userFields"}]


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: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"agent","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:03
updated_at: 2025-06-12 08:59:03
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":{"resource":"agent","dynamic_property":null},"id":"o6z2gc6e97h9ymxxcb0nev","name":"Phantombuster","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"agent","options":[{"name":"Agent","value":"agent"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AgentDescription_1.agentOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AgentDescription_1.agentFields"}]


node_type: n8n-nodes-base.PagerDuty
name: PagerDuty
display_name: PagerDuty
description: Consume PagerDuty API
category: output
icon: file:pagerDuty.svg
code_hash: 3ee5770722cf0d95e6f298602b21b57dcfb1209250ecf06d50fe9a7465455ef9
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.PagerDuty
documentation_title: PagerDuty node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"pagerduty","description":"Templates for pagerduty"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"authentication":"apiToken","resource":"incident","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:03
updated_at: 2025-06-12 08:59:03
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.PagerDuty = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const IncidentDescription_1 = require("./IncidentDescription");
  const IncidentNoteDescription_1 = require("./IncidentNoteDescription");
  const LogEntryDescription_1 = require("./LogEntryDescription");
  const UserDescription_1 = require("./UserDescription");
  const change_case_1 = require("change-case");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class PagerDuty {
      constructor() {
          this.description = {
              displayName: 'PagerDuty',
              name: 'pagerDuty',
              icon: 'file:pagerDuty.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume PagerDuty API',
              defaults: {
                  name: 'PagerDuty',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pagerDutyApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['apiToken'],
                          },
                      },
                  },
                  {
                      name: 'pagerDutyOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              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: 'Incident',
                              value: 'incident',
                          },
                          {
                              name: 'Incident Note',
                              value: 'incidentNote',
                          },
                          {
                              name: 'Log Entry',
                              value: 'logEntry',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'incident',
                  },
                  ...IncidentDescription_1.incidentOperations,
                  ...IncidentDescription_1.incidentFields,
                  ...IncidentNoteDescription_1.incidentNoteOperations,
                  ...IncidentNoteDescription_1.incidentNoteFields,
                  ...LogEntryDescription_1.logEntryOperations,
                  ...LogEntryDescription_1.logEntryFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getEscalationPolicies() {
                      const returnData = [];
                      const escalationPolicies = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'escalation_policies', 'GET', '/escalation_policies');
                      for (const escalationPolicy of escalationPolicies) {
                          const escalationPolicyName = escalationPolicy.name;
                          const escalationPolicyId = escalationPolicy.id;
                          returnData.push({
                              name: escalationPolicyName,
                              value: escalationPolicyId,
                          });
                      }
                      return returnData;
                  },
                  async getPriorities() {
                      const returnData = [];
                      const priorities = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'priorities', 'GET', '/priorities');
                      for (const priority of priorities) {
                          const priorityName = priority.name;
                          const priorityId = priority.id;
                          const priorityDescription = priority.description;
                          returnData.push({
                              name: priorityName,
                              value: priorityId,
                              description: priorityDescription,
                          });
                      }
                      return returnData;
                  },
                  async getServices() {
                      const returnData = [];
                      const services = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'services', 'GET', '/services');
                      for (const service of services) {
                          const serviceName = service.name;
                          const serviceId = service.id;
                          returnData.push({
                              name: serviceName,
                              value: serviceId,
                          });
                      }
                      return returnData;
                  },
                  async getTimezones() {
                      const returnData = [];
                      for (const timezone of moment_timezone_1.default.tz.names()) {
                          const timezoneName = timezone;
                          const timezoneId = timezone;
                          returnData.push({
                              name: timezoneName,
                              value: timezoneId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'incident') {
                      if (operation === 'create') {
                          const title = this.getNodeParameter('title', i);
                          const serviceId = this.getNodeParameter('serviceId', i);
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const conferenceBridge = this.getNodeParameter('conferenceBridgeUi', i)
                              .conferenceBridgeValues;
                          const body = {
                              type: 'incident',
                              title,
                              service: {
                                  id: serviceId,
                                  type: 'service_reference',
                              },
                          };
                          if (additionalFields.details) {
                              body.body = {
                                  type: 'incident_body',
                                  details: additionalFields.details,
                              };
                          }
                          if (additionalFields.priorityId) {
                              body.priority = {
                                  id: additionalFields.priorityId,
                                  type: 'priority_reference',
                              };
                          }
                          if (additionalFields.escalationPolicyId) {
                              body.escalation_policy = {
                                  id: additionalFields.escalationPolicyId,
                                  type: 'escalation_policy_reference',
                              };
                          }
                          if (additionalFields.urgency) {
                              body.urgency = additionalFields.urgency;
                          }
                          if (additionalFields.incidentKey) {
                              body.incident_key = additionalFields.incidentKey;
                          }
                          if (conferenceBridge) {
                              body.conference_bridge = {
                                  conference_number: conferenceBridge.conferenceNumber,
                                  conference_url: conferenceBridge.conferenceUrl,
                              };
                          }
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'POST', '/incidents', { incident: body }, {}, undefined, { from: email });
                          responseData = responseData.incident;
                      }
                      if (operation === 'get') {
                          const incidentId = this.getNodeParameter('incidentId', i);
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', `/incidents/${incidentId}`);
                          responseData = responseData.incident;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const options = this.getNodeParameter('options', 0);
                          if (options.userIds) {
                              options.userIds = options.userIds.split(',');
                          }
                          if (options.teamIds) {
                              options.teamIds = options.teamIds.split(',');
                          }
                          if (options.include) {
                              options.include = options.include.map((e) => (0, change_case_1.snakeCase)(e));
                          }
                          if (options.sortBy) {
                              options.sortBy = options.sortBy;
                          }
                          Object.assign(qs, (0, GenericFunctions_1.keysToSnakeCase)(options)[0]);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'incidents', 'GET', '/incidents', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', '/incidents', {}, qs);
                              responseData = responseData.incidents;
                          }
                      }
                      if (operation === 'update') {
                          const incidentId = this.getNodeParameter('incidentId', i);
                          const email = this.getNodeParameter('email', i);
                          const conferenceBridge = this.getNodeParameter('conferenceBridgeUi', i)
                              .conferenceBridgeValues;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              type: 'incident',
                          };
                          if (updateFields.title) {
                              body.title = updateFields.title;
                          }
                          if (updateFields.escalationLevel) {
                              body.escalation_level = updateFields.escalationLevel;
                          }
                          if (updateFields.details) {
                              body.body = {
                                  type: 'incident_body',
                                  details: updateFields.details,
                              };
                          }
                          if (updateFields.priorityId) {
                              body.priority = {
                                  id: updateFields.priorityId,
                                  type: 'priority_reference',
                              };
                          }
                          if (updateFields.escalationPolicyId) {
                              body.escalation_policy = {
                                  id: updateFields.escalationPolicyId,
                                  type: 'escalation_policy_reference',
                              };
                          }
                          if (updateFields.urgency) {
                              body.urgency = updateFields.urgency;
                          }
                          if (updateFields.resolution) {
                              body.resolution = updateFields.resolution;
                          }
                          if (updateFields.status) {
                              body.status = updateFields.status;
                          }
                          if (conferenceBridge) {
                              body.conference_bridge = {
                                  conference_number: conferenceBridge.conferenceNumber,
                                  conference_url: conferenceBridge.conferenceUrl,
                              };
                          }
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'PUT', `/incidents/${incidentId}`, { incident: body }, {}, undefined, { from: email });
                          responseData = responseData.incident;
                      }
                  }
                  if (resource === 'incidentNote') {
                      if (operation === 'create') {
                          const incidentId = this.getNodeParameter('incidentId', i);
                          const content = this.getNodeParameter('content', i);
                          const email = this.getNodeParameter('email', i);
                          const body = {
                              content,
                          };
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'POST', `/incidents/${incidentId}/notes`, { note: body }, {}, undefined, { from: email });
                      }
                      if (operation === 'getAll') {
                          const incidentId = this.getNodeParameter('incidentId', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'notes', 'GET', `/incidents/${incidentId}/notes`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', `/incidents/${incidentId}/notes`, {}, qs);
                              responseData = responseData.notes;
                          }
                      }
                  }
                  if (resource === 'logEntry') {
                      if (operation === 'get') {
                          const logEntryId = this.getNodeParameter('logEntryId', i);
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', `/log_entries/${logEntryId}`);
                          responseData = responseData.log_entry;
                      }
                      if (operation === 'getAll') {
                          const options = this.getNodeParameter('options', i);
                          Object.assign(qs, options);
                          (0, GenericFunctions_1.keysToSnakeCase)(qs);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'log_entries', 'GET', '/log_entries', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', '/log_entries', {}, qs);
                              responseData = responseData.log_entries;
                          }
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('userId', i);
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', `/users/${userId}`);
                          responseData = responseData.user;
                      }
                  }
                  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.PagerDuty = PagerDuty;
  //# sourceMappingURL=PagerDuty.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PagerDutyApi = void 0;
  class PagerDutyApi {
      constructor() {
          this.name = 'pagerDutyApi';
          this.displayName = 'PagerDuty API';
          this.documentationUrl = 'pagerDuty';
          this.properties = [
              {
                  displayName: 'API Token',
                  name: 'apiToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.PagerDutyApi = PagerDutyApi;
  //# sourceMappingURL=PagerDutyApi.credentials.js.map

  // --- Next Credential File ---

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

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PagerDutyApi = void 0;
  class PagerDutyApi {
      constructor() {
          this.name = 'pagerDutyApi';
          this.displayName = 'PagerDuty API';
          this.documentationUrl = 'pagerDuty';
          this.properties = [
              {
                  displayName: 'API Token',
                  name: 'apiToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.PagerDutyApi = PagerDutyApi;
  //# sourceMappingURL=PagerDutyApi.credentials.js.map

  // --- Next Credential File ---

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

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

  # PagerDuty node

  Use the PagerDuty node to automate work in PagerDuty, and integrate PagerDuty with other applications. n8n has built-in support for a wide range of PagerDuty features, including creating incident notes, as well as updating, and getting all log entries and users. 

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

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

  ## Operations

  * Incident
      * Create an incident
      * Get an incident
      * Get all incidents
      * Update an incident
  * Incident Note
      * Create an incident note
      * Get all incident's notes
  * Log Entry
      * Get a log entry
      * Get all log entries
  * User
      * Get a user

  ## Templates and examples

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

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

example_workflow:
  {"name":"PagerDuty Example Workflow","nodes":[{"parameters":{"authentication":"apiToken","resource":"incident","dynamic_property":null},"id":"4weelskt945d53ds2m53w5","name":"PagerDuty","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"apiToken","options":[{"name":"API Token","value":"apiToken"},{"name":"OAuth2","value":"oAuth2"}]},{"displayName":"Resource","name":"resource","type":"options","default":"incident","options":[{"name":"Incident","value":"incident"},{"name":"Incident Note","value":"incidentNote"},{"name":"Log Entry","value":"logEntry"},{"name":"User","value":"user"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IncidentDescription_1.incidentOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IncidentDescription_1.incidentFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IncidentNoteDescription_1.incidentNoteOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IncidentNoteDescription_1.incidentNoteFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...LogEntryDescription_1.logEntryOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...LogEntryDescription_1.logEntryFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserDescription_1.userOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserDescription_1.userFields"}]


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: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"light","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:03
updated_at: 2025-06-12 08:59:03
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":{"resource":"light","dynamic_property":null},"id":"nt4l1zn78i8os5yl0k3k","name":"Philips Hue","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"light","options":[{"name":"Light","value":"light"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...LightDescription_1.lightOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...LightDescription_1.lightFields"}]


node_type: n8n-nodes-base.PayPal
name: PayPal
display_name: PayPal
description: Consume PayPal API
category: output
icon: file:paypal.svg
code_hash: 1375d7a13c2cfc4ee9d6c6abd2b20daf2503641d47214ed515cfa09d25b12ceb
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.PayPal
documentation_title: PayPal node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"paypal","description":"Templates for paypal"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"payout","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:03
updated_at: 2025-06-12 08:59:03
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PayPal = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const PaymentDescription_1 = require("./PaymentDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class PayPal {
      constructor() {
          this.description = {
              displayName: 'PayPal',
              name: 'payPal',
              icon: 'file:paypal.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume PayPal API',
              defaults: {
                  name: 'PayPal',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'payPalApi',
                      required: true,
                      testedBy: 'payPalApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Payout',
                              value: 'payout',
                          },
                          {
                              name: 'Payout Item',
                              value: 'payoutItem',
                          },
                      ],
                      default: 'payout',
                  },
                  ...PaymentDescription_1.payoutOperations,
                  ...PaymentDescription_1.payoutItemOperations,
                  ...PaymentDescription_1.payoutFields,
                  ...PaymentDescription_1.payoutItemFields,
              ],
          };
          this.methods = {
              credentialTest: {
                  async payPalApiTest(credential) {
                      const credentials = credential.data;
                      const clientId = credentials.clientId;
                      const clientSecret = credentials.secret;
                      const environment = credentials.env;
                      if (!clientId || !clientSecret || !environment) {
                          return {
                              status: 'Error',
                              message: 'Connection details not valid: missing credentials',
                          };
                      }
                      let baseUrl = '';
                      if (environment !== 'live') {
                          baseUrl = 'https://api-m.sandbox.paypal.com';
                      }
                      else {
                          baseUrl = 'https://api-m.paypal.com';
                      }
                      const base64Key = Buffer.from(`${clientId}:${clientSecret}`).toString('base64');
                      const options = {
                          headers: {
                              Authorization: `Basic ${base64Key}`,
                          },
                          method: 'POST',
                          uri: `${baseUrl}/v1/oauth2/token`,
                          form: {
                              grant_type: 'client_credentials',
                          },
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful!',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: `Connection details not valid: ${error.message}`,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'payout') {
                      if (operation === 'create') {
                          const body = {};
                          const header = {};
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const senderBatchId = this.getNodeParameter('senderBatchId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          header.sender_batch_id = senderBatchId;
                          if (additionalFields.emailSubject) {
                              header.email_subject = additionalFields.emailSubject;
                          }
                          if (additionalFields.emailMessage) {
                              header.email_message = additionalFields.emailMessage;
                          }
                          if (additionalFields.note) {
                              header.note = additionalFields.note;
                          }
                          body.sender_batch_header = header;
                          if (!jsonActive) {
                              const payoutItems = [];
                              const itemsValues = this.getNodeParameter('itemsUi', i)
                                  .itemsValues;
                              if (itemsValues && itemsValues.length > 0) {
                                  itemsValues.forEach((o) => {
                                      const payoutItem = {};
                                      const amount = {};
                                      amount.currency = o.currency;
                                      amount.value = parseFloat(o.amount);
                                      payoutItem.amount = amount;
                                      payoutItem.note = o.note || '';
                                      payoutItem.receiver = o.receiverValue;
                                      payoutItem.recipient_type = o.recipientType;
                                      payoutItem.recipient_wallet = o.recipientWallet;
                                      payoutItem.sender_item_id = o.senderItemId || '';
                                      payoutItems.push(payoutItem);
                                  });
                                  body.items = payoutItems;
                              }
                              else {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'You must have at least one item.', {
                                      itemIndex: i,
                                  });
                              }
                          }
                          else {
                              const itemsJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('itemsJson', i));
                              body.items = itemsJson;
                          }
                          responseData = await GenericFunctions_1.payPalApiRequest.call(this, '/payments/payouts', 'POST', body);
                      }
                      if (operation === 'get') {
                          const payoutBatchId = this.getNodeParameter('payoutBatchId', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.payPalApiRequestAllItems.call(this, 'items', `/payments/payouts/${payoutBatchId}`, 'GET', {}, qs);
                          }
                          else {
                              qs.page_size = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.payPalApiRequest.call(this, `/payments/payouts/${payoutBatchId}`, 'GET', {}, qs);
                              responseData = responseData.items;
                          }
                      }
                  }
                  else if (resource === 'payoutItem') {
                      if (operation === 'get') {
                          const payoutItemId = this.getNodeParameter('payoutItemId', i);
                          responseData = await GenericFunctions_1.payPalApiRequest.call(this, `/payments/payouts-item/${payoutItemId}`, 'GET', {}, qs);
                      }
                      if (operation === 'cancel') {
                          const payoutItemId = this.getNodeParameter('payoutItemId', i);
                          responseData = await GenericFunctions_1.payPalApiRequest.call(this, `/payments/payouts-item/${payoutItemId}/cancel`, 'POST', {}, qs);
                      }
                  }
                  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.PayPal = PayPal;
  //# sourceMappingURL=PayPal.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PayPalApi = void 0;
  class PayPalApi {
      constructor() {
          this.name = 'payPalApi';
          this.displayName = 'PayPal API';
          this.documentationUrl = 'payPal';
          this.properties = [
              {
                  displayName: 'Client ID',
                  name: 'clientId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Secret',
                  name: 'secret',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Environment',
                  name: 'env',
                  type: 'options',
                  default: 'live',
                  options: [
                      {
                          name: 'Sandbox',
                          value: 'sanbox',
                      },
                      {
                          name: 'Live',
                          value: 'live',
                      },
                  ],
              },
          ];
      }
  }
  exports.PayPalApi = PayPalApi;
  //# sourceMappingURL=PayPalApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PayPalApi = void 0;
  class PayPalApi {
      constructor() {
          this.name = 'payPalApi';
          this.displayName = 'PayPal API';
          this.documentationUrl = 'payPal';
          this.properties = [
              {
                  displayName: 'Client ID',
                  name: 'clientId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Secret',
                  name: 'secret',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Environment',
                  name: 'env',
                  type: 'options',
                  default: 'live',
                  options: [
                      {
                          name: 'Sandbox',
                          value: 'sanbox',
                      },
                      {
                          name: 'Live',
                          value: 'live',
                      },
                  ],
              },
          ];
      }
  }
  exports.PayPalApi = PayPalApi;
  //# sourceMappingURL=PayPalApi.credentials.js.map

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

  # PayPal node

  Use the PayPal node to automate work in PayPal, and integrate PayPal with other applications. n8n has built-in support for a wide range of PayPal features, including creating a batch payout and canceling unclaimed payout items. 

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

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

  ## Operations

  * Payout
      * Create a batch payout
      * Show batch payout details
  * Payout Item
      * Cancels an unclaimed payout item
      * Show payout item details

  ## Templates and examples

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"payout","options":[{"name":"Payout","value":"payout"},{"name":"Payout Item","value":"payoutItem"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PaymentDescription_1.payoutOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PaymentDescription_1.payoutItemOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PaymentDescription_1.payoutFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PaymentDescription_1.payoutItemFields"}]


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: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:03
updated_at: 2025-06-12 08:59:03
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":{"authentication":"apiToken","resource":"activity","operation":"getAll","subject":"example-value","done":"0","type":"example-value","additionalFields":{},"activityId":10,"updateFields":{},"title":"example-value","associateWith":"organization","org_id":10,"person_id":10,"dealId":"","productId":"","item_price":10,"quantity":1,"productAttachmentId":"","term":"example-value","exactMatch":false,"returnAll":false,"limit":100,"binaryPropertyName":"Example Name","fileId":10,"organization_id":10,"leadId":"example-value","content":"example-value","noteId":10,"name":"Example Name","organizationId":10,"personId":10,"resolveProperties":false,"encodeProperties":false,"filters":{}},"id":"v2fgjjfyxwjiufm2z79gho","name":"Pipedrive","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"authentication":"apiToken","resource":"activity","operation":"getAll","subject":"example-value","done":"0","type":"example-value","additionalFields":{},"activityId":10,"updateFields":{},"title":"example-value","associateWith":"organization","org_id":10,"person_id":10,"dealId":"","productId":"","item_price":10,"quantity":1,"productAttachmentId":"","term":"example-value","exactMatch":false,"returnAll":false,"limit":100,"binaryPropertyName":"Example Name","fileId":10,"organization_id":10,"leadId":"example-value","content":"example-value","noteId":10,"name":"Example Name","organizationId":10,"personId":10,"resolveProperties":false,"encodeProperties":false,"filters":{}}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"apiToken","options":[{"name":"API Token","value":"apiToken"},{"name":"OAuth2","value":"oAuth2"}]},{"displayName":"Resource","name":"resource","type":"options","default":"deal","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"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create an activity","options":[{"name":"Create","value":"create","description":"Create an activity"},{"name":"Delete","value":"delete","description":"Delete an activity"},{"name":"Get","value":"get","description":"Get data of an activity"},{"name":"Get Many","value":"getAll","description":"Get data of many activities"},{"name":"Update","value":"update","description":"Update an activity"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a deal","options":[{"name":"Create","value":"create","description":"Create a deal"},{"name":"Delete","value":"delete","description":"Delete a deal"},{"name":"Duplicate","value":"duplicate","description":"Duplicate a deal"},{"name":"Get","value":"get","description":"Get data of a deal"},{"name":"Get Many","value":"getAll","description":"Get data of many deals"},{"name":"Search","value":"search","description":"Search a deal"},{"name":"Update","value":"update","description":"Update a deal"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getAll","description":"Get many activities of a deal","options":[{"name":"Get Many","value":"getAll","description":"Get many activities of a deal"}]},{"displayName":"Operation","name":"operation","type":"options","default":"add","description":"Add a product to a deal","options":[{"name":"Add","value":"add","description":"Add a product to a deal"},{"name":"Get Many","value":"getAll","description":"Get many products in a deal"},{"name":"Remove","value":"remove","description":"Remove a product from a deal"},{"name":"Update","value":"update","description":"Update a product in a deal"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a file","options":[{"name":"Create","value":"create","description":"Create a file"},{"name":"Delete","value":"delete","description":"Delete a file"},{"name":"Download","value":"download","description":"Download a file"},{"name":"Get","value":"get","description":"Get data of a file"},{"name":"Update","value":"update","description":"Update file details"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a lead","options":[{"name":"Create","value":"create","description":"Create a lead"},{"name":"Delete","value":"delete","description":"Delete a lead"},{"name":"Get","value":"get","description":"Get data of a lead"},{"name":"Get Many","value":"getAll","description":"Get data of many leads"},{"name":"Update","value":"update","description":"Update a lead"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a note","options":[{"name":"Create","value":"create","description":"Create a note"},{"name":"Delete","value":"delete","description":"Delete a note"},{"name":"Get","value":"get","description":"Get data of a note"},{"name":"Get Many","value":"getAll","description":"Get data of many notes"},{"name":"Update","value":"update","description":"Update a note"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create an organization","options":[{"name":"Create","value":"create","description":"Create an organization"},{"name":"Delete","value":"delete","description":"Delete an organization"},{"name":"Get","value":"get","description":"Get data of an organization"},{"name":"Get Many","value":"getAll","description":"Get data of many organizations"},{"name":"Search","value":"search","description":"Search organizations"},{"name":"Update","value":"update","description":"Update an organization"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a person","options":[{"name":"Create","value":"create","description":"Create a person"},{"name":"Delete","value":"delete","description":"Delete a person"},{"name":"Get","value":"get","description":"Get data of a person"},{"name":"Get Many","value":"getAll","description":"Get data of many persons"},{"name":"Search","value":"search","description":"Search all persons"},{"name":"Update","value":"update","description":"Update a person"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getAll","description":"Get data of many products","options":[{"name":"Get Many","value":"getAll","description":"Get data of many products"}]},{"displayName":"Subject","name":"subject","type":"string","default":"","required":true,"description":"The subject of the activity to create"},{"displayName":"Done","name":"done","type":"options","default":"0","description":"Whether the activity is done or not","options":[{"name":"Not Done","value":"0"},{"name":"Done","value":"1"}]},{"displayName":"Type","name":"type","type":"string","default":"","required":true,"description":"Type of the activity like ","placeholder":"call"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"ID of the deal this activity will be associated with","placeholder":"Add Field"},{"displayName":"Activity ID","name":"activityId","type":"number","default":0,"required":true,"description":"ID of the activity to delete"},{"displayName":"Activity ID","name":"activityId","type":"number","default":0,"required":true,"description":"ID of the activity to get"},{"displayName":"Activity ID","name":"activityId","type":"number","default":0,"required":true,"description":"ID of the activity to update"},{"displayName":"Update Fields","name":"updateFields","type":"collection","default":"{","description":"ID of the deal this activity will be associated with","placeholder":"Add Field"},{"displayName":"Title","name":"title","type":"string","default":"","required":true,"description":"The title of the deal to create"},{"displayName":"Associate With","name":"associateWith","type":"options","default":"organization","required":true,"description":"Type of entity to link to this deal","options":[{"name":"Organization","value":"organization"},{"name":"Person","value":"person"}]},{"displayName":"Organization ID","name":"org_id","type":"number","default":0,"required":true,"description":"ID of the organization this deal will be associated with"},{"displayName":"Person ID","name":"person_id","type":"number","default":0,"description":"ID of the person this deal will be associated with"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Currency of the deal. Accepts a 3-character currency code. Like EUR, USD, ...","placeholder":"Add Field"},{"displayName":"Deal ID","name":"dealId","type":"number","default":0,"required":true,"description":"ID of the deal to delete"},{"displayName":"Deal ID","name":"dealId","type":"number","default":0,"required":true,"description":"ID of the deal to duplicate"},{"displayName":"Deal ID","name":"dealId","type":"number","default":0,"required":true,"description":"ID of the deal to get"},{"displayName":"Deal ID","name":"dealId","type":"number","default":0,"required":true,"description":"ID of the deal to update"},{"displayName":"Update Fields","name":"updateFields","type":"collection","default":"{","description":"Currency of the deal. Accepts a 3-character currency code. Like EUR, USD, ...","placeholder":"Add Field"},{"displayName":"Deal Name or ID","name":"dealId","type":"options","default":"","required":true,"description":"The ID of the deal to add a product to. Choose from the list, or specify an ID using an <a href="},{"displayName":"Product Name or ID","name":"productId","type":"options","default":"","required":true,"description":"The ID of the product to add to a deal. Choose from the list, or specify an ID using an <a href="},{"displayName":"Item Price","name":"item_price","type":"number","default":0,"required":true,"description":"Price at which to add or update this product in a deal"},{"displayName":"Quantity","name":"quantity","type":"number","default":1,"required":true,"description":"How many items of this product to add/update in a deal"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Text to describe this product-deal attachment","placeholder":"Add Field"},{"displayName":"Deal Name or ID","name":"dealId","type":"options","default":"","required":true,"description":"The ID of the deal whose product to update. Choose from the list, or specify an ID using an <a href="},{"displayName":"Product Attachment Name or ID","name":"productAttachmentId","type":"options","default":"","required":true,"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="},{"displayName":"Update Fields","name":"updateFields","type":"collection","default":"{","description":"Text to describe this product-deal attachment","placeholder":"Add Field"},{"displayName":"Deal Name or ID","name":"dealId","type":"options","default":"","required":true,"description":"The ID of the deal whose product to remove. Choose from the list, or specify an ID using an <a href="},{"displayName":"Product Attachment Name or ID","name":"productAttachmentId","type":"options","default":"","required":true,"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="},{"displayName":"Deal Name or ID","name":"dealId","type":"options","default":"","required":true,"description":"The ID of the deal whose products to retrieve. Choose from the list, or specify an ID using an <a href="},{"displayName":"Term","name":"term","type":"string","default":"","required":true,"description":"The search term to look for. Minimum 2 characters (or 1 if using exact_match)."},{"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":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":100,"description":"Max number of results to return"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Supports including optional fields in the results which are not provided by default. Example: deal.cc_email.","placeholder":"Add Field"},{"displayName":"Binary Property","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Name of the binary property which contains the data for the file to be created"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"ID of the activite this file will be associated with","placeholder":"Add Field"},{"displayName":"File ID","name":"fileId","type":"number","default":0,"required":true,"description":"ID of the file to delete"},{"displayName":"File ID","name":"fileId","type":"number","default":0,"required":true,"description":"ID of the file to download"},{"displayName":"Binary Property","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Name of the binary property to which to write the data of the downloaded file"},{"displayName":"File ID","name":"fileId","type":"number","default":0,"required":true,"description":"ID of the file to get"},{"displayName":"File ID","name":"fileId","type":"number","default":0,"required":true,"description":"ID of the file to update"},{"displayName":"Update Fields","name":"updateFields","type":"collection","default":"{","description":"The updated visible name of the file","placeholder":"Add Field"},{"displayName":"Title","name":"title","type":"string","default":"","required":true,"description":"Name of the lead to create"},{"displayName":"Associate With","name":"associateWith","type":"options","default":"organization","required":true,"description":"Type of entity to link to this lead","options":[{"name":"Organization","value":"organization"},{"name":"Person","value":"person"}]},{"displayName":"Organization ID","name":"organization_id","type":"number","default":0,"required":true,"description":"ID of the organization to link to this lead"},{"displayName":"Person ID","name":"person_id","type":"number","default":0,"required":true,"description":"ID of the person to link to this lead"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Date when the lead’s deal is expected to be closed, in ISO-8601 format","placeholder":"Add Field"},{"displayName":"Lead ID","name":"leadId","type":"string","default":"","required":true,"description":"ID of the lead to delete"},{"displayName":"Lead ID","name":"leadId","type":"string","default":"","required":true,"description":"ID of the lead to retrieve"},{"displayName":"Lead ID","name":"leadId","type":"string","default":"","required":true,"description":"ID of the lead to update"},{"displayName":"Update Fields","name":"updateFields","type":"collection","default":"{","description":"Name of the lead to update","placeholder":"Add Field"},{"displayName":"Content","name":"content","type":"string","default":"","required":true,"description":"The content of the note to create"},{"displayName":"Note ID","name":"noteId","type":"number","default":0,"required":true,"description":"ID of the note to delete"},{"displayName":"Note ID","name":"noteId","type":"number","default":0,"required":true,"description":"ID of the note to get"},{"displayName":"Note ID","name":"noteId","type":"number","default":0,"required":true,"description":"ID of the note to update"},{"displayName":"Update Fields","name":"updateFields","type":"collection","default":"{","description":"The content of the note","placeholder":"Add Field"},{"displayName":"Name","name":"name","type":"string","default":"","required":true,"description":"The name of the organization to create"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Adds a custom property to set also values which have not been predefined","placeholder":"Add Field"},{"displayName":"Organization ID","name":"organizationId","type":"number","default":0,"required":true,"description":"ID of the organization to delete"},{"displayName":"Organization ID","name":"organizationId","type":"number","default":0,"required":true,"description":"ID of the organization to get"},{"displayName":"Term","name":"term","type":"string","default":"","required":true,"description":"The search term to look for. Minimum 2 characters (or 1 if using exact_match)."},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Whether only full exact matches against the given term are returned. It is not case sensitive.","placeholder":"Add Field"},{"displayName":"Organization ID","name":"organizationId","type":"number","default":"","required":true,"description":"The ID of the organization to create"},{"displayName":"Update Fields","name":"updateFields","type":"collection","default":"{","description":"Adds a custom property to set also values which have not been predefined","placeholder":"Add Field"},{"displayName":"Name","name":"name","type":"string","default":"","required":true,"description":"The name of the person to create"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Adds a custom property to set also values which have not been predefined","placeholder":"Add Field"},{"displayName":"Person ID","name":"personId","type":"number","default":0,"required":true,"description":"ID of the person to delete"},{"displayName":"Person ID","name":"personId","type":"number","default":0,"required":true,"description":"ID of the person to get"},{"displayName":"Person ID","name":"personId","type":"number","default":0,"required":true,"description":"ID of the person to update"},{"displayName":"Update Fields","name":"updateFields","type":"collection","default":"{","description":"The fields to update","placeholder":"Add Field"},{"displayName":"Resolve Properties","name":"resolveProperties","type":"boolean","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","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","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":100,"description":"Max number of results to return"},{"displayName":"Deal Name or ID","name":"dealId","type":"options","default":"","required":true,"description":"The ID of the deal whose activity to retrieve. Choose from the list, or specify an ID using an <a href="},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Whether the activity is done or not","placeholder":"Add Field"},{"displayName":"Filters","name":"filters","type":"collection","default":"{","placeholder":"Add Filter"},{"displayName":"Filters","name":"filters","type":"collection","default":"{","description":"If supplied, only organizations whose name starts with the specified letter will be returned","placeholder":"Add Field"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"ID of the filter to use. Choose from the list, or specify an ID using an <a href=","placeholder":"Add Field"},{"displayName":"Term","name":"term","type":"string","default":"","required":true,"description":"The search term to look for. Minimum 2 characters (or 1 if using exact_match)."},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Whether only full exact matches against the given term are returned. It is not case sensitive.","placeholder":"Add Field"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"ID of the deal this note will be associated with","placeholder":"Add Field"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Whether the Activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities.","placeholder":"Add Field"},{"displayName":"Filters","name":"filters","type":"collection","default":"{","description":"Predefined filter to apply to the deals to retrieve. Choose from the list, or specify an ID using an <a href=","placeholder":"Add Filter"}]


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-12 08:59:04
updated_at: 2025-06-12 08:59:04
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":"0j2wrdt96fcsdmycf50iav6","name":"Postgres","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: []
parameter_schemas: []
example_parameters: {"resource":"bin","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:04
updated_at: 2025-06-12 08:59:04
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.

workflow_examples:
  [{"name":"tutorial","workflow":{"name":"Tutorial-workflow","nodes":[{"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[1],"triggerAtHour":9}]}},"type":"n8n-nodes-base.scheduleTrigger","typeVersion":1.2,"position":[-680,100],"id":"ef14445c-2f5f-4c78-96c8-66732feb7a8f","name":"Schedule Trigger"},{"parameters":{"resource":"donkiSolarFlare","additionalFields":{"startDate":"={{ $today.minus(7, 'days') }}"}},"type":"n8n-nodes-base.nasa","typeVersion":1,"position":[-460,100],"id":"52c58b93-c780-4aff-a216-d67b28195a45","name":"NASA","credentials":{"nasaApi":{"id":"sSVnxV9AcBmBOYn8","name":"NASA account"}}},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"2f469c8e-12b3-4ee5-95fc-ff81508d0b43","leftValue":"={{ $json.classType }}","rightValue":"C","operator":{"type":"string","operation":"contains"}}],"combinator":"and"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[-240,100],"id":"b54e3289-9ebb-451f-8bac-87edeeeced13","name":"If"},{"parameters":{"resource":"request","operation":"send","binId":"1741914338605-0907339996192","binContent":"=There was a solar flare of class {{$json[\"classType\"]}}","requestOptions":{}},"type":"n8n-nodes-base.postBin","typeVersion":1,"position":[-20,0],"id":"a8b602b6-17b1-4274-8d33-73344b6bb8fb","name":"PostBin(true)"},{"parameters":{"resource":"request","operation":"send","binId":"1741914338605-0907339996192","binContent":"=There was a solar flare of class {{$json[\"classType\"]}}","requestOptions":{}},"type":"n8n-nodes-base.postBin","typeVersion":1,"position":[-20,200],"id":"09c2c7a4-c229-430d-a5b0-8d7491515d9f","name":"PostBin(false)"},{"parameters":{"content":"## Setup required\n\nYou need to create a NASA account and create credentials, and create a bin with Postbin and enter the ID - see [the documentation](https://docs.n8n.io/try-it-out/longer-introduction/)","height":120,"width":600},"type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-720,-60],"id":"08e0b8f9-c90e-4c9c-a663-01aca805b9be","name":"Sticky Note"}],"pinData":{},"connections":{"Schedule Trigger":{"main":[[{"node":"NASA","type":"main","index":0}]]},"NASA":{"main":[[{"node":"If","type":"main","index":0}]]},"If":{"main":[[{"node":"PostBin(true)","type":"main","index":0}],[{"node":"PostBin(false)","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"37de4877-e4f6-4b9a-b6f0-9b7e7aea0163","meta":{"templateCredsSetupCompleted":true,"instanceId":"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"},"id":"DPzMzTIyDrYohiw4","tags":[{"createdAt":"2021-06-25T07:47:07.640Z","updatedAt":"2021-06-25T07:47:07.640Z","id":"1","name":"docs"}]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.postBin","version":1,"parameters":{"resource":"request","operation":"send","binId":"1741914338605-0907339996192","binContent":"=There was a solar flare of class {{$json[\"classType\"]}}","requestOptions":{}},"position":[-20,0]},{"nodeType":"n8n-nodes-base.postBin","version":1,"parameters":{"resource":"request","operation":"send","binId":"1741914338605-0907339996192","binContent":"=There was a solar flare of class {{$json[\"classType\"]}}","requestOptions":{}},"position":[-20,200]}],"connections":{"Schedule Trigger":{"main":[[{"node":"NASA","type":"main","index":0}]]},"NASA":{"main":[[{"node":"If","type":"main","index":0}]]},"If":{"main":[[{"node":"PostBin(true)","type":"main","index":0}],[{"node":"PostBin(false)","type":"main","index":0}]]}},"source":"docs/_workflows/try-it-out/quickstart/tutorial.json","description":"Workflow example from docs/_workflows/try-it-out/quickstart/tutorial.json"}]

troubleshooting_info:
  [{"issue":"Send requests","solution":"To send requests to a PostBin bin:"},{"issue":"Create and manage bins","solution":"You can create and manage PostBin bins using the PostBin node. "}]

node_connections:
  [{"fromNode":"Schedule Trigger","toNode":"NASA","connectionType":"main"},{"fromNode":"NASA","toNode":"If","connectionType":"main"},{"fromNode":"If","toNode":"PostBin(true)","connectionType":"main"},{"fromNode":"If","toNode":"PostBin(false)","connectionType":"main"}]

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"bin","required":true,"options":[{"name":"Bin","value":"bin"},{"name":"Request","value":"request"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...BinDescription_1.binOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...BinDescription_1.binFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...RequestDescription_1.requestOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...RequestDescription_1.requestFields"}]


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: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"company","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:04
updated_at: 2025-06-12 08:59:04
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":{"resource":"company","dynamic_property":null},"id":"2kwhzehpqy3cbty41geepa","name":"ProfitWell","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"metric","options":[{"name":"Company","value":"company"},{"name":"Metric","value":"metric"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CompanyDescription_1.companyOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...MetricDescription_1.metricOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...MetricDescription_1.metricFields"}]


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: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"alias","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:04
updated_at: 2025-06-12 08:59:04
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":{"resource":"alias","dynamic_property":null},"id":"ezvi6reicgepug5o7g6e","name":"PostHog","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"event","options":[{"name":"Alias","value":"alias"},{"name":"Event","value":"event"},{"name":"Identity","value":"identity"},{"name":"Track","value":"track"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AliasDescription_1.aliasOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AliasDescription_1.aliasFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EventDescription_1.eventOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EventDescription_1.eventFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IdentityDescription_1.identityOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IdentityDescription_1.identityFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...TrackDescription_1.trackOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...TrackDescription_1.trackFields"}]


