# nodes

node_type: n8n-nodes-base.Hunter
name: Hunter
display_name: Hunter
description: Consume Hunter API
category: output
icon: file:hunter.png
code_hash: 51c8bda9ec8694acf0c9362ae3c4ede9dc8e3fcf9b20e8b4d42731ce83b2c983
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Hunter
documentation_title: Hunter node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"hunter","description":"Templates for hunter"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:46
updated_at: 2025-06-12 08:58:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Hunter = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Hunter {
      constructor() {
          this.description = {
              displayName: 'Hunter',
              name: 'hunter',
              icon: 'file:hunter.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"]}}',
              description: 'Consume Hunter API',
              defaults: {
                  name: 'Hunter',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'hunterApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Domain Search',
                              value: 'domainSearch',
                              description: 'Get every email address found on the internet using a given domain name, with sources',
                              action: 'Get every email address found on the internet using a given domain name, with sources',
                          },
                          {
                              name: 'Email Finder',
                              value: 'emailFinder',
                              description: 'Generate or retrieve the most likely email address from a domain name, a first name and a last name',
                              action: 'Generate or retrieve the most likely email address from a domain name, a first name and a last name',
                          },
                          {
                              name: 'Email Verifier',
                              value: 'emailVerifier',
                              description: 'Verify the deliverability of an email address',
                              action: 'Verify the deliverability of an email address',
                          },
                      ],
                      default: 'domainSearch',
                      description: 'Operation to consume',
                  },
                  {
                      displayName: 'Domain',
                      name: 'domain',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['domainSearch'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Domain name from which you want to find the email addresses. For example, "stripe.com".',
                  },
                  {
                      displayName: 'Only Emails',
                      name: 'onlyEmails',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['domainSearch'],
                          },
                      },
                      default: true,
                      description: 'Whether to return only the the found emails',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['domainSearch'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['domainSearch'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['domainSearch'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Type',
                              name: 'type',
                              type: 'options',
                              default: '',
                              options: [
                                  {
                                      name: 'Personal',
                                      value: 'personal',
                                  },
                                  {
                                      name: 'Generic',
                                      value: 'generic',
                                  },
                              ],
                          },
                          {
                              displayName: 'Seniority',
                              name: 'seniority',
                              type: 'multiOptions',
                              default: [],
                              options: [
                                  {
                                      name: 'Junior',
                                      value: 'junior',
                                  },
                                  {
                                      name: 'Senior',
                                      value: 'senior',
                                  },
                                  {
                                      name: 'Executive',
                                      value: 'executive',
                                  },
                              ],
                          },
                          {
                              displayName: 'Department',
                              name: 'department',
                              type: 'multiOptions',
                              default: [],
                              options: [
                                  {
                                      name: 'Communication',
                                      value: 'communication',
                                  },
                                  {
                                      name: 'Executive',
                                      value: 'executive',
                                  },
                                  {
                                      name: 'Finance',
                                      value: 'finance',
                                  },
                                  {
                                      name: 'HR',
                                      value: 'hr',
                                  },
                                  {
                                      name: 'IT',
                                      value: 'it',
                                  },
                                  {
                                      name: 'Legal',
                                      value: 'legal',
                                  },
                                  {
                                      name: 'Management',
                                      value: 'management',
                                  },
                                  {
                                      name: 'Marketing',
                                      value: 'marketing',
                                  },
                                  {
                                      name: 'Sales',
                                      value: 'sales',
                                  },
                                  {
                                      name: 'Support',
                                      value: 'support',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Domain',
                      name: 'domain',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['emailFinder'],
                          },
                      },
                      required: true,
                      description: 'Domain name from which you want to find the email addresses. For example, "stripe.com".',
                  },
                  {
                      displayName: 'First Name',
                      name: 'firstname',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['emailFinder'],
                          },
                      },
                      default: '',
                      required: true,
                      description: "The person's first name. It doesn't need to be in lowercase.",
                  },
                  {
                      displayName: 'Last Name',
                      name: 'lastname',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['emailFinder'],
                          },
                      },
                      default: '',
                      required: true,
                      description: "The person's last name. It doesn't need to be in lowercase.",
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              operation: ['emailVerifier'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'The email address you want to verify',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  const operation = this.getNodeParameter('operation', 0);
                  if (operation === 'domainSearch') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const filters = this.getNodeParameter('filters', i);
                      const domain = this.getNodeParameter('domain', i);
                      const onlyEmails = this.getNodeParameter('onlyEmails', i, false);
                      qs.domain = domain;
                      if (filters.type) {
                          qs.type = filters.type;
                      }
                      if (filters.seniority) {
                          qs.seniority = filters.seniority.join(',');
                      }
                      if (filters.department) {
                          qs.department = filters.department.join(',');
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.hunterApiRequestAllItems.call(this, 'data', 'GET', '/domain-search', {}, qs);
                          if (!onlyEmails) {
                              let tempReturnData = {};
                              for (let index = 0; index < responseData.length; index++) {
                                  if (index === 0) {
                                      tempReturnData = responseData[index];
                                      continue;
                                  }
                                  tempReturnData.emails.push.apply(tempReturnData.emails, responseData[index].emails);
                              }
                              responseData = tempReturnData;
                          }
                      }
                      else {
                          const limit = this.getNodeParameter('limit', i);
                          qs.limit = limit;
                          responseData = await GenericFunctions_1.hunterApiRequest.call(this, 'GET', '/domain-search', {}, qs);
                          responseData = responseData.data;
                      }
                      if (onlyEmails) {
                          let tempReturnData = [];
                          if (Array.isArray(responseData)) {
                              for (const data of responseData) {
                                  tempReturnData.push.apply(tempReturnData, data.emails);
                              }
                          }
                          else {
                              tempReturnData = responseData.emails;
                          }
                          responseData = tempReturnData;
                      }
                  }
                  if (operation === 'emailFinder') {
                      const domain = this.getNodeParameter('domain', i);
                      const firstname = this.getNodeParameter('firstname', i);
                      const lastname = this.getNodeParameter('lastname', i);
                      qs.first_name = firstname;
                      qs.last_name = lastname;
                      qs.domain = domain;
                      responseData = await GenericFunctions_1.hunterApiRequest.call(this, 'GET', '/email-finder', {}, qs);
                      responseData = responseData.data;
                  }
                  if (operation === 'emailVerifier') {
                      const email = this.getNodeParameter('email', i);
                      qs.email = email;
                      responseData = await GenericFunctions_1.hunterApiRequest.call(this, 'GET', '/email-verifier', {}, qs);
                      responseData = responseData.data;
                  }
                  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.Hunter = Hunter;
  //# sourceMappingURL=Hunter.node.js.map

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

  // --- Next Credential File ---

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

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

  # Hunter node

  Use the Hunter node to automate work in Hunter, and integrate Hunter with other applications. n8n has built-in support for a wide range of Hunter features, including getting, generating, and verifying email addresses. 

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

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

  ## Operations

  * Get every email address found on the internet using a given domain name, with sources
  * Generate or retrieve the most likely email address from a domain name, a first name and a last name
  * Verify the deliverability of an email address

  ## Templates and examples

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

example_workflow:
  {"name":"Hunter Example Workflow","nodes":[{"parameters":{"operation":"domainSearch","domain":"example-value","onlyEmails":true,"returnAll":false,"limit":100,"filters":{},"firstname":"Example Name","lastname":"Example Name","email":"user@example.com"},"id":"061w9whuv4z8px63y0uk8z","name":"Hunter","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"operation":"domainSearch","domain":"example-value","onlyEmails":true,"returnAll":false,"limit":100,"filters":{},"firstname":"Example Name","lastname":"Example Name","email":"user@example.com"}

properties_schema:
  [{"displayName":"Operation","name":"operation","type":"options","default":"domainSearch","description":"Get every email address found on the internet using a given domain name, with sources","options":[{"name":"Domain Search","value":"domainSearch","description":"Get every email address found on the internet using a given domain name, with sources"},{"name":"Email Finder","value":"emailFinder","description":"Generate or retrieve the most likely email address from a domain name, a first name and a last name"},{"name":"Email Verifier","value":"emailVerifier","description":"Verify the deliverability of an email address"}]},{"displayName":"Domain","name":"domain","type":"string","default":"","required":true,"description":"Domain name from which you want to find the email addresses. For example, "},{"displayName":"Only Emails","name":"onlyEmails","type":"boolean","default":true,"description":"Whether to return only the the found emails"},{"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":"Filters","name":"filters","type":"collection","default":"{","placeholder":"Add Filter"},{"displayName":"Domain","name":"domain","type":"string","default":"","required":true,"description":"Domain name from which you want to find the email addresses. For example, "},{"displayName":"First Name","name":"firstname","type":"string","default":"","required":true,"description":"The person"},{"displayName":"Last Name","name":"lastname","type":"string","default":"","required":true,"description":"The person"},{"displayName":"Email","name":"email","type":"string","default":"","required":true,"description":"The email address you want to verify","placeholder":"name@email.com"}]


node_type: n8n-nodes-base.Interval
name: Interval
display_name: Interval
description: Triggers the workflow in a given interval
category: Other
icon: fa:hourglass
code_hash: 395078df09873d83a3b69b11f17d73622c51e2d85584a0ce995738a764a1fe3c
example_parameters: {"notice":null,"interval":1,"unit":"seconds"}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:46
updated_at: 2025-06-12 08:58:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Interval = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class Interval {
      constructor() {
          this.description = {
              displayName: 'Interval',
              name: 'interval',
              icon: 'fa:hourglass',
              group: ['trigger', 'schedule'],
              version: 1,
              hidden: true,
              description: 'Triggers the workflow in a given interval',
              eventTriggerDescription: '',
              activationMessage: 'Your interval trigger will now trigger executions on the schedule you have defined.',
              defaults: {
                  name: 'Interval',
                  color: '#00FF00',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'This workflow will run on the schedule you define here once you <a data-key="activate">activate</a> it.<br><br>For testing, you can also trigger it manually: by going back to the canvas and clicking ‘execute workflow’',
                      name: 'notice',
                      type: 'notice',
                      default: '',
                  },
                  {
                      displayName: 'Interval',
                      name: 'interval',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      default: 1,
                      description: 'Interval value',
                  },
                  {
                      displayName: 'Unit',
                      name: 'unit',
                      type: 'options',
                      options: [
                          {
                              name: 'Seconds',
                              value: 'seconds',
                          },
                          {
                              name: 'Minutes',
                              value: 'minutes',
                          },
                          {
                              name: 'Hours',
                              value: 'hours',
                          },
                      ],
                      default: 'seconds',
                      description: 'Unit of the interval value',
                  },
              ],
          };
      }
      async trigger() {
          const interval = this.getNodeParameter('interval');
          const unit = this.getNodeParameter('unit');
          if (interval <= 0) {
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The interval has to be set to at least 1 or higher!');
          }
          let intervalValue = interval;
          if (unit === 'minutes') {
              intervalValue *= 60;
          }
          if (unit === 'hours') {
              intervalValue *= 60 * 60;
          }
          const executeTrigger = () => {
              this.emit([this.helpers.returnJsonArray([{}])]);
          };
          intervalValue *= 1000;
          if (intervalValue > 2147483647) {
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The interval value is too large.');
          }
          const intervalObj = setInterval(executeTrigger, intervalValue);
          async function closeFunction() {
              clearInterval(intervalObj);
          }
          async function manualTriggerFunction() {
              executeTrigger();
          }
          return {
              closeFunction,
              manualTriggerFunction,
          };
      }
  }
  exports.Interval = Interval;
  //# sourceMappingURL=Interval.node.js.map

example_workflow:
  {"name":"Interval Example Workflow","nodes":[{"parameters":{"notice":null,"interval":1,"unit":"seconds"},"id":"tbm5i7cei5sk62ahllt4o","name":"Interval","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"This workflow will run on the schedule you define here once you <a data-key=","name":"notice","type":"notice","default":""},{"displayName":"Interval","name":"interval","type":"number","default":1,"description":"Interval value"},{"displayName":"Unit","name":"unit","type":"options","default":"seconds","description":"Unit of the interval value","options":[{"name":"Seconds","value":"seconds"},{"name":"Minutes","value":"minutes"},{"name":"Hours","value":"hours"}]}]


node_type: n8n-nodes-base.Intercom
name: Intercom
display_name: Intercom
description: Consume Intercom API
category: output
icon: file:intercom.png
code_hash: be4c08e687ac6d523ea522d1b9f22155077485762de518664618a8a40f427844
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Intercom
documentation_title: Intercom node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"intercom","description":"Templates for intercom"}]
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:58:46
updated_at: 2025-06-12 08:58:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Intercom = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const LeadDescription_1 = require("./LeadDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  const UserDescription_1 = require("./UserDescription");
  const CompanyDescription_1 = require("./CompanyDescription");
  class Intercom {
      constructor() {
          this.description = {
              displayName: 'Intercom',
              name: 'intercom',
              icon: 'file:intercom.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Intercom API',
              defaults: {
                  name: 'Intercom',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'intercomApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Company',
                              value: 'company',
                              description: 'Companies allow you to represent commercial organizations using your product',
                          },
                          {
                              name: 'Lead',
                              value: 'lead',
                              description: 'Leads are useful for representing logged-out users of your application',
                          },
                          {
                              name: 'User',
                              value: 'user',
                              description: 'The Users resource is the primary way of interacting with Intercom',
                          },
                      ],
                      default: 'user',
                  },
                  ...LeadDescription_1.leadOperations,
                  ...UserDescription_1.userOperations,
                  ...CompanyDescription_1.companyOperations,
                  ...UserDescription_1.userFields,
                  ...LeadDescription_1.leadFields,
                  ...CompanyDescription_1.companyFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCompanies() {
                      const returnData = [];
                      let response;
                      try {
                          response = await GenericFunctions_1.intercomApiRequest.call(this, '/companies', 'GET');
                      }
                      catch (error) {
                          throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                      }
                      const companies = response.companies;
                      for (const company of companies) {
                          const companyName = company.name;
                          const companyId = company.company_id;
                          returnData.push({
                              name: companyName,
                              value: companyId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let qs;
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  qs = {};
                  const resource = this.getNodeParameter('resource', 0);
                  const operation = this.getNodeParameter('operation', 0);
                  if (resource === 'lead') {
                      if (operation === 'create' || operation === 'update') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const body = {};
                          if (operation === 'create') {
                              body.email = this.getNodeParameter('email', i);
                          }
                          if (additionalFields.email) {
                              body.email = additionalFields.email;
                          }
                          if (additionalFields.phone) {
                              body.phone = additionalFields.phone;
                          }
                          if (additionalFields.name) {
                              body.name = additionalFields.name;
                          }
                          if (additionalFields.unsubscribedFromEmails) {
                              body.unsubscribed_from_emails = additionalFields.unsubscribedFromEmails;
                          }
                          if (additionalFields.updateLastRequestAt) {
                              body.update_last_request_at = additionalFields.updateLastRequestAt;
                          }
                          if (additionalFields.utmSource) {
                              body.utm_source = additionalFields.utmSource;
                          }
                          if (additionalFields.utmMedium) {
                              body.utm_medium = additionalFields.utmMedium;
                          }
                          if (additionalFields.utmCampaign) {
                              body.utm_campaign = additionalFields.utmCampaign;
                          }
                          if (additionalFields.utmTerm) {
                              body.utm_term = additionalFields.utmTerm;
                          }
                          if (additionalFields.utmContent) {
                              body.utm_content = additionalFields.utmContent;
                          }
                          if (additionalFields.avatar) {
                              const avatar = {
                                  type: 'avatar',
                                  image_url: additionalFields.avatar,
                              };
                              body.avatar = avatar;
                          }
                          if (additionalFields.companies) {
                              const companies = [];
                              additionalFields.companies.forEach((o) => {
                                  const company = {};
                                  company.company_id = o;
                                  companies.push(company);
                              });
                              body.companies = companies;
                          }
                          if (!jsonActive) {
                              const customAttributesValues = this.getNodeParameter('customAttributesUi', i).customAttributesValues;
                              if (customAttributesValues) {
                                  const customAttributes = {};
                                  for (let index = 0; index < customAttributesValues.length; index++) {
                                      customAttributes[customAttributesValues[index].name] =
                                          customAttributesValues[index].value;
                                  }
                                  body.custom_attributes = customAttributes;
                              }
                          }
                          else {
                              const customAttributesJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('customAttributesJson', i));
                              if (customAttributesJson) {
                                  body.custom_attributes = customAttributesJson;
                              }
                          }
                          if (operation === 'update') {
                              const updateBy = this.getNodeParameter('updateBy', 0);
                              const value = this.getNodeParameter('value', i);
                              if (updateBy === 'userId') {
                                  body.user_id = value;
                              }
                              if (updateBy === 'id') {
                                  body.id = value;
                              }
                          }
                          try {
                              responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/contacts', 'POST', body);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                      if (operation === 'get') {
                          const selectBy = this.getNodeParameter('selectBy', 0);
                          const value = this.getNodeParameter('value', i);
                          if (selectBy === 'email') {
                              qs.email = value;
                          }
                          if (selectBy === 'userId') {
                              qs.user_id = value;
                          }
                          if (selectBy === 'phone') {
                              qs.phone = value;
                          }
                          try {
                              if (selectBy === 'id') {
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, `/contacts/${value}`, 'GET');
                              }
                              else {
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/contacts', 'GET', {}, qs);
                                  responseData = responseData.contacts;
                              }
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          try {
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.intercomApiRequestAllItems.call(this, 'contacts', '/contacts', 'GET', {}, qs);
                              }
                              else {
                                  qs.per_page = this.getNodeParameter('limit', i);
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/contacts', 'GET', {}, qs);
                                  responseData = responseData.contacts;
                              }
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                      if (operation === 'delete') {
                          const deleteBy = this.getNodeParameter('deleteBy', 0);
                          const value = this.getNodeParameter('value', i);
                          try {
                              if (deleteBy === 'id') {
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, `/contacts/${value}`, 'DELETE');
                              }
                              else {
                                  qs.user_id = value;
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/contacts', 'DELETE', {}, qs);
                              }
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'create' || operation === 'update') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const body = {};
                          if (operation === 'create') {
                              const identifierType = this.getNodeParameter('identifierType', i);
                              if (identifierType === 'email') {
                                  body.email = this.getNodeParameter('idValue', i);
                              }
                              else if (identifierType === 'userId') {
                                  body.user_id = this.getNodeParameter('idValue', i);
                              }
                          }
                          if (additionalFields.email) {
                              body.email = additionalFields.email;
                          }
                          if (additionalFields.userId) {
                              body.user_id = additionalFields.userId;
                          }
                          if (additionalFields.phone) {
                              body.phone = additionalFields.phone;
                          }
                          if (additionalFields.name) {
                              body.name = additionalFields.name;
                          }
                          if (additionalFields.unsubscribedFromEmails) {
                              body.unsubscribed_from_emails = additionalFields.unsubscribedFromEmails;
                          }
                          if (additionalFields.updateLastRequestAt) {
                              body.update_last_request_at = additionalFields.updateLastRequestAt;
                          }
                          if (additionalFields.sessionCount) {
                              body.session_count = additionalFields.sessionCount;
                          }
                          if (additionalFields.avatar) {
                              const avatar = {
                                  type: 'avatar',
                                  image_url: additionalFields.avatar,
                              };
                              body.avatar = avatar;
                          }
                          if (additionalFields.utmSource) {
                              body.utm_source = additionalFields.utmSource;
                          }
                          if (additionalFields.utmMedium) {
                              body.utm_medium = additionalFields.utmMedium;
                          }
                          if (additionalFields.utmCampaign) {
                              body.utm_campaign = additionalFields.utmCampaign;
                          }
                          if (additionalFields.utmTerm) {
                              body.utm_term = additionalFields.utmTerm;
                          }
                          if (additionalFields.utmContent) {
                              body.utm_content = additionalFields.utmContent;
                          }
                          if (additionalFields.companies) {
                              const companies = [];
                              additionalFields.companies.forEach((o) => {
                                  const company = {};
                                  company.company_id = o;
                                  companies.push(company);
                              });
                              body.companies = companies;
                          }
                          if (additionalFields.sessionCount) {
                              body.session_count = additionalFields.sessionCount;
                          }
                          if (!jsonActive) {
                              const customAttributesValues = this.getNodeParameter('customAttributesUi', i).customAttributesValues;
                              if (customAttributesValues) {
                                  const customAttributes = {};
                                  for (let index = 0; index < customAttributesValues.length; index++) {
                                      customAttributes[customAttributesValues[index].name] =
                                          customAttributesValues[index].value;
                                  }
                                  body.custom_attributes = customAttributes;
                              }
                          }
                          else {
                              const customAttributesJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('customAttributesJson', i));
                              if (customAttributesJson) {
                                  body.custom_attributes = customAttributesJson;
                              }
                          }
                          if (operation === 'update') {
                              const updateBy = this.getNodeParameter('updateBy', 0);
                              const value = this.getNodeParameter('value', i);
                              if (updateBy === 'userId') {
                                  body.user_id = value;
                              }
                              if (updateBy === 'id') {
                                  body.id = value;
                              }
                              if (updateBy === 'email') {
                                  body.email = value;
                              }
                          }
                          try {
                              responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/users', 'POST', body, qs);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                      if (operation === 'get') {
                          const selectBy = this.getNodeParameter('selectBy', 0);
                          const value = this.getNodeParameter('value', i);
                          if (selectBy === 'userId') {
                              qs.user_id = value;
                          }
                          try {
                              if (selectBy === 'id') {
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, `/users/${value}`, 'GET', {}, qs);
                              }
                              else {
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/users', 'GET', {}, qs);
                              }
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          try {
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.intercomApiRequestAllItems.call(this, 'users', '/users', 'GET', {}, qs);
                              }
                              else {
                                  qs.per_page = this.getNodeParameter('limit', i);
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/users', 'GET', {}, qs);
                                  responseData = responseData.users;
                              }
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                      if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          try {
                              responseData = await GenericFunctions_1.intercomApiRequest.call(this, `/users/${id}`, 'DELETE');
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Intercom Error: ${JSON.stringify(error)}`, { itemIndex: i });
                          }
                      }
                  }
                  if (resource === 'company') {
                      if (operation === 'create' || operation === 'update') {
                          const id = this.getNodeParameter('companyId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const body = {
                              company_id: id,
                          };
                          if (additionalFields.monthlySpend) {
                              body.monthly_spend = additionalFields.monthlySpend;
                          }
                          if (additionalFields.name) {
                              body.name = additionalFields.name;
                          }
                          if (additionalFields.plan) {
                              body.plan = additionalFields.plan;
                          }
                          if (additionalFields.size) {
                              body.size = additionalFields.size;
                          }
                          if (additionalFields.website) {
                              body.website = additionalFields.website;
                          }
                          if (additionalFields.industry) {
                              body.industry = additionalFields.industry;
                          }
                          if (!jsonActive) {
                              const customAttributesValues = this.getNodeParameter('customAttributesUi', i).customAttributesValues;
                              if (customAttributesValues) {
                                  const customAttributes = {};
                                  for (let index = 0; index < customAttributesValues.length; index++) {
                                      customAttributes[customAttributesValues[index].name] =
                                          customAttributesValues[index].value;
                                  }
                                  body.custom_attributes = customAttributes;
                              }
                          }
                          else {
                              const customAttributesJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('customAttributesJson', i));
                              if (customAttributesJson) {
                                  body.custom_attributes = customAttributesJson;
                              }
                          }
                          try {
                              responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/companies', 'POST', body, qs);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Intercom Error: ${JSON.stringify(error)}`, { itemIndex: i });
                          }
                      }
                      if (operation === 'get') {
                          const selectBy = this.getNodeParameter('selectBy', 0);
                          const value = this.getNodeParameter('value', i);
                          if (selectBy === 'companyId') {
                              qs.company_id = value;
                          }
                          if (selectBy === 'name') {
                              qs.name = value;
                          }
                          try {
                              if (selectBy === 'id') {
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, `/companies/${value}`, 'GET', {}, qs);
                              }
                              else {
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/companies', 'GET', {}, qs);
                              }
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Intercom Error: ${JSON.stringify(error)}`, { itemIndex: i });
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          try {
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.intercomApiRequestAllItems.call(this, 'companies', '/companies', 'GET', {}, qs);
                              }
                              else {
                                  qs.per_page = this.getNodeParameter('limit', i);
                                  responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/companies', 'GET', {}, qs);
                                  responseData = responseData.companies;
                              }
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Intercom Error: ${JSON.stringify(error)}`, { itemIndex: i });
                          }
                      }
                      if (operation === 'users') {
                          const listBy = this.getNodeParameter('listBy', 0);
                          const value = this.getNodeParameter('value', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (listBy === 'companyId') {
                              qs.company_id = value;
                          }
                          try {
                              if (listBy === 'id') {
                                  if (returnAll) {
                                      responseData = await GenericFunctions_1.intercomApiRequestAllItems.call(this, 'users', `/companies/${value}/users`, 'GET', {}, qs);
                                  }
                                  else {
                                      qs.per_page = this.getNodeParameter('limit', i);
                                      responseData = await GenericFunctions_1.intercomApiRequest.call(this, `/companies/${value}/users`, 'GET', {}, qs);
                                      responseData = responseData.users;
                                  }
                              }
                              else {
                                  qs.type = 'users';
                                  if (returnAll) {
                                      responseData = await GenericFunctions_1.intercomApiRequestAllItems.call(this, 'users', '/companies', 'GET', {}, qs);
                                  }
                                  else {
                                      qs.per_page = this.getNodeParameter('limit', i);
                                      responseData = await GenericFunctions_1.intercomApiRequest.call(this, '/companies', 'GET', {}, qs);
                                      responseData = responseData.users;
                                  }
                              }
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Intercom Error: ${JSON.stringify(error)}`, { itemIndex: i });
                          }
                      }
                  }
                  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.Intercom = Intercom;
  //# sourceMappingURL=Intercom.node.js.map

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

  // --- Next Credential File ---

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

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

  # Intercom node

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

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

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

  ## Operations

  * Company
      * Create a new company
      * Get data of a company
      * Get data of all companies
      * Update a company
      * List company's users
  * Lead
      * Create a new lead
      * Delete a lead
      * Get data of a lead
      * Get data of all leads
      * Update new lead
  * User
      * Create a new user
      * Delete a user
      * Get data of a user
      * Get data of all users
      * Update a user

  ## Templates and examples

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

example_workflow:
  {"name":"Intercom Example Workflow","nodes":[{"parameters":{"resource":"company","dynamic_property":null},"id":"ovhhqs5k5ds6hurugihclh","name":"Intercom","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":"user","description":"Companies allow you to represent commercial organizations using your product","options":[{"name":"Company","value":"company","description":"Companies allow you to represent commercial organizations using your product"},{"name":"Lead","value":"lead","description":"Leads are useful for representing logged-out users of your application"},{"name":"User","value":"user","description":"The Users resource is the primary way of interacting with Intercom"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...LeadDescription_1.leadOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserDescription_1.userOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CompanyDescription_1.companyOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserDescription_1.userFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...LeadDescription_1.leadFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CompanyDescription_1.companyFields"}]


node_type: n8n-nodes-base.Jira
name: Jira
display_name: Jira Software
description: Consume Jira Software API
category: output
icon: file:jira.svg
code_hash: 4e93fa0d77ac1881853591e98dea6a0effa65338c59c3a2097a06ff8c8d34278
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Jira
documentation_title: Jira Software node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"jira-software","description":"Templates for jira-software"}]
required_scopes: []
parameter_schemas: []
example_parameters: {"jiraVersion":"cloud","resource":"issue","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:48
updated_at: 2025-06-12 08:58:48
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.Jira = void 0;
  const mergeWith_1 = __importDefault(require("lodash/mergeWith"));
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const IssueAttachmentDescription_1 = require("./IssueAttachmentDescription");
  const IssueCommentDescription_1 = require("./IssueCommentDescription");
  const IssueDescription_1 = require("./IssueDescription");
  const UserDescription_1 = require("./UserDescription");
  class Jira {
      constructor() {
          this.description = {
              displayName: 'Jira Software',
              name: 'jira',
              icon: 'file:jira.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Jira Software API',
              defaults: {
                  name: 'Jira Software',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'jiraSoftwareCloudApi',
                      required: true,
                      displayOptions: {
                          show: {
                              jiraVersion: ['cloud'],
                          },
                      },
                  },
                  {
                      name: 'jiraSoftwareServerApi',
                      required: true,
                      displayOptions: {
                          show: {
                              jiraVersion: ['server'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Jira Version',
                      name: 'jiraVersion',
                      type: 'options',
                      options: [
                          {
                              name: 'Cloud',
                              value: 'cloud',
                          },
                          {
                              name: 'Server (Self Hosted)',
                              value: 'server',
                          },
                      ],
                      default: 'cloud',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Issue',
                              value: 'issue',
                              description: 'Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask',
                          },
                          {
                              name: 'Issue Attachment',
                              value: 'issueAttachment',
                              description: 'Add, remove, and get an attachment from an issue',
                          },
                          {
                              name: 'Issue Comment',
                              value: 'issueComment',
                              description: 'Get, create, update, and delete a comment from an issue',
                          },
                          {
                              name: 'User',
                              value: 'user',
                              description: 'Get, create and delete a user',
                          },
                      ],
                      default: 'issue',
                  },
                  ...IssueDescription_1.issueOperations,
                  ...IssueDescription_1.issueFields,
                  ...IssueAttachmentDescription_1.issueAttachmentOperations,
                  ...IssueAttachmentDescription_1.issueAttachmentFields,
                  ...IssueCommentDescription_1.issueCommentOperations,
                  ...IssueCommentDescription_1.issueCommentFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              listSearch: {
                  async getProjects(filter) {
                      const returnData = [];
                      const jiraVersion = this.getCurrentNodeParameter('jiraVersion');
                      let endpoint = '';
                      let projects;
                      if (jiraVersion === 'server') {
                          endpoint = '/api/2/project';
                          projects = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, endpoint, 'GET');
                      }
                      else {
                          endpoint = '/api/2/project/search';
                          projects = await GenericFunctions_1.jiraSoftwareCloudApiRequestAllItems.call(this, 'values', endpoint, 'GET');
                      }
                      if (projects.values && Array.isArray(projects.values)) {
                          projects = projects.values;
                      }
                      for (const project of projects) {
                          const projectName = project.name;
                          const projectId = project.id;
                          returnData.push({
                              name: projectName,
                              value: projectId,
                          });
                      }
                      return { results: (0, GenericFunctions_1.filterSortSearchListItems)(returnData, filter) };
                  },
                  async getIssueTypes() {
                      const projectId = this.getCurrentNodeParameter('project', { extractValue: true });
                      const returnData = [];
                      const { issueTypes } = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/project/${projectId}`, 'GET');
                      for (const issueType of issueTypes) {
                          const issueTypeName = issueType.name;
                          const issueTypeId = issueType.id;
                          returnData.push({
                              name: issueTypeName,
                              value: issueTypeId,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return { results: returnData };
                  },
                  async getUsers(filter) {
                      const users = await GenericFunctions_1.getUsers.call(this);
                      return { results: (0, GenericFunctions_1.filterSortSearchListItems)(users, filter) };
                  },
                  async getPriorities() {
                      const returnData = [];
                      const priorities = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, '/api/2/priority', 'GET');
                      for (const priority of priorities) {
                          const priorityName = priority.name;
                          const priorityId = priority.id;
                          returnData.push({
                              name: priorityName,
                              value: priorityId,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return { results: returnData };
                  },
                  async getTransitions() {
                      const returnData = [];
                      const issueKey = this.getCurrentNodeParameter('issueKey');
                      const transitions = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}/transitions`, 'GET');
                      for (const transition of transitions.transitions) {
                          returnData.push({
                              name: transition.name,
                              value: transition.id,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return { results: returnData };
                  },
                  async getCustomFields() {
                      const returnData = [];
                      const operation = this.getCurrentNodeParameter('operation');
                      let projectId;
                      let issueTypeId;
                      if (operation === 'create') {
                          projectId = this.getCurrentNodeParameter('project', { extractValue: true });
                          issueTypeId = this.getCurrentNodeParameter('issueType', { extractValue: true });
                      }
                      else {
                          const issueKey = this.getCurrentNodeParameter('issueKey');
                          const res = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}`, 'GET', {}, {});
                          projectId = res.fields.project.id;
                          issueTypeId = res.fields.issuetype.id;
                      }
                      const res = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/createmeta?projectIds=${projectId}&issueTypeIds=${issueTypeId}&expand=projects.issuetypes.fields`, 'GET');
                      const fields = res.projects
                          .find((o) => o.id === projectId)
                          .issuetypes.find((o) => o.id === issueTypeId).fields;
                      for (const key of Object.keys(fields)) {
                          const field = fields[key];
                          if (field.schema && Object.keys(field.schema).includes('customId')) {
                              returnData.push({
                                  name: field.name,
                                  value: field.key || field.fieldId,
                              });
                          }
                      }
                      return { results: returnData };
                  },
              },
              loadOptions: {
                  async getLabels() {
                      const returnData = [];
                      const labels = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, '/api/2/label', 'GET');
                      for (const label of labels.values) {
                          const labelName = label;
                          const labelId = label;
                          returnData.push({
                              name: labelName,
                              value: labelId,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
                  async getUsers() {
                      return GenericFunctions_1.getUsers.call(this);
                  },
                  async getGroups() {
                      const returnData = [];
                      const groups = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, '/api/2/groups/picker', 'GET');
                      for (const group of groups.groups) {
                          const groupName = group.name;
                          const groupId = group.name;
                          returnData.push({
                              name: groupName,
                              value: groupId,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
                  async getProjectComponents() {
                      const returnData = [];
                      const project = this.getCurrentNodeParameter('project', { extractValue: true });
                      const { values: components } = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/project/${project}/component`, 'GET');
                      for (const component of components) {
                          returnData.push({
                              name: component.name,
                              value: component.id,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      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);
          const jiraVersion = this.getNodeParameter('jiraVersion', 0);
          if (resource === 'issue') {
              if (operation === 'create') {
                  for (let i = 0; i < length; i++) {
                      const summary = this.getNodeParameter('summary', i);
                      const projectId = this.getNodeParameter('project', i, '', {
                          extractValue: true,
                      });
                      const issueTypeId = this.getNodeParameter('issueType', i, '', {
                          extractValue: true,
                      });
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const assignee = this.getNodeParameter('additionalFields.assignee', i, '', {
                          extractValue: true,
                      });
                      if (assignee)
                          additionalFields.assignee = assignee;
                      const reporter = this.getNodeParameter('additionalFields.reporter', i, '', {
                          extractValue: true,
                      });
                      if (reporter)
                          additionalFields.reporter = reporter;
                      const priority = this.getNodeParameter('additionalFields.priority', i, '', {
                          extractValue: true,
                      });
                      if (priority)
                          additionalFields.priority = priority;
                      const body = {};
                      const fields = {
                          summary,
                          project: {
                              id: projectId,
                          },
                          issuetype: {
                              id: issueTypeId,
                          },
                      };
                      if (additionalFields.labels) {
                          fields.labels = additionalFields.labels;
                      }
                      if (additionalFields.serverLabels) {
                          fields.labels = additionalFields.serverLabels;
                      }
                      if (additionalFields.priority) {
                          fields.priority = {
                              id: additionalFields.priority,
                          };
                      }
                      if (additionalFields.assignee) {
                          if (jiraVersion === 'server') {
                              fields.assignee = {
                                  name: additionalFields.assignee,
                              };
                          }
                          else {
                              fields.assignee = {
                                  id: additionalFields.assignee,
                              };
                          }
                      }
                      if (additionalFields.reporter) {
                          if (jiraVersion === 'server') {
                              fields.reporter = {
                                  name: additionalFields.reporter,
                              };
                          }
                          else {
                              fields.reporter = {
                                  id: additionalFields.reporter,
                              };
                          }
                      }
                      if (additionalFields.description) {
                          fields.description = additionalFields.description;
                      }
                      if (additionalFields.updateHistory) {
                          qs.updateHistory = additionalFields.updateHistory;
                      }
                      if (additionalFields.componentIds) {
                          fields.components = additionalFields.componentIds.map((id) => ({ id }));
                      }
                      if (additionalFields.customFieldsUi) {
                          const customFields = additionalFields.customFieldsUi
                              .customFieldsValues;
                          if (customFields) {
                              customFields.forEach((cf) => {
                                  if (typeof cf.fieldId !== 'string') {
                                      cf.fieldId = cf.fieldId.value.trim();
                                  }
                              });
                              const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                              Object.assign(fields, data);
                          }
                      }
                      const issueTypes = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, '/api/2/issuetype', 'GET', body, qs);
                      const subtaskIssues = [];
                      for (const issueType of issueTypes) {
                          if (issueType.subtask) {
                              subtaskIssues.push(issueType.id);
                          }
                      }
                      if (!additionalFields.parentIssueKey && subtaskIssues.includes(issueTypeId)) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'You must define a Parent Issue Key when Issue type is sub-task', { itemIndex: i });
                      }
                      else if (additionalFields.parentIssueKey && subtaskIssues.includes(issueTypeId)) {
                          fields.parent = {
                              key: additionalFields.parentIssueKey.toUpperCase(),
                          };
                      }
                      body.fields = fields;
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, '/api/2/issue', 'POST', body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'update') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const updateFields = this.getNodeParameter('updateFields', i);
                      const assignee = this.getNodeParameter('updateFields.assignee', i, '', {
                          extractValue: true,
                      });
                      if (assignee)
                          updateFields.assignee = assignee;
                      const reporter = this.getNodeParameter('updateFields.reporter', i, '', {
                          extractValue: true,
                      });
                      if (reporter)
                          updateFields.reporter = reporter;
                      const priority = this.getNodeParameter('updateFields.priority', i, '', {
                          extractValue: true,
                      });
                      if (priority)
                          updateFields.priority = priority;
                      const statusId = this.getNodeParameter('updateFields.statusId', i, '', {
                          extractValue: true,
                      });
                      if (statusId)
                          updateFields.statusId = statusId;
                      const body = {};
                      const fields = {};
                      if (updateFields.summary) {
                          fields.summary = updateFields.summary;
                      }
                      if (updateFields.issueType) {
                          fields.issuetype = {
                              id: updateFields.issueType,
                          };
                      }
                      if (updateFields.labels) {
                          fields.labels = updateFields.labels;
                      }
                      if (updateFields.serverLabels) {
                          fields.labels = updateFields.serverLabels;
                      }
                      if (updateFields.priority) {
                          fields.priority = {
                              id: updateFields.priority,
                          };
                      }
                      if (updateFields.assignee) {
                          if (jiraVersion === 'server') {
                              fields.assignee = {
                                  name: updateFields.assignee,
                              };
                          }
                          else {
                              fields.assignee = {
                                  id: updateFields.assignee,
                              };
                          }
                      }
                      if (updateFields.reporter) {
                          if (jiraVersion === 'server') {
                              fields.reporter = {
                                  name: updateFields.reporter,
                              };
                          }
                          else {
                              fields.reporter = {
                                  id: updateFields.reporter,
                              };
                          }
                      }
                      if (updateFields.description) {
                          fields.description = updateFields.description;
                      }
                      if (updateFields.customFieldsUi) {
                          const customFields = updateFields.customFieldsUi
                              .customFieldsValues;
                          if (customFields) {
                              customFields.forEach((cf) => {
                                  if (typeof cf.fieldId !== 'string') {
                                      cf.fieldId = cf.fieldId.value.trim();
                                  }
                              });
                              const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                              Object.assign(fields, data);
                          }
                      }
                      const issueTypes = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, '/api/2/issuetype', 'GET', body);
                      const subtaskIssues = [];
                      for (const issueType of issueTypes) {
                          if (issueType.subtask) {
                              subtaskIssues.push(issueType.id);
                          }
                      }
                      if (!updateFields.parentIssueKey && subtaskIssues.includes(updateFields.issueType)) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'You must define a Parent Issue Key when Issue type is sub-task', { itemIndex: i });
                      }
                      else if (updateFields.parentIssueKey &&
                          subtaskIssues.includes(updateFields.issueType)) {
                          fields.parent = {
                              key: updateFields.parentIssueKey.toUpperCase(),
                          };
                      }
                      body.fields = fields;
                      if (updateFields.statusId) {
                          responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}/transitions`, 'POST', { transition: { id: updateFields.statusId } });
                      }
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}`, 'PUT', body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'get') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const simplifyOutput = this.getNodeParameter('simplifyOutput', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (additionalFields.fields) {
                          qs.fields = additionalFields.fields;
                      }
                      if (additionalFields.fieldsByKey) {
                          qs.fieldsByKey = additionalFields.fieldsByKey;
                      }
                      if (additionalFields.expand) {
                          qs.expand = additionalFields.expand;
                      }
                      if (simplifyOutput) {
                          qs.expand = `${qs.expand || ''},names`;
                      }
                      if (additionalFields.properties) {
                          qs.properties = additionalFields.properties;
                      }
                      if (additionalFields.updateHistory) {
                          qs.updateHistory = additionalFields.updateHistory;
                      }
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}`, 'GET', {}, qs);
                      if (simplifyOutput) {
                          qs.expand = qs.expand || '';
                          if (qs.expand.toLowerCase().indexOf('renderedfields') !== -1 &&
                              responseData.renderedFields &&
                              Object.keys(responseData.renderedFields).length) {
                              responseData.fields = (0, mergeWith_1.default)(responseData.fields, responseData.renderedFields, (a, b) => (b === null ? a : b));
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray((0, GenericFunctions_1.simplifyIssueOutput)(responseData)), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else {
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
              }
              if (operation === 'getAll') {
                  for (let i = 0; i < length; i++) {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      const body = {};
                      if (options.fields) {
                          body.fields = options.fields.split(',');
                      }
                      if (options.jql) {
                          body.jql = options.jql;
                      }
                      if (options.expand) {
                          if (typeof options.expand === 'string') {
                              body.expand = options.expand.split(',');
                          }
                          else {
                              body.expand = options.expand;
                          }
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequestAllItems.call(this, 'issues', '/api/2/search', 'POST', body);
                      }
                      else {
                          const limit = this.getNodeParameter('limit', i);
                          body.maxResults = limit;
                          responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, '/api/2/search', 'POST', body);
                          responseData = responseData.issues;
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'changelog') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const returnAll = this.getNodeParameter('returnAll', i);
                      if (returnAll) {
                          responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequestAllItems.call(this, 'values', `/api/2/issue/${issueKey}/changelog`, 'GET');
                      }
                      else {
                          qs.maxResults = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}/changelog`, 'GET', {}, qs);
                          responseData = responseData.values;
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'notify') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const jsonActive = this.getNodeParameter('jsonParameters', 0);
                      const body = {};
                      if (additionalFields.textBody) {
                          body.textBody = additionalFields.textBody;
                      }
                      if (additionalFields.htmlBody) {
                          body.htmlBody = additionalFields.htmlBody;
                      }
                      if (!jsonActive) {
                          const notificationRecipientsValues = this.getNodeParameter('notificationRecipientsUi', i).notificationRecipientsValues;
                          const notificationRecipients = {};
                          if (notificationRecipientsValues) {
                              if (notificationRecipientsValues.reporter) {
                                  notificationRecipients.reporter = notificationRecipientsValues.reporter;
                              }
                              if (notificationRecipientsValues.assignee) {
                                  notificationRecipients.assignee = notificationRecipientsValues.assignee;
                              }
                              if (notificationRecipientsValues.assignee) {
                                  notificationRecipients.watchers = notificationRecipientsValues.watchers;
                              }
                              if (notificationRecipientsValues.voters) {
                                  notificationRecipients.watchers = notificationRecipientsValues.voters;
                              }
                              if ((notificationRecipientsValues.users || []).length > 0) {
                                  notificationRecipients.users = notificationRecipientsValues.users.map((user) => {
                                      return {
                                          accountId: user,
                                      };
                                  });
                              }
                              if ((notificationRecipientsValues.groups || []).length > 0) {
                                  notificationRecipients.groups = notificationRecipientsValues.groups.map((group) => {
                                      return {
                                          name: group,
                                      };
                                  });
                              }
                          }
                          body.to = notificationRecipients;
                          const notificationRecipientsRestrictionsValues = this.getNodeParameter('notificationRecipientsRestrictionsUi', i).notificationRecipientsRestrictionsValues;
                          const notificationRecipientsRestrictions = {};
                          if (notificationRecipientsRestrictionsValues) {
                              if ((notificationRecipientsRestrictionsValues.groups || []).length >
                                  0) {
                                  notificationRecipientsRestrictions.groups = notificationRecipientsRestrictionsValues.groups.map((group) => {
                                      return {
                                          name: group,
                                      };
                                  });
                              }
                          }
                          body.restrict = notificationRecipientsRestrictions;
                      }
                      else {
                          const notificationRecipientsJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('notificationRecipientsJson', i));
                          if (notificationRecipientsJson) {
                              body.to = notificationRecipientsJson;
                          }
                          const notificationRecipientsRestrictionsJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('notificationRecipientsRestrictionsJson', i));
                          if (notificationRecipientsRestrictionsJson) {
                              body.restrict = notificationRecipientsRestrictionsJson;
                          }
                      }
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}/notify`, 'POST', body, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'transitions') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (additionalFields.transitionId) {
                          qs.transitionId = additionalFields.transitionId;
                      }
                      if (additionalFields.expand) {
                          qs.expand = additionalFields.expand;
                      }
                      if (additionalFields.skipRemoteOnlyCondition) {
                          qs.skipRemoteOnlyCondition = additionalFields.skipRemoteOnlyCondition;
                      }
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}/transitions`, 'GET', {}, qs);
                      responseData = responseData.transitions;
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'delete') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const deleteSubtasks = this.getNodeParameter('deleteSubtasks', i);
                      qs.deleteSubtasks = deleteSubtasks;
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}`, 'DELETE', {}, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
          }
          if (resource === 'issueAttachment') {
              const apiVersion = jiraVersion === 'server' ? '2' : '3';
              if (operation === 'add') {
                  for (let i = 0; i < length; i++) {
                      const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                      let uploadData;
                      if (binaryData.id) {
                          uploadData = await this.helpers.getBinaryStream(binaryData.id);
                      }
                      else {
                          uploadData = Buffer.from(binaryData.data, n8n_workflow_1.BINARY_ENCODING);
                      }
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/issue/${issueKey}/attachments`, 'POST', {}, {}, undefined, {
                          formData: {
                              file: {
                                  value: uploadData,
                                  options: {
                                      filename: binaryData.fileName,
                                  },
                              },
                          },
                      });
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'remove') {
                  for (let i = 0; i < length; i++) {
                      const attachmentId = this.getNodeParameter('attachmentId', i);
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/attachment/${attachmentId}`, 'DELETE', {}, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'get') {
                  const download = this.getNodeParameter('download', 0);
                  for (let i = 0; i < length; i++) {
                      const attachmentId = this.getNodeParameter('attachmentId', i);
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/attachment/${attachmentId}`, 'GET', {}, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  if (download) {
                      const binaryPropertyName = this.getNodeParameter('binaryProperty', 0);
                      for (const [index, attachment] of returnData.entries()) {
                          returnData[index].binary = {};
                          const buffer = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, '', 'GET', {}, {}, attachment === null || attachment === void 0 ? void 0 : attachment.json.content, { json: false, encoding: null, useStream: true });
                          returnData[index].binary[binaryPropertyName] =
                              await this.helpers.prepareBinaryData(buffer, attachment.json.filename, attachment.json.mimeType);
                      }
                  }
              }
              if (operation === 'getAll') {
                  const download = this.getNodeParameter('download', 0);
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const { fields: { attachment }, } = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/2/issue/${issueKey}`, 'GET', {}, qs);
                      responseData = attachment;
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', i);
                          responseData = responseData.slice(0, limit);
                      }
                      responseData = responseData.map((data) => ({ json: data }));
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  if (download) {
                      const binaryPropertyName = this.getNodeParameter('binaryProperty', 0);
                      for (const [index, attachment] of returnData.entries()) {
                          returnData[index].binary = {};
                          const buffer = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, '', 'GET', {}, {}, attachment.json.content, { json: false, encoding: null, useStream: true });
                          returnData[index].binary[binaryPropertyName] =
                              await this.helpers.prepareBinaryData(buffer, attachment.json.filename, attachment.json.mimeType);
                      }
                  }
              }
          }
          if (resource === 'issueComment') {
              const apiVersion = jiraVersion === 'server' ? '2' : '3';
              if (operation === 'add') {
                  for (let i = 0; i < length; i++) {
                      const jsonParameters = this.getNodeParameter('jsonParameters', 0);
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const options = this.getNodeParameter('options', i);
                      const body = {};
                      if (options.expand) {
                          qs.expand = options.expand;
                          delete options.expand;
                      }
                      Object.assign(body, options);
                      if (!jsonParameters) {
                          const comment = this.getNodeParameter('comment', i);
                          if (jiraVersion === 'server') {
                              Object.assign(body, { body: comment });
                          }
                          else {
                              Object.assign(body, {
                                  body: {
                                      type: 'doc',
                                      version: 1,
                                      content: [
                                          {
                                              type: 'paragraph',
                                              content: [
                                                  {
                                                      type: 'text',
                                                      text: comment,
                                                  },
                                              ],
                                          },
                                      ],
                                  },
                              });
                          }
                      }
                      else {
                          const commentJson = this.getNodeParameter('commentJson', i);
                          const json = (0, GenericFunctions_1.validateJSON)(commentJson);
                          if (json === '') {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Document Format must be a valid JSON', {
                                  itemIndex: i,
                              });
                          }
                          Object.assign(body, { body: json });
                      }
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/issue/${issueKey}/comment`, 'POST', body, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'get') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const commentId = this.getNodeParameter('commentId', i);
                      const options = this.getNodeParameter('options', i);
                      Object.assign(qs, options);
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/issue/${issueKey}/comment/${commentId}`, 'GET', {}, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'getAll') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      const body = {};
                      Object.assign(qs, options);
                      if (returnAll) {
                          responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequestAllItems.call(this, 'comments', `/api/${apiVersion}/issue/${issueKey}/comment`, 'GET', body, qs);
                      }
                      else {
                          const limit = this.getNodeParameter('limit', i);
                          body.maxResults = limit;
                          responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/issue/${issueKey}/comment`, 'GET', body, qs);
                          responseData = responseData.comments;
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'remove') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const commentId = this.getNodeParameter('commentId', i);
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/issue/${issueKey}/comment/${commentId}`, 'DELETE', {}, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'update') {
                  for (let i = 0; i < length; i++) {
                      const issueKey = this.getNodeParameter('issueKey', i);
                      const commentId = this.getNodeParameter('commentId', i);
                      const options = this.getNodeParameter('options', i);
                      const jsonParameters = this.getNodeParameter('jsonParameters', 0);
                      const body = {};
                      if (options.expand) {
                          qs.expand = options.expand;
                          delete options.expand;
                      }
                      Object.assign(qs, options);
                      if (!jsonParameters) {
                          const comment = this.getNodeParameter('comment', i);
                          if (jiraVersion === 'server') {
                              Object.assign(body, { body: comment });
                          }
                          else {
                              Object.assign(body, {
                                  body: {
                                      type: 'doc',
                                      version: 1,
                                      content: [
                                          {
                                              type: 'paragraph',
                                              content: [
                                                  {
                                                      type: 'text',
                                                      text: comment,
                                                  },
                                              ],
                                          },
                                      ],
                                  },
                              });
                          }
                      }
                      else {
                          const commentJson = this.getNodeParameter('commentJson', i);
                          const json = (0, GenericFunctions_1.validateJSON)(commentJson);
                          if (json === '') {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Document Format must be a valid JSON', {
                                  itemIndex: i,
                              });
                          }
                          Object.assign(body, { body: json });
                      }
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/issue/${issueKey}/comment/${commentId}`, 'PUT', body, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
          }
          if (resource === 'user') {
              const apiVersion = jiraVersion === 'server' ? '2' : '3';
              if (operation === 'create') {
                  for (let i = 0; i < length; i++) {
                      const body = {
                          name: this.getNodeParameter('username', i),
                          emailAddress: this.getNodeParameter('emailAddress', i),
                          displayName: this.getNodeParameter('displayName', i),
                      };
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      Object.assign(body, additionalFields);
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/user`, 'POST', body, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              else if (operation === 'delete') {
                  for (let i = 0; i < length; i++) {
                      qs.accountId = this.getNodeParameter('accountId', i);
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/user`, 'DELETE', {}, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              else if (operation === 'get') {
                  for (let i = 0; i < length; i++) {
                      qs.accountId = this.getNodeParameter('accountId', i);
                      const { expand } = this.getNodeParameter('additionalFields', i);
                      if (expand) {
                          qs.expand = expand.join(',');
                      }
                      responseData = await GenericFunctions_1.jiraSoftwareCloudApiRequest.call(this, `/api/${apiVersion}/user`, 'GET', {}, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
          }
          return [returnData];
      }
  }
  exports.Jira = Jira;
  //# sourceMappingURL=Jira.node.js.map

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

  # Jira Software node

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

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

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

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

  ## Operations

  * Issue
      * Get issue changelog
      * Create a new issue
      * Delete an issue
      * Get an issue
      * Get all issues
      * Create an email notification for an issue and add it to the mail queue
      * Return either all transitions or a transition that can be performed by the user on an issue, based on the issue's status
      * Update an issue
  * Issue Attachment
      * Add attachment to issue
      * Get an attachment
      * Get all attachments
      * Remove an attachment
  * Issue Comment
      * Add comment to issue
      * Get a comment
      * Get all comments
      * Remove a comment
      * Update a comment
  * User
      * Create a new user.
      * Delete a user.
      * Retrieve a user.

  ## Templates and examples

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

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

  ## Related resources

  Refer to the [official JQL documentation](https://www.atlassian.com/software/jira/guides/expand-jira/jql) about Jira Query Language (JQL) to learn more about it.

  ## Fetch issues for a specific project

  The **Get All** operation returns all the issues from Jira. To fetch issues for a particular project, you need to use Jira Query Language (JQL).

  For example, if you want to receive all the issues of a project named `n8n`, you'd do something like this:

  - Select **Get All** from the **Operation** dropdown list.
  - Toggle **Return All** to true.
  - Select **Add Option** and select **JQL**.
  - Enter `project=n8n` in the **JQL** field.

  This query will fetch all the issues in the project named `n8n`. Enter the name of your project instead of `n8n` to fetch all the issues for your project.

related_resources:
  [{"title":"official JQL documentation","url":"https://www.atlassian.com/software/jira/guides/expand-jira/jql","type":"external"}]

troubleshooting_info:
  [{"issue":"Fetch issues for a specific project","solution":"The **Get All** operation returns all the issues from Jira. To fetch issues for a particular project, you need to use Jira Query Language (JQL)."}]

example_workflow:
  {"name":"Jira Software Example Workflow","nodes":[{"parameters":{"jiraVersion":"cloud","resource":"issue","dynamic_property":null},"id":"li4rdj7f6nduir9kllzolm","name":"Jira Software","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Jira Version","name":"jiraVersion","type":"options","default":"cloud","options":[{"name":"Cloud","value":"cloud"},{"name":"Server (Self Hosted)","value":"server"}]},{"displayName":"Resource","name":"resource","type":"options","default":"issue","description":"Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask","options":[{"name":"Issue","value":"issue","description":"Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask"},{"name":"Issue Attachment","value":"issueAttachment","description":"Add, remove, and get an attachment from an issue"},{"name":"Issue Comment","value":"issueComment","description":"Get, create, update, and delete a comment from an issue"},{"name":"User","value":"user","description":"Get, create and delete a user"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IssueDescription_1.issueOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IssueDescription_1.issueFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IssueAttachmentDescription_1.issueAttachmentOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IssueAttachmentDescription_1.issueAttachmentFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IssueCommentDescription_1.issueCommentOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IssueCommentDescription_1.issueCommentFields"},{"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.Iterable
name: Iterable
display_name: Iterable
description: Consume Iterable API
category: input
icon: file:iterable.png
code_hash: a25bf56399e021962735e8a204bbfbeb4be8a9760a2650eb2534acd7ffed11d6
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Iterable
documentation_title: Iterable node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"iterable","description":"Templates for iterable"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"event","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:48
updated_at: 2025-06-12 08:58:48
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.Iterable = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const EventDescription_1 = require("./EventDescription");
  const UserDescription_1 = require("./UserDescription");
  const UserListDescription_1 = require("./UserListDescription");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Iterable {
      constructor() {
          this.description = {
              displayName: 'Iterable',
              name: 'iterable',
              icon: 'file:iterable.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Iterable API',
              defaults: {
                  name: 'Iterable',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'iterableApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                          {
                              name: 'User List',
                              value: 'userList',
                          },
                      ],
                      default: 'user',
                  },
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
                  ...UserListDescription_1.userListOperations,
                  ...UserListDescription_1.userListFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLists() {
                      const { lists } = await GenericFunctions_1.iterableApiRequest.call(this, 'GET', '/lists');
                      const returnData = [];
                      for (const list of lists) {
                          returnData.push({
                              name: list.name,
                              value: list.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const timezone = this.getTimezone();
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          if (resource === 'event') {
              if (operation === 'track') {
                  const events = [];
                  for (let i = 0; i < length; i++) {
                      const name = this.getNodeParameter('name', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (!additionalFields.email && !additionalFields.id) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Either email or userId must be passed in to identify the user. Please add one of both via "Additional Fields". If both are passed in, email takes precedence.', { itemIndex: i });
                      }
                      const body = {
                          eventName: name,
                      };
                      Object.assign(body, additionalFields);
                      if (body.dataFieldsUi) {
                          const dataFields = body.dataFieldsUi.dataFieldValues;
                          const data = {};
                          for (const dataField of dataFields) {
                              data[dataField.key] = dataField.value;
                          }
                          body.dataFields = data;
                          delete body.dataFieldsUi;
                      }
                      if (body.createdAt) {
                          body.createdAt = moment_timezone_1.default.tz(body.createdAt, timezone).unix();
                      }
                      events.push(body);
                  }
                  responseData = await GenericFunctions_1.iterableApiRequest.call(this, 'POST', '/events/trackBulk', { events });
                  returnData.push(responseData);
              }
          }
          if (resource === 'user') {
              if (operation === 'upsert') {
                  for (let i = 0; i < length; i++) {
                      const identifier = this.getNodeParameter('identifier', i);
                      const value = this.getNodeParameter('value', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {};
                      if (identifier === 'email') {
                          body.email = value;
                      }
                      else {
                          body.preferUserId = this.getNodeParameter('preferUserId', i);
                          body.userId = value;
                      }
                      Object.assign(body, additionalFields);
                      if (body.dataFieldsUi) {
                          const dataFields = body.dataFieldsUi.dataFieldValues;
                          const data = {};
                          for (const dataField of dataFields) {
                              data[dataField.key] = dataField.value;
                          }
                          body.dataFields = data;
                          delete body.dataFieldsUi;
                      }
                      responseData = await GenericFunctions_1.iterableApiRequest.call(this, 'POST', '/users/update', body);
                      if (!this.continueOnFail()) {
                          if (responseData.code !== 'Success') {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Iterable error response [400]: ${responseData.msg}`, { itemIndex: i });
                          }
                      }
                      returnData.push(responseData);
                  }
              }
              if (operation === 'delete') {
                  for (let i = 0; i < length; i++) {
                      const by = this.getNodeParameter('by', i);
                      let endpoint;
                      if (by === 'email') {
                          const email = this.getNodeParameter('email', i);
                          endpoint = `/users/${email}`;
                      }
                      else {
                          const userId = this.getNodeParameter('userId', i);
                          endpoint = `/users/byUserId/${userId}`;
                      }
                      responseData = await GenericFunctions_1.iterableApiRequest.call(this, 'DELETE', endpoint);
                      if (!this.continueOnFail()) {
                          if (responseData.code !== 'Success') {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData);
                          }
                      }
                      returnData.push(responseData);
                  }
              }
              if (operation === 'get') {
                  for (let i = 0; i < length; i++) {
                      const by = this.getNodeParameter('by', i);
                      let endpoint;
                      if (by === 'email') {
                          const email = this.getNodeParameter('email', i);
                          endpoint = '/users/getByEmail';
                          qs.email = email;
                      }
                      else {
                          const userId = this.getNodeParameter('userId', i);
                          endpoint = `/users/byUserId/${userId}`;
                      }
                      responseData = await GenericFunctions_1.iterableApiRequest.call(this, 'GET', endpoint, {}, qs);
                      if (!this.continueOnFail()) {
                          if (Object.keys(responseData).length === 0) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData, {
                                  message: 'User not found',
                                  httpCode: '404',
                              });
                          }
                      }
                      responseData = responseData.user || {};
                      returnData.push(responseData);
                  }
              }
          }
          if (resource === 'userList') {
              if (operation === 'add') {
                  const listId = this.getNodeParameter('listId', 0);
                  const identifier = this.getNodeParameter('identifier', 0);
                  const body = {
                      listId: parseInt(listId, 10),
                      subscribers: [],
                  };
                  const subscribers = [];
                  for (let i = 0; i < length; i++) {
                      const value = this.getNodeParameter('value', i);
                      if (identifier === 'email') {
                          subscribers.push({ email: value });
                      }
                      else {
                          subscribers.push({ userId: value });
                      }
                  }
                  body.subscribers = subscribers;
                  responseData = await GenericFunctions_1.iterableApiRequest.call(this, 'POST', '/lists/subscribe', body);
                  returnData.push(responseData);
              }
              if (operation === 'remove') {
                  const listId = this.getNodeParameter('listId', 0);
                  const identifier = this.getNodeParameter('identifier', 0);
                  const additionalFields = this.getNodeParameter('additionalFields', 0);
                  const body = {
                      listId: parseInt(listId, 10),
                      subscribers: [],
                      campaignId: additionalFields.campaignId,
                      channelUnsubscribe: additionalFields.channelUnsubscribe,
                  };
                  const subscribers = [];
                  for (let i = 0; i < length; i++) {
                      const value = this.getNodeParameter('value', i);
                      if (identifier === 'email') {
                          subscribers.push({ email: value });
                      }
                      else {
                          subscribers.push({ userId: value });
                      }
                  }
                  body.subscribers = subscribers;
                  responseData = await GenericFunctions_1.iterableApiRequest.call(this, 'POST', '/lists/unsubscribe', body);
                  returnData.push(responseData);
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Iterable = Iterable;
  //# sourceMappingURL=Iterable.node.js.map

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

  // --- Next Credential File ---

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

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

  # Iterable node

  Use the Iterable node to automate work in Iterable, and integrate Iterable with other applications. n8n has built-in support for a wide range of Iterable features, including creating users, recording the actions performed by the users, and adding and removing users from the list. 

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

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

  ## Operations

  * Event
      * Record the actions a user perform
  * User
      * Create/Update a user
      * Delete a user
      * Get a user
  * User List
      * Add user to list
      * Remove a user from a list

  ## Templates and examples

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

example_workflow:
  {"name":"Iterable Example Workflow","nodes":[{"parameters":{"resource":"event","dynamic_property":null},"id":"zjvcrrx9s9121htzvcav0a","name":"Iterable","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":"user","options":[{"name":"Event","value":"event"},{"name":"User","value":"user"},{"name":"User List","value":"userList"}]},{"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":"...UserDescription_1.userOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserDescription_1.userFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserListDescription_1.userListOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserListDescription_1.userListFields"}]


node_type: n8n-nodes-base.Jenkins
name: Jenkins
display_name: Jenkins
description: Consume Jenkins API
category: output
icon: file:jenkins.svg
code_hash: f2cc66998d1891568379ae5503e6ad1467a505ba3e06e5df8209d990381c015e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Jenkins
documentation_title: Jenkins node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"jenkins","description":"Templates for jenkins"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:48
updated_at: 2025-06-12 08:58:48
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Jenkins = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Jenkins {
      constructor() {
          this.description = {
              displayName: 'Jenkins',
              name: 'jenkins',
              icon: 'file:jenkins.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Jenkins API',
              defaults: {
                  name: 'Jenkins',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'jenkinsApi',
                      required: true,
                      testedBy: 'jenkinApiCredentialTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      options: [
                          {
                              name: 'Build',
                              value: 'build',
                          },
                          {
                              name: 'Instance',
                              value: 'instance',
                          },
                          {
                              name: 'Job',
                              value: 'job',
                          },
                      ],
                      default: 'job',
                      noDataExpression: true,
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['job'],
                          },
                      },
                      options: [
                          {
                              name: 'Copy',
                              value: 'copy',
                              description: 'Copy a specific job',
                              action: 'Copy a job',
                          },
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a new job',
                              action: 'Create a job',
                          },
                          {
                              name: 'Trigger',
                              value: 'trigger',
                              description: 'Trigger a specific job',
                              action: 'Trigger a job',
                          },
                          {
                              name: 'Trigger with Parameters',
                              value: 'triggerParams',
                              description: 'Trigger a specific job',
                              action: 'Trigger a job with parameters',
                          },
                      ],
                      default: 'trigger',
                      description: 'Possible operations',
                      noDataExpression: true,
                  },
                  {
                      displayName: 'Make sure the job is setup to support triggering with parameters. <a href="https://wiki.jenkins.io/display/JENKINS/Parameterized+Build" target="_blank">More info</a>',
                      name: 'triggerParamsNotice',
                      type: 'notice',
                      displayOptions: {
                          show: {
                              resource: ['job'],
                              operation: ['triggerParams'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Job Name or ID',
                      name: 'job',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getJobs',
                      },
                      displayOptions: {
                          show: {
                              resource: ['job'],
                              operation: ['trigger', 'triggerParams', 'copy'],
                          },
                      },
                      required: true,
                      default: '',
                      description: 'Name of the job. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Parameters',
                      name: 'param',
                      type: 'fixedCollection',
                      placeholder: 'Add Parameter',
                      displayOptions: {
                          show: {
                              resource: ['job'],
                              operation: ['triggerParams'],
                          },
                      },
                      required: true,
                      default: {},
                      typeOptions: {
                          multipleValues: true,
                      },
                      options: [
                          {
                              name: 'params',
                              displayName: 'Parameters',
                              values: [
                                  {
                                      displayName: 'Name or ID',
                                      name: 'name',
                                      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: 'getJobParameters',
                                          loadOptionsDependsOn: ['job'],
                                      },
                                      default: '',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                  },
                              ],
                          },
                      ],
                      description: 'Parameters for Jenkins job',
                  },
                  {
                      displayName: 'New Job Name',
                      name: 'newJob',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['job'],
                              operation: ['copy', 'create'],
                          },
                      },
                      required: true,
                      default: '',
                      description: 'Name of the new Jenkins job',
                  },
                  {
                      displayName: 'XML',
                      name: 'xml',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['job'],
                              operation: ['create'],
                          },
                      },
                      required: true,
                      default: '',
                      description: 'XML of Jenkins config',
                  },
                  {
                      displayName: 'To get the XML of an existing job, add ‘config.xml’ to the end of the job URL',
                      name: 'createNotice',
                      type: 'notice',
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['job'],
                              operation: ['create'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['instance'],
                          },
                      },
                      options: [
                          {
                              name: 'Cancel Quiet Down',
                              value: 'cancelQuietDown',
                              description: 'Cancel quiet down state',
                              action: 'Cancel Quiet Down an instance',
                          },
                          {
                              name: 'Quiet Down',
                              value: 'quietDown',
                              description: 'Put Jenkins in quiet mode, no builds can be started, Jenkins is ready for shutdown',
                              action: 'Quiet Down an instance',
                          },
                          {
                              name: 'Restart',
                              value: 'restart',
                              description: 'Restart Jenkins immediately on environments where it is possible',
                              action: 'Restart an instance',
                          },
                          {
                              name: 'Safely Restart',
                              value: 'safeRestart',
                              description: 'Restart Jenkins once no jobs are running on environments where it is possible',
                              action: 'Safely Restart an instance',
                          },
                          {
                              name: 'Safely Shutdown',
                              value: 'safeExit',
                              description: 'Shutdown once no jobs are running',
                              action: 'Safely Shutdown an instance',
                          },
                          {
                              name: 'Shutdown',
                              value: 'exit',
                              description: 'Shutdown Jenkins immediately',
                              action: 'Shutdown an instance',
                          },
                      ],
                      default: 'safeRestart',
                      description: 'Jenkins instance operations',
                      noDataExpression: true,
                  },
                  {
                      displayName: 'Reason',
                      name: 'reason',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['instance'],
                              operation: ['quietDown'],
                          },
                      },
                      default: '',
                      description: 'Freeform reason for quiet down mode',
                  },
                  {
                      displayName: 'Instance operation can shutdown Jenkins instance and make it unresponsive. Some commands may not be available depending on instance implementation.',
                      name: 'instanceNotice',
                      type: 'notice',
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['instance'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['build'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'List Builds',
                              action: 'Get many builds',
                          },
                      ],
                      default: 'getAll',
                      noDataExpression: true,
                  },
                  {
                      displayName: 'Job Name or ID',
                      name: 'job',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getJobs',
                      },
                      displayOptions: {
                          show: {
                              resource: ['build'],
                              operation: ['getAll'],
                          },
                      },
                      required: true,
                      default: '',
                      description: 'Name of the job. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      default: false,
                      displayOptions: {
                          show: {
                              resource: ['build'],
                              operation: ['getAll'],
                          },
                      },
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      default: 50,
                      typeOptions: {
                          minValue: 1,
                      },
                      displayOptions: {
                          show: {
                              resource: ['build'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      description: 'Max number of results to return',
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async jenkinApiCredentialTest(credential) {
                      const { baseUrl, username, apiKey } = credential.data;
                      const url = (0, GenericFunctions_1.tolerateTrailingSlash)(baseUrl);
                      const endpoint = '/api/json';
                      const options = {
                          auth: {
                              username,
                              password: apiKey,
                          },
                          method: 'GET',
                          body: {},
                          qs: {},
                          uri: `${url}${endpoint}`,
                          json: true,
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
              },
              loadOptions: {
                  async getJobs() {
                      const returnData = [];
                      const endpoint = '/api/json';
                      const { jobs } = await GenericFunctions_1.jenkinsApiRequest.call(this, 'GET', endpoint);
                      for (const job of jobs) {
                          returnData.push({
                              name: job.name,
                              value: job.name,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
                  async getJobParameters() {
                      const job = this.getCurrentNodeParameter('job');
                      const returnData = [];
                      const endpoint = `/job/${job}/api/json?tree=actions[parameterDefinitions[*]]`;
                      const { actions } = await GenericFunctions_1.jenkinsApiRequest.call(this, 'GET', endpoint);
                      for (const { _class, parameterDefinitions } of actions) {
                          if (_class === null || _class === void 0 ? void 0 : _class.includes('ParametersDefinitionProperty')) {
                              for (const { name, type } of parameterDefinitions) {
                                  returnData.push({
                                      name: `${name} - (${type})`,
                                      value: name,
                                  });
                              }
                          }
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'job') {
                      if (operation === 'trigger') {
                          const job = this.getNodeParameter('job', i);
                          const endpoint = `/job/${job}/build`;
                          await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint);
                          responseData = { success: true };
                      }
                      if (operation === 'triggerParams') {
                          const job = this.getNodeParameter('job', i);
                          const params = this.getNodeParameter('param.params', i, []);
                          let form = {};
                          if (params.length) {
                              form = params.reduce((body, param) => {
                                  body[param.name] = param.value;
                                  return body;
                              }, {});
                          }
                          const endpoint = `/job/${job}/buildWithParameters`;
                          await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint, {}, {}, {
                              form,
                              headers: {
                                  'content-type': 'application/x-www-form-urlencoded',
                              },
                          });
                          responseData = { success: true };
                      }
                      if (operation === 'copy') {
                          const job = this.getNodeParameter('job', i);
                          const name = this.getNodeParameter('newJob', i);
                          const queryParams = {
                              name,
                              mode: 'copy',
                              from: job,
                          };
                          const endpoint = '/createItem';
                          try {
                              await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint, queryParams);
                              responseData = { success: true };
                          }
                          catch (error) {
                              if (error.httpCode === '302') {
                                  responseData = { success: true };
                              }
                              else {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                              }
                          }
                      }
                      if (operation === 'create') {
                          const name = this.getNodeParameter('newJob', i);
                          const queryParams = {
                              name,
                          };
                          const headers = {
                              'content-type': 'application/xml',
                          };
                          const body = this.getNodeParameter('xml', i);
                          const endpoint = '/createItem';
                          await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint, queryParams, body, {
                              headers,
                              json: false,
                          });
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'instance') {
                      if (operation === 'quietDown') {
                          const reason = this.getNodeParameter('reason', i);
                          let queryParams;
                          if (reason) {
                              queryParams = {
                                  reason,
                              };
                          }
                          const endpoint = '/quietDown';
                          await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint, queryParams);
                          responseData = { success: true };
                      }
                      if (operation === 'cancelQuietDown') {
                          const endpoint = '/cancelQuietDown';
                          await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint);
                          responseData = { success: true };
                      }
                      if (operation === 'restart') {
                          const endpoint = '/restart';
                          try {
                              await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint);
                          }
                          catch (error) {
                              if (error.httpCode === '503') {
                                  responseData = { success: true };
                              }
                              else {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                              }
                          }
                      }
                      if (operation === 'safeRestart') {
                          const endpoint = '/safeRestart';
                          try {
                              await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint);
                          }
                          catch (error) {
                              if (error.httpCode === '503') {
                                  responseData = { success: true };
                              }
                              else {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                              }
                          }
                      }
                      if (operation === 'exit') {
                          const endpoint = '/exit';
                          await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint);
                          responseData = { success: true };
                      }
                      if (operation === 'safeExit') {
                          const endpoint = '/safeExit';
                          await GenericFunctions_1.jenkinsApiRequest.call(this, 'POST', endpoint);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'build') {
                      if (operation === 'getAll') {
                          const job = this.getNodeParameter('job', i);
                          let endpoint = `/job/${job}/api/json?tree=builds[*]`;
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              endpoint += `{0,${limit}}`;
                          }
                          responseData = await GenericFunctions_1.jenkinsApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.builds;
                      }
                  }
                  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.Jenkins = Jenkins;
  //# sourceMappingURL=Jenkins.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.JenkinsApi = void 0;
  class JenkinsApi {
      constructor() {
          this.name = 'jenkinsApi';
          this.displayName = 'Jenkins API';
          this.documentationUrl = 'jenkins';
          this.properties = [
              {
                  displayName: 'Jenking Username',
                  name: 'username',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Personal API Token',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Jenkins Instance URL',
                  name: 'baseUrl',
                  type: 'string',
                  default: '',
              },
          ];
      }
  }
  exports.JenkinsApi = JenkinsApi;
  //# sourceMappingURL=JenkinsApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.JenkinsApi = void 0;
  class JenkinsApi {
      constructor() {
          this.name = 'jenkinsApi';
          this.displayName = 'Jenkins API';
          this.documentationUrl = 'jenkins';
          this.properties = [
              {
                  displayName: 'Jenking Username',
                  name: 'username',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Personal API Token',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Jenkins Instance URL',
                  name: 'baseUrl',
                  type: 'string',
                  default: '',
              },
          ];
      }
  }
  exports.JenkinsApi = JenkinsApi;
  //# sourceMappingURL=JenkinsApi.credentials.js.map

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

  # Jenkins node

  Use the Jenkins node to automate work in Jenkins, and integrate Jenkins with other applications. n8n has built-in support for a wide range of Jenkins features, including listing builds, managing instances, and creating and copying jobs. 

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

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

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

  ## Operations

  * Build
      * List Builds
  * Instance
      * Cancel quiet down state
      * Put Jenkins in quiet mode, no builds can be started, Jenkins is ready for shutdown
      * Restart Jenkins immediately on environments where it's possible
      * Restart Jenkins once no jobs are running on environments where it's possible
      * Shutdown once no jobs are running
      * Shutdown Jenkins immediately
  * Job
      * Copy a specific job
      * Create a new job
      * Trigger a specific job
      * Trigger a specific job

  ## Templates and examples

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

example_workflow:
  {"name":"Jenkins Example Workflow","nodes":[{"parameters":{"resource":"build","operation":"getAll","triggerParamsNotice":null,"job":"","param":{},"newJob":"example-value","xml":"example-value","createNotice":null,"reason":"example-value","instanceNotice":null,"returnAll":false,"limit":50},"id":"nj2b8zn9gggx75jg7oabi8","name":"Jenkins","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"resource":"build","operation":"getAll","triggerParamsNotice":null,"job":"","param":{},"newJob":"example-value","xml":"example-value","createNotice":null,"reason":"example-value","instanceNotice":null,"returnAll":false,"limit":50}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"job","options":[{"name":"Build","value":"build"},{"name":"Instance","value":"instance"},{"name":"Job","value":"job"}]},{"displayName":"Operation","name":"operation","type":"options","default":"trigger","description":"Copy a specific job","options":[{"name":"Copy","value":"copy","description":"Copy a specific job"},{"name":"Create","value":"create","description":"Create a new job"},{"name":"Trigger","value":"trigger","description":"Trigger a specific job"},{"name":"Trigger with Parameters","value":"triggerParams","description":"Trigger a specific job"}]},{"displayName":"Make sure the job is setup to support triggering with parameters. <a href=","name":"triggerParamsNotice","type":"notice","default":""},{"displayName":"Job Name or ID","name":"job","type":"options","default":"","required":true,"description":"Name of the job. Choose from the list, or specify an ID using an <a href="},{"displayName":"Parameters","name":"param","type":"fixedCollection","default":"{","required":true,"description":"Choose from the list, or specify an ID using an <a href=","placeholder":"Add Parameter"},{"displayName":"New Job Name","name":"newJob","type":"string","default":"","required":true,"description":"Name of the new Jenkins job"},{"displayName":"XML","name":"xml","type":"string","default":"","required":true,"description":"XML of Jenkins config"},{"displayName":"To get the XML of an existing job, add ‘config.xml’ to the end of the job URL","name":"createNotice","type":"notice","default":""},{"displayName":"Operation","name":"operation","type":"options","default":"safeRestart","description":"Cancel quiet down state","options":[{"name":"Cancel Quiet Down","value":"cancelQuietDown","description":"Cancel quiet down state"},{"name":"Quiet Down","value":"quietDown","description":"Put Jenkins in quiet mode, no builds can be started, Jenkins is ready for shutdown"},{"name":"Restart","value":"restart","description":"Restart Jenkins immediately on environments where it is possible"},{"name":"Safely Restart","value":"safeRestart","description":"Restart Jenkins once no jobs are running on environments where it is possible"},{"name":"Safely Shutdown","value":"safeExit","description":"Shutdown once no jobs are running"},{"name":"Shutdown","value":"exit","description":"Shutdown Jenkins immediately"}]},{"displayName":"Reason","name":"reason","type":"string","default":"","description":"Freeform reason for quiet down mode"},{"displayName":"Instance operation can shutdown Jenkins instance and make it unresponsive. Some commands may not be available depending on instance implementation.","name":"instanceNotice","type":"notice","default":""},{"displayName":"Operation","name":"operation","type":"options","default":"getAll","description":"List Builds","options":[{"name":"Get Many","value":"getAll","description":"List Builds"}]},{"displayName":"Job Name or ID","name":"job","type":"options","default":"","required":true,"description":"Name of the job. Choose from the list, or specify an ID using an <a href="},{"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":50,"description":"Max number of results to return"}]


node_type: n8n-nodes-base.Keap
name: Keap
display_name: Keap
description: Consume Keap API
category: input
icon: file:keap.png
code_hash: 6edbc9075b37a91bd9f057729c08aa0d1296fdd8316a1790b34ba81da790c32e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Keap
documentation_title: Keap node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"keap","description":"Templates for keap"}]
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:58:48
updated_at: 2025-06-12 08:58:48
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.Keap = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ContactDescription_1 = require("./ContactDescription");
  const ContactNoteDescription_1 = require("./ContactNoteDescription");
  const ContactTagDescription_1 = require("./ContactTagDescription");
  const EcommerceOrderDescripion_1 = require("./EcommerceOrderDescripion");
  const EcommerceProductDescription_1 = require("./EcommerceProductDescription");
  const EmailDescription_1 = require("./EmailDescription");
  const FileDescription_1 = require("./FileDescription");
  const CompanyDescription_1 = require("./CompanyDescription");
  const change_case_1 = require("change-case");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Keap {
      constructor() {
          this.description = {
              displayName: 'Keap',
              name: 'keap',
              icon: 'file:keap.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Keap API',
              defaults: {
                  name: 'Keap',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'keapOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Company',
                              value: 'company',
                          },
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                          {
                              name: 'Contact Note',
                              value: 'contactNote',
                          },
                          {
                              name: 'Contact Tag',
                              value: 'contactTag',
                          },
                          {
                              name: 'Ecommerce Order',
                              value: 'ecommerceOrder',
                          },
                          {
                              name: 'Ecommerce Product',
                              value: 'ecommerceProduct',
                          },
                          {
                              name: 'Email',
                              value: 'email',
                          },
                          {
                              name: 'File',
                              value: 'file',
                          },
                      ],
                      default: 'company',
                  },
                  ...CompanyDescription_1.companyOperations,
                  ...CompanyDescription_1.companyFields,
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
                  ...ContactNoteDescription_1.contactNoteOperations,
                  ...ContactNoteDescription_1.contactNoteFields,
                  ...ContactTagDescription_1.contactTagOperations,
                  ...ContactTagDescription_1.contactTagFields,
                  ...EcommerceOrderDescripion_1.ecommerceOrderOperations,
                  ...EcommerceOrderDescripion_1.ecommerceOrderFields,
                  ...EcommerceProductDescription_1.ecommerceProductOperations,
                  ...EcommerceProductDescription_1.ecommerceProductFields,
                  ...EmailDescription_1.emailOperations,
                  ...EmailDescription_1.emailFields,
                  ...FileDescription_1.fileOperations,
                  ...FileDescription_1.fileFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTags() {
                      const returnData = [];
                      const tags = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'tags', 'GET', '/tags');
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = tag.id;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
                  async getUsers() {
                      const returnData = [];
                      const users = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'users', 'GET', '/users');
                      for (const user of users) {
                          const userName = user.given_name;
                          const userId = user.id;
                          returnData.push({
                              name: userName,
                              value: userId,
                          });
                      }
                      return returnData;
                  },
                  async getCountries() {
                      const returnData = [];
                      const { countries } = await GenericFunctions_1.keapApiRequest.call(this, 'GET', '/locales/countries');
                      for (const key of Object.keys(countries)) {
                          const countryName = countries[key];
                          const countryId = key;
                          returnData.push({
                              name: countryName,
                              value: countryId,
                          });
                      }
                      return returnData;
                  },
                  async getProvinces() {
                      const countryCode = this.getCurrentNodeParameter('countryCode');
                      const returnData = [];
                      const { provinces } = await GenericFunctions_1.keapApiRequest.call(this, 'GET', `/locales/countries/${countryCode}/provinces`);
                      for (const key of Object.keys(provinces)) {
                          const provinceName = provinces[key];
                          const provinceId = key;
                          returnData.push({
                              name: provinceName,
                              value: provinceId,
                          });
                      }
                      return returnData;
                  },
                  async getContactTypes() {
                      const returnData = [];
                      const types = await GenericFunctions_1.keapApiRequest.call(this, 'GET', '/setting/contact/optionTypes');
                      for (const type of types.value.split(',')) {
                          const typeName = type;
                          const typeId = type;
                          returnData.push({
                              name: typeName,
                              value: typeId,
                          });
                      }
                      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;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              if (resource === 'company') {
                  if (operation === 'create') {
                      const addresses = this.getNodeParameter('addressesUi', i)
                          .addressesValues;
                      const faxes = this.getNodeParameter('faxesUi', i)
                          .faxesValues;
                      const phones = this.getNodeParameter('phonesUi', i)
                          .phonesValues;
                      const companyName = this.getNodeParameter('companyName', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          company_name: companyName,
                      };
                      (0, GenericFunctions_1.keysToSnakeCase)(additionalFields);
                      Object.assign(body, additionalFields);
                      if (addresses) {
                          body.address = (0, GenericFunctions_1.keysToSnakeCase)(addresses)[0];
                      }
                      if (faxes) {
                          body.fax_number = faxes[0];
                      }
                      if (phones) {
                          body.phone_number = phones[0];
                      }
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'POST', '/companies', body);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      (0, GenericFunctions_1.keysToSnakeCase)(options);
                      Object.assign(qs, options);
                      if (qs.fields) {
                          qs.optional_properties = qs.fields;
                          delete qs.fields;
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'companies', 'GET', '/companies', {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', '/companies', {}, qs);
                          responseData = responseData.companies;
                      }
                  }
              }
              if (resource === 'contact') {
                  if (operation === 'upsert') {
                      const duplicateOption = this.getNodeParameter('duplicateOption', i);
                      const addresses = this.getNodeParameter('addressesUi', i)
                          .addressesValues;
                      const emails = this.getNodeParameter('emailsUi', i)
                          .emailsValues;
                      const faxes = this.getNodeParameter('faxesUi', i)
                          .faxesValues;
                      const socialAccounts = this.getNodeParameter('socialAccountsUi', i)
                          .socialAccountsValues;
                      const phones = this.getNodeParameter('phonesUi', i)
                          .phonesValues;
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          duplicate_option: (0, change_case_1.pascalCase)(duplicateOption),
                      };
                      if (additionalFields.anniversary) {
                          body.anniversary = additionalFields.anniversary;
                      }
                      if (additionalFields.contactType) {
                          body.contact_type = additionalFields.contactType;
                      }
                      if (additionalFields.familyName) {
                          body.family_name = additionalFields.familyName;
                      }
                      if (additionalFields.givenName) {
                          body.given_name = additionalFields.givenName;
                      }
                      if (additionalFields.jobTitle) {
                          body.job_title = additionalFields.jobTitle;
                      }
                      if (additionalFields.leadSourceId) {
                          body.lead_source_id = additionalFields.leadSourceId;
                      }
                      if (additionalFields.middleName) {
                          body.middle_name = additionalFields.middleName;
                      }
                      if (additionalFields.middleName) {
                          body.middle_name = additionalFields.middleName;
                      }
                      if (additionalFields.OptInReason) {
                          body.opt_in_reason = additionalFields.OptInReason;
                      }
                      if (additionalFields.ownerId) {
                          body.owner_id = additionalFields.ownerId;
                      }
                      if (additionalFields.preferredLocale) {
                          body.preferred_locale = additionalFields.preferredLocale;
                      }
                      if (additionalFields.preferredName) {
                          body.preferred_name = additionalFields.preferredName;
                      }
                      if (additionalFields.sourceType) {
                          body.source_type = additionalFields.sourceType;
                      }
                      if (additionalFields.spouseName) {
                          body.spouse_name = additionalFields.spouseName;
                      }
                      if (additionalFields.timezone) {
                          body.time_zone = additionalFields.timezone;
                      }
                      if (additionalFields.website) {
                          body.website = additionalFields.website;
                      }
                      if (additionalFields.ipAddress) {
                          body.origin = { ip_address: additionalFields.ipAddress };
                      }
                      if (additionalFields.companyId) {
                          body.company = { id: additionalFields.companyId };
                      }
                      if (additionalFields.optInReason) {
                          body.opt_in_reason = additionalFields.optInReason;
                      }
                      if (addresses) {
                          body.addresses = (0, GenericFunctions_1.keysToSnakeCase)(addresses);
                      }
                      if (emails) {
                          body.email_addresses = emails;
                      }
                      if (faxes) {
                          body.fax_numbers = faxes;
                      }
                      if (socialAccounts) {
                          body.social_accounts = socialAccounts;
                      }
                      if (phones) {
                          body.phone_numbers = phones;
                      }
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'PUT', '/contacts', body);
                  }
                  if (operation === 'delete') {
                      const contactId = parseInt(this.getNodeParameter('contactId', i), 10);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'DELETE', `/contacts/${contactId}`);
                      responseData = { success: true };
                  }
                  if (operation === 'get') {
                      const contactId = parseInt(this.getNodeParameter('contactId', i), 10);
                      const options = this.getNodeParameter('options', i);
                      if (options.fields) {
                          qs.optional_properties = options.fields;
                      }
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', `/contacts/${contactId}`, {}, qs);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      if (options.email) {
                          qs.email = options.email;
                      }
                      if (options.givenName) {
                          qs.given_name = options.givenName;
                      }
                      if (options.familyName) {
                          qs.family_name = options.familyName;
                      }
                      if (options.order) {
                          qs.order = options.order;
                      }
                      if (options.orderDirection) {
                          qs.order_direction = options.orderDirection;
                      }
                      if (options.since) {
                          qs.since = options.since;
                      }
                      if (options.until) {
                          qs.until = options.until;
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'contacts', 'GET', '/contacts', {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', '/contacts', {}, qs);
                          responseData = responseData.contacts;
                      }
                  }
              }
              if (resource === 'contactNote') {
                  if (operation === 'create') {
                      const userId = this.getNodeParameter('userId', i);
                      const contactId = parseInt(this.getNodeParameter('contactId', i), 10);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          user_id: userId,
                          contact_id: contactId,
                      };
                      (0, GenericFunctions_1.keysToSnakeCase)(additionalFields);
                      if (additionalFields.type) {
                          additionalFields.type = (0, change_case_1.pascalCase)(additionalFields.type);
                      }
                      Object.assign(body, additionalFields);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'POST', '/notes', body);
                  }
                  if (operation === 'delete') {
                      const noteId = this.getNodeParameter('noteId', i);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'DELETE', `/notes/${noteId}`);
                      responseData = { success: true };
                  }
                  if (operation === 'get') {
                      const noteId = this.getNodeParameter('noteId', i);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', `/notes/${noteId}`);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const filters = this.getNodeParameter('filters', i);
                      (0, GenericFunctions_1.keysToSnakeCase)(filters);
                      Object.assign(qs, filters);
                      if (returnAll) {
                          responseData = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'notes', 'GET', '/notes', {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', '/notes', {}, qs);
                          responseData = responseData.notes;
                      }
                  }
                  if (operation === 'update') {
                      const noteId = this.getNodeParameter('noteId', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {};
                      (0, GenericFunctions_1.keysToSnakeCase)(additionalFields);
                      if (additionalFields.type) {
                          additionalFields.type = (0, change_case_1.pascalCase)(additionalFields.type);
                      }
                      Object.assign(body, additionalFields);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'PATCH', `/notes/${noteId}`, body);
                  }
              }
              if (resource === 'contactTag') {
                  if (operation === 'create') {
                      const contactId = parseInt(this.getNodeParameter('contactId', i), 10);
                      const tagIds = this.getNodeParameter('tagIds', i);
                      const body = {
                          tagIds,
                      };
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'POST', `/contacts/${contactId}/tags`, body);
                  }
                  if (operation === 'delete') {
                      const contactId = parseInt(this.getNodeParameter('contactId', i), 10);
                      const tagIds = this.getNodeParameter('tagIds', i);
                      qs.ids = tagIds;
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'DELETE', `/contacts/${contactId}/tags`, {}, qs);
                      responseData = { success: true };
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const contactId = parseInt(this.getNodeParameter('contactId', i), 10);
                      if (returnAll) {
                          responseData = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'tags', 'GET', `/contacts/${contactId}/tags`, {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', `/contacts/${contactId}/tags`, {}, qs);
                          responseData = responseData.tags;
                      }
                  }
              }
              if (resource === 'ecommerceOrder') {
                  if (operation === 'create') {
                      const contactId = parseInt(this.getNodeParameter('contactId', i), 10);
                      const orderDate = this.getNodeParameter('orderDate', i);
                      const orderTitle = this.getNodeParameter('orderTitle', i);
                      const orderType = this.getNodeParameter('orderType', i);
                      const orderItems = this.getNodeParameter('orderItemsUi', i)
                          .orderItemsValues;
                      const shippingAddress = this.getNodeParameter('addressUi', i)
                          .addressValues;
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          contact_id: contactId,
                          order_date: orderDate,
                          order_title: orderTitle,
                          order_type: (0, change_case_1.pascalCase)(orderType),
                      };
                      if (additionalFields.promoCodes) {
                          additionalFields.promoCodes = additionalFields.promoCodes.split(',');
                      }
                      (0, GenericFunctions_1.keysToSnakeCase)(additionalFields);
                      Object.assign(body, additionalFields);
                      body.order_items = (0, GenericFunctions_1.keysToSnakeCase)(orderItems);
                      if (shippingAddress) {
                          body.shipping_address = (0, GenericFunctions_1.keysToSnakeCase)(shippingAddress)[0];
                      }
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'POST', '/orders', body);
                  }
                  if (operation === 'delete') {
                      const orderId = parseInt(this.getNodeParameter('orderId', i), 10);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'DELETE', `/orders/${orderId}`);
                      responseData = { success: true };
                  }
                  if (operation === 'get') {
                      const orderId = parseInt(this.getNodeParameter('orderId', i), 10);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'get', `/orders/${orderId}`);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      (0, GenericFunctions_1.keysToSnakeCase)(options);
                      Object.assign(qs, options);
                      if (returnAll) {
                          responseData = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'orders', 'GET', '/orders', {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', '/orders', {}, qs);
                          responseData = responseData.orders;
                      }
                  }
              }
              if (resource === 'ecommerceProduct') {
                  if (operation === 'create') {
                      const productName = this.getNodeParameter('productName', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          product_name: productName,
                      };
                      (0, GenericFunctions_1.keysToSnakeCase)(additionalFields);
                      Object.assign(body, additionalFields);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'POST', '/products', body);
                  }
                  if (operation === 'delete') {
                      const productId = this.getNodeParameter('productId', i);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'DELETE', `/products/${productId}`);
                      responseData = { success: true };
                  }
                  if (operation === 'get') {
                      const productId = this.getNodeParameter('productId', i);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'get', `/products/${productId}`);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const filters = this.getNodeParameter('filters', i);
                      (0, GenericFunctions_1.keysToSnakeCase)(filters);
                      Object.assign(qs, filters);
                      if (returnAll) {
                          responseData = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'products', 'GET', '/products', {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', '/products', {}, qs);
                          responseData = responseData.products;
                      }
                  }
              }
              if (resource === 'email') {
                  if (operation === 'createRecord') {
                      const sentFromAddress = this.getNodeParameter('sentFromAddress', i);
                      const sendToAddress = this.getNodeParameter('sentToAddress', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          sent_to_address: sendToAddress,
                          sent_from_address: sentFromAddress,
                      };
                      Object.assign(body, additionalFields);
                      (0, GenericFunctions_1.keysToSnakeCase)(body);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'POST', '/emails', body);
                  }
                  if (operation === 'deleteRecord') {
                      const emailRecordId = parseInt(this.getNodeParameter('emailRecordId', i), 10);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'DELETE', `/emails/${emailRecordId}`);
                      responseData = { success: true };
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const filters = this.getNodeParameter('filters', i);
                      (0, GenericFunctions_1.keysToSnakeCase)(filters);
                      Object.assign(qs, filters);
                      if (returnAll) {
                          responseData = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'emails', 'GET', '/emails', {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', '/emails', {}, qs);
                          responseData = responseData.emails;
                      }
                  }
                  if (operation === 'send') {
                      const userId = this.getNodeParameter('userId', i);
                      const contactIds = this.getNodeParameter('contactIds', i)
                          .split(',')
                          .map((e) => parseInt(e, 10));
                      const subject = this.getNodeParameter('subject', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          user_id: userId,
                          contacts: contactIds,
                          subject,
                      };
                      (0, GenericFunctions_1.keysToSnakeCase)(additionalFields);
                      Object.assign(body, additionalFields);
                      const attachmentsUi = this.getNodeParameter('attachmentsUi', i);
                      let attachments = [];
                      if (attachmentsUi) {
                          if (attachmentsUi.attachmentsValues) {
                              (0, GenericFunctions_1.keysToSnakeCase)(attachmentsUi.attachmentsValues);
                              attachments = attachmentsUi.attachmentsValues;
                          }
                          const attachmentsBinary = attachmentsUi.attachmentsBinary;
                          if (attachmentsBinary === null || attachmentsBinary === void 0 ? void 0 : attachmentsBinary.length) {
                              for (const { property } of attachmentsBinary) {
                                  const binaryData = this.helpers.assertBinaryData(i, property);
                                  attachments.push({
                                      file_data: binaryData.data,
                                      file_name: binaryData.fileName,
                                  });
                              }
                          }
                          body.attachments = attachments;
                      }
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'POST', '/emails/queue', body);
                      responseData = { success: true };
                  }
              }
              if (resource === 'file') {
                  if (operation === 'delete') {
                      const fileId = parseInt(this.getNodeParameter('fileId', i), 10);
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'DELETE', `/files/${fileId}`);
                      responseData = { success: true };
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const filters = this.getNodeParameter('filters', i);
                      (0, GenericFunctions_1.keysToSnakeCase)(filters);
                      Object.assign(qs, filters);
                      if (qs.permission) {
                          qs.permission = qs.permission.toUpperCase();
                      }
                      if (qs.type) {
                          qs.type = (0, change_case_1.capitalCase)(qs.type);
                      }
                      if (qs.viewable) {
                          qs.viewable = qs.viewable.toUpperCase();
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.keapApiRequestAllItems.call(this, 'files', 'GET', '/files', {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.keapApiRequest.call(this, 'GET', '/files', {}, qs);
                          responseData = responseData.files;
                      }
                  }
                  if (operation === 'upload') {
                      const fileAssociation = this.getNodeParameter('fileAssociation', i);
                      const isPublic = this.getNodeParameter('isPublic', i);
                      const body = {
                          is_public: isPublic,
                          file_association: fileAssociation.toUpperCase(),
                      };
                      if (fileAssociation === 'contact') {
                          const contactId = parseInt(this.getNodeParameter('contactId', i), 10);
                          body.contact_id = contactId;
                      }
                      if (this.getNodeParameter('binaryData', i)) {
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          body.file_data = binaryData.data;
                          body.file_name = binaryData.fileName;
                      }
                      else {
                          const fileName = this.getNodeParameter('fileName', i);
                          const fileData = this.getNodeParameter('fileData', i);
                          body.file_name = fileName;
                          body.file_data = fileData;
                      }
                      responseData = await GenericFunctions_1.keapApiRequest.call(this, 'POST', '/files', body);
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Keap = Keap;
  //# sourceMappingURL=Keap.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.KeapOAuth2Api = void 0;
  const scopes = ['full'];
  class KeapOAuth2Api {
      constructor() {
          this.name = 'keapOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Keap OAuth2 API';
          this.documentationUrl = 'keap';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://signin.infusionsoft.com/app/oauth/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.infusionsoft.com/token',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: scopes.join(' '),
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.KeapOAuth2Api = KeapOAuth2Api;
  //# sourceMappingURL=KeapOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.KeapOAuth2Api = void 0;
  const scopes = ['full'];
  class KeapOAuth2Api {
      constructor() {
          this.name = 'keapOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Keap OAuth2 API';
          this.documentationUrl = 'keap';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://signin.infusionsoft.com/app/oauth/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.infusionsoft.com/token',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: scopes.join(' '),
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.KeapOAuth2Api = KeapOAuth2Api;
  //# sourceMappingURL=KeapOAuth2Api.credentials.js.map

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

  # Keap node

  Use the Keap node to automate work in Keap, and integrate Keap with other applications. n8n has built-in support for a wide range of Keap features, including creating, updating, deleting, and getting companies, products, ecommerce orders, emails, and files. 

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

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

  ## Operations

  * Company
      * Create a company
      * Retrieve all companies
  * Contact
      * Create/update a contact
      * Delete an contact
      * Retrieve an contact
      * Retrieve all contacts
  * Contact Note
      * Create a note
      * Delete a note
      * Get a notes
      * Retrieve all notes
      * Update a note
  * Contact Tag
      * Add a list of tags to a contact
      * Delete a contact's tag
      * Retrieve all contact's tags
  * Ecommerce Order
      * Create an ecommerce order
      * Get an ecommerce order
      * Delete an ecommerce order
      * Retrieve all ecommerce orders
  * Ecommerce Product
      * Create an ecommerce product
      * Delete an ecommerce product
      * Get an ecommerce product
      * Retrieve all ecommerce product
  * Email
      * Create a record of an email sent to a contact
      * Retrieve all sent emails
      * Send Email
  * File
      * Delete a file
      * Retrieve all files
      * Upload a file

  ## Templates and examples

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

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

example_workflow:
  {"name":"Keap Example Workflow","nodes":[{"parameters":{"resource":"company","dynamic_property":null},"id":"eymyrnnx9zf0s571j1tpzj","name":"Keap","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":"company","options":[{"name":"Company","value":"company"},{"name":"Contact","value":"contact"},{"name":"Contact Note","value":"contactNote"},{"name":"Contact Tag","value":"contactTag"},{"name":"Ecommerce Order","value":"ecommerceOrder"},{"name":"Ecommerce Product","value":"ecommerceProduct"},{"name":"Email","value":"email"},{"name":"File","value":"file"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CompanyDescription_1.companyOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CompanyDescription_1.companyFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContactDescription_1.contactOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContactDescription_1.contactFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContactNoteDescription_1.contactNoteOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContactNoteDescription_1.contactNoteFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContactTagDescription_1.contactTagOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContactTagDescription_1.contactTagFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EcommerceOrderDescripion_1.ecommerceOrderOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EcommerceOrderDescripion_1.ecommerceOrderFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EcommerceProductDescription_1.ecommerceProductOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EcommerceProductDescription_1.ecommerceProductFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EmailDescription_1.emailOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EmailDescription_1.emailFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...FileDescription_1.fileOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...FileDescription_1.fileFields"}]


node_type: n8n-nodes-base.Kafka
name: Kafka
display_name: Kafka
description: Sends messages to a Kafka topic
category: transform
icon: file:kafka.svg
code_hash: 74c45cee3cedf2f42356b732d5025dcedca4654fe4a2c472ffc62e2d27715f7f
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Kafka
documentation_title: Kafka node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"kafka","description":"Templates for kafka"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:48
updated_at: 2025-06-12 08:58:48
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Kafka = void 0;
  const kafkajs_1 = require("kafkajs");
  const confluent_schema_registry_1 = require("@kafkajs/confluent-schema-registry");
  const n8n_workflow_1 = require("n8n-workflow");
  const utilities_1 = require("../../utils/utilities");
  class Kafka {
      constructor() {
          this.description = {
              displayName: 'Kafka',
              name: 'kafka',
              icon: 'file:kafka.svg',
              group: ['transform'],
              version: 1,
              description: 'Sends messages to a Kafka topic',
              defaults: {
                  name: 'Kafka',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'kafka',
                      required: true,
                      testedBy: 'kafkaConnectionTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Topic',
                      name: 'topic',
                      type: 'string',
                      default: '',
                      placeholder: 'topic-name',
                      description: 'Name of the queue of topic to publish to',
                  },
                  {
                      displayName: 'Send Input Data',
                      name: 'sendInputData',
                      type: 'boolean',
                      default: true,
                      description: 'Whether to send the the data the node receives as JSON to Kafka',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      displayOptions: {
                          show: {
                              sendInputData: [false],
                          },
                      },
                      default: '',
                      description: 'The message to be sent',
                  },
                  {
                      displayName: 'JSON Parameters',
                      name: 'jsonParameters',
                      type: 'boolean',
                      default: false,
                  },
                  {
                      displayName: 'Use Schema Registry',
                      name: 'useSchemaRegistry',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to use Confluent Schema Registry',
                  },
                  {
                      displayName: 'Schema Registry URL',
                      name: 'schemaRegistryUrl',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              useSchemaRegistry: [true],
                          },
                      },
                      placeholder: 'https://schema-registry-domain:8081',
                      default: '',
                      description: 'URL of the schema registry',
                  },
                  {
                      displayName: 'Use Key',
                      name: 'useKey',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to use a message key',
                  },
                  {
                      displayName: 'Key',
                      name: 'key',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              useKey: [true],
                          },
                      },
                      placeholder: '',
                      default: '',
                      description: 'The message key',
                  },
                  {
                      displayName: 'Event Name',
                      name: 'eventName',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              useSchemaRegistry: [true],
                          },
                      },
                      default: '',
                      description: 'Namespace and Name of Schema in Schema Registry (namespace.name)',
                  },
                  {
                      displayName: 'Headers',
                      name: 'headersUi',
                      placeholder: 'Add Header',
                      type: 'fixedCollection',
                      displayOptions: {
                          show: {
                              jsonParameters: [false],
                          },
                      },
                      typeOptions: {
                          multipleValues: true,
                      },
                      default: {},
                      options: [
                          {
                              name: 'headerValues',
                              displayName: 'Header',
                              values: [
                                  {
                                      displayName: 'Key',
                                      name: 'key',
                                      type: 'string',
                                      default: '',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Headers (JSON)',
                      name: 'headerParametersJson',
                      type: 'json',
                      displayOptions: {
                          show: {
                              jsonParameters: [true],
                          },
                      },
                      default: '',
                      description: 'Header parameters as JSON (flat object)',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add Option',
                      options: [
                          {
                              displayName: 'Acks',
                              name: 'acks',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not producer must wait for acknowledgement from all replicas',
                          },
                          {
                              displayName: 'Compression',
                              name: 'compression',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to send the data in a compressed format using the GZIP codec',
                          },
                          {
                              displayName: 'Timeout',
                              name: 'timeout',
                              type: 'number',
                              default: 30000,
                              description: 'The time to await a response in ms',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async kafkaConnectionTest(credential) {
                      const credentials = credential.data;
                      try {
                          const brokers = (credentials.brokers || '')
                              .split(',')
                              .map((item) => item.trim());
                          const clientId = credentials.clientId;
                          const ssl = credentials.ssl;
                          const config = {
                              clientId,
                              brokers,
                              ssl,
                          };
                          if (credentials.authentication === true) {
                              if (!(credentials.username && credentials.password)) {
                                  throw Error('Username and password are required for authentication');
                              }
                              config.sasl = {
                                  username: credentials.username,
                                  password: credentials.password,
                                  mechanism: credentials.saslMechanism,
                              };
                          }
                          const kafka = new kafkajs_1.Kafka(config);
                          await kafka.admin().connect();
                          await kafka.admin().disconnect();
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const itemData = (0, utilities_1.generatePairedItemData)(items.length);
          const length = items.length;
          const topicMessages = [];
          let responseData;
          try {
              const options = this.getNodeParameter('options', 0);
              const sendInputData = this.getNodeParameter('sendInputData', 0);
              const useSchemaRegistry = this.getNodeParameter('useSchemaRegistry', 0);
              const timeout = options.timeout;
              let compression = kafkajs_1.CompressionTypes.None;
              const acks = options.acks === true ? 1 : 0;
              if (options.compression === true) {
                  compression = kafkajs_1.CompressionTypes.GZIP;
              }
              const credentials = await this.getCredentials('kafka');
              const brokers = (credentials.brokers || '').split(',').map((item) => item.trim());
              const clientId = credentials.clientId;
              const ssl = credentials.ssl;
              const config = {
                  clientId,
                  brokers,
                  ssl,
              };
              if (credentials.authentication === true) {
                  if (!(credentials.username && credentials.password)) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Username and password are required for authentication');
                  }
                  config.sasl = {
                      username: credentials.username,
                      password: credentials.password,
                      mechanism: credentials.saslMechanism,
                  };
              }
              const kafka = new kafkajs_1.Kafka(config);
              const producer = kafka.producer();
              await producer.connect();
              let message;
              for (let i = 0; i < length; i++) {
                  if (sendInputData) {
                      message = JSON.stringify(items[i].json);
                  }
                  else {
                      message = this.getNodeParameter('message', i);
                  }
                  if (useSchemaRegistry) {
                      try {
                          const schemaRegistryUrl = this.getNodeParameter('schemaRegistryUrl', 0);
                          const eventName = this.getNodeParameter('eventName', 0);
                          const registry = new confluent_schema_registry_1.SchemaRegistry({ host: schemaRegistryUrl });
                          const id = await registry.getLatestSchemaId(eventName);
                          message = await registry.encode(id, JSON.parse(message));
                      }
                      catch (exception) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Verify your Schema Registry configuration');
                      }
                  }
                  const topic = this.getNodeParameter('topic', i);
                  const jsonParameters = this.getNodeParameter('jsonParameters', i);
                  const useKey = this.getNodeParameter('useKey', i);
                  const key = useKey ? this.getNodeParameter('key', i) : null;
                  let headers;
                  if (jsonParameters) {
                      headers = this.getNodeParameter('headerParametersJson', i);
                      try {
                          headers = JSON.parse(headers);
                      }
                      catch (exception) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Headers must be a valid json');
                      }
                  }
                  else {
                      const values = this.getNodeParameter('headersUi', i)
                          .headerValues;
                      headers = {};
                      if (values !== undefined) {
                          for (const value of values) {
                              headers[value.key] = value.value;
                          }
                      }
                  }
                  topicMessages.push({
                      topic,
                      messages: [
                          {
                              value: message,
                              headers,
                              key,
                          },
                      ],
                  });
              }
              responseData = await producer.sendBatch({
                  topicMessages,
                  timeout,
                  compression,
                  acks,
              });
              if (responseData.length === 0) {
                  responseData.push({
                      success: true,
                  });
              }
              await producer.disconnect();
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData });
              return [executionData];
          }
          catch (error) {
              if (this.continueOnFail()) {
                  return [[{ json: { error: error.message }, pairedItem: itemData }]];
              }
              else {
                  throw error;
              }
          }
      }
  }
  exports.Kafka = Kafka;
  //# sourceMappingURL=Kafka.node.js.map

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

  # Kafka node

  Use the Kafka node to automate work in Kafka, and integrate Kafka with other applications. n8n has built-in support for a wide range of Kafka features, including sending messages. 

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

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

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

  ## Operations

  - Send message

  ## Templates and examples

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

example_workflow:
  {"name":"Kafka Example Workflow","nodes":[{"parameters":{"topic":"example-value","sendInputData":true,"message":"example-value","jsonParameters":false,"useSchemaRegistry":false,"schemaRegistryUrl":"https://example.com","useKey":false,"key":"example-value","eventName":"Example Name","headersUi":{},"headerParametersJson":null,"options":{}},"id":"p2uui661g8f9ucc53zqnv4","name":"Kafka","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"topic":"example-value","sendInputData":true,"message":"example-value","jsonParameters":false,"useSchemaRegistry":false,"schemaRegistryUrl":"https://example.com","useKey":false,"key":"example-value","eventName":"Example Name","headersUi":{},"headerParametersJson":null,"options":{}}

properties_schema:
  [{"displayName":"Topic","name":"topic","type":"string","default":"","description":"Name of the queue of topic to publish to","placeholder":"topic-name"},{"displayName":"Send Input Data","name":"sendInputData","type":"boolean","default":true,"description":"Whether to send the the data the node receives as JSON to Kafka"},{"displayName":"Message","name":"message","type":"string","default":"","description":"The message to be sent"},{"displayName":"JSON Parameters","name":"jsonParameters","type":"boolean","default":false},{"displayName":"Use Schema Registry","name":"useSchemaRegistry","type":"boolean","default":false,"description":"Whether to use Confluent Schema Registry"},{"displayName":"Schema Registry URL","name":"schemaRegistryUrl","type":"string","default":"","required":true,"description":"URL of the schema registry","placeholder":"https://schema-registry-domain:8081"},{"displayName":"Use Key","name":"useKey","type":"boolean","default":false,"description":"Whether to use a message key"},{"displayName":"Key","name":"key","type":"string","default":"","required":true,"description":"The message key"},{"displayName":"Event Name","name":"eventName","type":"string","default":"","required":true,"description":"Namespace and Name of Schema in Schema Registry (namespace.name)"},{"displayName":"Headers","name":"headersUi","type":"fixedCollection","default":"{","placeholder":"Add Header"},{"displayName":"Headers (JSON)","name":"headerParametersJson","type":"json","default":"","description":"Header parameters as JSON (flat object)"},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Whether or not producer must wait for acknowledgement from all replicas","placeholder":"Add Option"}]


node_type: n8n-nodes-base.Kitemaker
name: Kitemaker
display_name: Kitemaker
description: Consume the Kitemaker GraphQL API
category: input
icon: file:kitemaker.svg
code_hash: d77a6740a8ec5ce77b62d5069a0e2bd6349891c973f38cf5d4fc6242c854c0ba
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Kitemaker
documentation_title: Kitemaker node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"kitemaker","description":"Templates for kitemaker"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"organization","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:50
updated_at: 2025-06-12 08:58:50
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Kitemaker = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const queries_1 = require("./queries");
  const mutations_1 = require("./mutations");
  class Kitemaker {
      constructor() {
          this.description = {
              displayName: 'Kitemaker',
              name: 'kitemaker',
              icon: 'file:kitemaker.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
              description: 'Consume the Kitemaker GraphQL API',
              defaults: {
                  name: 'Kitemaker',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'kitemakerApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Space',
                              value: 'space',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                          {
                              name: 'Work Item',
                              value: 'workItem',
                          },
                      ],
                      default: 'workItem',
                      required: true,
                  },
                  ...descriptions_1.organizationOperations,
                  ...descriptions_1.spaceOperations,
                  ...descriptions_1.spaceFields,
                  ...descriptions_1.userOperations,
                  ...descriptions_1.userFields,
                  ...descriptions_1.workItemOperations,
                  ...descriptions_1.workItemFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLabels() {
                      const responseData = await GenericFunctions_1.kitemakerRequest.call(this, { query: queries_1.getLabels });
                      const { data: { organization: { spaces }, }, } = responseData;
                      return (0, GenericFunctions_1.createLoadOptions)(spaces[0].labels);
                  },
                  async getSpaces() {
                      const responseData = await GenericFunctions_1.kitemakerRequest.call(this, { query: queries_1.getSpaces });
                      const { data: { organization: { spaces }, }, } = responseData;
                      return (0, GenericFunctions_1.createLoadOptions)(spaces);
                  },
                  async getStatuses() {
                      const spaceId = this.getNodeParameter('spaceId', 0);
                      if (!spaceId.length) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please choose a space to set for the work item to create.');
                      }
                      const responseData = await GenericFunctions_1.kitemakerRequest.call(this, { query: queries_1.getStatuses });
                      const { data: { organization: { spaces }, }, } = responseData;
                      const space = spaces.find((e) => e.id === spaceId);
                      return (0, GenericFunctions_1.createLoadOptions)(space.statuses);
                  },
                  async getUsers() {
                      const responseData = await GenericFunctions_1.kitemakerRequest.call(this, { query: queries_1.getUsers });
                      const { data: { organization: { users }, }, } = responseData;
                      return (0, GenericFunctions_1.createLoadOptions)(users);
                  },
                  async getWorkItems() {
                      const spaceId = this.getNodeParameter('spaceId', 0);
                      const responseData = await GenericFunctions_1.kitemakerRequest.call(this, {
                          query: queries_1.getWorkItems,
                          variables: { spaceId },
                      });
                      const { data: { workItems: { workItems }, }, } = responseData;
                      return (0, GenericFunctions_1.createLoadOptions)(workItems);
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              if (resource === 'organization') {
                  if (operation === 'get') {
                      responseData = await GenericFunctions_1.kitemakerRequest.call(this, {
                          query: queries_1.getOrganization,
                      });
                      responseData = responseData.data.organization;
                  }
              }
              else if (resource === 'space') {
                  if (operation === 'getAll') {
                      const allItems = await GenericFunctions_1.kitemakerRequestAllItems.call(this, {
                          query: queries_1.getAllSpaces,
                          variables: {},
                      });
                      responseData = allItems;
                  }
              }
              else if (resource === 'user') {
                  if (operation === 'getAll') {
                      const allItems = await GenericFunctions_1.kitemakerRequestAllItems.call(this, {
                          query: queries_1.getAllUsers,
                          variables: {},
                      });
                      responseData = allItems;
                  }
              }
              else if (resource === 'workItem') {
                  if (operation === 'create') {
                      const input = {
                          title: this.getNodeParameter('title', i),
                          statusId: this.getNodeParameter('statusId', i),
                      };
                      if (!input.statusId.length) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter a status to set for the work item to create.', { itemIndex: i });
                      }
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (Object.keys(additionalFields).length) {
                          Object.assign(input, additionalFields);
                      }
                      responseData = await GenericFunctions_1.kitemakerRequest.call(this, {
                          query: mutations_1.createWorkItem,
                          variables: { input },
                      });
                      responseData = responseData.data.createWorkItem.workItem;
                  }
                  else if (operation === 'get') {
                      const workItemId = this.getNodeParameter('workItemId', i);
                      responseData = await GenericFunctions_1.kitemakerRequest.call(this, {
                          query: queries_1.getWorkItem,
                          variables: { workItemId },
                      });
                      responseData = responseData.data.workItem;
                  }
                  else if (operation === 'getAll') {
                      const allItems = await GenericFunctions_1.kitemakerRequestAllItems.call(this, {
                          query: queries_1.getAllWorkItems,
                          variables: {
                              spaceId: this.getNodeParameter('spaceId', i),
                          },
                      });
                      responseData = allItems;
                  }
                  else if (operation === 'update') {
                      const input = {
                          id: this.getNodeParameter('workItemId', i),
                      };
                      const updateFields = this.getNodeParameter('updateFields', i);
                      if (!Object.keys(updateFields).length) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter at least one field to update for the work item.', { itemIndex: i });
                      }
                      Object.assign(input, updateFields);
                      responseData = await GenericFunctions_1.kitemakerRequest.call(this, {
                          query: mutations_1.editWorkItem,
                          variables: { input },
                      });
                      responseData = responseData.data.editWorkItem.workItem;
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Kitemaker = Kitemaker;
  //# sourceMappingURL=Kitemaker.node.js.map

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

  // --- Next Credential File ---

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

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

  # Kitemaker node

  Use the Kitemaker node to automate work in Kitemaker, and integrate Kitemaker with other applications. n8n has built-in support for a wide range of Kitemaker features, including retrieving data on organizations, spaces and users, as well as creating, getting, and updating work items. 

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

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

  ## Operations

  * Organization
      * Retrieve data on the logged-in user's organization.
  * Space
      * Retrieve data on all the spaces in the logged-in user's organization.
  * User
      * Retrieve data on all the users in the logged-in user's organization.
  * Work Item
      * Create
      * Get
      * Get All
      * Update

  ## Templates and examples

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

example_workflow:
  {"name":"Kitemaker Example Workflow","nodes":[{"parameters":{"resource":"organization","dynamic_property":null},"id":"hxir2z22y6clbpbdv5sx","name":"Kitemaker","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":"workItem","required":true,"options":[{"name":"Organization","value":"organization"},{"name":"Space","value":"space"},{"name":"User","value":"user"},{"name":"Work Item","value":"workItem"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.organizationOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.spaceOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.spaceFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.userOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.userFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.workItemOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.workItemFields"}]


node_type: n8n-nodes-base.Line
name: Line
display_name: Line
description: Consume Line API
category: input
icon: file:line.png
code_hash: c8d8b4834af3201e0b176fa5da6263bbb5882a92e7a82b42f8d86470310e9fda
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Line
documentation_title: Line node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"line","description":"Templates for line"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"notification","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:50
updated_at: 2025-06-12 08:58:50
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Line = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const NotificationDescription_1 = require("./NotificationDescription");
  class Line {
      constructor() {
          this.description = {
              displayName: 'Line',
              name: 'line',
              icon: 'file:line.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Line API',
              defaults: {
                  name: 'Line',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'lineNotifyOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['notification'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Notification',
                              value: 'notification',
                          },
                      ],
                      default: 'notification',
                  },
                  ...NotificationDescription_1.notificationOperations,
                  ...NotificationDescription_1.notificationFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'notification') {
                      if (operation === 'send') {
                          const message = this.getNodeParameter('message', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              message,
                          };
                          Object.assign(body, additionalFields);
                          if (body.hasOwnProperty('notificationDisabled')) {
                              body.notificationDisabled = body.notificationDisabled ? 'true' : 'false';
                          }
                          if (body.stickerUi) {
                              const sticker = body.stickerUi.stickerValue;
                              if (sticker) {
                                  body.stickerId = sticker.stickerId;
                                  body.stickerPackageId = sticker.stickerPackageId;
                              }
                              delete body.stickerUi;
                          }
                          if (body.imageUi) {
                              const image = body.imageUi.imageValue;
                              if (image && image.binaryData === true) {
                                  const binaryProperty = image.binaryProperty;
                                  const binaryData = this.helpers.assertBinaryData(i, binaryProperty);
                                  const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty);
                                  body.imageFile = {
                                      value: binaryDataBuffer,
                                      options: {
                                          filename: binaryData.fileName,
                                      },
                                  };
                              }
                              else {
                                  body.imageFullsize = image.imageFullsize;
                                  body.imageThumbnail = image.imageThumbnail;
                              }
                              delete body.imageUi;
                          }
                          responseData = await GenericFunctions_1.lineApiRequest.call(this, 'POST', '', {}, {}, 'https://notify-api.line.me/api/notify', { formData: body });
                      }
                  }
                  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.Line = Line;
  //# sourceMappingURL=Line.node.js.map

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

  # Line node

  <!-- vale off -->
  /// warning | Deprecated: End of service
  LINE Notify is discontinuing service as of April 1st 2025 and this node will no longer work after that date. View LINE Notify's [end of service announement](https://notify-bot.line.me/closing-announce){:target=_blank .external-link} for more information.
  ///
  <!-- vale on -->

  Use the Line node to automate work in Line, and integrate Line with other applications. n8n has built-in support for a wide range of Line features, including sending notifications. 

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

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

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

  ## Operations

  * Notification
      * Sends notifications to users or groups

  ## Templates and examples

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

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

example_workflow:
  {"name":"Line Example Workflow","nodes":[{"parameters":{"resource":"notification","dynamic_property":null},"id":"28kisycbv77iqy3r631y9h","name":"Line","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":"notification","options":[{"name":"Notification","value":"notification"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...NotificationDescription_1.notificationOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...NotificationDescription_1.notificationFields"}]


node_type: n8n-nodes-base.Lemlist
name: Lemlist
display_name: Lemlist
description: Consume the Lemlist API
category: transform
icon: file:lemlist.svg
code_hash: 874dd1c1de4d3bc41d4acb8e78a610448f7e2fbf0025090f94cbed80261b1fa8
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Lemlist
documentation_title: Lemlist node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"lemlist","description":"Templates for lemlist"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"activity","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:50
updated_at: 2025-06-12 08:58:50
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.Lemlist = void 0;
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  const omit_1 = __importDefault(require("lodash/omit"));
  class Lemlist {
      constructor() {
          this.description = {
              displayName: 'Lemlist',
              name: 'lemlist',
              icon: 'file:lemlist.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Lemlist API',
              defaults: {
                  name: 'Lemlist',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'lemlistApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                          {
                              name: 'Campaign',
                              value: 'campaign',
                          },
                          {
                              name: 'Lead',
                              value: 'lead',
                          },
                          {
                              name: 'Team',
                              value: 'team',
                          },
                          {
                              name: 'Unsubscribe',
                              value: 'unsubscribe',
                          },
                      ],
                      default: 'activity',
                  },
                  ...descriptions_1.activityOperations,
                  ...descriptions_1.activityFields,
                  ...descriptions_1.campaignOperations,
                  ...descriptions_1.campaignFields,
                  ...descriptions_1.leadOperations,
                  ...descriptions_1.leadFields,
                  ...descriptions_1.teamOperations,
                  ...descriptions_1.teamFields,
                  ...descriptions_1.unsubscribeOperations,
                  ...descriptions_1.unsubscribeFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCampaigns() {
                      const campaigns = await GenericFunctions_1.lemlistApiRequest.call(this, 'GET', '/campaigns');
                      return campaigns.map(({ _id, name }) => ({
                          name,
                          value: _id,
                      }));
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'activity') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (!(0, isEmpty_1.default)(filters)) {
                              Object.assign(qs, filters);
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.lemlistApiRequestAllItems.call(this, 'GET', '/activities', qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'GET', '/activities', {}, qs);
                          }
                      }
                  }
                  else if (resource === 'campaign') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.lemlistApiRequestAllItems.call(this, 'GET', '/campaigns', {});
                          }
                          else {
                              const qs = {
                                  limit: this.getNodeParameter('limit', i),
                              };
                              responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'GET', '/campaigns', {}, qs);
                          }
                      }
                  }
                  else if (resource === 'lead') {
                      if (operation === 'create') {
                          const qs = {};
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.deduplicate !== undefined) {
                              qs.deduplicate = additionalFields.deduplicate;
                          }
                          const body = {};
                          const remainingAdditionalFields = (0, omit_1.default)(additionalFields, 'deduplicate');
                          if (!(0, isEmpty_1.default)(remainingAdditionalFields)) {
                              Object.assign(body, remainingAdditionalFields);
                          }
                          const campaignId = this.getNodeParameter('campaignId', i);
                          const email = this.getNodeParameter('email', i);
                          const endpoint = `/campaigns/${campaignId}/leads/${email}`;
                          responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'POST', endpoint, body, qs);
                      }
                      else if (operation === 'delete') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          const email = this.getNodeParameter('email', i);
                          const endpoint = `/campaigns/${campaignId}/leads/${email}`;
                          responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'DELETE', endpoint, {}, { action: 'remove' });
                      }
                      else if (operation === 'get') {
                          const email = this.getNodeParameter('email', i);
                          responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'GET', `/leads/${email}`);
                      }
                      else if (operation === 'unsubscribe') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          const email = this.getNodeParameter('email', i);
                          const endpoint = `/campaigns/${campaignId}/leads/${email}`;
                          responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'DELETE', endpoint);
                      }
                  }
                  else if (resource === 'team') {
                      if (operation === 'get') {
                          responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'GET', '/team');
                      }
                  }
                  else if (resource === 'unsubscribe') {
                      if (operation === 'add') {
                          const email = this.getNodeParameter('email', i);
                          responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'POST', `/unsubscribes/${email}`);
                      }
                      else if (operation === 'delete') {
                          const email = this.getNodeParameter('email', i);
                          responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'DELETE', `/unsubscribes/${email}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.lemlistApiRequestAllItems.call(this, 'GET', '/unsubscribes', {});
                          }
                          else {
                              const qs = {
                                  limit: this.getNodeParameter('limit', i),
                              };
                              responseData = await GenericFunctions_1.lemlistApiRequest.call(this, 'GET', '/unsubscribes', {}, qs);
                          }
                      }
                  }
              }
              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.Lemlist = Lemlist;
  //# sourceMappingURL=Lemlist.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LemlistApi = void 0;
  class LemlistApi {
      constructor() {
          this.name = 'lemlistApi';
          this.displayName = 'Lemlist API';
          this.documentationUrl = 'lemlist';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.test = {
              request: {
                  baseURL: 'https://api.lemlist.com/api',
                  url: '/campaigns',
              },
          };
      }
      async authenticate(credentials, requestOptions) {
          const encodedApiKey = Buffer.from(':' + credentials.apiKey).toString('base64');
          requestOptions.headers.Authorization = `Basic ${encodedApiKey}`;
          requestOptions.headers['user-agent'] = 'n8n';
          return requestOptions;
      }
  }
  exports.LemlistApi = LemlistApi;
  //# sourceMappingURL=LemlistApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LemlistApi = void 0;
  class LemlistApi {
      constructor() {
          this.name = 'lemlistApi';
          this.displayName = 'Lemlist API';
          this.documentationUrl = 'lemlist';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.test = {
              request: {
                  baseURL: 'https://api.lemlist.com/api',
                  url: '/campaigns',
              },
          };
      }
      async authenticate(credentials, requestOptions) {
          const encodedApiKey = Buffer.from(':' + credentials.apiKey).toString('base64');
          requestOptions.headers.Authorization = `Basic ${encodedApiKey}`;
          requestOptions.headers['user-agent'] = 'n8n';
          return requestOptions;
      }
  }
  exports.LemlistApi = LemlistApi;
  //# sourceMappingURL=LemlistApi.credentials.js.map

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

  # Lemlist node

  Use the Lemlist node to automate work in Lemlist, and integrate Lemlist with other applications. n8n has built-in support for a wide range of Lemlist features, including getting activities, teams and campaigns, as well as creating, updating, and deleting leads. 

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

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

  ## Operations

  <!-- vale from-write-good.Weasel = NO -->
  <!-- vale from-write-good.TooWordy = NO -->
  * Activity
      * Get Many: Get many activities
  * Campaign
      * Get Many: Get many campaigns
      * Get Stats: Get campaign stats
  * Enrichment
  	* Get: Fetches a previously completed enrichment
  	* Enrich Lead: Enrich a lead using an email or LinkedIn URL
  	* Enrich Person: Enrich a person using an email or LinkedIn URL
  * Lead
      * Create: Create a new lead
      * Delete: Delete an existing lead
      * Get: Get an existing lead
      * Unsubscribe: Unsubscribe an existing lead
  * Team
      * Get: Get an existing team
  	* Get Credits: Get an existing team's credits
  * Unsubscribe
      * Add: Add an email to an unsubscribe list
      * Delete: Delete an email from an unsubscribe list
      * Get Many: Get many unsubscribed emails
  <!-- vale from-write-good.TooWordy = YES -->
  <!-- vale from-write-good.Weasel = YES -->

  ## Templates and examples

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

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

example_workflow:
  {"name":"Lemlist Example Workflow","nodes":[{"parameters":{"resource":"activity","dynamic_property":null},"id":"62vrh0l11971zjfaohstcp","name":"Lemlist","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":"activity","options":[{"name":"Activity","value":"activity"},{"name":"Campaign","value":"campaign"},{"name":"Lead","value":"lead"},{"name":"Team","value":"team"},{"name":"Unsubscribe","value":"unsubscribe"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.activityOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.activityFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.campaignOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.campaignFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.leadOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.leadFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.teamOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.teamFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.unsubscribeOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.unsubscribeFields"}]


node_type: n8n-nodes-base.KoBoToolbox
name: KoBoToolbox
display_name: KoBoToolbox
description: Work with KoBoToolbox forms and submissions
category: transform
icon: file:koBoToolbox.svg
code_hash: c9c4bb6871c6b52d5ab1470bb539737a94680fae02acf480bc6fb2b8b8c57a7f
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.KoBoToolbox
documentation_title: KoboToolbox node documentation
operations: []
api_methods: []
templates: [{"name":"kobotoolbox","description":"Templates for kobotoolbox"}]
related_resources: []
required_scopes: []
parameter_schemas: []
version_info: {"breakingChanges":[],"currentVersion":"38.527"}
example_parameters: {"resource":"file","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:50
updated_at: 2025-06-12 08:58:50
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.KoBoToolbox = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const FormDescription_1 = require("./FormDescription");
  const SubmissionDescription_1 = require("./SubmissionDescription");
  const HookDescription_1 = require("./HookDescription");
  const FileDescription_1 = require("./FileDescription");
  class KoBoToolbox {
      constructor() {
          this.description = {
              displayName: 'KoBoToolbox',
              name: 'koBoToolbox',
              icon: 'file:koBoToolbox.svg',
              group: ['transform'],
              version: 1,
              description: 'Work with KoBoToolbox forms and submissions',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'KoBoToolbox',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'koBoToolboxApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Form',
                              value: 'form',
                          },
                          {
                              name: 'Hook',
                              value: 'hook',
                          },
                          {
                              name: 'Submission',
                              value: 'submission',
                          },
                      ],
                      default: 'submission',
                      required: true,
                  },
                  ...FormDescription_1.formOperations,
                  ...FormDescription_1.formFields,
                  ...HookDescription_1.hookOperations,
                  ...HookDescription_1.hookFields,
                  ...SubmissionDescription_1.submissionOperations,
                  ...SubmissionDescription_1.submissionFields,
                  ...FileDescription_1.fileOperations,
                  ...FileDescription_1.fileFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  loadForms: GenericFunctions_1.loadForms,
              },
          };
      }
      async execute() {
          var _a, _b, _c, _d, _e, _f;
          let responseData;
          let returnData = [];
          const binaryItems = [];
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              if (resource === 'form') {
                  if (operation === 'get') {
                      const formId = this.getNodeParameter('formId', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              url: `/api/v2/assets/${formId}`,
                          }),
                      ];
                  }
                  if (operation === 'getAll') {
                      const formQueryOptions = this.getNodeParameter('options', i);
                      const formFilterOptions = this.getNodeParameter('filters', i);
                      responseData = await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                          url: '/api/v2/assets/',
                          qs: {
                              limit: this.getNodeParameter('limit', i, 1000),
                              ...(formFilterOptions.filter && { q: formFilterOptions.filter }),
                              ...(((_b = (_a = formQueryOptions === null || formQueryOptions === void 0 ? void 0 : formQueryOptions.sort) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.ordering) && {
                                  ordering: (((_d = (_c = formQueryOptions === null || formQueryOptions === void 0 ? void 0 : formQueryOptions.sort) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.descending) ? '-' : '') +
                                      ((_f = (_e = formQueryOptions === null || formQueryOptions === void 0 ? void 0 : formQueryOptions.sort) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.ordering),
                              }),
                          },
                          scroll: this.getNodeParameter('returnAll', i),
                      });
                  }
                  if (operation === 'redeploy') {
                      const formId = this.getNodeParameter('formId', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              method: 'PATCH',
                              url: `/api/v2/assets/${formId}/deployment/`,
                          }),
                      ];
                  }
              }
              if (resource === 'submission') {
                  const formId = this.getNodeParameter('formId', i);
                  if (operation === 'getAll') {
                      const submissionQueryOptions = this.getNodeParameter('options', i);
                      const filterJson = this.getNodeParameter('filterJson', i, null);
                      responseData = await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                          url: `/api/v2/assets/${formId}/data/`,
                          qs: {
                              limit: this.getNodeParameter('limit', i, 1000),
                              ...(filterJson && { query: filterJson }),
                              ...(submissionQueryOptions.sort && { sort: submissionQueryOptions.sort }),
                              ...(submissionQueryOptions.fields && {
                                  fields: JSON.stringify((0, GenericFunctions_1.parseStringList)(submissionQueryOptions.fields)),
                              }),
                          },
                          scroll: this.getNodeParameter('returnAll', i),
                      });
                      if (submissionQueryOptions.reformat) {
                          responseData = responseData.map((submission) => {
                              return (0, GenericFunctions_1.formatSubmission)(submission, (0, GenericFunctions_1.parseStringList)(submissionQueryOptions.selectMask), (0, GenericFunctions_1.parseStringList)(submissionQueryOptions.numberMask));
                          });
                      }
                      if (submissionQueryOptions.download) {
                          for (const submission of responseData) {
                              binaryItems.push(await GenericFunctions_1.downloadAttachments.call(this, submission, submissionQueryOptions));
                          }
                      }
                  }
                  if (operation === 'get') {
                      const submissionId = this.getNodeParameter('submissionId', i);
                      const options = this.getNodeParameter('options', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              url: `/api/v2/assets/${formId}/data/${submissionId}`,
                              qs: {
                                  ...(options.fields && {
                                      fields: JSON.stringify((0, GenericFunctions_1.parseStringList)(options.fields)),
                                  }),
                              },
                          }),
                      ];
                      if (options.reformat) {
                          responseData = responseData.map((submission) => {
                              return (0, GenericFunctions_1.formatSubmission)(submission, (0, GenericFunctions_1.parseStringList)(options.selectMask), (0, GenericFunctions_1.parseStringList)(options.numberMask));
                          });
                      }
                      if (options.download) {
                          for (const submission of responseData) {
                              binaryItems.push(await GenericFunctions_1.downloadAttachments.call(this, submission, options));
                          }
                      }
                  }
                  if (operation === 'delete') {
                      const id = this.getNodeParameter('submissionId', i);
                      await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                          method: 'DELETE',
                          url: `/api/v2/assets/${formId}/data/${id}`,
                      });
                      responseData = [
                          {
                              success: true,
                          },
                      ];
                  }
                  if (operation === 'getValidation') {
                      const submissionId = this.getNodeParameter('submissionId', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              url: `/api/v2/assets/${formId}/data/${submissionId}/validation_status/`,
                          }),
                      ];
                  }
                  if (operation === 'setValidation') {
                      const submissionId = this.getNodeParameter('submissionId', i);
                      const status = this.getNodeParameter('validationStatus', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              method: 'PATCH',
                              url: `/api/v2/assets/${formId}/data/${submissionId}/validation_status/`,
                              body: {
                                  'validation_status.uid': status,
                              },
                          }),
                      ];
                  }
              }
              if (resource === 'hook') {
                  const formId = this.getNodeParameter('formId', i);
                  if (operation === 'getAll') {
                      responseData = await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                          url: `/api/v2/assets/${formId}/hooks/`,
                          qs: {
                              limit: this.getNodeParameter('limit', i, 1000),
                          },
                          scroll: this.getNodeParameter('returnAll', i),
                      });
                  }
                  if (operation === 'get') {
                      const hookId = this.getNodeParameter('hookId', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              url: `/api/v2/assets/${formId}/hooks/${hookId}`,
                          }),
                      ];
                  }
                  if (operation === 'retryAll') {
                      const hookId = this.getNodeParameter('hookId', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              method: 'PATCH',
                              url: `/api/v2/assets/${formId}/hooks/${hookId}/retry/`,
                          }),
                      ];
                  }
                  if (operation === 'getLogs') {
                      const hookId = this.getNodeParameter('hookId', i);
                      const startDate = this.getNodeParameter('startDate', i, null);
                      const endDate = this.getNodeParameter('endDate', i, null);
                      const status = this.getNodeParameter('status', i, null);
                      responseData = await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                          url: `/api/v2/assets/${formId}/hooks/${hookId}/logs/`,
                          qs: {
                              ...(startDate && { start: startDate }),
                              ...(endDate && { end: endDate }),
                              ...(status && { status }),
                          },
                      });
                  }
                  if (operation === 'retryOne') {
                      const hookId = this.getNodeParameter('hookId', i);
                      const logId = this.getNodeParameter('logId', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              method: 'PATCH',
                              url: `/api/v2/assets/${formId}/hooks/${hookId}/logs/${logId}/retry/`,
                          }),
                      ];
                  }
              }
              if (resource === 'file') {
                  const formId = this.getNodeParameter('formId', i);
                  if (operation === 'getAll') {
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              url: `/api/v2/assets/${formId}/files`,
                              qs: {
                                  file_type: 'form_media',
                              },
                              scroll: true,
                          }),
                      ];
                  }
                  if (operation === 'get') {
                      const fileId = this.getNodeParameter('fileId', i);
                      const download = this.getNodeParameter('download', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              url: `/api/v2/assets/${formId}/files/${fileId}`,
                          }),
                      ];
                      if ((responseData === null || responseData === void 0 ? void 0 : responseData[0]) && download) {
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryItem = {
                              json: responseData[0],
                              binary: {},
                          };
                          const response = await GenericFunctions_1.koBoToolboxRawRequest.call(this, {
                              url: `/api/v2/assets/${formId}/files/${fileId}/content`,
                              encoding: 'arraybuffer',
                          });
                          console.dir(response);
                          binaryItem.binary[binaryPropertyName] = await this.helpers.prepareBinaryData(response, responseData[0].metadata.filename);
                          binaryItems.push(binaryItem);
                      }
                  }
                  if (operation === 'delete') {
                      const fileId = this.getNodeParameter('fileId', i);
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              method: 'DELETE',
                              url: `/api/v2/assets/${formId}/files/${fileId}`,
                          }),
                      ];
                  }
                  if (operation === 'create') {
                      const fileMode = this.getNodeParameter('fileMode', i);
                      const body = {
                          description: 'Uploaded file',
                          file_type: 'form_media',
                      };
                      if ('binary' === fileMode) {
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const item = items[i].binary;
                          const binaryData = item[binaryPropertyName];
                          body.base64Encoded = 'data:' + binaryData.mimeType + ';base64,' + binaryData.data;
                          body.metadata = {
                              filename: binaryData.fileName,
                          };
                      }
                      else {
                          const fileUrl = this.getNodeParameter('fileUrl', i);
                          body.metadata = {
                              redirect_url: fileUrl,
                          };
                      }
                      responseData = [
                          await GenericFunctions_1.koBoToolboxApiRequest.call(this, {
                              method: 'POST',
                              url: `/api/v2/assets/${formId}/files/`,
                              body,
                          }),
                      ];
                  }
              }
              returnData = returnData.concat(responseData);
          }
          return binaryItems.length > 0 ? [binaryItems] : [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.KoBoToolbox = KoBoToolbox;
  //# sourceMappingURL=KoBoToolbox.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.KoBoToolboxApi = void 0;
  class KoBoToolboxApi {
      constructor() {
          this.name = 'koBoToolboxApi';
          this.displayName = 'KoBoToolbox API Token';
          this.documentationUrl = 'koBoToolbox';
          this.properties = [
              {
                  displayName: 'API Root URL',
                  name: 'URL',
                  type: 'string',
                  default: 'https://kf.kobotoolbox.org/',
              },
              {
                  displayName: 'API Token',
                  name: 'token',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  hint: 'You can get your API token at https://[api-root]/token/?format=json (for a logged in user)',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Token {{$credentials.token}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.URL}}',
                  url: '/api/v2/assets/',
                  method: 'GET',
              },
          };
      }
  }
  exports.KoBoToolboxApi = KoBoToolboxApi;
  //# sourceMappingURL=KoBoToolboxApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.KoBoToolboxApi = void 0;
  class KoBoToolboxApi {
      constructor() {
          this.name = 'koBoToolboxApi';
          this.displayName = 'KoBoToolbox API Token';
          this.documentationUrl = 'koBoToolbox';
          this.properties = [
              {
                  displayName: 'API Root URL',
                  name: 'URL',
                  type: 'string',
                  default: 'https://kf.kobotoolbox.org/',
              },
              {
                  displayName: 'API Token',
                  name: 'token',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  hint: 'You can get your API token at https://[api-root]/token/?format=json (for a logged in user)',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Token {{$credentials.token}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.URL}}',
                  url: '/api/v2/assets/',
                  method: 'GET',
              },
          };
      }
  }
  exports.KoBoToolboxApi = KoBoToolboxApi;
  //# sourceMappingURL=KoBoToolboxApi.credentials.js.map

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

  # KoboToolbox node

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

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

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

  ## Operations

  * File
  	* Create
  	* Delete
  	* Get
  	* Get Many
  * Form
      * Get
      * Get Many
  		* Redeploy
  * Hook
      * Get
      * Get Many
      * Logs
      * Retry All
      * Retry One
  * Submission
      * Delete
      * Get
      * Get Many
      * Get Validation Status
      * Update Validation Status

  ## Templates and examples

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

  ## Options

  ### Query Options

  The Query Submission operation supports query options:

  * In the main section of the **Parameters** panel:
      * **Start** controls the index offset to start the query from (to use the API pagination logic).
      * **Limit** sets the maximum number of records to return. Note that the API always has a limit of 30,000 returned records, whatever value you provide.
  * In the **Query Options** section, you can activate the following parameters:
      * **Query** lets you specify filter predicates in MongoDB's JSON query format. For example: `{"status": "success", "_submission_time": {"$lt": "2021-11-01T01:02:03"}}` queries for all submissions with the value `success` for the field `status`, and submitted before November 1st, 2021, 01:02:03.
      * **Fields** lets you specify the list of fields you want to fetch, to make the response lighter.
      * **Sort** lets you provide a list of sorting criteria in MongoDB JSON format. For example, `{"status": 1, "_submission_time": -1}` specifies a sort order by ascending status, and then descending submission time.

  More details about these options can be found in the [Formhub API docs](https://github.com/SEL-Columbia/formhub/wiki/Formhub-Access-Points-(API)#api-parameters)

  ### Submission options

  All operations that return form submission data offer options to tweak the response. These include:

  - Download options lets you download any attachment linked to each particular form submissions, such as pictures and videos. It also lets you select the naming pattern, and the file size to download (if available - typically for images). 
  - Formatting options perform some reformatting as described in [About reformatting](#about-reformatting).

  #### About reformatting

  The default JSON format for KoboToolbox submission data is sometimes hard to deal with, because it's not schema-aware, and all fields are therefore returned as strings.

  This node provides a lightweight opinionated reformatting logic, enabled with the **Reformat?** parameter, available on all operations that return form submissions: the submission query, get, and the attachment download operations.

  When enabled, the reformatting:

  - Reorganizes the JSON into a multi-level hierarchy following the form's groups. By default, question grouping hierarchy is materialized by a `/` character in the field names, for example `Group1/Question1`. With reformatting enabled, n8n reorganizes these into `Group1.Question1`, as nested JSON objects.
  - Renames fields to trim `_` (not supported by many downstream systems).
  - Parses all geospatial fields (Point, Line, and Area question types) into their standard GeoJSON equivalent.
  - Splits all fields matching any of the **Multiselect Mask** wildcard masks into an array. Since the multi-select fields appear as space-separated strings, they can't be guessed algorithmically, so you must provide a field naming mask. Format the masks as a comma-separated list. Lists support the `*` wildcard.
  - Converts all fields matching any of the **Number Mask** wildcard masks into a JSON float.

  Here's a detailed example in JSON:

  ```json
  {
    "_id": 471987,
    "formhub/uuid": "189436bb09a54957bfcc798e338b54d6",
    "start": "2021-12-05T16:13:38.527+02:00",
    "end": "2021-12-05T16:15:33.407+02:00",
    "Field_Details/Field_Name": "Test Fields",
    "Field_Details/Field_Location": "-1.932914 30.078211 1421 165",
    "Field_Details/Field_Shape": "-1.932914 30.078211 1421 165;-1.933011 30.078085 0 0;-1.933257 30.078004 0 0;-1.933338 30.078197 0 0;-1.933107 30.078299 0 0;-1.932914 30.078211 1421 165",
    "Field_Details/Crops_Grown": "maize beans avocado",
    "Field_Details/Field_Size_sqm": "2300",
    "__version__": "veGcULpqP6JNFKRJbbMvMs",
    "meta/instanceID": "uuid:2356cbbe-c1fd-414d-85c8-84f33e92618a",
    "_xform_id_string": "ajXVJpBkTD5tB4Nu9QXpgm",
    "_uuid": "2356cbbe-c1fd-414d-85c8-84f33e92618a",
    "_attachments": [],
    "_status": "submitted_via_web",
    "_geolocation": [
      -1.932914,
      30.078211
    ],
    "_submission_time": "2021-12-05T14:15:44",
    "_tags": [],
    "_notes": [],
    "_validation_status": {},
    "_submitted_by": null
  }
  ```

  With reformatting enabled, and the appropriate masks for multi-select and number formatting (for example, `Crops_*` and `*_sqm` respectively), n8n parses it into:

  ```json
  {
    "id": 471987,
    "formhub": {
      "uuid": "189436bb09a54957bfcc798e338b54d6"
    },
    "start": "2021-12-05T16:13:38.527+02:00",
    "end": "2021-12-05T16:15:33.407+02:00",
    "Field_Details": {
      "Field_Name": "Test Fields",
      "Field_Location": {
        "lat": -1.932914,
        "lon": 30.078211
      },
      "Field_Shape": {
        "type": "polygon",
        "coordinates": [
          {
            "lat": -1.932914,
            "lon": 30.078211
          },
          {
            "lat": -1.933011,
            "lon": 30.078085
          },
          {
            "lat": -1.933257,
            "lon": 30.078004
          },
          {
            "lat": -1.933338,
            "lon": 30.078197
          },
          {
            "lat": -1.933107,
            "lon": 30.078299
          },
          {
            "lat": -1.932914,
            "lon": 30.078211
          }
        ]
      },
      "Crops_Grown": [
        "maize",
        "beans",
        "avocado"
      ],
      "Field_Size_sqm": 2300
    },
    "version": "veGcULpqP6JNFKRJbbMvMs",
    "meta": {
      "instanceID": "uuid:2356cbbe-c1fd-414d-85c8-84f33e92618a"
    },
    "xform_id_string": "ajXVJpBkTD5tB4Nu9QXpgm",
    "uuid": "2356cbbe-c1fd-414d-85c8-84f33e92618a",
    "attachments": [],
    "status": "submitted_via_web",
    "geolocation": {
      "lat": -1.932914,
      "lon": 30.078211
    },
    "submission_time": "2021-12-05T14:15:44",
    "tags": [],
    "notes": [],
    "validation_status": {},
    "submitted_by": null
  }
  ```


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

documentation_examples:
  [{"type":"json","language":"json","code":"{\n  \"_id\": 471987,\n  \"formhub/uuid\": \"189436bb09a54957bfcc798e338b54d6\",\n  \"start\": \"2021-12-05T16:13:38.527+02:00\",\n  \"end\": \"2021-12-05T16:15:33.407+02:00\",\n  \"Field_Details/Field_Name\": \"Test Fields\",\n  \"Field_Details/Field_Location\": \"-1.932914 30.078211 1421 165\",\n  \"Field_Details/Field_Shape\": \"-1.932914 30.078211 1421 165;-1.933011 30.078085 0 0;-1.933257 30.078004 0 0;-1.933338 30.078197 0 0;-1.933107 30.078299 0 0;-1.932914 30.078211 1421 165\",\n  \"Field_Details/Crops_Grown\": \"maize beans avocado\",\n  \"Field_Details/Field_Size_sqm\": \"2300\",\n  \"__version__\": \"veGcULpqP6JNFKRJbbMvMs\",\n  \"meta/instanceID\": \"uuid:2356cbbe-c1fd-414d-85c8-84f33e92618a\",\n  \"_xform_id_string\": \"ajXVJpBkTD5tB4Nu9QXpgm\",\n  \"_uuid\": \"2356cbbe-c1fd-414d-85c8-84f33e92618a\",\n  \"_attachments\": [],\n  \"_status\": \"submitted_via_web\",\n  \"_geolocation\": [\n    -1.932914,\n    30.078211\n  ],\n  \"_submission_time\": \"2021-12-05T14:15:44\",\n  \"_tags\": [],\n  \"_notes\": [],\n  \"_validation_status\": {},\n  \"_submitted_by\": null\n}","title":"Here's a detailed example in JSON"},{"type":"json","language":"json","code":"{\n  \"id\": 471987,\n  \"formhub\": {\n    \"uuid\": \"189436bb09a54957bfcc798e338b54d6\"\n  },\n  \"start\": \"2021-12-05T16:13:38.527+02:00\",\n  \"end\": \"2021-12-05T16:15:33.407+02:00\",\n  \"Field_Details\": {\n    \"Field_Name\": \"Test Fields\",\n    \"Field_Location\": {\n      \"lat\": -1.932914,\n      \"lon\": 30.078211\n    },\n    \"Field_Shape\": {\n      \"type\": \"polygon\",\n      \"coordinates\": [\n        {\n          \"lat\": -1.932914,\n          \"lon\": 30.078211\n        },\n        {\n          \"lat\": -1.933011,\n          \"lon\": 30.078085\n        },\n        {\n          \"lat\": -1.933257,\n          \"lon\": 30.078004\n        },\n        {\n          \"lat\": -1.933338,\n          \"lon\": 30.078197\n        },\n        {\n          \"lat\": -1.933107,\n          \"lon\": 30.078299\n        },\n        {\n          \"lat\": -1.932914,\n          \"lon\": 30.078211\n        }\n      ]\n    },\n    \"Crops_Grown\": [\n      \"maize\",\n      \"beans\",\n      \"avocado\"\n    ],\n    \"Field_Size_sqm\": 2300\n  },\n  \"version\": \"veGcULpqP6JNFKRJbbMvMs\",\n  \"meta\": {\n    \"instanceID\": \"uuid:2356cbbe-c1fd-414d-85c8-84f33e92618a\"\n  },\n  \"xform_id_string\": \"ajXVJpBkTD5tB4Nu9QXpgm\",\n  \"uuid\": \"2356cbbe-c1fd-414d-85c8-84f33e92618a\",\n  \"attachments\": [],\n  \"status\": \"submitted_via_web\",\n  \"geolocation\": {\n    \"lat\": -1.932914,\n    \"lon\": 30.078211\n  },\n  \"submission_time\": \"2021-12-05T14:15:44\",\n  \"tags\": [],\n  \"notes\": [],\n  \"validation_status\": {},\n  \"submitted_by\": null\n}","title":"With reformatting enabled, and the appropriate masks for multi-select and number formatting (for example, `Crops_*` and `*_sqm` respectively), n8n parses it into"}]

troubleshooting_info:
  [{"issue":"Query Options","solution":"The Query Submission operation supports query options:"},{"issue":"Submission options","solution":"All operations that return form submission data offer options to tweak the response. These include:"},{"issue":"About reformatting","solution":"The default JSON format for KoboToolbox submission data is sometimes hard to deal with, because it's not schema-aware, and all fields are therefore returned as strings."}]

example_workflow:
  {"name":"KoBoToolbox Example Workflow","nodes":[{"parameters":{"resource":"file","dynamic_property":null},"id":"mtx9j9u8vxkzsf3l0zq9s","name":"KoBoToolbox","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":"submission","required":true,"options":[{"name":"File","value":"file"},{"name":"Form","value":"form"},{"name":"Hook","value":"hook"},{"name":"Submission","value":"submission"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...FormDescription_1.formOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...FormDescription_1.formFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...HookDescription_1.hookOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...HookDescription_1.hookFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SubmissionDescription_1.submissionOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SubmissionDescription_1.submissionFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...FileDescription_1.fileOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...FileDescription_1.fileFields"}]


node_type: n8n-nodes-base.Linear
name: Linear
display_name: Linear
description: Consume Linear API
category: output
icon: file:linear.svg
code_hash: 03a0ceb98ba3b2007d39314f83e4819bde871064bef40846749d33477a352ed5
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Linear
documentation_title: Linear node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"linear","description":"Templates for linear"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"authentication":"apiToken","resource":"issue","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:50
updated_at: 2025-06-12 08:58:50
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Linear = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const IssueDescription_1 = require("./IssueDescription");
  const Queries_1 = require("./Queries");
  class Linear {
      constructor() {
          this.description = {
              displayName: 'Linear',
              name: 'linear',
              icon: 'file:linear.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Linear API',
              defaults: {
                  name: 'Linear',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'linearApi',
                      required: true,
                      testedBy: 'linearApiTest',
                      displayOptions: {
                          show: {
                              authentication: ['apiToken'],
                          },
                      },
                  },
                  {
                      name: 'linearOAuth2Api',
                      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: 'Issue',
                              value: 'issue',
                          },
                      ],
                      default: 'issue',
                  },
                  ...IssueDescription_1.issueOperations,
                  ...IssueDescription_1.issueFields,
              ],
          };
          this.methods = {
              credentialTest: {
                  async linearApiTest(credential) {
                      try {
                          await GenericFunctions_1.validateCredentials.call(this, credential.data);
                      }
                      catch (error) {
                          const { error: err } = error;
                          const errors = err.errors;
                          const authenticationError = Boolean(errors.filter((e) => e.extensions.code === 'AUTHENTICATION_ERROR').length);
                          if (authenticationError) {
                              return {
                                  status: 'Error',
                                  message: 'The security token included in the request is invalid',
                              };
                          }
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
              loadOptions: {
                  async getTeams() {
                      const returnData = [];
                      const body = {
                          query: Queries_1.query.getTeams(),
                          variables: {
                              $first: 10,
                          },
                      };
                      const teams = await GenericFunctions_1.linearApiRequestAllItems.call(this, 'data.teams', body);
                      for (const team of teams) {
                          returnData.push({
                              name: team.name,
                              value: team.id,
                          });
                      }
                      return returnData;
                  },
                  async getUsers() {
                      const returnData = [];
                      const body = {
                          query: Queries_1.query.getUsers(),
                          variables: {
                              $first: 10,
                          },
                      };
                      const users = await GenericFunctions_1.linearApiRequestAllItems.call(this, 'data.users', body);
                      for (const user of users) {
                          returnData.push({
                              name: user.name,
                              value: user.id,
                          });
                      }
                      return returnData;
                  },
                  async getStates() {
                      var _a, _b, _c;
                      let teamId = this.getNodeParameter('teamId', null);
                      if (!teamId) {
                          const updateFields = this.getNodeParameter('updateFields', null);
                          if (!updateFields.teamId) {
                              const issueId = this.getNodeParameter('issueId');
                              const body = {
                                  query: Queries_1.query.getIssueTeam(),
                                  variables: {
                                      issueId,
                                  },
                              };
                              const responseData = await GenericFunctions_1.linearApiRequest.call(this, body);
                              teamId = (_c = (_b = (_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.issue) === null || _b === void 0 ? void 0 : _b.team) === null || _c === void 0 ? void 0 : _c.id;
                          }
                          else {
                              teamId = updateFields.teamId;
                          }
                      }
                      const returnData = [];
                      const body = {
                          query: Queries_1.query.getStates(),
                          variables: {
                              $first: 10,
                              filter: {
                                  team: {
                                      id: {
                                          eq: teamId,
                                      },
                                  },
                              },
                          },
                      };
                      const states = await GenericFunctions_1.linearApiRequestAllItems.call(this, 'data.workflowStates', body);
                      for (const state of states) {
                          returnData.push({
                              name: state.name,
                              value: state.id,
                          });
                      }
                      return returnData.sort(GenericFunctions_1.sort);
                  },
              },
          };
      }
      async execute() {
          var _a, _b, _c, _d;
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'issue') {
                      if (operation === 'create') {
                          const teamId = this.getNodeParameter('teamId', i);
                          const title = this.getNodeParameter('title', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              query: Queries_1.query.createIssue(),
                              variables: {
                                  teamId,
                                  title,
                                  ...additionalFields,
                              },
                          };
                          responseData = await GenericFunctions_1.linearApiRequest.call(this, body);
                          responseData = (_a = responseData.data.issueCreate) === null || _a === void 0 ? void 0 : _a.issue;
                      }
                      if (operation === 'delete') {
                          const issueId = this.getNodeParameter('issueId', i);
                          const body = {
                              query: Queries_1.query.deleteIssue(),
                              variables: {
                                  issueId,
                              },
                          };
                          responseData = await GenericFunctions_1.linearApiRequest.call(this, body);
                          responseData = (_b = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _b === void 0 ? void 0 : _b.issueDelete;
                      }
                      if (operation === 'get') {
                          const issueId = this.getNodeParameter('issueId', i);
                          const body = {
                              query: Queries_1.query.getIssue(),
                              variables: {
                                  issueId,
                              },
                          };
                          responseData = await GenericFunctions_1.linearApiRequest.call(this, body);
                          responseData = responseData.data.issue;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const body = {
                              query: Queries_1.query.getIssues(),
                              variables: {
                                  first: 50,
                              },
                          };
                          if (returnAll) {
                              responseData = await GenericFunctions_1.linearApiRequestAllItems.call(this, 'data.issues', body);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', 0);
                              body.variables.first = limit;
                              responseData = await GenericFunctions_1.linearApiRequest.call(this, body);
                              responseData = responseData.data.issues.nodes;
                          }
                      }
                      if (operation === 'update') {
                          const issueId = this.getNodeParameter('issueId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              query: Queries_1.query.updateIssue(),
                              variables: {
                                  issueId,
                                  ...updateFields,
                              },
                          };
                          responseData = await GenericFunctions_1.linearApiRequest.call(this, body);
                          responseData = (_d = (_c = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _c === void 0 ? void 0 : _c.issueUpdate) === null || _d === void 0 ? void 0 : _d.issue;
                      }
                  }
                  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.Linear = Linear;
  //# sourceMappingURL=Linear.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LinearApi = void 0;
  class LinearApi {
      constructor() {
          this.name = 'linearApi';
          this.displayName = 'Linear API';
          this.documentationUrl = 'linear';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '={{$credentials.apiKey}}',
                  },
              },
          };
      }
  }
  exports.LinearApi = LinearApi;
  //# sourceMappingURL=LinearApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LinearOAuth2Api = void 0;
  const scopes = ['read', 'write', 'issues:create', 'comments:create'];
  class LinearOAuth2Api {
      constructor() {
          this.name = 'linearOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Linear OAuth2 API';
          this.documentationUrl = 'linear';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://linear.app/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.linear.app/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Actor',
                  name: 'actor',
                  type: 'options',
                  options: [
                      {
                          name: 'User',
                          value: 'user',
                          description: 'Resources are created as the user who authorized the application',
                      },
                      {
                          name: 'Application',
                          value: 'application',
                          description: 'Resources are created as the application',
                      },
                  ],
                  default: 'user',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: scopes.join(' '),
                  required: true,
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '={{"actor="+$self["actor"]}}',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.LinearOAuth2Api = LinearOAuth2Api;
  //# sourceMappingURL=LinearOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LinearApi = void 0;
  class LinearApi {
      constructor() {
          this.name = 'linearApi';
          this.displayName = 'Linear API';
          this.documentationUrl = 'linear';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '={{$credentials.apiKey}}',
                  },
              },
          };
      }
  }
  exports.LinearApi = LinearApi;
  //# sourceMappingURL=LinearApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LinearOAuth2Api = void 0;
  const scopes = ['read', 'write', 'issues:create', 'comments:create'];
  class LinearOAuth2Api {
      constructor() {
          this.name = 'linearOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Linear OAuth2 API';
          this.documentationUrl = 'linear';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://linear.app/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.linear.app/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Actor',
                  name: 'actor',
                  type: 'options',
                  options: [
                      {
                          name: 'User',
                          value: 'user',
                          description: 'Resources are created as the user who authorized the application',
                      },
                      {
                          name: 'Application',
                          value: 'application',
                          description: 'Resources are created as the application',
                      },
                  ],
                  default: 'user',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: scopes.join(' '),
                  required: true,
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '={{"actor="+$self["actor"]}}',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.LinearOAuth2Api = LinearOAuth2Api;
  //# sourceMappingURL=LinearOAuth2Api.credentials.js.map

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

  # Linear node

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

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

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

  ## Operations

  * Issue
      * Create
      * Delete
      * Get
      * Get All
      * Update

  ## Templates and examples

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

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

example_workflow:
  {"name":"Linear Example Workflow","nodes":[{"parameters":{"authentication":"apiToken","resource":"issue","dynamic_property":null},"id":"jdj7yz7ldmjfp0u4odq8ze","name":"Linear","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":"issue","options":[{"name":"Issue","value":"issue"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IssueDescription_1.issueOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...IssueDescription_1.issueFields"}]


node_type: n8n-nodes-base.Ldap
name: Ldap
display_name: Ldap
description: Interact with LDAP servers
category: transform
icon: file:ldap.svg
code_hash: d672264081d30d100685786ddec6cc77a4750dd916eb833f83d2f27dd6ef18b2
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.Ldap
documentation_title: LDAP
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"ldap","description":"Templates for ldap"}]
related_resources: []
required_scopes: []
parameter_schemas: []
example_parameters: {"operation":"compare","nodeDebug":false,"dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:50
updated_at: 2025-06-12 08:58:50
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Ldap = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const ldapts_1 = require("ldapts");
  const LdapDescription_1 = require("./LdapDescription");
  const Helpers_1 = require("./Helpers");
  class Ldap {
      constructor() {
          this.description = {
              displayName: 'Ldap',
              name: 'ldap',
              icon: 'file:ldap.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Interact with LDAP servers',
              defaults: {
                  name: 'LDAP',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'ldap',
                      required: true,
                      testedBy: 'ldapConnectionTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Compare',
                              value: 'compare',
                              description: 'Compare an attribute',
                              action: 'Compare an attribute',
                          },
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a new entry',
                              action: 'Create a new entry',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete an entry',
                              action: 'Delete an entry',
                          },
                          {
                              name: 'Rename',
                              value: 'rename',
                              description: 'Rename the DN of an existing entry',
                              action: 'Rename the DN of an existing entry',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search LDAP',
                              action: 'Search LDAP',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update attributes',
                              action: 'Update attributes',
                          },
                      ],
                      default: 'search',
                  },
                  {
                      displayName: 'Debug',
                      name: 'nodeDebug',
                      type: 'boolean',
                      isNodeSetting: true,
                      default: false,
                      noDataExpression: true,
                  },
                  ...LdapDescription_1.ldapFields,
              ],
          };
          this.methods = {
              credentialTest: {
                  async ldapConnectionTest(credential) {
                      const credentials = credential.data;
                      const client = await (0, Helpers_1.createLdapClient)(credentials);
                      try {
                          await client.bind(credentials.bindDN, credentials.bindPassword);
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                      finally {
                          await client.unbind();
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
              loadOptions: {
                  async getAttributes() {
                      const credentials = await this.getCredentials('ldap');
                      const client = await (0, Helpers_1.createLdapClient)(credentials);
                      try {
                          await client.bind(credentials.bindDN, credentials.bindPassword);
                      }
                      catch (error) {
                          await client.unbind();
                          console.log(error);
                          return [];
                      }
                      let results;
                      const baseDN = this.getNodeParameter('baseDN', 0);
                      try {
                          results = await client.search(baseDN, { sizeLimit: 200, paged: false });
                      }
                      catch (error) {
                          console.log(error);
                          return [];
                      }
                      finally {
                          await client.unbind();
                      }
                      const unique = Object.keys(Object.assign({}, ...results.searchEntries));
                      return unique.map((x) => ({
                          name: x,
                          value: x,
                      }));
                  },
                  async getObjectClasses() {
                      const credentials = await this.getCredentials('ldap');
                      const client = await (0, Helpers_1.createLdapClient)(credentials);
                      try {
                          await client.bind(credentials.bindDN, credentials.bindPassword);
                      }
                      catch (error) {
                          await client.unbind();
                          console.log(error);
                          return [];
                      }
                      const baseDN = this.getNodeParameter('baseDN', 0);
                      let results;
                      try {
                          results = await client.search(baseDN, { sizeLimit: 10, paged: false });
                      }
                      catch (error) {
                          console.log(error);
                          return [];
                      }
                      finally {
                          await client.unbind();
                      }
                      const objects = [];
                      for (const entry of results.searchEntries) {
                          if (typeof entry.objectClass === 'string') {
                              objects.push(entry.objectClass);
                          }
                          else {
                              objects.push(...entry.objectClass);
                          }
                      }
                      const unique = [...new Set(objects)];
                      unique.push('custom');
                      const result = [];
                      for (const value of unique) {
                          if (value === 'custom') {
                              result.push({ name: 'custom', value: 'custom' });
                          }
                          else
                              result.push({ name: value, value: `(objectclass=${value})` });
                      }
                      return result;
                  },
                  async getAttributesForDn() {
                      const credentials = await this.getCredentials('ldap');
                      const client = await (0, Helpers_1.createLdapClient)(credentials);
                      try {
                          await client.bind(credentials.bindDN, credentials.bindPassword);
                      }
                      catch (error) {
                          await client.unbind();
                          console.log(error);
                          return [];
                      }
                      let results;
                      const baseDN = this.getNodeParameter('dn', 0);
                      try {
                          results = await client.search(baseDN, { sizeLimit: 1, paged: false });
                      }
                      catch (error) {
                          console.log(error);
                          return [];
                      }
                      finally {
                          await client.unbind();
                      }
                      const unique = Object.keys(Object.assign({}, ...results.searchEntries));
                      return unique.map((x) => ({
                          name: x,
                          value: x,
                      }));
                  },
              },
          };
      }
      async execute() {
          const nodeDebug = this.getNodeParameter('nodeDebug', 0);
          const items = this.getInputData();
          const returnItems = [];
          if (nodeDebug) {
              n8n_workflow_1.LoggerProxy.info(`[${this.getNode().type} | ${this.getNode().name}] - Starting with ${items.length} input items`);
          }
          const credentials = await this.getCredentials('ldap');
          const client = await (0, Helpers_1.createLdapClient)(credentials, nodeDebug, this.getNode().type, this.getNode().name);
          try {
              await client.bind(credentials.bindDN, credentials.bindPassword);
          }
          catch (error) {
              delete error.cert;
              await client.unbind();
              if (this.continueOnFail()) {
                  return [
                      items.map((x) => {
                          x.json.error = error.reason || 'LDAP connection error occurred';
                          return x;
                      }),
                  ];
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {});
              }
          }
          const operation = this.getNodeParameter('operation', 0);
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              try {
                  if (operation === 'compare') {
                      const dn = this.getNodeParameter('dn', itemIndex);
                      const attributeId = this.getNodeParameter('id', itemIndex);
                      const value = this.getNodeParameter('value', itemIndex, '');
                      const res = await client.compare(dn, attributeId, value);
                      returnItems.push({
                          json: { dn, attribute: attributeId, result: res },
                          pairedItem: { item: itemIndex },
                      });
                  }
                  else if (operation === 'create') {
                      const dn = this.getNodeParameter('dn', itemIndex);
                      const attributeFields = this.getNodeParameter('attributes', itemIndex);
                      const attributes = {};
                      if (Object.keys(attributeFields).length) {
                          attributeFields.attribute.map((attr) => {
                              attributes[attr.id] = attr.value;
                          });
                      }
                      await client.add(dn, attributes);
                      returnItems.push({
                          json: { dn, result: 'success' },
                          pairedItem: { item: itemIndex },
                      });
                  }
                  else if (operation === 'delete') {
                      const dn = this.getNodeParameter('dn', itemIndex);
                      await client.del(dn);
                      returnItems.push({
                          json: { dn, result: 'success' },
                          pairedItem: { item: itemIndex },
                      });
                  }
                  else if (operation === 'rename') {
                      const dn = this.getNodeParameter('dn', itemIndex);
                      const targetDn = this.getNodeParameter('targetDn', itemIndex);
                      await client.modifyDN(dn, targetDn);
                      returnItems.push({
                          json: { dn: targetDn, result: 'success' },
                          pairedItem: { item: itemIndex },
                      });
                  }
                  else if (operation === 'update') {
                      const dn = this.getNodeParameter('dn', itemIndex);
                      const attributes = this.getNodeParameter('attributes', itemIndex, {});
                      const changes = [];
                      for (const [action, attrs] of Object.entries(attributes)) {
                          attrs.map((attr) => changes.push(new ldapts_1.Change({
                              operation: action,
                              modification: new ldapts_1.Attribute({
                                  type: attr.id,
                                  values: [attr.value],
                              }),
                          })));
                      }
                      await client.modify(dn, changes);
                      returnItems.push({
                          json: { dn, result: 'success', changes },
                          pairedItem: { item: itemIndex },
                      });
                  }
                  else if (operation === 'search') {
                      const baseDN = this.getNodeParameter('baseDN', itemIndex);
                      let searchFor = this.getNodeParameter('searchFor', itemIndex);
                      const returnAll = this.getNodeParameter('returnAll', itemIndex);
                      const limit = this.getNodeParameter('limit', itemIndex, 0);
                      const options = this.getNodeParameter('options', itemIndex);
                      const pageSize = this.getNodeParameter('options.pageSize', itemIndex, 1000);
                      delete options.pageSize;
                      options.sizeLimit = returnAll ? 0 : limit;
                      if (pageSize) {
                          options.paged = { pageSize };
                      }
                      if (typeof options.attributes === 'string') {
                          options.attributes = options.attributes.split(',').map((attribute) => attribute.trim());
                      }
                      options.explicitBufferAttributes = Helpers_1.BINARY_AD_ATTRIBUTES;
                      if (searchFor === 'custom') {
                          searchFor = this.getNodeParameter('customFilter', itemIndex);
                      }
                      else {
                          const searchText = this.getNodeParameter('searchText', itemIndex);
                          const attribute = this.getNodeParameter('attribute', itemIndex);
                          searchFor = `(&${searchFor}(${attribute}=${searchText}))`;
                      }
                      searchFor = searchFor.replace(/\\\\/g, '\\5c');
                      searchFor = searchFor.replace(/\\\*/g, '\\2a');
                      searchFor = searchFor.replace(/\\\(/g, '\\28');
                      searchFor = searchFor.replace(/\\\)/g, '\\29');
                      options.filter = searchFor;
                      if (nodeDebug) {
                          n8n_workflow_1.LoggerProxy.info(`[${this.getNode().type} | ${this.getNode().name}] - Search Options ${JSON.stringify(options, null, 2)}`);
                      }
                      const results = await client.search(baseDN, options);
                      if (!returnAll) {
                          results.searchEntries = results.searchEntries.slice(0, limit);
                      }
                      (0, Helpers_1.resolveBinaryAttributes)(results.searchEntries);
                      returnItems.push.apply(returnItems, results.searchEntries.map((result) => ({
                          json: result,
                          pairedItem: { item: itemIndex },
                      })));
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnItems.push({ json: items[itemIndex].json, error, pairedItem: itemIndex });
                  }
                  else {
                      await client.unbind();
                      if (error.context) {
                          error.context.itemIndex = itemIndex;
                          throw error;
                      }
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
                          itemIndex,
                      });
                  }
              }
          }
          if (nodeDebug) {
              n8n_workflow_1.LoggerProxy.info(`[${this.getNode().type} | ${this.getNode().name}] - Finished`);
          }
          await client.unbind();
          return [returnItems];
      }
  }
  exports.Ldap = Ldap;
  //# sourceMappingURL=Ldap.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: LDAP
  description: Documentation for the LDAP node in n8n, a workflow automation platform. Includes guidance on usage, and links to examples.
  contentType: [integration, reference]
  ---

  # LDAP

  This node allows you to interact with your LDAP servers to create, find, and update objects.

  /// note | Credentials
  You can find authentication information for this node [here](/integrations/builtin/credentials/ldap.md).
  ///

  ## Operations

  * [**Compare**](#compare) an attribute
  * [**Create**](#create) a new entry
  * [**Delete**](#delete) an entry
  * [**Rename**](#rename) the DN of an existing entry
  * [**Search**](#search) LDAP
  * [**Update**](#update) attributes

  Refer to the sections below for details on configuring the node for each operation.

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

  ## Compare

  Configure this operation using these parameters:

  * **Credential to connect with**: Select or create an [LDAP credential](/integrations/builtin/credentials/ldap.md) to connect with.
  * **DN**: Enter the Distinguished Name (DN) of the entry to compare.
  * **Attribute ID**: Enter the ID of the attribute to compare.
  * **Value**: Enter the value to compare.

  ## Create

  Configure this operation using these parameters:

  * **Credential to connect with**: Select or create an [LDAP credential](/integrations/builtin/credentials/ldap.md) to connect with.
  * **DN**: Enter the Distinguished Name (DN) of the entry to create.
  * **Attributes**: Add the **Attribute ID**/**Value** pairs you'd like to create.

  ## Delete

  Configure this operation using these parameters:

  * **Credential to connect with**: Select or create an [LDAP credential](/integrations/builtin/credentials/ldap.md) to connect with.
  * **DN**: Enter the Distinguished Name (DN) of the entry to be deleted.

  ## Rename

  Configure this operation using these parameters:

  * **Credential to connect with**: Select or create an [LDAP credential](/integrations/builtin/credentials/ldap.md) to connect with.
  * **DN**: Enter the current Distinguished Name (DN) of the entry to rename.
  * **New DN**: Enter the new Distinguished Name (DN) for the entry in this field.

  ## Search

  Configure this operation using these parameters:

  * **Credential to connect with**: Select or create an [LDAP credential](/integrations/builtin/credentials/ldap.md) to connect with.
  * **Base DN**: Enter the Distinguished Name (DN) of the subtree to search in.
  * **Search For**: Select the directory object class to search for.
  * **Attribute**: Select the attribute to search for.
  * **Search Text**: Enter the text to search for. Use `*` for a wildcard.
  * **Return All**: When turned on, the node will return all results. When turned off, the node will return results up to the set **Limit**.
  * **Limit**: Only available when you turn off **Return All**. Enter the maximum number of results to return.

  ### Search options

  You can also configure this operation using these options:

  * **Attribute Names or IDs**: Enter a comma-separated list of attributes to return. Choose from the list or specify IDs using an expression.
  * **Page Size**: Enter the maximum number of results to request at one time. Set to 0 to disable paging.
  * **Scopes**: The set of entries at or below the **Base DN** to search for potential matches. Select from:
      * **Base Tree**: Often referred to as subordinateSubtree or just "subordinates," selecting this option will search the subordinates of the **Base DN** entry but not the **Base DN** entry itself.
      * **Single Level**: Often referred to as "one," selecting this option will search only the immediate children of the **Base DN** entry.
      * **Whole Subtree**: Often referred to as "sub," selecting this option will search the **Base DN** entry and all its subordinates to any depth.

  Refer to [The LDAP Search Operation](https://ldap.com/the-ldap-search-operation/){:target="_blank" .external-link} for more information on search scopes.

  ## Update

  Configure this operation using these parameters:

  * **Credential to connect with**: Select or create an [LDAP credential](/integrations/builtin/credentials/ldap.md) to connect with.
  * **DN**: Enter the Distinguished Name (DN) of the entry to update.
  * ***Update Attributes**: Select whether to **Add** new, **Remove** existing, or **Replace** existing attribute.
  * Then enter the **Attribute ID**/**Value** pair you'd like to update.

  ## Templates and examples

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

troubleshooting_info:
  [{"issue":"Compare","solution":"Configure this operation using these parameters:"},{"issue":"Create","solution":"Configure this operation using these parameters:"},{"issue":"Delete","solution":"Configure this operation using these parameters:"},{"issue":"Rename","solution":"Configure this operation using these parameters:"},{"issue":"Search","solution":"Configure this operation using these parameters:"},{"issue":"Search options","solution":"You can also configure this operation using these options:"},{"issue":"Update","solution":"Configure this operation using these parameters:"}]

example_workflow:
  {"name":"Ldap Example Workflow","nodes":[{"parameters":{"operation":"compare","nodeDebug":false,"dynamic_property":null},"id":"4tujo7hih9jrtrltfcw0tg","name":"Ldap","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":"search","description":"Compare an attribute","options":[{"name":"Compare","value":"compare","description":"Compare an attribute"},{"name":"Create","value":"create","description":"Create a new entry"},{"name":"Delete","value":"delete","description":"Delete an entry"},{"name":"Rename","value":"rename","description":"Rename the DN of an existing entry"},{"name":"Search","value":"search","description":"Search LDAP"},{"name":"Update","value":"update","description":"Update attributes"}]},{"displayName":"Debug","name":"nodeDebug","type":"boolean","default":false},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...LdapDescription_1.ldapFields"}]


node_type: n8n-nodes-base.LingvaNex
name: LingvaNex
display_name: LingvaNex
description: Consume LingvaNex API
category: output
icon: file:lingvanex.png
code_hash: 29d29315fd6ef3b4f9454e49bfcd822bf94f31464bab1c11b494288d33fce502
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.LingvaNex
documentation_title: LingvaNex node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"lingvanex","description":"Templates for lingvanex"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"operation":"translate","text":"example-value","translateTo":"","options":{}}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:50
updated_at: 2025-06-12 08:58:50
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LingvaNex = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class LingvaNex {
      constructor() {
          this.description = {
              displayName: 'LingvaNex',
              name: 'lingvaNex',
              icon: 'file:lingvanex.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume LingvaNex API',
              defaults: {
                  name: 'LingvaNex',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'lingvaNexApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Translate',
                              value: 'translate',
                              description: 'Translate data',
                              action: 'Translate data',
                          },
                      ],
                      default: 'translate',
                  },
                  {
                      displayName: 'Text',
                      name: 'text',
                      type: 'string',
                      default: '',
                      description: 'The input text to translate',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['translate'],
                          },
                      },
                  },
                  {
                      displayName: 'Translate To',
                      name: 'translateTo',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLanguages',
                      },
                      default: '',
                      description: 'The language to use for translation of the input text, set to one of the language codes listed in <a href="https://cloud.google.com/translate/docs/languages">Language Support</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['translate'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['translate'],
                          },
                      },
                      options: [
                          {
                              displayName: 'From',
                              name: 'from',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getLanguages',
                              },
                              default: '',
                              description: 'The language code in the format “language code_code of the country”. If this parameter is not present, the auto-detect language mode is enabled. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Platform',
                              name: 'platform',
                              type: 'string',
                              default: 'api',
                          },
                          {
                              displayName: 'Translate Mode',
                              name: 'translateMode',
                              type: 'string',
                              default: '',
                              description: 'Describe the input text format. Possible value is "html" for translating and preserving html structure. If value is not specified or is other than "html" than plain text is translating.',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLanguages() {
                      const returnData = [];
                      const data = await GenericFunctions_1.lingvaNexApiRequest.call(this, 'GET', '/getLanguages', {}, { platform: 'api' });
                      for (const language of data.result) {
                          returnData.push({
                              name: language.englishName,
                              value: language.full_code,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          const operation = this.getNodeParameter('operation', 0);
          const responseData = [];
          for (let i = 0; i < length; i++) {
              if (operation === 'translate') {
                  const text = this.getNodeParameter('text', i);
                  const translateTo = this.getNodeParameter('translateTo', i);
                  const options = this.getNodeParameter('options', i);
                  const body = {
                      data: text,
                      to: translateTo,
                      platform: 'api',
                  };
                  Object.assign(body, options);
                  const response = await GenericFunctions_1.lingvaNexApiRequest.call(this, 'POST', '/translate', body);
                  responseData.push(response);
              }
          }
          return [this.helpers.returnJsonArray(responseData)];
      }
  }
  exports.LingvaNex = LingvaNex;
  //# sourceMappingURL=LingvaNex.node.js.map

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

  // --- Next Credential File ---

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

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

  # LingvaNex node

  Use the LingvaNex node to automate work in LingvaNex, and integrate LingvaNex with other applications. n8n has built-in support for translating data with LingvaNex.

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

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

  ## Operations

  - Translate data

  ## Templates and examples

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

example_workflow:
  {"name":"LingvaNex Example Workflow","nodes":[{"parameters":{"operation":"translate","text":"example-value","translateTo":"","options":{}},"id":"dd1lp85ffae792oyawc96i","name":"LingvaNex","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":"translate","description":"Translate data","options":[{"name":"Translate","value":"translate","description":"Translate data"}]},{"displayName":"Text","name":"text","type":"string","default":"","required":true,"description":"The input text to translate"},{"displayName":"Translate To","name":"translateTo","type":"options","default":"","required":true,"description":"The language to use for translation of the input text, set to one of the language codes listed in <a href="},{"displayName":"Additional Options","name":"options","type":"collection","default":"{","description":"The language code in the format “language code_code of the country”. If this parameter is not present, the auto-detect language mode is enabled. Choose from the list, or specify an ID using an <a href=","placeholder":"Add Option"}]


node_type: n8n-nodes-base.LocalFileTrigger
name: LocalFileTrigger
display_name: Local File Trigger
description: Triggers a workflow on file system changes
category: trigger
icon: fa:folder-open
code_hash: 0b091f165d93567d21a8b943d4cab4e6fd20ccf85e00e1d733456047688a0737
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.LocalFileTrigger
documentation_title: Local File Trigger node documentation
operations: []
api_methods: []
templates: [{"name":"local-file-trigger","description":"Templates for local-file-trigger"}]
related_resources: []
required_scopes: []
parameter_schemas: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:51
updated_at: 2025-06-12 08:58:51
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LocalFileTrigger = void 0;
  const chokidar_1 = require("chokidar");
  class LocalFileTrigger {
      constructor() {
          this.description = {
              displayName: 'Local File Trigger',
              name: 'localFileTrigger',
              icon: 'fa:folder-open',
              group: ['trigger'],
              version: 1,
              subtitle: '=Path: {{$parameter["path"]}}',
              description: 'Triggers a workflow on file system changes',
              eventTriggerDescription: '',
              defaults: {
                  name: 'Local File Trigger',
                  color: '#404040',
              },
              triggerPanel: {
                  header: '',
                  executionsHelp: {
                      inactive: "<b>While building your workflow</b>, click the 'listen' button, then make a change to your watched file or folder. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time a change is detected, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
                      active: "<b>While building your workflow</b>, click the 'listen' button, then make a change to your watched file or folder. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time a change is detected, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
                  },
                  activationHint: "Once you’ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won’t see those executions here).",
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Trigger On',
                      name: 'triggerOn',
                      type: 'options',
                      options: [
                          {
                              name: 'Changes to a Specific File',
                              value: 'file',
                          },
                          {
                              name: 'Changes Involving a Specific Folder',
                              value: 'folder',
                          },
                      ],
                      required: true,
                      default: '',
                  },
                  {
                      displayName: 'File to Watch',
                      name: 'path',
                      type: 'string',
                      displayOptions: {
                          show: {
                              triggerOn: ['file'],
                          },
                      },
                      default: '',
                      placeholder: '/data/invoices/1.pdf',
                  },
                  {
                      displayName: 'Folder to Watch',
                      name: 'path',
                      type: 'string',
                      displayOptions: {
                          show: {
                              triggerOn: ['folder'],
                          },
                      },
                      default: '',
                      placeholder: '/data/invoices',
                  },
                  {
                      displayName: 'Watch for',
                      name: 'events',
                      type: 'multiOptions',
                      displayOptions: {
                          show: {
                              triggerOn: ['folder'],
                          },
                      },
                      options: [
                          {
                              name: 'File Added',
                              value: 'add',
                              description: 'Triggers whenever a new file was added',
                          },
                          {
                              name: 'File Changed',
                              value: 'change',
                              description: 'Triggers whenever a file was changed',
                          },
                          {
                              name: 'File Deleted',
                              value: 'unlink',
                              description: 'Triggers whenever a file was deleted',
                          },
                          {
                              name: 'Folder Added',
                              value: 'addDir',
                              description: 'Triggers whenever a new folder was added',
                          },
                          {
                              name: 'Folder Deleted',
                              value: 'unlinkDir',
                              description: 'Triggers whenever a folder was deleted',
                          },
                      ],
                      required: true,
                      default: [],
                      description: 'The events to listen to',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Include Linked Files/Folders',
                              name: 'followSymlinks',
                              type: 'boolean',
                              default: true,
                              description: 'Whether linked files/folders will also be watched (this includes symlinks, aliases on MacOS and shortcuts on Windows). Otherwise only the links themselves will be monitored).',
                          },
                          {
                              displayName: 'Ignore',
                              name: 'ignored',
                              type: 'string',
                              default: '',
                              placeholder: '**/*.txt',
                              description: 'Files or paths to ignore. The whole path is tested, not just the filename. Supports <a href="https://github.com/micromatch/anymatch">Anymatch</a>- syntax.',
                          },
                          {
                              displayName: 'Max Folder Depth',
                              name: 'depth',
                              type: 'options',
                              options: [
                                  {
                                      name: '1 Levels Down',
                                      value: 1,
                                  },
                                  {
                                      name: '2 Levels Down',
                                      value: 2,
                                  },
                                  {
                                      name: '3 Levels Down',
                                      value: 3,
                                  },
                                  {
                                      name: '4 Levels Down',
                                      value: 4,
                                  },
                                  {
                                      name: '5 Levels Down',
                                      value: 5,
                                  },
                                  {
                                      name: 'Top Folder Only',
                                      value: 0,
                                  },
                                  {
                                      name: 'Unlimited',
                                      value: -1,
                                  },
                              ],
                              default: -1,
                              description: 'How deep into the folder structure to watch for changes',
                          },
                      ],
                  },
              ],
          };
      }
      async trigger() {
          const triggerOn = this.getNodeParameter('triggerOn');
          const path = this.getNodeParameter('path');
          const options = this.getNodeParameter('options', {});
          let events;
          if (triggerOn === 'file') {
              events = ['change'];
          }
          else {
              events = this.getNodeParameter('events', []);
          }
          const watcher = (0, chokidar_1.watch)(path, {
              ignored: options.ignored === '' ? undefined : options.ignored,
              persistent: true,
              ignoreInitial: true,
              followSymlinks: options.followSymlinks === undefined ? true : options.followSymlinks,
              depth: [-1, undefined].includes(options.depth)
                  ? undefined
                  : options.depth,
          });
          const executeTrigger = (event, pathString) => {
              this.emit([this.helpers.returnJsonArray([{ event, path: pathString }])]);
          };
          for (const eventName of events) {
              watcher.on(eventName, (pathString) => executeTrigger(eventName, pathString));
          }
          async function closeFunction() {
              return watcher.close();
          }
          return {
              closeFunction,
          };
      }
  }
  exports.LocalFileTrigger = LocalFileTrigger;
  //# sourceMappingURL=LocalFileTrigger.node.js.map

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

  # Local File Trigger node

  The Local File Trigger node starts a workflow when it detects changes on the file system. These changes involve a file or folder getting added, changed, or deleted.

  /// note | Self-hosted n8n only
  This node isn't available on n8n Cloud.
  ///

  ## Node parameters

  You can choose what event to watch for using the **Trigger On** parameter.

  ## Changes to a Specific File

  The node triggers when the specified file changes.

  Enter the path for the file to watch in **File to Watch**.

  ## Changes Involving a Specific Folder

  The node triggers when a change occurs in the selected folder.

  Configure these parameters:

  - **Folder to Watch**: Enter the path of the folder to watch.
  - **Watch for**: Select the type of change to watch for.


  ## Node options

  Use the node **Options** to include or exclude files and folders.

  - **Include Linked Files/Folders**: also watch for changes to linked files or folders.
  - **Ignore**: files or paths to ignore. n8n tests the whole path, not just the filename. Supports the [Anymatch](https://github.com/micromatch/anymatch){:target=_blank .external-link} syntax.
  - **Max Folder Depth**: how deep into the folder structure to watch for changes.

  ### Examples for Ignore

  Ignore a single file:

  ```sh
  **/<fileName>.<suffix>
  # For example, **/myfile.txt
  ```

  Ignore a sub-directory of a directory you're watching:

  ```sh
  **/<directoryName>/**
  # For example, **/myDirectory/**
  ```

  ## Templates and examples

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

documentation_examples:
  [{"type":"text","language":"sh","code":"**/<fileName>.<suffix>\n# For example, **/myfile.txt","title":"Examples for Ignore"},{"type":"text","language":"sh","code":"**/<directoryName>/**\n# For example, **/myDirectory/**","title":"Examples for Ignore"}]

troubleshooting_info:
  [{"issue":"Node parameters","solution":"You can choose what event to watch for using the **Trigger On** parameter."},{"issue":"Changes to a Specific File","solution":"The node triggers when the specified file changes."},{"issue":"Changes Involving a Specific Folder","solution":"The node triggers when a change occurs in the selected folder."},{"issue":"Node options","solution":"Use the node **Options** to include or exclude files and folders."},{"issue":"Examples for Ignore","solution":"Ignore a single file:"}]

example_workflow:
  {"name":"Local File Trigger Example Workflow","nodes":[{"parameters":{"triggerOn":"file","path":"example-value","events":"[]","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]}},"id":"z2dtz9z77bd5gon30io7xq","name":"Local File Trigger","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"triggerOn":"file","path":"example-value","events":"[]","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]}}

properties_schema:
  [{"displayName":"Trigger On","name":"triggerOn","type":"options","default":"","required":true,"options":[{"name":"Changes to a Specific File","value":"file"},{"name":"Changes Involving a Specific Folder","value":"folder"}]},{"displayName":"File to Watch","name":"path","type":"string","default":"","placeholder":"/data/invoices/1.pdf"},{"displayName":"Folder to Watch","name":"path","type":"string","default":"","placeholder":"/data/invoices"},{"displayName":"Watch for","name":"events","type":"multiOptions","default":"[]","required":true,"description":"Triggers whenever a new file was added","options":[{"name":"File Added","value":"add","description":"Triggers whenever a new file was added"},{"name":"File Changed","value":"change","description":"Triggers whenever a file was changed"},{"name":"File Deleted","value":"unlink","description":"Triggers whenever a file was deleted"},{"name":"Folder Added","value":"addDir","description":"Triggers whenever a new folder was added"},{"name":"Folder Deleted","value":"unlinkDir","description":"Triggers whenever a folder was deleted"}]},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Whether linked files/folders will also be watched (this includes symlinks, aliases on MacOS and shortcuts on Windows). Otherwise only the links themselves will be monitored).","placeholder":"Add Option"}]


node_type: n8n-nodes-base.LoneScale
name: LoneScale
display_name: LoneScale
description: Create List, add / delete items
category: transform
icon: file:lonescale-logo.svg
code_hash: 87192faf002fbba84590b3c3dd0d367a26378865321adb7fd5cf70349fec00e3
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.LoneScale
documentation_title: LoneScale node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"lonescale","description":"Templates for lonescale"}]
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:51
updated_at: 2025-06-12 08:58:51
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LoneScale = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class LoneScale {
      constructor() {
          this.description = {
              displayName: 'LoneScale',
              name: 'loneScale',
              group: ['transform'],
              icon: 'file:lonescale-logo.svg',
              version: 1,
              description: 'Create List, add / delete items',
              subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
              defaults: {
                  name: 'LoneScale',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'loneScaleApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      options: [
                          {
                              name: 'List',
                              value: 'list',
                              description: 'Manipulate list',
                          },
                          {
                              name: 'Item',
                              value: 'item',
                              description: 'Manipulate item',
                          },
                      ],
                      default: 'list',
                      noDataExpression: true,
                      required: true,
                      description: 'Create a new list',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['list'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a list',
                              action: 'Create a list',
                          },
                      ],
                      default: 'create',
                      noDataExpression: true,
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['item'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'add',
                              description: 'Create an item',
                              action: 'Create a item',
                          },
                      ],
                      default: 'add',
                      noDataExpression: true,
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      type: 'options',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['item'],
                          },
                      },
                      options: [
                          {
                              name: 'Company',
                              value: 'COMPANY',
                              description: 'List of company',
                          },
                          {
                              name: 'Contact',
                              value: 'PEOPLE',
                              description: 'List of contact',
                          },
                      ],
                      default: 'PEOPLE',
                      description: 'Type of your list',
                      noDataExpression: true,
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['item'],
                          },
                      },
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                          loadOptionsDependsOn: ['type'],
                      },
                      default: '',
                      description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                      required: true,
                  },
                  {
                      displayName: 'First Name',
                      name: 'first_name',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['item'],
                              type: ['PEOPLE'],
                          },
                      },
                      default: '',
                      description: 'Contact first name',
                      required: true,
                  },
                  {
                      displayName: 'Last Name',
                      name: 'last_name',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['item'],
                              type: ['PEOPLE'],
                          },
                      },
                      default: '',
                      description: 'Contact last name',
                      required: true,
                  },
                  {
                      displayName: 'Company Name',
                      name: 'company_name',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['item'],
                              type: ['COMPANY'],
                          },
                      },
                      default: '',
                      description: 'Contact company name',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'peopleAdditionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['item'],
                              type: ['PEOPLE'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Full Name',
                              name: 'full_name',
                              type: 'string',
                              default: '',
                              description: 'Contact full name',
                          },
                          {
                              displayName: 'Contact Email',
                              name: 'email',
                              type: 'string',
                              placeholder: 'name@email.com',
                              default: '',
                          },
                          {
                              displayName: 'Company Name',
                              name: 'company_name',
                              type: 'string',
                              default: '',
                              description: 'Contact company name',
                          },
                          {
                              displayName: 'Current Position',
                              name: 'current_position',
                              type: 'string',
                              default: '',
                              description: 'Contact current position',
                          },
                          {
                              displayName: 'Company Domain',
                              name: 'domain',
                              type: 'string',
                              default: '',
                              description: 'Contact company domain',
                          },
                          {
                              displayName: 'Linkedin Url',
                              name: 'linkedin_url',
                              type: 'string',
                              default: '',
                              description: 'Contact Linkedin URL',
                          },
                          {
                              displayName: 'Contact Location',
                              name: 'location',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Contact ID',
                              name: 'contact_id',
                              type: 'string',
                              default: '',
                              description: 'Contact ID from your source',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'companyAdditionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['item'],
                              type: ['COMPANY'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Linkedin Url',
                              name: 'linkedin_url',
                              type: 'string',
                              default: '',
                              description: 'Company Linkedin URL',
                          },
                          {
                              displayName: 'Company Domain',
                              name: 'domain',
                              type: 'string',
                              default: '',
                              description: 'Company company domain',
                          },
                          {
                              displayName: 'Contact Location',
                              name: 'location',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Contact ID',
                              name: 'contact_id',
                              type: 'string',
                              default: '',
                              description: 'Contact ID from your source',
                          },
                      ],
                  },
                  {
                      displayName: 'Name',
                      name: 'name',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['list'],
                          },
                      },
                      default: '',
                      placeholder: 'list name',
                      description: 'Name of your list',
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      type: 'options',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['list'],
                          },
                      },
                      options: [
                          {
                              name: 'Company',
                              value: 'COMPANY',
                              description: 'Create a list of companies',
                              action: 'Create a list of companies',
                          },
                          {
                              name: 'Contact',
                              value: 'PEOPLE',
                              description: 'Create a list of contacts',
                              action: 'Create a list of contacts',
                          },
                      ],
                      default: 'COMPANY',
                      description: 'Type of your list',
                      noDataExpression: true,
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLists() {
                      var _a;
                      const type = this.getNodeParameter('type');
                      const data = await GenericFunctions_1.lonescaleApiRequest.call(this, 'GET', '/lists', {}, { entity: type });
                      return (_a = data === null || data === void 0 ? void 0 : data.list) === null || _a === void 0 ? void 0 : _a.filter((l) => l.entity === type).map((d) => ({
                          name: d.name,
                          value: d.id,
                      }));
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          let responseData;
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'list') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const entity = this.getNodeParameter('type', i);
                          const body = {
                              name,
                              entity,
                          };
                          responseData = await GenericFunctions_1.lonescaleApiRequest.call(this, 'POST', '/lists', body);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
                  if (resource === 'item') {
                      if (operation === 'add') {
                          let firstName = '';
                          let lastName = '';
                          let currentPosition = '';
                          let fullName = '';
                          let email = '';
                          let linkedinUrl = '';
                          let companyName = '';
                          let domain = '';
                          let location = '';
                          let contactId = '';
                          const entity = this.getNodeParameter('type', i);
                          const listId = this.getNodeParameter('list', i);
                          if (entity === 'PEOPLE') {
                              const peopleAdditionalFields = this.getNodeParameter('peopleAdditionalFields', i);
                              firstName = this.getNodeParameter('first_name', i);
                              lastName = this.getNodeParameter('last_name', i);
                              fullName = peopleAdditionalFields === null || peopleAdditionalFields === void 0 ? void 0 : peopleAdditionalFields.full_name;
                              currentPosition = peopleAdditionalFields === null || peopleAdditionalFields === void 0 ? void 0 : peopleAdditionalFields.current_position;
                              email = peopleAdditionalFields === null || peopleAdditionalFields === void 0 ? void 0 : peopleAdditionalFields.email;
                              linkedinUrl = peopleAdditionalFields === null || peopleAdditionalFields === void 0 ? void 0 : peopleAdditionalFields.linkedin_url;
                              companyName = peopleAdditionalFields === null || peopleAdditionalFields === void 0 ? void 0 : peopleAdditionalFields.company_name;
                              domain = peopleAdditionalFields === null || peopleAdditionalFields === void 0 ? void 0 : peopleAdditionalFields.domain;
                              location = peopleAdditionalFields === null || peopleAdditionalFields === void 0 ? void 0 : peopleAdditionalFields.location;
                              contactId = peopleAdditionalFields === null || peopleAdditionalFields === void 0 ? void 0 : peopleAdditionalFields.contact_id;
                          }
                          if (entity === 'COMPANY') {
                              const companyAdditionalFields = this.getNodeParameter('companyAdditionalFields', i);
                              companyName = this.getNodeParameter('company_name', i);
                              linkedinUrl = companyAdditionalFields === null || companyAdditionalFields === void 0 ? void 0 : companyAdditionalFields.linkedin_url;
                              domain = companyAdditionalFields === null || companyAdditionalFields === void 0 ? void 0 : companyAdditionalFields.domain;
                              location = companyAdditionalFields === null || companyAdditionalFields === void 0 ? void 0 : companyAdditionalFields.location;
                              contactId = companyAdditionalFields === null || companyAdditionalFields === void 0 ? void 0 : companyAdditionalFields.contact_id;
                          }
                          const body = {
                              ...(firstName && { first_name: firstName }),
                              ...(lastName && { last_name: lastName }),
                              ...(fullName && { full_name: fullName }),
                              ...(linkedinUrl && { linkedin_url: linkedinUrl }),
                              ...(companyName && { company_name: companyName }),
                              ...(currentPosition && { current_position: currentPosition }),
                              ...(domain && { domain }),
                              ...(location && { location }),
                              ...(email && { email }),
                              ...(contactId && { contact_id: contactId }),
                          };
                          responseData = await GenericFunctions_1.lonescaleApiRequest.call(this, 'POST', `/lists/${listId}/item`, body);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.LoneScale = LoneScale;
  //# sourceMappingURL=LoneScale.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LoneScaleApi = void 0;
  class LoneScaleApi {
      constructor() {
          this.name = 'loneScaleApi';
          this.displayName = 'LoneScale API';
          this.documentationUrl = 'lonescale';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '={{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://public-api.lonescale.com',
                  url: '/users',
              },
          };
      }
  }
  exports.LoneScaleApi = LoneScaleApi;
  //# sourceMappingURL=LoneScaleApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LoneScaleApi = void 0;
  class LoneScaleApi {
      constructor() {
          this.name = 'loneScaleApi';
          this.displayName = 'LoneScale API';
          this.documentationUrl = 'lonescale';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '={{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://public-api.lonescale.com',
                  url: '/users',
              },
          };
      }
  }
  exports.LoneScaleApi = LoneScaleApi;
  //# sourceMappingURL=LoneScaleApi.credentials.js.map

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

  # LoneScale node

  Use the LoneScale node to automate work in LoneScale and integrate LoneScale with other applications. n8n has built-in support for managing Lists and Items in LoneScale. 

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

  /// note | Credentials
  You can find authentication information for this node [here](/integrations/builtin/credentials/lonescale.md).
  ///

  ## Operations

  * List
  	* Create
  * Item
  	* Create

  ## Templates and examples

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

  ## Related resources

  Refer to [LoneScales documentation](https://help-center.lonescale.com/en/articles/6454360-lonescale-public-api){:target=_blank .external-link} for more information about the service.

  n8n provides a trigger node for LoneScale. You can find the trigger node docs [here](/integrations/builtin/trigger-nodes/n8n-nodes-base.lonescaletrigger.md).

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

related_resources:
  [{"title":"LoneScales documentation","url":"https://help-center.lonescale.com/en/articles/6454360-lonescale-public-api","type":"external"},{"title":"here","url":"/integrations/builtin/trigger-nodes/n8n-nodes-base.lonescaletrigger.md","type":"documentation"}]

example_workflow:
  {"name":"LoneScale Example Workflow","nodes":[{"parameters":{"resource":"list","operation":"add","type":"COMPANY","list":"","first_name":"Example Name","last_name":"Example Name","company_name":"Example Name","peopleAdditionalFields":{},"companyAdditionalFields":{},"name":"Example Name"},"id":"8nvkutxa37c0fg374u79plb","name":"LoneScale","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"resource":"list","operation":"add","type":"COMPANY","list":"","first_name":"Example Name","last_name":"Example Name","company_name":"Example Name","peopleAdditionalFields":{},"companyAdditionalFields":{},"name":"Example Name"}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"list","required":true,"description":"Manipulate list","options":[{"name":"List","value":"list","description":"Manipulate list"},{"name":"Item","value":"item","description":"Manipulate item"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a list","options":[{"name":"Create","value":"create","description":"Create a list"}]},{"displayName":"Operation","name":"operation","type":"options","default":"add","description":"Create an item","options":[{"name":"Create","value":"add","description":"Create an item"}]},{"displayName":"Type","name":"type","type":"options","default":"PEOPLE","required":true,"description":"List of company","options":[{"name":"Company","value":"COMPANY","description":"List of company"},{"name":"Contact","value":"PEOPLE","description":"List of contact"}]},{"displayName":"List Name or ID","name":"list","type":"options","default":"","required":true,"description":"Choose from the list, or specify an ID using an <a href="},{"displayName":"First Name","name":"first_name","type":"string","default":"","required":true,"description":"Contact first name"},{"displayName":"Last Name","name":"last_name","type":"string","default":"","required":true,"description":"Contact last name"},{"displayName":"Company Name","name":"company_name","type":"string","default":"","description":"Contact company name"},{"displayName":"Additional Fields","name":"peopleAdditionalFields","type":"collection","default":"{","description":"Contact full name","placeholder":"Add Field"},{"displayName":"Additional Fields","name":"companyAdditionalFields","type":"collection","default":"{","description":"Company Linkedin URL","placeholder":"Add Field"},{"displayName":"Name","name":"name","type":"string","default":"","required":true,"description":"Name of your list","placeholder":"list name"},{"displayName":"Type","name":"type","type":"options","default":"COMPANY","required":true,"description":"Create a list of companies","options":[{"name":"Company","value":"COMPANY","description":"Create a list of companies"},{"name":"Contact","value":"PEOPLE","description":"Create a list of contacts"}]}]


