# nodes

node_type: n8n-nodes-base.Contentful
name: Contentful
display_name: Contentful
description: Consume Contentful API
category: input
icon: file:contentful.png
code_hash: 6f3781a04c10511e8692ba49827eb10317ba66b23720b978e9ec69423e57ea05
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Contentful
documentation_title: Contentful node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"contentful","description":"Templates for contentful"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"source":"deliveryApi","resource":"entry","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:24
updated_at: 2025-06-12 08:58:24
source_code:
  "use strict";
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
      }
      Object.defineProperty(o, k2, desc);
  }) : (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      o[k2] = m[k];
  }));
  var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
  }) : function(o, v) {
      o["default"] = v;
  });
  var __importStar = (this && this.__importStar) || function (mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      __setModuleDefault(result, mod);
      return result;
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Contentful = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const SpaceDescription = __importStar(require("./SpaceDescription"));
  const ContentTypeDescription = __importStar(require("./ContentTypeDescription"));
  const EntryDescription = __importStar(require("./EntryDescription"));
  const AssetDescription = __importStar(require("./AssetDescription"));
  const LocaleDescription = __importStar(require("./LocaleDescription"));
  class Contentful {
      constructor() {
          this.description = {
              displayName: 'Contentful',
              name: 'contentful',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              icon: 'file:contentful.png',
              group: ['input'],
              version: 1,
              description: 'Consume Contentful API',
              defaults: {
                  name: 'Contentful',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'contentfulApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Source',
                      name: 'source',
                      type: 'options',
                      default: 'deliveryApi',
                      description: 'Pick where your data comes from, delivery or preview API',
                      options: [
                          {
                              name: 'Delivery API',
                              value: 'deliveryApi',
                          },
                          {
                              name: 'Preview API',
                              value: 'previewApi',
                          },
                      ],
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          AssetDescription.resource,
                          ContentTypeDescription.resource,
                          EntryDescription.resource,
                          LocaleDescription.resource,
                          SpaceDescription.resource,
                      ],
                      default: 'entry',
                  },
                  ...SpaceDescription.operations,
                  ...ContentTypeDescription.operations,
                  ...EntryDescription.operations,
                  ...AssetDescription.operations,
                  ...LocaleDescription.operations,
                  ...SpaceDescription.fields,
                  ...ContentTypeDescription.fields,
                  ...EntryDescription.fields,
                  ...AssetDescription.fields,
                  ...LocaleDescription.fields,
              ],
          };
      }
      async execute() {
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const items = this.getInputData();
          const returnData = [];
          const qs = {};
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'space') {
                      if (operation === 'get') {
                          const credentials = await this.getCredentials('contentfulApi');
                          responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}`);
                      }
                  }
                  if (resource === 'contentType') {
                      if (operation === 'get') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const env = this.getNodeParameter('environmentId', 0);
                          const id = this.getNodeParameter('contentTypeId', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/content_types/${id}`);
                          if (!additionalFields.rawData) {
                              responseData = responseData.fields;
                          }
                      }
                  }
                  if (resource === 'entry') {
                      if (operation === 'get') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const env = this.getNodeParameter('environmentId', 0);
                          const id = this.getNodeParameter('entryId', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/entries/${id}`, {}, qs);
                          if (!additionalFields.rawData) {
                              responseData = responseData.fields;
                          }
                      }
                      else if (operation === 'getAll') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const rawData = additionalFields.rawData;
                          additionalFields.rawData = undefined;
                          const env = this.getNodeParameter('environmentId', i);
                          Object.assign(qs, additionalFields);
                          if (qs.equal) {
                              const [atribute, value] = qs.equal.split('=');
                              qs[atribute] = value;
                              delete qs.equal;
                          }
                          if (qs.notEqual) {
                              const [atribute, value] = qs.notEqual.split('=');
                              qs[atribute] = value;
                              delete qs.notEqual;
                          }
                          if (qs.include) {
                              const [atribute, value] = qs.include.split('=');
                              qs[atribute] = value;
                              delete qs.include;
                          }
                          if (qs.exclude) {
                              const [atribute, value] = qs.exclude.split('=');
                              qs[atribute] = value;
                              delete qs.exclude;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.contentfulApiRequestAllItems.call(this, 'items', 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/entries`, {}, qs);
                              if (!rawData) {
                                  const assets = [];
                                  responseData.map((asset) => {
                                      assets.push(asset.fields);
                                  });
                                  responseData = assets;
                              }
                          }
                          else {
                              const limit = this.getNodeParameter('limit', 0);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/entries`, {}, qs);
                              responseData = responseData.items;
                              if (!rawData) {
                                  const assets = [];
                                  responseData.map((asset) => {
                                      assets.push(asset.fields);
                                  });
                                  responseData = assets;
                              }
                          }
                      }
                  }
                  if (resource === 'asset') {
                      if (operation === 'get') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const env = this.getNodeParameter('environmentId', 0);
                          const id = this.getNodeParameter('assetId', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/assets/${id}`, {}, qs);
                          if (!additionalFields.rawData) {
                              responseData = responseData.fields;
                          }
                      }
                      else if (operation === 'getAll') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const rawData = additionalFields.rawData;
                          additionalFields.rawData = undefined;
                          const env = this.getNodeParameter('environmentId', i);
                          Object.assign(qs, additionalFields);
                          if (qs.equal) {
                              const [atribute, value] = qs.equal.split('=');
                              qs[atribute] = value;
                              delete qs.equal;
                          }
                          if (qs.notEqual) {
                              const [atribute, value] = qs.notEqual.split('=');
                              qs[atribute] = value;
                              delete qs.notEqual;
                          }
                          if (qs.include) {
                              const [atribute, value] = qs.include.split('=');
                              qs[atribute] = value;
                              delete qs.include;
                          }
                          if (qs.exclude) {
                              const [atribute, value] = qs.exclude.split('=');
                              qs[atribute] = value;
                              delete qs.exclude;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.contentfulApiRequestAllItems.call(this, 'items', 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/assets`, {}, qs);
                              if (!rawData) {
                                  const assets = [];
                                  responseData.map((asset) => {
                                      assets.push(asset.fields);
                                  });
                                  responseData = assets;
                              }
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/assets`, {}, qs);
                              responseData = responseData.items;
                              if (!rawData) {
                                  const assets = [];
                                  responseData.map((asset) => {
                                      assets.push(asset.fields);
                                  });
                                  responseData = assets;
                              }
                          }
                      }
                  }
                  if (resource === 'locale') {
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const env = this.getNodeParameter('environmentId', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.contentfulApiRequestAllItems.call(this, 'items', 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/locales`, {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', 0);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/locales`, {}, qs);
                              responseData = responseData.items;
                          }
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {} });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Contentful = Contentful;
  //# sourceMappingURL=Contentful.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ContentfulApi = void 0;
  class ContentfulApi {
      constructor() {
          this.name = 'contentfulApi';
          this.displayName = 'Contentful API';
          this.documentationUrl = 'contentful';
          this.properties = [
              {
                  displayName: 'Space ID',
                  name: 'spaceId',
                  type: 'string',
                  default: '',
                  required: true,
                  description: 'The ID for the Contentful space',
              },
              {
                  displayName: 'Content Delivery API Access Token',
                  name: 'ContentDeliveryaccessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Access token that has access to the space. Can be left empty if only Delivery API should be used.',
              },
              {
                  displayName: 'Content Preview API Access Token',
                  name: 'ContentPreviewaccessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Access token that has access to the space. Can be left empty if only Preview API should be used.',
              },
          ];
      }
  }
  exports.ContentfulApi = ContentfulApi;
  //# sourceMappingURL=ContentfulApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ContentfulApi = void 0;
  class ContentfulApi {
      constructor() {
          this.name = 'contentfulApi';
          this.displayName = 'Contentful API';
          this.documentationUrl = 'contentful';
          this.properties = [
              {
                  displayName: 'Space ID',
                  name: 'spaceId',
                  type: 'string',
                  default: '',
                  required: true,
                  description: 'The ID for the Contentful space',
              },
              {
                  displayName: 'Content Delivery API Access Token',
                  name: 'ContentDeliveryaccessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Access token that has access to the space. Can be left empty if only Delivery API should be used.',
              },
              {
                  displayName: 'Content Preview API Access Token',
                  name: 'ContentPreviewaccessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Access token that has access to the space. Can be left empty if only Preview API should be used.',
              },
          ];
      }
  }
  exports.ContentfulApi = ContentfulApi;
  //# sourceMappingURL=ContentfulApi.credentials.js.map

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

  # Contentful node

  Use the Contentful node to automate work in Contentful, and integrate Contentful with other applications. n8n has built-in support for a wide range of Contentful features, including getting assets, content types, entries, locales, and space.

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

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

  ## Operations

  * Asset
      * Get
      * Get All
  * Content Type
      * Get
  * Entry
      * Get
      * Get All
  * Locale
      * Get All
  * Space
      * Get

  ## Templates and examples

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

example_workflow:
  {"name":"Contentful Example Workflow","nodes":[{"parameters":{"source":"deliveryApi","resource":"entry","dynamic_property":null},"id":"055wzdiey9xuau6kfjd1oya","name":"Contentful","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Source","name":"source","type":"options","default":"deliveryApi","description":"Pick where your data comes from, delivery or preview API","options":[{"name":"Delivery API","value":"deliveryApi"},{"name":"Preview API","value":"previewApi"}]},{"displayName":"Resource","name":"resource","type":"options","default":"entry","options":[]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SpaceDescription.operations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContentTypeDescription.operations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EntryDescription.operations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AssetDescription.operations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...LocaleDescription.operations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SpaceDescription.fields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContentTypeDescription.fields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EntryDescription.fields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AssetDescription.fields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...LocaleDescription.fields"}]


node_type: n8n-nodes-base.Copper
name: Copper
display_name: Copper
description: Consume the Copper API
category: transform
icon: file:copper.svg
code_hash: 58626d8463fe950ea43cdbf38c7f1922aa76e79c36751703680e2885527e52b9
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Copper
documentation_title: Copper node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"copper","description":"Templates for copper"}]
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:24
updated_at: 2025-06-12 08:58:24
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Copper = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Copper {
      constructor() {
          this.description = {
              displayName: 'Copper',
              name: 'copper',
              icon: 'file:copper.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Copper API',
              defaults: {
                  name: 'Copper',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'copperApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Company',
                              value: 'company',
                          },
                          {
                              name: 'Customer Source',
                              value: 'customerSource',
                          },
                          {
                              name: 'Lead',
                              value: 'lead',
                          },
                          {
                              name: 'Opportunity',
                              value: 'opportunity',
                          },
                          {
                              name: 'Person',
                              value: 'person',
                          },
                          {
                              name: 'Project',
                              value: 'project',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'company',
                  },
                  ...descriptions_1.companyOperations,
                  ...descriptions_1.companyFields,
                  ...descriptions_1.customerSourceOperations,
                  ...descriptions_1.customerSourceFields,
                  ...descriptions_1.leadOperations,
                  ...descriptions_1.leadFields,
                  ...descriptions_1.opportunityOperations,
                  ...descriptions_1.opportunityFields,
                  ...descriptions_1.personOperations,
                  ...descriptions_1.personFields,
                  ...descriptions_1.projectOperations,
                  ...descriptions_1.projectFields,
                  ...descriptions_1.taskOperations,
                  ...descriptions_1.taskFields,
                  ...descriptions_1.userOperations,
                  ...descriptions_1.userFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'company') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustCompanyFields)(additionalFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/companies', body);
                      }
                      else if (operation === 'delete') {
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/companies/${companyId}`);
                      }
                      else if (operation === 'get') {
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/companies/${companyId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/companies/search', body);
                      }
                      else if (operation === 'update') {
                          const companyId = this.getNodeParameter('companyId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustCompanyFields)(updateFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/companies/${companyId}`, body);
                      }
                  }
                  else if (resource === 'customerSource') {
                      if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/customer_sources');
                      }
                  }
                  else if (resource === 'lead') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustLeadFields)(additionalFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/leads', body);
                      }
                      else if (operation === 'delete') {
                          const leadId = this.getNodeParameter('leadId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/leads/${leadId}`);
                      }
                      else if (operation === 'get') {
                          const leadId = this.getNodeParameter('leadId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/leads/${leadId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/leads/search', body);
                      }
                      else if (operation === 'update') {
                          const leadId = this.getNodeParameter('leadId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustLeadFields)(updateFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/leads/${leadId}`, body);
                      }
                  }
                  else if (resource === 'opportunity') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                              customer_source_id: this.getNodeParameter('customerSourceId', i),
                              primary_contact_id: this.getNodeParameter('primaryContactId', i),
                          };
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/opportunities', body);
                      }
                      else if (operation === 'delete') {
                          const opportunityId = this.getNodeParameter('opportunityId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/opportunities/${opportunityId}`);
                      }
                      else if (operation === 'get') {
                          const opportunityId = this.getNodeParameter('opportunityId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/opportunities/${opportunityId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/opportunities/search', body);
                      }
                      else if (operation === 'update') {
                          const opportunityId = this.getNodeParameter('opportunityId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/opportunities/${opportunityId}`, body);
                      }
                  }
                  else if (resource === 'person') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustPersonFields)(additionalFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/people', body);
                      }
                      else if (operation === 'delete') {
                          const personId = this.getNodeParameter('personId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/people/${personId}`);
                      }
                      else if (operation === 'get') {
                          const personId = this.getNodeParameter('personId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/people/${personId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/people/search', body);
                      }
                      else if (operation === 'update') {
                          const personId = this.getNodeParameter('personId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustPersonFields)(updateFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/people/${personId}`, body);
                      }
                  }
                  else if (resource === 'project') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/projects', body);
                      }
                      else if (operation === 'delete') {
                          const projectId = this.getNodeParameter('projectId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/projects/${projectId}`);
                      }
                      else if (operation === 'get') {
                          const projectId = this.getNodeParameter('projectId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/projects/${projectId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/projects/search', body);
                      }
                      else if (operation === 'update') {
                          const projectId = this.getNodeParameter('projectId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/projects/${projectId}`, body);
                      }
                  }
                  else if (resource === 'task') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/tasks', body);
                      }
                      else if (operation === 'delete') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/tasks/${taskId}`);
                      }
                      else if (operation === 'get') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/tasks/${taskId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustTaskFields)(filterFields));
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/tasks/search', body);
                      }
                      else if (operation === 'update') {
                          const taskId = this.getNodeParameter('taskId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/tasks/${taskId}`, body);
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/users/search');
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.toString(), json: {} });
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Copper = Copper;
  //# sourceMappingURL=Copper.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CopperApi = void 0;
  class CopperApi {
      constructor() {
          this.name = 'copperApi';
          this.displayName = 'Copper API';
          this.documentationUrl = 'copper';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Email',
                  name: 'email',
                  required: true,
                  type: 'string',
                  placeholder: 'name@email.com',
                  default: '',
              },
          ];
      }
  }
  exports.CopperApi = CopperApi;
  //# sourceMappingURL=CopperApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CopperApi = void 0;
  class CopperApi {
      constructor() {
          this.name = 'copperApi';
          this.displayName = 'Copper API';
          this.documentationUrl = 'copper';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Email',
                  name: 'email',
                  required: true,
                  type: 'string',
                  placeholder: 'name@email.com',
                  default: '',
              },
          ];
      }
  }
  exports.CopperApi = CopperApi;
  //# sourceMappingURL=CopperApi.credentials.js.map

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

  # Copper node

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

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

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

  ## Operations

  * Company
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Customer Source
      * Get All
  * Lead
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Opportunity
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Person
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Project
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Task
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * User
      * Get All

  ## Templates and examples

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

example_workflow:
  {"name":"Copper Example Workflow","nodes":[{"parameters":{"resource":"company","dynamic_property":null},"id":"14iqa6k3cc8ue6pbqb5drg","name":"Copper","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":"Customer Source","value":"customerSource"},{"name":"Lead","value":"lead"},{"name":"Opportunity","value":"opportunity"},{"name":"Person","value":"person"},{"name":"Project","value":"project"},{"name":"Task","value":"task"},{"name":"User","value":"user"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.companyOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.companyFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.customerSourceOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.customerSourceFields"},{"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.opportunityOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.opportunityFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.personOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.personFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.projectOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.projectFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.taskOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.taskFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.userOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.userFields"}]


node_type: n8n-nodes-base.ConvertKit
name: ConvertKit
display_name: ConvertKit
description: Consume ConvertKit API
category: input
icon: file:convertKit.svg
code_hash: f7753276ed6031dda1d07432d51218d88822fad961e6f03e0d1ec1709895c87f
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.ConvertKit
documentation_title: ConvertKit node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"convertkit","description":"Templates for convertkit"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"customField","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:24
updated_at: 2025-06-12 08:58:24
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ConvertKit = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const CustomFieldDescription_1 = require("./CustomFieldDescription");
  const FormDescription_1 = require("./FormDescription");
  const SequenceDescription_1 = require("./SequenceDescription");
  const TagDescription_1 = require("./TagDescription");
  const TagSubscriberDescription_1 = require("./TagSubscriberDescription");
  class ConvertKit {
      constructor() {
          this.description = {
              displayName: 'ConvertKit',
              name: 'convertKit',
              icon: 'file:convertKit.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume ConvertKit API',
              defaults: {
                  name: 'ConvertKit',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'convertKitApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Custom Field',
                              value: 'customField',
                          },
                          {
                              name: 'Form',
                              value: 'form',
                          },
                          {
                              name: 'Sequence',
                              value: 'sequence',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                          },
                          {
                              name: 'Tag Subscriber',
                              value: 'tagSubscriber',
                          },
                      ],
                      default: 'form',
                  },
                  ...CustomFieldDescription_1.customFieldOperations,
                  ...CustomFieldDescription_1.customFieldFields,
                  ...FormDescription_1.formOperations,
                  ...FormDescription_1.formFields,
                  ...SequenceDescription_1.sequenceOperations,
                  ...SequenceDescription_1.sequenceFields,
                  ...TagDescription_1.tagOperations,
                  ...TagDescription_1.tagFields,
                  ...TagSubscriberDescription_1.tagSubscriberOperations,
                  ...TagSubscriberDescription_1.tagSubscriberFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTags() {
                      const returnData = [];
                      const { tags } = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/tags');
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = tag.id;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
                  async getForms() {
                      const returnData = [];
                      const { forms } = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/forms');
                      for (const form of forms) {
                          const formName = form.name;
                          const formId = form.id;
                          returnData.push({
                              name: formName,
                              value: formId,
                          });
                      }
                      return returnData;
                  },
                  async getSequences() {
                      const returnData = [];
                      const { courses } = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/sequences');
                      for (const course of courses) {
                          const courseName = course.name;
                          const courseId = course.id;
                          returnData.push({
                              name: courseName,
                              value: courseId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'customField') {
                      if (operation === 'create') {
                          const label = this.getNodeParameter('label', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', '/custom_fields', { label }, qs);
                      }
                      if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'DELETE', `/custom_fields/${id}`);
                      }
                      if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', `/custom_fields/${id}`);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/custom_fields');
                          responseData = responseData.custom_fields;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const label = this.getNodeParameter('label', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'PUT', `/custom_fields/${id}`, {
                              label,
                          });
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'form') {
                      if (operation === 'addSubscriber') {
                          const email = this.getNodeParameter('email', i);
                          const formId = this.getNodeParameter('id', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                          };
                          if (additionalFields.firstName) {
                              body.first_name = additionalFields.firstName;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.fieldsUi) {
                              const fieldValues = additionalFields.fieldsUi
                                  .fieldsValues;
                              if (fieldValues) {
                                  body.fields = {};
                                  for (const fieldValue of fieldValues) {
                                      body.fields[fieldValue.key] = fieldValue.value;
                                  }
                              }
                          }
                          const { subscription } = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', `/forms/${formId}/subscribe`, body);
                          responseData = subscription;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/forms');
                          responseData = responseData.forms;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      if (operation === 'getSubscriptions') {
                          const formId = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.subscriberState) {
                              qs.subscriber_state = additionalFields.subscriberState;
                          }
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', `/forms/${formId}/subscriptions`, {}, qs);
                          responseData = responseData.subscriptions;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  if (resource === 'sequence') {
                      if (operation === 'addSubscriber') {
                          const email = this.getNodeParameter('email', i);
                          const sequenceId = this.getNodeParameter('id', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                          };
                          if (additionalFields.firstName) {
                              body.first_name = additionalFields.firstName;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.fieldsUi) {
                              const fieldValues = additionalFields.fieldsUi
                                  .fieldsValues;
                              if (fieldValues) {
                                  body.fields = {};
                                  for (const fieldValue of fieldValues) {
                                      body.fields[fieldValue.key] = fieldValue.value;
                                  }
                              }
                          }
                          const { subscription } = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', `/sequences/${sequenceId}/subscribe`, body);
                          responseData = subscription;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/sequences');
                          responseData = responseData.courses;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      if (operation === 'getSubscriptions') {
                          const sequenceId = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.subscriberState) {
                              qs.subscriber_state = additionalFields.subscriberState;
                          }
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', `/sequences/${sequenceId}/subscriptions`, {}, qs);
                          responseData = responseData.subscriptions;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  if (resource === 'tag') {
                      if (operation === 'create') {
                          const names = this.getNodeParameter('name', i)
                              .split(',')
                              .map((e) => ({ name: e }));
                          const body = {
                              tag: names,
                          };
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', '/tags', body);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/tags');
                          responseData = responseData.tags;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  if (resource === 'tagSubscriber') {
                      if (operation === 'add') {
                          const tagId = this.getNodeParameter('tagId', i);
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                          };
                          if (additionalFields.firstName) {
                              body.first_name = additionalFields.firstName;
                          }
                          if (additionalFields.fieldsUi) {
                              const fieldValues = additionalFields.fieldsUi
                                  .fieldsValues;
                              if (fieldValues) {
                                  body.fields = {};
                                  for (const fieldValue of fieldValues) {
                                      body.fields[fieldValue.key] = fieldValue.value;
                                  }
                              }
                          }
                          const { subscription } = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', `/tags/${tagId}/subscribe`, body);
                          responseData = subscription;
                      }
                      if (operation === 'getAll') {
                          const tagId = this.getNodeParameter('tagId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', `/tags/${tagId}/subscriptions`);
                          responseData = responseData.subscriptions;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      if (operation === 'delete') {
                          const tagId = this.getNodeParameter('tagId', i);
                          const email = this.getNodeParameter('email', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', `/tags/${tagId}>/unsubscribe`, { email });
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {} });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.ConvertKit = ConvertKit;
  //# sourceMappingURL=ConvertKit.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ConvertKitApi = void 0;
  class ConvertKitApi {
      constructor() {
          this.name = 'convertKitApi';
          this.displayName = 'ConvertKit API';
          this.documentationUrl = 'convertKit';
          this.properties = [
              {
                  displayName: 'API Secret',
                  name: 'apiSecret',
                  type: 'string',
                  default: '',
                  typeOptions: {
                      password: true,
                  },
              },
          ];
      }
  }
  exports.ConvertKitApi = ConvertKitApi;
  //# sourceMappingURL=ConvertKitApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ConvertKitApi = void 0;
  class ConvertKitApi {
      constructor() {
          this.name = 'convertKitApi';
          this.displayName = 'ConvertKit API';
          this.documentationUrl = 'convertKit';
          this.properties = [
              {
                  displayName: 'API Secret',
                  name: 'apiSecret',
                  type: 'string',
                  default: '',
                  typeOptions: {
                      password: true,
                  },
              },
          ];
      }
  }
  exports.ConvertKitApi = ConvertKitApi;
  //# sourceMappingURL=ConvertKitApi.credentials.js.map

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

  # ConvertKit node

  Use the ConvertKit node to automate work in ConvertKit, and integrate ConvertKit with other applications. n8n has built-in support for a wide range of ConvertKit features, including creating and deleting custom fields, getting tags, and adding subscribers.

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

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

  ## Operations

  * Custom Field
      * Create a field
      * Delete a field
      * Get all fields
      * Update a field
  * Form
      * Add a subscriber
      * Get all forms
      * List subscriptions to a form including subscriber data
  * Sequence
      * Add a subscriber
      * Get all sequences
      * Get all subscriptions to a sequence including subscriber data
  * Tag
      * Create a tag
      * Get all tags
  * Tag Subscriber
      * Add a tag to a subscriber
      * List subscriptions to a tag including subscriber data
      * Delete a tag from a subscriber

  ## Templates and examples

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

example_workflow:
  {"name":"ConvertKit Example Workflow","nodes":[{"parameters":{"resource":"customField","dynamic_property":null},"id":"a691czf8ina4fvaaqzbf4h","name":"ConvertKit","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":"form","options":[{"name":"Custom Field","value":"customField"},{"name":"Form","value":"form"},{"name":"Sequence","value":"sequence"},{"name":"Tag","value":"tag"},{"name":"Tag Subscriber","value":"tagSubscriber"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CustomFieldDescription_1.customFieldOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CustomFieldDescription_1.customFieldFields"},{"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":"...SequenceDescription_1.sequenceOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SequenceDescription_1.sequenceFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...TagDescription_1.tagOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...TagDescription_1.tagFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...TagSubscriberDescription_1.tagSubscriberOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...TagSubscriberDescription_1.tagSubscriberFields"}]


node_type: n8n-nodes-base.Code
name: Code
display_name: Code
description: Run custom JavaScript or Python code
category: transform
icon: fa:code
code_hash: 97df4024967b2e5c96a0738b9aaa3e94926e65bbe65b3a7e0f0b3e45baa8c879
documentation_url: https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.code
documentation_title: LangChain Code node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"langchain-code","description":"Templates for langchain-code"}]
related_resources: []
required_scopes: []
parameter_schemas: []
example_parameters: {"mode":"runOnceForAllItems","language":"javaScript","dynamic_property":null}
package_name: n8n-nodes-base
extracted_at: 2025-06-12 08:58:24
updated_at: 2025-06-12 08:58:24
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Code = void 0;
  const JavascriptCodeDescription_1 = require("./descriptions/JavascriptCodeDescription");
  const PythonCodeDescription_1 = require("./descriptions/PythonCodeDescription");
  const JavaScriptSandbox_1 = require("./JavaScriptSandbox");
  const PythonSandbox_1 = require("./PythonSandbox");
  const Sandbox_1 = require("./Sandbox");
  const utils_1 = require("./utils");
  const { CODE_ENABLE_STDOUT } = process.env;
  class Code {
      constructor() {
          this.description = {
              displayName: 'Code',
              name: 'code',
              icon: 'fa:code',
              group: ['transform'],
              version: [1, 2],
              defaultVersion: 2,
              description: 'Run custom JavaScript or Python code',
              defaults: {
                  name: 'Code',
                  color: '#FF9922',
              },
              inputs: ['main'],
              outputs: ['main'],
              parameterPane: 'wide',
              properties: [
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Run Once for All Items',
                              value: 'runOnceForAllItems',
                              description: 'Run this code only once, no matter how many input items there are',
                          },
                          {
                              name: 'Run Once for Each Item',
                              value: 'runOnceForEachItem',
                              description: 'Run this code as many times as there are input items',
                          },
                      ],
                      default: 'runOnceForAllItems',
                  },
                  {
                      displayName: 'Language',
                      name: 'language',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              '@version': [2],
                          },
                      },
                      options: [
                          {
                              name: 'JavaScript',
                              value: 'javaScript',
                          },
                          {
                              name: 'Python (Beta)',
                              value: 'python',
                          },
                      ],
                      default: 'javaScript',
                  },
                  {
                      displayName: 'Language',
                      name: 'language',
                      type: 'hidden',
                      displayOptions: {
                          show: {
                              '@version': [1],
                          },
                      },
                      default: 'javaScript',
                  },
                  ...JavascriptCodeDescription_1.javascriptCodeDescription,
                  ...PythonCodeDescription_1.pythonCodeDescription,
              ],
          };
      }
      async execute() {
          const nodeMode = this.getNodeParameter('mode', 0);
          const workflowMode = this.getMode();
          const node = this.getNode();
          const language = node.typeVersion === 2
              ? this.getNodeParameter('language', 0)
              : 'javaScript';
          const codeParameterName = language === 'python' ? 'pythonCode' : 'jsCode';
          const getSandbox = (index = 0) => {
              const code = this.getNodeParameter(codeParameterName, index);
              const context = Sandbox_1.getSandboxContext.call(this, index);
              if (nodeMode === 'runOnceForAllItems') {
                  context.items = context.$input.all();
              }
              else {
                  context.item = context.$input.item;
              }
              const Sandbox = language === 'python' ? PythonSandbox_1.PythonSandbox : JavaScriptSandbox_1.JavaScriptSandbox;
              const sandbox = new Sandbox(context, code, index, this.helpers);
              sandbox.on('output', workflowMode === 'manual'
                  ? this.sendMessageToUI
                  : CODE_ENABLE_STDOUT === 'true'
                      ? (...args) => console.log(`[Workflow "${this.getWorkflow().id}"][Node "${node.name}"]`, ...args)
                      : () => { });
              return sandbox;
          };
          if (nodeMode === 'runOnceForAllItems') {
              const sandbox = getSandbox();
              let items;
              try {
                  items = await sandbox.runCodeAllItems();
              }
              catch (error) {
                  if (!this.continueOnFail())
                      throw error;
                  items = [{ json: { error: error.message } }];
              }
              for (const item of items) {
                  (0, utils_1.standardizeOutput)(item.json);
              }
              return [items];
          }
          const returnData = [];
          const items = this.getInputData();
          for (let index = 0; index < items.length; index++) {
              const sandbox = getSandbox(index);
              let result;
              try {
                  result = await sandbox.runCodeEachItem();
              }
              catch (error) {
                  if (!this.continueOnFail())
                      throw error;
                  returnData.push({ json: { error: error.message } });
              }
              if (result) {
                  returnData.push({
                      json: (0, utils_1.standardizeOutput)(result.json),
                      pairedItem: { item: index },
                      ...(result.binary && { binary: result.binary }),
                  });
              }
          }
          return [returnData];
      }
  }
  exports.Code = Code;
  //# sourceMappingURL=Code.node.js.map

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

  # LangChain Code node

  Use the LangChain Code node to import LangChain. This means if there is functionality you need that n8n hasn't created a node for, you can still use it. By configuring the LangChain Code node connectors you can use it as a normal node, root node or sub-node.

  On this page, you'll find the node parameters, guidance on configuring the node, and links to more resources.

  /// note | Not available on Cloud
  This node is only available on self-hosted n8n.
  ///

  ## Node parameters

  ### Add Code

  Add your custom code. Choose either **Execute** or **Supply Data** mode. You can only use one mode.

  Unlike the [Code node](/integrations/builtin/core-nodes/n8n-nodes-base.code/index.md), the LangChain Code node doesn't support Python.

  * **Execute**: use the LangChain Code node like n8n's own Code node. This takes input data from the workflow, processes it, and returns it as the node output. This mode requires a main input and output. You must create these connections in **Inputs** and **Outputs**.
  * **Supply Data**: use the LangChain Code node as a sub-node, sending data to a root node. This uses an output other than main.

  By default, you can't load built-in or external modules in this node. Self-hosted users can [enable built-in and external modules](/hosting/configuration/configuration-methods.md).

  ### Inputs

  Choose the input types. 

  The main input is the normal connector found in all n8n workflows. If you have a main input and output set in the node, **Execute** code is required.

  ### Outputs

  Choose the output types. 

  The main output is the normal connector found in all n8n workflows. If you have a main input and output set in the node, **Execute** code is required.

  ## Node inputs and outputs configuration

  By configuring the LangChain Code node connectors (inputs and outputs) you can use it as an app node, root node or sub-node.

  ![Screenshot of a workflow with four LangChain nodes, configured as different node types](/_images/integrations/builtin/cluster-nodes/langchaincode/create-node-types.png)

  | Node type | Inputs | Outputs | Code mode |
  | --------- | ------ | ------- | --------- |
  | App node. Similar to the [Code node](/integrations/builtin/core-nodes/n8n-nodes-base.code/index.md). | Main | Main | Execute |
  | Root node | Main; at least one other type | Main | Execute |
  | Sub-node | - | A type other than main. Must match the input type you want to connect to. | Supply Data |
  | Sub-node with sub-nodes | A type other than main |A type other than main. Must match the input type you want to connect to. | Supply Data |

  ## Built-in methods

  n8n provides these methods to make it easier to perform common tasks in the LangChain Code node.

  --8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-root-nodes/langchaincode/builtin-methods.md"

  ## Templates and examples

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

  ## Related resources

  --8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-overview-link.md"
  --8<-- "_glossary/ai-glossary.md"

workflow_examples:
  [{"name":"ask_a_human","workflow":{"name":"Ask a human","nodes":[{"parameters":{},"id":"a60c8572-56c1-4bf3-8352-a6419a475887","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","typeVersion":1.1,"position":[900,760]},{"parameters":{"name":"dont_know_tool","description":"Use this tool if you don't know the answer to the user's question, or if you're not very confident about your answer.","workflowId":"={{ $workflow.id}}","fields":{"values":[{"name":"chatInput","stringValue":"={{ $('Chat Trigger').item.json.chatInput }}"}]}},"id":"b4f2e26c-903b-46b8-bd8b-110fd64de9e4","name":"Not sure?","type":"@n8n/n8n-nodes-langchain.toolWorkflow","typeVersion":1,"position":[1120,760]},{"parameters":{},"id":"951cc691-b422-4ce6-901f-b7feb3afd1ad","name":"Execute Workflow Trigger","type":"n8n-nodes-base.executeWorkflowTrigger","typeVersion":1,"position":[540,1360]},{"parameters":{"content":"### Sub-workflow: Custom tool\nThe agent above can call this workflow. It checks if the user has supplied an email address. If they haven't it prompts them to provide one. If they have, it messages a customer support channel for help.","height":775.3931210698682,"width":1118.3459011229047,"color":7},"id":"194ba9c0-e256-449a-8da7-ac5339123a99","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[500,1020],"typeVersion":1},{"parameters":{"content":"### Main workflow: AI agent using custom tool","height":486.5625,"width":927.5,"color":7},"id":"38c6b363-45a7-4e72-9e40-8c0df3cc480f","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[500,460],"typeVersion":1},{"parameters":{"content":"**This tool calls the sub-workflow below**","height":179.21380662202682,"width":197.45572294791873,"color":5},"id":"0389315b-e48d-4b00-b9a1-899302b1b094","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1060,700],"typeVersion":1},{"parameters":{"content":"**Set your credentials**","height":213.44323866265472,"width":150,"color":2},"id":"fb11064a-4cf5-4110-9e39-af24a3225164","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[700,680]},{"parameters":{"content":"**Set your credentials and Slack details**","height":250.57252651663197,"width":178.0499248677781,"color":2},"id":"d689021d-0a46-4dff-a01a-0b01ecdd198b","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1020,1180]},{"parameters":{"content":"## Try it out\n\nSelect **Chat** at the bottom and enter:\n\n_Hi! Please respond to this as if you don't know the answer to my query._","height":214.8397420554627,"width":185.9375,"color":4},"id":"0926cd61-c0b8-4bae-ae65-9afd130d17cd","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[340,520],"typeVersion":1},{"parameters":{"content":"## Next steps\n\nLearn more about [Advanced AI in n8n](https://docs.n8n.io/advanced-ai/)","height":144.50520156238127},"id":"cde69dfe-252e-4a05-8d56-fa79431df5d8","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1580,1600]},{"parameters":{},"id":"927b775a-47f6-4067-a1a5-5f13dea28e45","name":"Chat Trigger","type":"@n8n/n8n-nodes-langchain.chatTrigger","typeVersion":1,"position":[600,520],"webhookId":"785e0c0c-12e5-4249-9abe-47bb131975cb"},{"parameters":{"jsCode":"response = {\"response\":\"I'm sorry I don't know the answer. Please repeat your question and include your email address so I can request help.\"};\nreturn response;"},"id":"971e7b90-c2d8-4292-9da8-732d7d399f04","name":"Prompt the user to provide an email","type":"n8n-nodes-base.code","typeVersion":2,"position":[1060,1520]},{"parameters":{"jsCode":"response = {\"response\": \"Thank you for getting in touch. I've messaged a human to help.\"}\nreturn response;"},"id":"6f5a21b3-c145-46c8-8e69-660100c4a6fc","name":"Confirm that we've messaged a human","type":"n8n-nodes-base.code","typeVersion":2,"position":[1300,1260]},{"parameters":{"options":{"systemMessage":"Try to answer the user's question. When you can't answer, or you're not confident of the answer, use the appropriate tool. When you use the dont_know_tool, respond with the message from the tool."}},"id":"8b17da5e-e392-4028-91b0-bc02d34e46ed","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","typeVersion":1.2,"position":[820,520]},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"5e21e7c5-db60-4111-bb17-c289ae0fc159","leftValue":"={{ $('Execute Workflow Trigger').item.json.chatInput }}","rightValue":"/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+)/gi","operator":{"type":"string","operation":"regex"}}],"combinator":"and"},"options":{}},"id":"990ecd3b-6aa0-4b17-8d01-d606b9164fa8","name":"Check if user has provided email","type":"n8n-nodes-base.if","typeVersion":2,"position":[760,1360]},{"parameters":{"select":"channel","channelId":{"__rl":true,"value":"","mode":"name"},"text":"={{ \"A user had a question the bot couldn't answer. Here's their message: \" + $('Execute Workflow Trigger').item.json.chatInput }}","otherOptions":{}},"id":"d14da0ae-06ca-422b-b5b6-e7759e74c787","name":"Message Slack for help","type":"n8n-nodes-base.slack","typeVersion":2.1,"position":[1060,1260]},{"parameters":{"model":"gpt-4","options":{"temperature":0.2}},"id":"278391c7-6945-495e-a4f1-74fb8fcc3549","name":"GPT4","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","typeVersion":1,"position":[740,740]}],"pinData":{},"connections":{"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Not sure?":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Execute Workflow Trigger":{"main":[[{"node":"Check if user has provided email","type":"main","index":0}]]},"Chat Trigger":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Check if user has provided email":{"main":[[{"node":"Message Slack for help","type":"main","index":0}],[{"node":"Prompt the user to provide an email","type":"main","index":0}]]},"Message Slack for help":{"main":[[{"node":"Confirm that we've messaged a human","type":"main","index":0}]]},"GPT4":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]}}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"response = {\"response\":\"I'm sorry I don't know the answer. Please repeat your question and include your email address so I can request help.\"};\nreturn response;"},"position":[1060,1520]},{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"response = {\"response\": \"Thank you for getting in touch. I've messaged a human to help.\"}\nreturn response;"},"position":[1300,1260]}],"connections":{"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Not sure?":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Execute Workflow Trigger":{"main":[[{"node":"Check if user has provided email","type":"main","index":0}]]},"Chat Trigger":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Check if user has provided email":{"main":[[{"node":"Message Slack for help","type":"main","index":0}],[{"node":"Prompt the user to provide an email","type":"main","index":0}]]},"Message Slack for help":{"main":[[{"node":"Confirm that we've messaged a human","type":"main","index":0}]]},"GPT4":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]}},"source":"docs/_workflows/advanced-ai/examples/ask_a_human.json"},{"name":"chat_with_google_sheets_docs_version","workflow":{"name":"Chat with Google Sheets (docs version)","nodes":[{"parameters":{},"id":"e96a5e41-f0d6-49c1-977e-ff724a857212","name":"Execute Workflow Trigger","type":"n8n-nodes-base.executeWorkflowTrigger","position":[540,1240],"typeVersion":1},{"parameters":{"content":"### Sub-workflow: Custom tool\nThe agent above can call this workflow. It returns three different types of data from the Google Sheet, which can be used together for more complex queries without returning the whole sheet (which might be too big for GPT to handle).","height":612.0936015224503,"width":1449.2963504228514,"color":7},"id":"67facef0-e9c6-4280-8232-78f654b420d5","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[461.9740563285368,970.616715060075],"typeVersion":1},{"parameters":{"content":"### Main workflow: AI agent using custom tool","height":486.5625,"width":927.5,"color":7},"id":"bc448102-954b-451e-9bf7-bcadbc53bdbc","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[460,460],"typeVersion":1},{"parameters":{"content":"## Try it out\n\nSelect **Chat** at the bottom and enter:\n\n_Which is our biggest customer?_","height":183.85014518022527,"width":185.9375,"color":4},"id":"afb2da2f-8da2-4ee8-bff9-55a99eeecc5c","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[300,540],"typeVersion":1},{"parameters":{},"id":"5d56d128-9a83-45ee-a34c-bc1190d59322","name":"Chat Trigger","type":"@n8n/n8n-nodes-langchain.chatTrigger","position":[600,560],"webhookId":"e3f23177-c7c1-417b-a513-1c1090dda0a2","typeVersion":1},{"parameters":{"authentication":"serviceAccount","documentId":{"__rl":true,"mode":"url","value":"={{ $json.sheetUrl }}"},"sheetName":{"__rl":true,"mode":"url","value":"={{ $json.sheetUrl }}"},"options":{}},"id":"3c0e4b48-a27b-472f-948e-9aa001c49149","name":"Get Google sheet contents","type":"n8n-nodes-base.googleSheets","position":[980,1240],"typeVersion":4.2},{"parameters":{"fields":{"values":[{"name":"sheetUrl"}]},"options":{}},"id":"67f9c172-e70f-4a0f-afd3-513cfeae09db","name":"Set Google Sheet URL","type":"n8n-nodes-base.set","position":[760,1240],"typeVersion":3.2},{"parameters":{"fields":{"values":[{"name":"response","stringValue":"={{ Object.keys($json) }}"}]},"include":"none","options":{}},"id":"d49223eb-2927-4ddd-bd2c-cd439f927341","name":"Get column names","type":"n8n-nodes-base.set","position":[1440,1060],"executeOnce":true,"typeVersion":3.2},{"parameters":{"jsCode":"return {\n  'response': JSON.stringify($input.all().map(x => x.json))\n}"},"id":"37ceba7a-1f0b-4de7-ae4a-d29a18dabaf6","name":"Prepare output","type":"n8n-nodes-base.code","position":[1720,1240],"typeVersion":2},{"parameters":{"name":"list_columns_tool","description":"=### List all column names in customer data\nThis is useful to find out what data is available for each customer. Returns a JSON array containing all the column names.","workflowId":"={{ $workflow.id }}","fields":{"values":[{"name":"operation","stringValue":"column_names"}]}},"id":"94516eb1-89fc-4d3f-8000-d0fa43cd71cd","name":"List columns tool","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[940,780],"typeVersion":1},{"parameters":{"name":"get_customer_tool","description":"=### Get all columns for a given customer\nTo use this mode, pass the row number of the customer. Returns a JSON object with all the column names and their values.","workflowId":"={{ $workflow.id }}","fields":{"values":[{"name":"operation","stringValue":"row"}]}},"id":"006745a1-3df7-4de9-9483-c6e133272c55","name":"Get customer tool","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[1220,780],"typeVersion":1},{"parameters":{},"id":"c3d20569-1374-4f8d-8779-23b98952d124","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[800,780],"typeVersion":1.1},{"parameters":{"name":"column_values_tool","description":"=### Get the specified column value for all customers\nThis is useful if you want to find out which customers have a certain value for a given column. Returns an array of JSON objects, one per customer. Each JSON object includes the column being requested, plus the row_number column. (The row_number column can be used to request the full customer data in a second step.). To use this mode, pass the name of the column to fetch.\n\nYou may want to call the 'list columns' tool first to find out which columns you could be fetching.","workflowId":"={{ $workflow.id }}","fields":{"values":[{"name":"operation","stringValue":"column_values"}]}},"id":"3a370ae9-eaf8-4e84-948b-848c461ac9eb","name":"Get column values tool","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[1080,780],"typeVersion":1},{"parameters":{"text":"={{ $json.chatInput }}","options":{"maxIterations":10}},"id":"8f2a4854-2177-4ac8-9501-fa36cf2a3d73","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[820,560],"typeVersion":1.1},{"parameters":{"content":"**These tools all call the sub-workflow below**","height":179.21380662202682,"width":432.3271051132649,"color":5},"id":"2576563b-a104-4d99-b3c8-b53bff4c740c","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[900,740.8693557231958],"typeVersion":1},{"parameters":{"content":"**Change the URL of the Google Sheet**","height":226.64416053838073,"width":179.99762227826224,"color":2},"id":"5b623d9e-e188-403d-a702-9ece6172a487","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[723,1172],"typeVersion":1},{"parameters":{"model":"gpt-4","options":{"temperature":0}},"id":"2b8c8a67-a4df-4f5c-8c13-3cb2d25d2c5f","name":"GPT4 Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[660,780],"typeVersion":1},{"parameters":{"content":"**Set your credentials**","height":171,"width":150,"color":2},"id":"f39d0c9b-4055-4331-83c8-3dbffb43478e","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[620,720]},{"parameters":{"content":"**Set your credentials**","height":237,"width":176,"color":2},"id":"a8e09ef8-4dc6-4918-9194-047de402a8fa","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[940,1172]},{"parameters":{"content":"## Next steps\n\nLearn more about [Advanced AI in n8n](https://docs.n8n.io/advanced-ai/)","height":126.0084096222716,"width":291.1204551358572},"id":"a391dfb1-f408-4498-99cd-d35a258d6c9a","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1740,1540]},{"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"leftValue":"={{ $('Execute Workflow Trigger').item.json.operation }}","rightValue":"column_names","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"col names"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"9fe58592-72e2-4379-9bdb-10da19c8218b","leftValue":"={{ $('Execute Workflow Trigger').item.json.operation }}","rightValue":"column_values","operator":{"type":"string","operation":"equals","name":"filter.operator.equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"col values"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"c1836f93-7874-43a4-98ff-cc487b276600","leftValue":"={{ $('Execute Workflow Trigger').item.json.operation }}","rightValue":"row","operator":{"type":"string","operation":"equals","name":"filter.operator.equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"rows"}]},"options":{}},"id":"907deea9-26cc-427e-93fc-52ce6b67e5e1","name":"Check operations","type":"n8n-nodes-base.switch","typeVersion":3,"position":[1220,1240]},{"parameters":{"fields":{"values":[{"name":"={{ $('Execute Workflow Trigger').item.json.query }}","stringValue":"={{ $json[$('Execute Workflow Trigger').item.json.query] }}"},{"name":"row_number","stringValue":"={{ $json.row_number }}"}]},"include":"none","options":{}},"id":"f2ebcae6-3cfb-4862-a927-dc66bd24f197","name":"Prepare column data","type":"n8n-nodes-base.set","position":[1440,1240],"typeVersion":3.2},{"parameters":{"conditions":{"options":{"leftValue":"","caseSensitive":true,"typeValidation":"loose"},"combinator":"and","conditions":[{"id":"bf712098-97e4-42cb-8e08-2ee32d19d3e7","operator":{"type":"number","operation":"equals"},"leftValue":"={{ $json.row_number }}","rightValue":"={{ $('Execute Workflow Trigger').item.json.query }}"}]},"options":{"looseTypeValidation":true}},"id":"f40acb04-ef06-4670-b8b1-86b04f066af8","name":"Filter out other rows","type":"n8n-nodes-base.filter","position":[1440,1420],"typeVersion":2}],"pinData":{},"connections":{"GPT4 Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Chat Trigger":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Get column names":{"main":[[{"node":"Prepare output","type":"main","index":0}]]},"Get customer tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"List columns tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Set Google Sheet URL":{"main":[[{"node":"Get Google sheet contents","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Get column values tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Execute Workflow Trigger":{"main":[[{"node":"Set Google Sheet URL","type":"main","index":0}]]},"Get Google sheet contents":{"main":[[{"node":"Check operations","type":"main","index":0}]]},"Check operations":{"main":[[{"node":"Get column names","type":"main","index":0}],[{"node":"Prepare column data","type":"main","index":0}],[{"node":"Filter out other rows","type":"main","index":0}]]},"Prepare column data":{"main":[[{"node":"Prepare output","type":"main","index":0}]]},"Filter out other rows":{"main":[[{"node":"Prepare output","type":"main","index":0}]]}}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"return {\n  'response': JSON.stringify($input.all().map(x => x.json))\n}"},"position":[1720,1240]}],"connections":{"GPT4 Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Chat Trigger":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Get column names":{"main":[[{"node":"Prepare output","type":"main","index":0}]]},"Get customer tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"List columns tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Set Google Sheet URL":{"main":[[{"node":"Get Google sheet contents","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Get column values tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Execute Workflow Trigger":{"main":[[{"node":"Set Google Sheet URL","type":"main","index":0}]]},"Get Google sheet contents":{"main":[[{"node":"Check operations","type":"main","index":0}]]},"Check operations":{"main":[[{"node":"Get column names","type":"main","index":0}],[{"node":"Prepare column data","type":"main","index":0}],[{"node":"Filter out other rows","type":"main","index":0}]]},"Prepare column data":{"main":[[{"node":"Prepare output","type":"main","index":0}]]},"Filter out other rows":{"main":[[{"node":"Prepare output","type":"main","index":0}]]}},"source":"docs/_workflows/advanced-ai/examples/chat_with_google_sheets_docs_version.json"},{"name":"data-transformation","workflow":{"name":"Data transformation","nodes":[{"parameters":{},"id":"3ada6076-1cfb-4c2d-a421-4fce5466fc2d","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[1340,840]},{"parameters":{"jsCode":"return [\n{\n\"user_id\":\n\"0001\",\n\"username\":\n\"nathan\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"0002\",\n\"username\":\n\"natalie\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"0003\",\n\"username\":\n\"nadia\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"naomi\",\n\"username\":\n\"hkhjk\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"0005\",\n\"username\":\n\"nolan\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n}\n]"},"id":"08e4d878-01ab-4f01-ab27-84ef5afbf581","name":"Code","type":"n8n-nodes-base.code","typeVersion":2,"position":[1560,840]},{"parameters":{},"id":"57a9330b-9e46-42a6-b432-681e906de93a","name":"Join items","type":"n8n-nodes-base.code","typeVersion":2,"position":[1780,840]}],"pinData":{},"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Code","type":"main","index":0}]]},"Code":{"main":[[{"node":"Join items","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"d7409102-d3af-4ddf-bead-2df008554458","id":"B4K5I5pN4nqu85ac","meta":{"instanceId":"c5aabef739d71e3d0ceb8b6078a241aaf1b145fa71cbbe36ecfb2c8c3fd64f5f"},"tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"return [\n{\n\"user_id\":\n\"0001\",\n\"username\":\n\"nathan\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"0002\",\n\"username\":\n\"natalie\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"0003\",\n\"username\":\n\"nadia\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"naomi\",\n\"username\":\n\"hkhjk\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"0005\",\n\"username\":\n\"nolan\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n}\n]"},"position":[1560,840]},{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{},"position":[1780,840]}],"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Code","type":"main","index":0}]]},"Code":{"main":[[{"node":"Join items","type":"main","index":0}]]}},"source":"docs/_workflows/ai-code/data-transformation.json","description":"Workflow example from docs/_workflows/ai-code/data-transformation.json"},{"name":"find-a-piece-of-data","workflow":{"name":"Find a piece of data","nodes":[{"parameters":{},"id":"5319a081-f4f9-44ac-a91e-a57270e6eaa8","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[460,460]},{"parameters":{"jsCode":"return [\n{\n\"title\":\n\"\",\n\"phone\":\n\"\",\n\"skype\":\n\"\",\n\"real_name\":\n\"Nathan Berlin\",\n\"email\": \"nathan@example.io\",\n\"real_name_normalized\":\n\"Nathan Berlin\",\n\"display_name\":\n\"Nathan Berlin\",\n\"display_name_normalized\":\n\"Nathan Berlin\",\n\"fields\":\n{\n},\n\"status_text\":\n\"\",\n\"status_emoji\":\n\"\",\n\"status_emoji_display_info\":\n[\n],\n\"status_expiration\":\n0,\n\"avatar_hash\":\n\"0856f5fbbd43\",\n\"image_original\":\n\"https://example.png\",\n\"is_custom_image\":\ntrue,\n\"huddle_state\":\n\"default_unset\",\n\"huddle_state_expiration_ts\":\n0,\n\"first_name\":\n\"Nathan\",\n\"last_name\":\n\"Berlin\",\n\"image_24\":\n\"https://example.png\",\n\"image_32\":\n\"https://example.png\",\n\"image_48\":\n\"https://example.png\",\n\"image_72\":\n\"https://example.png\",\n\"image_192\":\n\"https://example.png\",\n\"image_512\":\n\"https://example.png\",\n\"image_1024\":\n\"https://example.png\",\n\"status_text_canonical\":\n\"\"\n}\n]"},"id":"3ec439bc-7e3f-4ec2-b724-092466efaa18","name":"Mock Slack","type":"n8n-nodes-base.code","typeVersion":2,"position":[680,460]},{"parameters":{"jsCode":"return [\n{\n\"object\":\n\"user\",\n\"id\":\n\"1234\",\n\"name\":\n\"Nathan Berlin\",\n\"avatar_url\":\n\"https://example.jpeg\",\n\"type\":\n\"person\",\n\"person\":\n{\n\"email\":\n\"nathan@example.io\"\n}\n},\n{\n\"object\":\n\"user\",\n\"id\":\n\"5678\",\n\"name\":\n\"Natalie Berlin\",\n\"avatar_url\":\n\"https://example.jpeg\",\n\"type\":\n\"person\",\n\"person\":\n{\n\"email\":\n\"natalie@example.io\"\n}\n}\n]"},"id":"4bb97ec6-c73a-4f01-b935-a94ffbf15d23","name":"Mock Notion","type":"n8n-nodes-base.code","typeVersion":2,"position":[900,460]},{"parameters":{},"id":"330ecf72-cff0-4ada-9b04-b1c99bb0f4de","name":"Code","type":"n8n-nodes-base.code","typeVersion":2,"position":[1120,460]}],"pinData":{},"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock Slack","type":"main","index":0}]]},"Mock Slack":{"main":[[{"node":"Mock Notion","type":"main","index":0}]]},"Mock Notion":{"main":[[{"node":"Code","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"81cabd2b-2854-4afb-b656-90a0cb77fa96","id":"3Brrdjs5aRHo57EX","meta":{"instanceId":"c5aabef739d71e3d0ceb8b6078a241aaf1b145fa71cbbe36ecfb2c8c3fd64f5f"},"tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"return [\n{\n\"title\":\n\"\",\n\"phone\":\n\"\",\n\"skype\":\n\"\",\n\"real_name\":\n\"Nathan Berlin\",\n\"email\": \"nathan@example.io\",\n\"real_name_normalized\":\n\"Nathan Berlin\",\n\"display_name\":\n\"Nathan Berlin\",\n\"display_name_normalized\":\n\"Nathan Berlin\",\n\"fields\":\n{\n},\n\"status_text\":\n\"\",\n\"status_emoji\":\n\"\",\n\"status_emoji_display_info\":\n[\n],\n\"status_expiration\":\n0,\n\"avatar_hash\":\n\"0856f5fbbd43\",\n\"image_original\":\n\"https://example.png\",\n\"is_custom_image\":\ntrue,\n\"huddle_state\":\n\"default_unset\",\n\"huddle_state_expiration_ts\":\n0,\n\"first_name\":\n\"Nathan\",\n\"last_name\":\n\"Berlin\",\n\"image_24\":\n\"https://example.png\",\n\"image_32\":\n\"https://example.png\",\n\"image_48\":\n\"https://example.png\",\n\"image_72\":\n\"https://example.png\",\n\"image_192\":\n\"https://example.png\",\n\"image_512\":\n\"https://example.png\",\n\"image_1024\":\n\"https://example.png\",\n\"status_text_canonical\":\n\"\"\n}\n]"},"position":[680,460]},{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"return [\n{\n\"object\":\n\"user\",\n\"id\":\n\"1234\",\n\"name\":\n\"Nathan Berlin\",\n\"avatar_url\":\n\"https://example.jpeg\",\n\"type\":\n\"person\",\n\"person\":\n{\n\"email\":\n\"nathan@example.io\"\n}\n},\n{\n\"object\":\n\"user\",\n\"id\":\n\"5678\",\n\"name\":\n\"Natalie Berlin\",\n\"avatar_url\":\n\"https://example.jpeg\",\n\"type\":\n\"person\",\n\"person\":\n{\n\"email\":\n\"natalie@example.io\"\n}\n}\n]"},"position":[900,460]},{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{},"position":[1120,460]}],"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock Slack","type":"main","index":0}]]},"Mock Slack":{"main":[[{"node":"Mock Notion","type":"main","index":0}]]},"Mock Notion":{"main":[[{"node":"Code","type":"main","index":0}]]}},"source":"docs/_workflows/ai-code/find-a-piece-of-data.json","description":"Workflow example from docs/_workflows/ai-code/find-a-piece-of-data.json"},{"name":"reference-incoming-data-explicitly","workflow":{"name":"Reference incoming data explicitly","nodes":[{"parameters":{},"id":"0abbe7f6-f8a0-4f71-8229-f4fd1a3c2683","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[620,520]},{"parameters":{"jsCode":"return [\n  {\n   \"id\": 0001,\n   \"personal_info\": {\n    \"first_name\": \"Natalie\",\n    \"surname\": \"Berlin\"\n   },\n   \"work_info\": {\n    \"job_title\": \"Automation engineer\"\n   }\n  },\n  {\n    \"id\": 0002,\n    \"personal_info\": {\n     \"first_name\": \"Nathan\",\n     \"surname\": \"Berlin\"\n    },\n    \"work_info\": {\n     \"job_title\": \"Automation designer\"\n    }\n   }\n]"},"id":"e19f11cd-c868-4aca-b88e-04b4ee6f0187","name":"Mock data","type":"n8n-nodes-base.code","typeVersion":2,"position":[840,520]},{"parameters":{},"id":"ef54d477-0596-441a-98e5-1ab005e9a268","name":"Code","type":"n8n-nodes-base.code","typeVersion":2,"position":[1060,520]}],"pinData":{},"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock data","type":"main","index":0}]]},"Mock data":{"main":[[{"node":"Code","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"4e3a0a21-c993-4851-848b-01bd5c090b6b","id":"EipyYyqKKQm7siq4","meta":{"instanceId":"c5aabef739d71e3d0ceb8b6078a241aaf1b145fa71cbbe36ecfb2c8c3fd64f5f"},"tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"return [\n  {\n   \"id\": 0001,\n   \"personal_info\": {\n    \"first_name\": \"Natalie\",\n    \"surname\": \"Berlin\"\n   },\n   \"work_info\": {\n    \"job_title\": \"Automation engineer\"\n   }\n  },\n  {\n    \"id\": 0002,\n    \"personal_info\": {\n     \"first_name\": \"Nathan\",\n     \"surname\": \"Berlin\"\n    },\n    \"work_info\": {\n     \"job_title\": \"Automation designer\"\n    }\n   }\n]"},"position":[840,520]},{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{},"position":[1060,520]}],"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock data","type":"main","index":0}]]},"Mock data":{"main":[[{"node":"Code","type":"main","index":0}]]}},"source":"docs/_workflows/ai-code/reference-incoming-data-explicitly.json","description":"Workflow example from docs/_workflows/ai-code/reference-incoming-data-explicitly.json"},{"name":"summarize-data","workflow":{"name":"Summarize data and prepare Slack message","nodes":[{"parameters":{},"id":"5d4bd82f-24e9-484e-a17e-c5de889087d9","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[860,540]},{"parameters":{},"id":"0d73c3df-300a-4397-8f53-fb0750dbf97f","name":"Summarize","type":"n8n-nodes-base.code","typeVersion":2,"position":[1300,540]},{"parameters":{"jsCode":"return [\n{\n\"id\":\n\"0001\",\n\"name\":\n\"Example feature 1\",\n\"url\": \"example.com\",\n\"property_tags\":\n[\n],\n\"property_type\":\n[\n\"Feature\"\n],\n\"property_votes\":\n2\n},\n{\n\"id\":\n\"0002\",\n\"name\":\n\"Example feature 2\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Feature\"\n],\n\"property_votes\":\n3\n},\n{\n\"id\":\n\"0003\",\n\"name\":\n\"Example feature 3\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Feature\"\n],\n\"property_votes\":\n1\n},\n{\n\"id\":\n\"0004\",\n\"name\":\n\"Example bug 1\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Bug\"\n],\n\"property_votes\":\n0\n},\n{\n\"id\":\n\"0005\",\n\"name\":\n\"Example idea 1\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Idea\"\n],\n\"property_votes\":\n4\n}\n]"},"id":"fda17968-61a5-4c0b-ab83-adb4e0bbf7c5","name":"Mock Ideas","type":"n8n-nodes-base.code","typeVersion":2,"position":[1080,540]}],"pinData":{},"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock Ideas","type":"main","index":0}]]},"Mock Ideas":{"main":[[{"node":"Summarize","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"077fe5dc-2214-4149-9f1b-ef6342e45dec","id":"5IoF8z4YUoSUpBUk","meta":{"instanceId":"c5aabef739d71e3d0ceb8b6078a241aaf1b145fa71cbbe36ecfb2c8c3fd64f5f"},"tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{},"position":[1300,540]},{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"return [\n{\n\"id\":\n\"0001\",\n\"name\":\n\"Example feature 1\",\n\"url\": \"example.com\",\n\"property_tags\":\n[\n],\n\"property_type\":\n[\n\"Feature\"\n],\n\"property_votes\":\n2\n},\n{\n\"id\":\n\"0002\",\n\"name\":\n\"Example feature 2\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Feature\"\n],\n\"property_votes\":\n3\n},\n{\n\"id\":\n\"0003\",\n\"name\":\n\"Example feature 3\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Feature\"\n],\n\"property_votes\":\n1\n},\n{\n\"id\":\n\"0004\",\n\"name\":\n\"Example bug 1\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Bug\"\n],\n\"property_votes\":\n0\n},\n{\n\"id\":\n\"0005\",\n\"name\":\n\"Example idea 1\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Idea\"\n],\n\"property_votes\":\n4\n}\n]"},"position":[1080,540]}],"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock Ideas","type":"main","index":0}]]},"Mock Ideas":{"main":[[{"node":"Summarize","type":"main","index":0}]]}},"source":"docs/_workflows/ai-code/summarize-data.json","description":"Workflow example from docs/_workflows/ai-code/summarize-data.json"},{"name":"chapter-5.5","workflow":{"nodes":[{"parameters":{"url":"https://internal.users.n8n.cloud/webhook/custom-erp","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendHeaders":true,"headerParameters":{"parameters":[{"name":"unique_id","value":"<YOUR_UNIQUE_ID_HERE>"}]},"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[300,-520],"id":"ada6becf-c320-41a7-bdca-a842ea3ee769","name":"HTTP Request1","credentials":{"httpHeaderAuth":{"id":"sMuanZ4xGobAurzY","name":"Nathan's ABCorp data warehouse account"}}},{"parameters":{"operation":"create","base":{"__rl":true,"value":"app9nOVsRxdypoknP","mode":"list","cachedResultName":"beginner course"},"table":{"__rl":true,"value":"tblTIOsm4BLJD9Tql","mode":"list","cachedResultName":"processingOrders"},"columns":{"mappingMode":"autoMapInputData","value":{},"matchingColumns":[],"schema":[{"id":"orderID","displayName":"orderID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"employeeName","displayName":"employeeName","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"type":"n8n-nodes-base.airtable","typeVersion":2.1,"position":[1020,-600],"id":"5e60ca72-d773-439c-b39a-4b14c54f795b","name":"Airtable1","credentials":{"airtableTokenApi":{"id":"UT32NHUYnp4pn1H3","name":"Airtable Personal Access Token account"}}},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"526cb30c-0f90-4f66-8f98-b64ceb2e52f2","leftValue":"={{ $json.orderStatus }}","rightValue":"processing","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[520,-520],"id":"70e4db65-f827-4e4f-8673-b405b7986d6e","name":"If1"},{"parameters":{"assignments":{"assignments":[{"id":"20d37948-763a-4d7b-b725-e65f3802af03","name":"orderID","value":"={{ $json.orderID }}","type":"number"},{"id":"9df108a7-6b13-42ab-a6dd-9ca582ba8b49","name":"employeeName","value":"={{ $json.employeeName }}","type":"string"}]},"options":{}},"type":"n8n-nodes-base.set","typeVersion":3.4,"position":[800,-600],"id":"a3d3dc53-32f1-4f44-bf95-50bc5450d601","name":"Edit Fields1"},{"parameters":{"jsCode":"let items = $input.all();\nlet totalBooked = items.length;\nlet bookedSum = 0;\n\nfor (let i=0; i < items.length; i++) {\n  bookedSum = bookedSum + items[i].json.orderPrice;\n}\n\nreturn [{ json: {totalBooked, bookedSum} }];"},"type":"n8n-nodes-base.code","typeVersion":2,"position":[760,-420],"id":"d24ea5e9-c9e6-4d06-b6ee-8db1abd42bc0","name":"Code1"},{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[80,-520],"id":"ffa1a8ce-1a1e-48c4-8a0d-6af28c0447a5","name":"When clicking ‘Execute workflow’"}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[{"node":"Code1","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"Code1":{"main":[[]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"let items = $input.all();\nlet totalBooked = items.length;\nlet bookedSum = 0;\n\nfor (let i=0; i < items.length; i++) {\n  bookedSum = bookedSum + items[i].json.orderPrice;\n}\n\nreturn [{ json: {totalBooked, bookedSum} }];"},"position":[760,-420]}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[{"node":"Code1","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"Code1":{"main":[[]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-5/chapter-5.5.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-5/chapter-5.5.json"},{"name":"chapter-5.6","workflow":{"nodes":[{"parameters":{"url":"https://internal.users.n8n.cloud/webhook/custom-erp","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendHeaders":true,"headerParameters":{"parameters":[{"name":"unique_id","value":"<YOUR_UNIQUE_ID_HERE>"}]},"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[300,-520],"id":"ada6becf-c320-41a7-bdca-a842ea3ee769","name":"HTTP Request1","credentials":{"httpHeaderAuth":{"id":"sMuanZ4xGobAurzY","name":"Nathan's ABCorp data warehouse account"}}},{"parameters":{"operation":"create","base":{"__rl":true,"value":"app9nOVsRxdypoknP","mode":"list","cachedResultName":"beginner course"},"table":{"__rl":true,"value":"tblTIOsm4BLJD9Tql","mode":"list","cachedResultName":"processingOrders"},"columns":{"mappingMode":"autoMapInputData","value":{},"matchingColumns":[],"schema":[{"id":"orderID","displayName":"orderID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"employeeName","displayName":"employeeName","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"type":"n8n-nodes-base.airtable","typeVersion":2.1,"position":[1020,-600],"id":"5e60ca72-d773-439c-b39a-4b14c54f795b","name":"Airtable1","credentials":{"airtableTokenApi":{"id":"UT32NHUYnp4pn1H3","name":"Airtable Personal Access Token account"}}},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"526cb30c-0f90-4f66-8f98-b64ceb2e52f2","leftValue":"={{ $json.orderStatus }}","rightValue":"processing","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[520,-520],"id":"70e4db65-f827-4e4f-8673-b405b7986d6e","name":"If1"},{"parameters":{"assignments":{"assignments":[{"id":"20d37948-763a-4d7b-b725-e65f3802af03","name":"orderID","value":"={{ $json.orderID }}","type":"number"},{"id":"9df108a7-6b13-42ab-a6dd-9ca582ba8b49","name":"employeeName","value":"={{ $json.employeeName }}","type":"string"}]},"options":{}},"type":"n8n-nodes-base.set","typeVersion":3.4,"position":[800,-600],"id":"a3d3dc53-32f1-4f44-bf95-50bc5450d601","name":"Edit Fields1"},{"parameters":{"jsCode":"let items = $input.all();\nlet totalBooked = items.length;\nlet bookedSum = 0;\n\nfor (let i=0; i < items.length; i++) {\n  bookedSum = bookedSum + items[i].json.orderPrice;\n}\n\nreturn [{ json: {totalBooked, bookedSum} }];"},"type":"n8n-nodes-base.code","typeVersion":2,"position":[760,-420],"id":"d24ea5e9-c9e6-4d06-b6ee-8db1abd42bc0","name":"Code1"},{"parameters":{"authentication":"webhook","content":"=This week we've {{$json[\"totalBooked\"]}} booked orders with a total value of {{$json[\"bookedSum\"]}}. My Unique ID: {{ $('HTTP Request1').params[\"headerParameters\"][\"parameters\"][0][\"value\"] }}","options":{}},"type":"n8n-nodes-base.discord","typeVersion":2,"position":[1000,-420],"id":"ed380465-c655-4c38-8eb3-2008b9e7869f","name":"Discord1","webhookId":"eff0b651-f0be-4cae-8f18-7d831385be3c","credentials":{"discordWebhookApi":{"id":"lOieo0mIb6h1Wi9R","name":"Discord Webhook account"}}},{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[80,-520],"id":"ffa1a8ce-1a1e-48c4-8a0d-6af28c0447a5","name":"When clicking ‘Execute workflow’"}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[{"node":"Code1","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"Code1":{"main":[[{"node":"Discord1","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"let items = $input.all();\nlet totalBooked = items.length;\nlet bookedSum = 0;\n\nfor (let i=0; i < items.length; i++) {\n  bookedSum = bookedSum + items[i].json.orderPrice;\n}\n\nreturn [{ json: {totalBooked, bookedSum} }];"},"position":[760,-420]}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[{"node":"Code1","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"Code1":{"main":[[{"node":"Discord1","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-5/chapter-5.6.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-5/chapter-5.6.json"},{"name":"finished","workflow":{"nodes":[{"parameters":{"url":"https://internal.users.n8n.cloud/webhook/custom-erp","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendHeaders":true,"headerParameters":{"parameters":[{"name":"unique_id","value":"4d259ec5241587a0d2820670fc048f0d"}]},"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[220,-40],"id":"e1fb70b3-0212-4e78-9976-cb77c69f1a92","name":"HTTP Request","credentials":{"httpHeaderAuth":{"id":"sMuanZ4xGobAurzY","name":"Nathan's ABCorp data warehouse account"}}},{"parameters":{"operation":"create","base":{"__rl":true,"value":"app9nOVsRxdypoknP","mode":"list","cachedResultName":"beginner course"},"table":{"__rl":true,"value":"tblTIOsm4BLJD9Tql","mode":"list","cachedResultName":"processingOrders"},"columns":{"mappingMode":"autoMapInputData","value":{},"matchingColumns":[],"schema":[{"id":"orderID","displayName":"orderID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"employeeName","displayName":"employeeName","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"type":"n8n-nodes-base.airtable","typeVersion":2.1,"position":[880,-140],"id":"5cef2ef7-98a6-4dc6-bc30-667eba06fd7b","name":"Airtable","credentials":{"airtableTokenApi":{"id":"UT32NHUYnp4pn1H3","name":"Airtable Personal Access Token account"}}},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"526cb30c-0f90-4f66-8f98-b64ceb2e52f2","leftValue":"={{ $json.orderStatus }}","rightValue":"processing","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[440,-40],"id":"448b2e3c-569d-42e6-a4b9-57c08b2cac1a","name":"If"},{"parameters":{"assignments":{"assignments":[{"id":"20d37948-763a-4d7b-b725-e65f3802af03","name":"orderID","value":"={{ $json.orderID }}","type":"number"},{"id":"9df108a7-6b13-42ab-a6dd-9ca582ba8b49","name":"employeeName","value":"={{ $json.employeeName }}","type":"string"}]},"options":{}},"type":"n8n-nodes-base.set","typeVersion":3.4,"position":[660,-140],"id":"7e2a8092-fb0f-4260-84e8-d796cf14d309","name":"Edit Fields"},{"parameters":{"jsCode":"let items = $input.all();\nlet totalBooked = items.length;\nlet bookedSum = 0;\n\nfor (let i=0; i < items.length; i++) {\n  bookedSum = bookedSum + items[i].json.orderPrice;\n}\n\nreturn [{ json: {totalBooked, bookedSum} }];"},"type":"n8n-nodes-base.code","typeVersion":2,"position":[660,60],"id":"26ce1d53-794b-4457-9aa8-0ecf9093b838","name":"Code"},{"parameters":{"authentication":"webhook","content":"=This week we've {{$json[\"totalBooked\"]}} booked orders with a total value of {{$json[\"bookedSum\"]}}. My Unique ID: {{ $('HTTP Request').params[\"headerParameters\"][\"parameters\"][0][\"value\"] }}","options":{}},"type":"n8n-nodes-base.discord","typeVersion":2,"position":[880,60],"id":"d8c0b4b6-3bf1-4055-a03f-f0023337777c","name":"Discord","webhookId":"eff0b651-f0be-4cae-8f18-7d831385be3c","credentials":{"discordWebhookApi":{"id":"lOieo0mIb6h1Wi9R","name":"Discord Webhook account"}}},{"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[1],"triggerAtHour":9}]}},"type":"n8n-nodes-base.scheduleTrigger","typeVersion":1.2,"position":[0,-40],"id":"15f0b179-6a43-483b-a522-2b8ba834b795","name":"Schedule Trigger"}],"connections":{"HTTP Request":{"main":[[{"node":"If","type":"main","index":0}]]},"If":{"main":[[{"node":"Edit Fields","type":"main","index":0}],[{"node":"Code","type":"main","index":0}]]},"Edit Fields":{"main":[[{"node":"Airtable","type":"main","index":0}]]},"Code":{"main":[[{"node":"Discord","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"HTTP Request","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"let items = $input.all();\nlet totalBooked = items.length;\nlet bookedSum = 0;\n\nfor (let i=0; i < items.length; i++) {\n  bookedSum = bookedSum + items[i].json.orderPrice;\n}\n\nreturn [{ json: {totalBooked, bookedSum} }];"},"position":[660,60]}],"connections":{"HTTP Request":{"main":[[{"node":"If","type":"main","index":0}]]},"If":{"main":[[{"node":"Edit Fields","type":"main","index":0}],[{"node":"Code","type":"main","index":0}]]},"Edit Fields":{"main":[[{"node":"Airtable","type":"main","index":0}]]},"Code":{"main":[[{"node":"Discord","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"HTTP Request","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/finished.json","description":"Workflow example from docs/_workflows/courses/level-one/finished.json"},{"name":"rss-feed-example","workflow":{"nodes":[{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[0,0],"id":"e6e1cfe6-eff1-48bd-b21c-6ba83d4244d9","name":"When clicking ‘Execute workflow’"},{"parameters":{"jsCode":"return [\n\t{\n\t\tjson: {\n\t\t\turl: 'https://medium.com/feed/n8n-io',\n\t\t}\n\t},\n\t{\n\t\tjson: {\n\t\t\turl: 'https://dev.to/feed/n8n',\n\t\t}\n\t}\n];"},"type":"n8n-nodes-base.code","typeVersion":2,"position":[220,0],"id":"137f1128-45b6-4bc4-a9fb-8660baa652a9","name":"Code"},{"parameters":{"options":{}},"type":"n8n-nodes-base.splitInBatches","typeVersion":3,"position":[440,0],"id":"3449a953-49c2-4a36-ba3d-cbc0573f3f6c","name":"Loop Over Items"},{"parameters":{"url":"={{ $json.url }}","options":{}},"type":"n8n-nodes-base.rssFeedRead","typeVersion":1.1,"position":[660,100],"id":"cc2e59d7-0a9b-4640-8052-d8f7f8d8c9fe","name":"RSS Read"}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Code","type":"main","index":0}]]},"Code":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Loop Over Items":{"main":[[],[{"node":"RSS Read","type":"main","index":0}]]},"RSS Read":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]}},"pinData":{},"meta":{"instanceId":"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.code","version":2,"parameters":{"jsCode":"return [\n\t{\n\t\tjson: {\n\t\t\turl: 'https://medium.com/feed/n8n-io',\n\t\t}\n\t},\n\t{\n\t\tjson: {\n\t\t\turl: 'https://dev.to/feed/n8n',\n\t\t}\n\t}\n];"},"position":[220,0]}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Code","type":"main","index":0}]]},"Code":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Loop Over Items":{"main":[[],[{"node":"RSS Read","type":"main","index":0}]]},"RSS Read":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]}},"source":"docs/_workflows/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/rss-feed-example.json","description":"Workflow example from docs/_workflows/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/rss-feed-example.json"}]

troubleshooting_info:
  [{"issue":"Add Code","solution":"Add your custom code. Choose either **Execute** or **Supply Data** mode. You can only use one mode."},{"issue":"Inputs","solution":"Choose the input types. "},{"issue":"Outputs","solution":"Choose the output types. "},{"issue":"Node inputs and outputs configuration","solution":"By configuring the LangChain Code node connectors (inputs and outputs) you can use it as an app node, root node or sub-node."},{"issue":"Built-in methods","solution":"n8n provides these methods to make it easier to perform common tasks in the LangChain Code node."}]

node_connections:
  [{"fromNode":"Simple Memory","toNode":"AI Agent","connectionType":"ai_memory"},{"fromNode":"Not sure?","toNode":"AI Agent","connectionType":"ai_tool"},{"fromNode":"Execute Workflow Trigger","toNode":"Check if user has provided email","connectionType":"main"},{"fromNode":"Chat Trigger","toNode":"AI Agent","connectionType":"main"},{"fromNode":"Check if user has provided email","toNode":"Message Slack for help","connectionType":"main"},{"fromNode":"Check if user has provided email","toNode":"Prompt the user to provide an email","connectionType":"main"},{"fromNode":"Message Slack for help","toNode":"Confirm that we've messaged a human","connectionType":"main"},{"fromNode":"GPT4","toNode":"AI Agent","connectionType":"ai_languageModel"},{"fromNode":"GPT4 Model","toNode":"AI Agent","connectionType":"ai_languageModel"},{"fromNode":"Get column names","toNode":"Prepare output","connectionType":"main"},{"fromNode":"Get customer tool","toNode":"AI Agent","connectionType":"ai_tool"},{"fromNode":"List columns tool","toNode":"AI Agent","connectionType":"ai_tool"},{"fromNode":"Set Google Sheet URL","toNode":"Get Google sheet contents","connectionType":"main"},{"fromNode":"Get column values tool","toNode":"AI Agent","connectionType":"ai_tool"},{"fromNode":"Execute Workflow Trigger","toNode":"Set Google Sheet URL","connectionType":"main"},{"fromNode":"Get Google sheet contents","toNode":"Check operations","connectionType":"main"},{"fromNode":"Check operations","toNode":"Get column names","connectionType":"main"},{"fromNode":"Check operations","toNode":"Prepare column data","connectionType":"main"},{"fromNode":"Check operations","toNode":"Filter out other rows","connectionType":"main"},{"fromNode":"Prepare column data","toNode":"Prepare output","connectionType":"main"},{"fromNode":"Filter out other rows","toNode":"Prepare output","connectionType":"main"},{"fromNode":"When clicking \"Execute Workflow\"","toNode":"Code","connectionType":"main"},{"fromNode":"Code","toNode":"Join items","connectionType":"main"},{"fromNode":"When clicking \"Execute Workflow\"","toNode":"Mock Slack","connectionType":"main"},{"fromNode":"Mock Slack","toNode":"Mock Notion","connectionType":"main"},{"fromNode":"Mock Notion","toNode":"Code","connectionType":"main"},{"fromNode":"When clicking \"Execute Workflow\"","toNode":"Mock data","connectionType":"main"},{"fromNode":"Mock data","toNode":"Code","connectionType":"main"},{"fromNode":"When clicking \"Execute Workflow\"","toNode":"Mock Ideas","connectionType":"main"},{"fromNode":"Mock Ideas","toNode":"Summarize","connectionType":"main"},{"fromNode":"HTTP Request1","toNode":"If1","connectionType":"main"},{"fromNode":"If1","toNode":"Edit Fields1","connectionType":"main"},{"fromNode":"If1","toNode":"Code1","connectionType":"main"},{"fromNode":"Edit Fields1","toNode":"Airtable1","connectionType":"main"},{"fromNode":"When clicking ‘Execute workflow’","toNode":"HTTP Request1","connectionType":"main"},{"fromNode":"Code1","toNode":"Discord1","connectionType":"main"},{"fromNode":"HTTP Request","toNode":"If","connectionType":"main"},{"fromNode":"If","toNode":"Edit Fields","connectionType":"main"},{"fromNode":"If","toNode":"Code","connectionType":"main"},{"fromNode":"Edit Fields","toNode":"Airtable","connectionType":"main"},{"fromNode":"Code","toNode":"Discord","connectionType":"main"},{"fromNode":"Schedule Trigger","toNode":"HTTP Request","connectionType":"main"},{"fromNode":"When clicking ‘Execute workflow’","toNode":"Code","connectionType":"main"},{"fromNode":"Code","toNode":"Loop Over Items","connectionType":"main"},{"fromNode":"Loop Over Items","toNode":"RSS Read","connectionType":"main"},{"fromNode":"RSS Read","toNode":"Loop Over Items","connectionType":"main"}]

example_workflow:
  {"name":"Code Example Workflow","nodes":[{"parameters":{"mode":"runOnceForAllItems","language":"javaScript","dynamic_property":null},"id":"nq82udd8zf63pbvad1tz","name":"Code","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Mode","name":"mode","type":"options","default":"runOnceForAllItems","description":"Run this code only once, no matter how many input items there are","options":[{"name":"Run Once for All Items","value":"runOnceForAllItems","description":"Run this code only once, no matter how many input items there are"},{"name":"Run Once for Each Item","value":"runOnceForEachItem","description":"Run this code as many times as there are input items"}]},{"displayName":"Language","name":"language","type":"options","default":"javaScript","options":[{"name":"JavaScript","value":"javaScript"},{"name":"Python (Beta)","value":"python"}]},{"displayName":"Language","name":"language","type":"hidden","default":"javaScript"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...JavascriptCodeDescription_1.javascriptCodeDescription"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PythonCodeDescription_1.pythonCodeDescription"}]


node_type: n8n-nodes-base.CompareDatasets
name: CompareDatasets
display_name: Compare Datasets
description: Compare two inputs for changes
category: transform
icon: file:compare.svg
code_hash: 1228e4985663cca8c9ac56b8daa9c825e9d730846ba5c2722fa65a302c81ee00
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.CompareDatasets
documentation_title: Compare Datasets
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"compare-datasets","description":"Templates for compare-datasets"}]
related_resources: []
required_scopes: []
parameter_schemas: []
package_name: n8n-nodes-base
extracted_at: 2025-06-12 08:58:24
updated_at: 2025-06-12 08:58:24
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CompareDatasets = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class CompareDatasets {
      constructor() {
          this.description = {
              displayName: 'Compare Datasets',
              name: 'compareDatasets',
              icon: 'file:compare.svg',
              group: ['transform'],
              version: [1, 2, 2.1, 2.2, 2.3],
              description: 'Compare two inputs for changes',
              defaults: { name: 'Compare Datasets' },
              inputs: ['main', 'main'],
              inputNames: ['Input A', 'Input B'],
              requiredInputs: 1,
              outputs: ['main', 'main', 'main', 'main'],
              outputNames: ['In A only', 'Same', 'Different', 'In B only'],
              properties: [
                  {
                      displayName: 'Items from different branches are paired together when the fields below match. If paired, the rest of the fields are compared to determine whether the items are the same or different',
                      name: 'infoBox',
                      type: 'notice',
                      default: '',
                  },
                  {
                      displayName: 'Fields to Match',
                      name: 'mergeByFields',
                      type: 'fixedCollection',
                      placeholder: 'Add Fields to Match',
                      default: { values: [{ field1: '', field2: '' }] },
                      typeOptions: {
                          multipleValues: true,
                      },
                      options: [
                          {
                              displayName: 'Values',
                              name: 'values',
                              values: [
                                  {
                                      displayName: 'Input A Field',
                                      name: 'field1',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'e.g. id',
                                      hint: ' Enter the field name as text',
                                      requiresDataPath: 'single',
                                  },
                                  {
                                      displayName: 'Input B Field',
                                      name: 'field2',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'e.g. id',
                                      hint: ' Enter the field name as text',
                                      requiresDataPath: 'single',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'When There Are Differences',
                      name: 'resolve',
                      type: 'options',
                      default: 'preferInput2',
                      options: [
                          {
                              name: 'Use Input A Version',
                              value: 'preferInput1',
                          },
                          {
                              name: 'Use Input B Version',
                              value: 'preferInput2',
                          },
                          {
                              name: 'Use a Mix of Versions',
                              value: 'mix',
                              description: 'Output uses different inputs for different fields',
                          },
                          {
                              name: 'Include Both Versions',
                              value: 'includeBoth',
                              description: 'Output contains all data (but structure more complex)',
                          },
                      ],
                      displayOptions: {
                          show: {
                              '@version': [1, 2],
                          },
                      },
                  },
                  {
                      displayName: 'When There Are Differences',
                      name: 'resolve',
                      type: 'options',
                      default: 'includeBoth',
                      options: [
                          {
                              name: 'Use Input A Version',
                              value: 'preferInput1',
                          },
                          {
                              name: 'Use Input B Version',
                              value: 'preferInput2',
                          },
                          {
                              name: 'Use a Mix of Versions',
                              value: 'mix',
                              description: 'Output uses different inputs for different fields',
                          },
                          {
                              name: 'Include Both Versions',
                              value: 'includeBoth',
                              description: 'Output contains all data (but structure more complex)',
                          },
                      ],
                      displayOptions: {
                          hide: {
                              '@version': [1, 2],
                          },
                      },
                  },
                  {
                      displayName: 'Fuzzy Compare',
                      name: 'fuzzyCompare',
                      type: 'boolean',
                      default: false,
                      description: "Whether to tolerate small type differences when comparing fields. E.g. the number 3 and the string '3' are treated as the same.",
                      displayOptions: {
                          hide: {
                              '@version': [1],
                          },
                      },
                  },
                  {
                      displayName: 'Prefer',
                      name: 'preferWhenMix',
                      type: 'options',
                      default: 'input1',
                      options: [
                          {
                              name: 'Input A Version',
                              value: 'input1',
                          },
                          {
                              name: 'Input B Version',
                              value: 'input2',
                          },
                      ],
                      displayOptions: {
                          show: {
                              resolve: ['mix'],
                          },
                      },
                  },
                  {
                      displayName: 'For Everything Except',
                      name: 'exceptWhenMix',
                      type: 'string',
                      default: '',
                      placeholder: 'e.g. id, country',
                      hint: 'Enter the names of the input fields as text, separated by commas',
                      displayOptions: {
                          show: {
                              resolve: ['mix'],
                          },
                      },
                      requiresDataPath: 'multiple',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Fields to Skip Comparing',
                              name: 'skipFields',
                              type: 'string',
                              default: '',
                              placeholder: 'e.g. updated_at, updated_by',
                              hint: 'Enter the field names as text, separated by commas',
                              description: "Fields that shouldn't be included when checking whether two items are the same",
                              requiresDataPath: 'multiple',
                          },
                          {
                              displayName: 'Fuzzy Compare',
                              name: 'fuzzyCompare',
                              type: 'boolean',
                              default: false,
                              description: "Whether to tolerate small type differences when comparing fields. E.g. the number 3 and the string '3' are treated as the same.",
                              displayOptions: {
                                  show: {
                                      '@version': [1],
                                  },
                              },
                          },
                          {
                              displayName: 'Disable Dot Notation',
                              name: 'disableDotNotation',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to disallow referencing child fields using `parent.child` in the field name',
                          },
                          {
                              displayName: 'Multiple Matches',
                              name: 'multipleMatches',
                              type: 'options',
                              default: 'first',
                              options: [
                                  {
                                      name: 'Include First Match Only',
                                      value: 'first',
                                      description: 'Only ever output a single item per match',
                                  },
                                  {
                                      name: 'Include All Matches',
                                      value: 'all',
                                      description: 'Output multiple items if there are multiple matches',
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const matchFields = (0, GenericFunctions_1.checkMatchFieldsInput)(this.getNodeParameter('mergeByFields.values', 0, []));
          const options = this.getNodeParameter('options', 0, {});
          options.nodeVersion = this.getNode().typeVersion;
          if (options.nodeVersion >= 2) {
              options.fuzzyCompare = this.getNodeParameter('fuzzyCompare', 0, false);
          }
          let input1 = this.getInputData(0);
          let input2 = this.getInputData(1);
          if (options.nodeVersion < 2.2) {
              input1 = (0, GenericFunctions_1.checkInputAndThrowError)(input1, matchFields.map((pair) => pair.field1), options.disableDotNotation || false, 'Input A');
              input2 = (0, GenericFunctions_1.checkInputAndThrowError)(input2, matchFields.map((pair) => pair.field2), options.disableDotNotation || false, 'Input B');
          }
          else {
              input1 = (0, GenericFunctions_1.checkInput)(input1);
              input2 = (0, GenericFunctions_1.checkInput)(input2);
          }
          const resolve = this.getNodeParameter('resolve', 0, '');
          options.resolve = resolve;
          if (resolve === 'mix') {
              options.preferWhenMix = this.getNodeParameter('preferWhenMix', 0, '');
              options.exceptWhenMix = this.getNodeParameter('exceptWhenMix', 0, '');
          }
          const matches = (0, GenericFunctions_1.findMatches)(input1, input2, matchFields, options);
          return matches;
      }
  }
  exports.CompareDatasets = CompareDatasets;
  //# sourceMappingURL=CompareDatasets.node.js.map

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

  # Compare Datasets

  The Compare Datasets node helps you compare data from two input streams.

  ## Node parameters

  1. Decide which fields to compare. In **Input A Field**, enter the name of the field you want to use from input stream A. In **Input B Field**, enter the name of the field you want to use from input stream B. 
  2. **Optional**: You can compare by multiple fields. Select **Add Fields to Match** to set up more comparisons.
  3. Choose how to handle differences between the datasets. In **When There Are Differences**, select one of the following:
  	* **Use Input A Version** to treat input stream A as the source of truth.
  	* **Use Input B Version** to treat input stream B as the source of truth.
  	* **Use a Mix of Versions** to use different inputs for different fields.
  		* Use **Prefer** to select either **Input A Version** or **Input B Version** as the main source of truth.
  		* Enter input fields that are exceptions to **For Everything Except** to pull from the other input source. To add multiple input fields, enter a comma-separated list.
  	* **Include Both Versions** to include both input streams in the output, which may make the structure more complex.
  4. Decide whether to use **Fuzzy Compare**. When turned on, the comparison will tolerate small type differences when comparing fields. For example, the number 3 and the string `3` are treated as the same with **Fuzzy Compare** turned on, but wouldn't be treated the same with it turned off.

  ## Understand item comparison

  Item comparison is a two stage process:

  1. n8n checks if the values of the fields you selected to compare match across both inputs.
  2. If the fields to compare match, n8n then compares all fields within the items, to determine if the items are the same or different.

  ## Node options

  Use the node **Options** to refine your comparison or tweak comparison behavior.

  ### Fields to Skip Comparing

  Enter field names that you want to ignore in the comparison.

  For example, if you compare the two datasets below using `person.language` as the **Fields to Match**, n8n returns them as different. If you add `person.name` to **Fields to Skip Comparing**, n8n returns them as matching.

  ```json
  	// Input 1
  	[
  		{
  			"person":
  			{
  				"name":	"Stefan",
  				"language":	"de"
  			}
  		},
  		{
  			"person":
  			{
  				"name":	"Jim",
  				"language":	"en"
  			}
  		},
  		{
  			"person":
  			{
  				"name":	"Hans",
  				"language":	"de"
  			}
  		}
  	]
  	// Input 2
  		[
  		{
  			"person":
  			{
  				"name":	"Sara",
  				"language":	"de"
  			}
  		},
  		{
  			"person":
  			{
  				"name":	"Jane",
  				"language":	"en"
  			}
  		},
  		{
  			"person":
  			{
  				"name":	"Harriet",
  				"language":	"de"
  			}
  		}
  	]
  ```

  ### Disable Dot Notation

  Whether to disallow referencing child fields using `parent.child` in the field name (turned on) or allow it (turned off, default).

  ### Multiple Matches

  Choose how to handle duplicate data. The default is **Include All Matches**. You can choose **Include First Match Only**.

  For example, given these two datasets:
  ```json
  	// Input 1
  	[
  		{
  			"fruit": {
  				"type": "apple",
  				"color": "red"
  			}
  		},
  				{
  			"fruit": {
  				"type": "apple",
  				"color": "red"
  			}
  		},
  				{
  			"fruit": {
  				"type": "banana",
  				"color": "yellow"
  			}
  		}
  	]
  	// Input 2
  	[
  		{
  			"fruit": {
  				"type": "apple",
  				"color": "red"
  			}
  		},
  				{
  			"fruit": {
  				"type": "apple",
  				"color": "red"
  			}
  		},
  				{
  			"fruit": {
  				"type": "banana",
  				"color": "yellow"
  			}
  		}
  	]
  ```

  n8n returns three items in the **Same Branch** tab. The data is the same in both branches.

  If you select **Include First Match Only**, n8n returns two items, in the **Same Branch** tab. The data is the same in both branches, but n8n only returns the first occurrence of the matching "apple" items.


  ## Understand the output

  There are four output options:

  * **In A only Branch**: Contains data that occurs only in the first input.
  * **Same Branch**: Contains data that's the same in both inputs.
  * **Different Branch**: Contains data that's different between inputs.
  * **In B only Branch**: Contains data that occurs only in the second output.

  ## Templates and examples

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

troubleshooting_info:
  [{"issue":"Node parameters","solution":"1. Decide which fields to compare. In **Input A Field**, enter the name of the field you want to use from input stream A. In **Input B Field**, enter the name of the field you want to use from input stream B. \n2. **Optional**: You can compare by multiple fields. Select **Add Fields to Match** to set up more comparisons.\n3. Choose how to handle differences between the datasets. In **When There Are Differences**, select one of the following:\n\t* **Use Input A Version** to treat input stream A as the source of truth.\n\t* **Use Input B Version** to treat input stream B as the source of truth.\n\t* **Use a Mix of Versions** to use different inputs for different fields.\n\t\t* Use **Prefer** to select either **Input A Version** or **Input B Version** as the main source of truth.\n\t\t* Enter input fields that are exceptions to **For Everything Except** to pull from the other input source. To add multiple input fields, enter a comma-separated list.\n\t* **Include Both Versions** to include both input streams in the output, which may make the structure more complex.\n4. Decide whether to use **Fuzzy Compare**. When turned on, the comparison will tolerate small type differences when comparing fields. For example, the number 3 and the string `3` are treated as the same with **Fuzzy Compare** turned on, but wouldn't be treated the same with it turned off."},{"issue":"Understand item comparison","solution":"Item comparison is a two stage process:"},{"issue":"Node options","solution":"Use the node **Options** to refine your comparison or tweak comparison behavior."},{"issue":"Fields to Skip Comparing","solution":"Enter field names that you want to ignore in the comparison."},{"issue":"Disable Dot Notation","solution":"Whether to disallow referencing child fields using `parent.child` in the field name (turned on) or allow it (turned off, default)."},{"issue":"Multiple Matches","solution":"Choose how to handle duplicate data. The default is **Include All Matches**. You can choose **Include First Match Only**."},{"issue":"Understand the output","solution":"There are four output options:"}]

example_workflow:
  {"name":"Compare Datasets Example Workflow","nodes":[{"parameters":{"infoBox":null,"mergeByFields":{},"resolve":"preferInput1","fuzzyCompare":false,"preferWhenMix":"input1","exceptWhenMix":"example-value","options":{}},"id":"lgbcqiqvffnax4w34lvsd","name":"Compare Datasets","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"infoBox":null,"mergeByFields":{},"resolve":"preferInput1","fuzzyCompare":false,"preferWhenMix":"input1","exceptWhenMix":"example-value","options":{}}

properties_schema:
  [{"displayName":"Items from different branches are paired together when the fields below match. If paired, the rest of the fields are compared to determine whether the items are the same or different","name":"infoBox","type":"notice","default":""},{"displayName":"Fields to Match","name":"mergeByFields","type":"fixedCollection","default":"{ values: [{ field1: ''","placeholder":"Add Fields to Match"},{"displayName":"When There Are Differences","name":"resolve","type":"options","default":"preferInput2","description":"Output uses different inputs for different fields","options":[{"name":"Use Input A Version","value":"preferInput1"},{"name":"Use Input B Version","value":"preferInput2"},{"name":"Use a Mix of Versions","value":"mix","description":"Output uses different inputs for different fields"},{"name":"Include Both Versions","value":"includeBoth","description":"Output contains all data (but structure more complex)"}]},{"displayName":"When There Are Differences","name":"resolve","type":"options","default":"includeBoth","description":"Output uses different inputs for different fields","options":[{"name":"Use Input A Version","value":"preferInput1"},{"name":"Use Input B Version","value":"preferInput2"},{"name":"Use a Mix of Versions","value":"mix","description":"Output uses different inputs for different fields"},{"name":"Include Both Versions","value":"includeBoth","description":"Output contains all data (but structure more complex)"}]},{"displayName":"Fuzzy Compare","name":"fuzzyCompare","type":"boolean","default":false,"description":"Whether to tolerate small type differences when comparing fields. E.g. the number 3 and the string "},{"displayName":"Prefer","name":"preferWhenMix","type":"options","default":"input1","options":[{"name":"Input A Version","value":"input1"},{"name":"Input B Version","value":"input2"}]},{"displayName":"For Everything Except","name":"exceptWhenMix","type":"string","default":"","placeholder":"e.g. id, country"},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Fields that shouldn","placeholder":"Add Option"}]


node_type: n8n-nodes-base.Cron
name: Cron
display_name: Cron
description: Triggers the workflow at a specific time
category: Other
icon: fa:clock
code_hash: 1007935f771c6c047d905b9d18670c642e442bffb3587f1b054ebd817dc1604c
example_parameters: {"notice":null,"triggerTimes":{}}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:26
updated_at: 2025-06-12 08:58:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Cron = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const cron_1 = require("cron");
  class Cron {
      constructor() {
          this.description = {
              displayName: 'Cron',
              name: 'cron',
              icon: 'fa:clock',
              group: ['trigger', 'schedule'],
              version: 1,
              hidden: true,
              description: 'Triggers the workflow at a specific time',
              eventTriggerDescription: '',
              activationMessage: 'Your cron trigger will now trigger executions on the schedule you have defined.',
              defaults: {
                  name: 'Cron',
                  color: '#29a568',
              },
              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: 'Trigger Times',
                      name: 'triggerTimes',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                          multipleValueButtonText: 'Add Time',
                      },
                      default: {},
                      description: 'Triggers for the workflow',
                      placeholder: 'Add Cron Time',
                      options: n8n_workflow_1.NodeHelpers.cronNodeOptions,
                  },
              ],
          };
      }
      async trigger() {
          const triggerTimes = this.getNodeParameter('triggerTimes');
          const cronTimes = (triggerTimes.item || []).map(n8n_workflow_1.toCronExpression);
          const executeTrigger = () => {
              this.emit([this.helpers.returnJsonArray([{}])]);
          };
          const timezone = this.getTimezone();
          const cronJobs = cronTimes.map((cronTime) => new cron_1.CronJob(cronTime, executeTrigger, undefined, true, timezone));
          async function closeFunction() {
              for (const cronJob of cronJobs) {
                  cronJob.stop();
              }
          }
          async function manualTriggerFunction() {
              executeTrigger();
          }
          return {
              closeFunction,
              manualTriggerFunction,
          };
      }
  }
  exports.Cron = Cron;
  //# sourceMappingURL=Cron.node.js.map

example_workflow:
  {"name":"Cron Example Workflow","nodes":[{"parameters":{"notice":null,"triggerTimes":{}},"id":"cb0214mmclq8q3uaqjikp6","name":"Cron","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":"Trigger Times","name":"triggerTimes","type":"fixedCollection","default":"{","description":"Triggers for the workflow","placeholder":"Add Cron Time"}]


node_type: n8n-nodes-base.DateTime
name: DateTime
display_name: Date & Time
description: Allows you to manipulate date and time values
category: transform
icon: fa:clock
code_hash: 5b2d624ad5788edd31b5c0bcec8b91e25d0cdc5ba56f41c1b9e21350e7193fa7
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.DateTime
documentation_title: Date & Time
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"date-and-time","description":"Templates for date-and-time"}]
required_scopes: []
parameter_schemas: []
version_info: {"breakingChanges":[],"currentVersion":"2.1"}
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-12 08:58:26
updated_at: 2025-06-12 08:58:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DateTime = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const DateTimeV1_node_1 = require("./V1/DateTimeV1.node");
  const DateTimeV2_node_1 = require("./V2/DateTimeV2.node");
  class DateTime extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Date & Time',
              name: 'dateTime',
              icon: 'fa:clock',
              group: ['transform'],
              defaultVersion: 2,
              description: 'Allows you to manipulate date and time values',
              subtitle: '={{$parameter["action"]}}',
          };
          const nodeVersions = {
              1: new DateTimeV1_node_1.DateTimeV1(baseDescription),
              2: new DateTimeV2_node_1.DateTimeV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.DateTime = DateTime;
  //# sourceMappingURL=DateTime.node.js.map

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

  # Date & Time

  The Date & Time node manipulates date and time data and convert it to different formats.

  --8<-- "_snippets/integrations/builtin/core-nodes/schedule/timezone-settings.md"

  /// note | Date and time in other nodes
  You can work with data and time in the Code node, and in expressions in any node. n8n supports Luxon to help work with date and time in JavaScript. Refer to [Date and time with Luxon](/code/cookbook/luxon.md) for more information.
  ///

  ## Operations

  * **Add to a Date**: Add a specified amount of time to a date.
  * **Extract Part of a Date**: Extract part of a date, such as the year, month, or day.
  * **Format a Date**: Transform a date's format to a new format using preset options or a custom expression.
  * **Get Current Date**: Get the current date and choose whether to include the current time or not. Useful for triggering other flows and conditional logic.
  * **Get Time Between Dates**: Calculate the amount of time in specific units between two dates.
  * **Round a Date**: Round a date up or down to the nearest unit of your choice, such as month, day, or hour.
  * **Subtract From a Date**: Subtract a specified amount of time from a date.

  Refer to the sections below for parameters and options specific to each operation.

  ## Add to a Date

  Configure the node for this operation using these parameters:

  * **Date to Add To**: Enter the date you want to change.
  * **Time Unit to Add**: Select the time unit for the **Duration** parameter.
  * **Duration**: Enter the number of time units to add to the date.
  * **Output Field Name**: Enter the name of the field to output the new date to.

  ### Add to a Date options

  This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.

  ## Extract Part of a Date

  Configure the node for this operation using these parameters:

  * **Date**: Enter the date you want to round or extract part of.
  * **Part**: Select the part of the date you want to extract. Choose from:
      * **Year**
      * **Month**
      * **Week**
      * **Day**
      * **Hour**
      * **Minute**
      * **Second**
  * **Output Field Name**: Enter the name of the field to output the extracted date part to.

  ### Extract Part of a Date options

  This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.

  ## Format a Date

  Configure the node for this operation using these parameters:

  * **Date**: Enter the date you want to format.
  * **Format**: Select the format you want to change the date to. Choose from:
      * **Custom Format**: Enter your own custom format using Luxon's [special tokens](https://moment.github.io/luxon/#/formatting?id=table-of-tokens){:target=_blank .external-link}. Tokens are case-sensitive.
      * **MM/DD/YYYY**: For `4 September 1986`, this formats the date as `09/04/1986`.
      * **YYYY/MM/DD**: For `4 September 1986`, this formats the date as `1986/09/04`.
      * **MMMM DD YYYY**: For `4 September 1986`, this formats the date as `September 04 1986`.
      * **MM-DD-YYYY**: For `4 September 1986`, this formats the date as `09-04-1986`.
      * **YYYY-MM-DD**: For `4 September 1986`, this formats the date as `1986-09-04`.
  * **Output Field Name**: Enter the name of the field to output the formatted date to.

  ### Format a Date options

  This operation includes these options:

  * **Include Input Fields**: If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.
  * **From Date Format**: If the node isn't recognizing the **Date** format correctly, enter the format for that **Date** here so the node can process it properly. Use Luxon's [special tokens](https://moment.github.io/luxon/#/formatting?id=table-of-tokens){:target=_blank .external-link} to enter the format. Tokens are case-sensitive
  * **Use Workflow Timezone**: Whether to use the input's time zone (turned off) or the workflow's timezone (turned on).

  ## Get Current Date

  Configure the node for this operation using these parameters:

  * **Include Current Time**: Choose whether to include the current time (turned on) or to set the time to midnight (turned off).
  * **Output Field Name**: Enter the name of the field to output the current date to.

  ### Get Current Date options

  This operation includes these options:

  * **Include Input Fields**: If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.
  * **Timezone**: Set the timezone to use. If left blank, the node uses the n8n instance's timezone.

  /// note | +00:00 timezone
  Use `GMT` for +00:00 timezone.
  ///

  ## Get Time Between Dates

  Configure the node for this operation using these parameters:

  * **Start Date**: Enter the earlier date you want to compare.
  * **End Date**: Enter the later date you want to compare.
  * **Units**: Select the units you want to calculate the time between. You can include multiple units. Choose from:
      * **Year**
      * **Month**
      * **Week**
      * **Day**
      * **Hour**
      * **Minute**
      * **Second**
      * **Millisecond**
  * **Output Field Name**: Enter the name of the field to output the calculated time between to.

  ### Get Time Between Dates options

  The Get Time Between Dates operation includes the **Include Input Fields** option as well as an **Output as ISO String** option. If you leave this option off, each unit you selected will return its own time difference calculation, for example:

      timeDifference
      years : 1
      months : 3
      days : 13

  If you turn on the **Output as ISO String** option, the node formats the output as a single ISO duration string, for example: `P1Y3M13D`.

  ISO duration format displays a format as `P<n>Y<n>M<n>DT<n>H<n>M<n>S`. `<n>` is the number for the unit after it.

  * P = period (duration). It begins all ISO duration strings.
  * Y = years
  * M = months
  * W = weeks
  * D = days
  * T = delineator between dates and times, used to avoid confusion between months and minutes
  * H = hours
  * M = minutes
  * S = seconds

  Milliseconds don't get their own unit, but instead are decimal seconds. For example, 2.1 milliseconds is `0.0021S`.

  ## Round a Date

  Configure the node for this operation using these parameters:

  * **Date**: Enter the date you'd like to round.
  * **Mode**: Choose whether to **Round Down** or **Round Up**.
  * **To Nearest**: Select the unit you'd like to round to. Choose from:
      * **Year**
      * **Month**
      * **Week**
      * **Day**
      * **Hour**
      * **Minute**
      * **Second**
  * **Output Field Name**: Enter the name of the field to output the rounded date to.

  ### Round a Date options

  This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.

  ## Subtract From a Date

  Configure the node for this operation using these parameters:

  * **Date to Subtract From**: Enter the date you'd like to subtract from.
  * **Time Unit to Subtract**: Select the unit for the **Duration** amount you want to subtract.
  * **Duration**: Enter the amount of the time units you want to subtract from the **Date to Subtract From**.
  * **Output Field Name**: Enter the name of the field to output the rounded date to.

  ### Subtract From a Date options

  This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.

  ## Templates and examples

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

  ## Related resources

  The Date & Time node uses [Luxon](https://moment.github.io/luxon){:target=_blank .external-link}. You can also use Luxon in the [Code](/code/code-node.md) node and [expressions](/code/expressions.md). Refer to [Date and time with Luxon](/code/cookbook/luxon.md) for more information.

  ### Supported date formats

  n8n supports all date formats [supported by Luxon](https://moment.github.io/luxon/#/formatting?id=table-of-tokens){:target=_blank .external-link}. Tokens are case-sensitive.

related_resources:
  [{"title":"Luxon","url":"https://moment.github.io/luxon","type":"external"},{"title":"Code","url":"/code/code-node.md","type":"documentation"},{"title":"expressions","url":"/code/expressions.md","type":"documentation"},{"title":"Date and time with Luxon","url":"/code/cookbook/luxon.md","type":"documentation"}]

troubleshooting_info:
  [{"issue":"Add to a Date","solution":"Configure the node for this operation using these parameters:"},{"issue":"Add to a Date options","solution":"This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output."},{"issue":"Extract Part of a Date","solution":"Configure the node for this operation using these parameters:"},{"issue":"Extract Part of a Date options","solution":"This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output."},{"issue":"Format a Date","solution":"Configure the node for this operation using these parameters:"},{"issue":"Format a Date options","solution":"This operation includes these options:"},{"issue":"Get Current Date","solution":"Configure the node for this operation using these parameters:"},{"issue":"Get Current Date options","solution":"This operation includes these options:"},{"issue":"Get Time Between Dates","solution":"Configure the node for this operation using these parameters:"},{"issue":"Get Time Between Dates options","solution":"The Get Time Between Dates operation includes the **Include Input Fields** option as well as an **Output as ISO String** option. If you leave this option off, each unit you selected will return its own time difference calculation, for example:"},{"issue":"Round a Date","solution":"Configure the node for this operation using these parameters:"},{"issue":"Round a Date options","solution":"This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output."},{"issue":"Subtract From a Date","solution":"Configure the node for this operation using these parameters:"},{"issue":"Subtract From a Date options","solution":"This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output."},{"issue":"Supported date formats","solution":"n8n supports all date formats [supported by Luxon](https://moment.github.io/luxon/#/formatting?id=table-of-tokens){:target=_blank .external-link}. Tokens are case-sensitive."}]

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


node_type: n8n-nodes-base.Cortex
name: Cortex
display_name: Cortex
description: Apply the Cortex analyzer/responder on the given entity
category: transform
icon: file:cortex.svg
code_hash: 8f389c8f2baaa7c8b3f6baa6e6f1207c28c8d3f75ad14339b2f345e321864b98
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Cortex
documentation_title: Cortex node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"cortex","description":"Templates for cortex"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"analyzer","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:26
updated_at: 2025-06-12 08:58:26
source_code:
  "use strict";
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
      }
      Object.defineProperty(o, k2, desc);
  }) : (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      o[k2] = m[k];
  }));
  var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
  }) : function(o, v) {
      o["default"] = v;
  });
  var __importStar = (this && this.__importStar) || function (mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      __setModuleDefault(result, mod);
      return result;
  };
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Cortex = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const AnalyzerDescriptions_1 = require("./AnalyzerDescriptions");
  const ResponderDescription_1 = require("./ResponderDescription");
  const JobDescription_1 = require("./JobDescription");
  const upperFirst_1 = __importDefault(require("lodash/upperFirst"));
  const crypto_1 = require("crypto");
  const changeCase = __importStar(require("change-case"));
  class Cortex {
      constructor() {
          this.description = {
              displayName: 'Cortex',
              name: 'cortex',
              icon: 'file:cortex.svg',
              group: ['transform'],
              subtitle: '={{$parameter["operation"]+ ": " + $parameter["resource"]}}',
              version: 1,
              description: 'Apply the Cortex analyzer/responder on the given entity',
              defaults: {
                  name: 'Cortex',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'cortexApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Analyzer',
                              value: 'analyzer',
                          },
                          {
                              name: 'Job',
                              value: 'job',
                          },
                          {
                              name: 'Responder',
                              value: 'responder',
                          },
                      ],
                      default: 'analyzer',
                      description: 'Choose a resource',
                      required: true,
                  },
                  ...AnalyzerDescriptions_1.analyzersOperations,
                  ...AnalyzerDescriptions_1.analyzerFields,
                  ...ResponderDescription_1.respondersOperations,
                  ...ResponderDescription_1.responderFields,
                  ...JobDescription_1.jobOperations,
                  ...JobDescription_1.jobFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async loadActiveAnalyzers() {
                      const requestResult = await GenericFunctions_1.cortexApiRequest.call(this, 'POST', '/analyzer/_search?range=all');
                      const returnData = [];
                      for (const analyzer of requestResult) {
                          returnData.push({
                              name: analyzer.name,
                              value: `${analyzer.id}::${analyzer.name}`,
                              description: analyzer.description,
                          });
                      }
                      return returnData;
                  },
                  async loadActiveResponders() {
                      const requestResult = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', '/responder');
                      const returnData = [];
                      for (const responder of requestResult) {
                          returnData.push({
                              name: responder.name,
                              value: `${responder.id}::${responder.name}`,
                              description: responder.description,
                          });
                      }
                      return returnData;
                  },
                  async loadObservableOptions() {
                      const selectedAnalyzerId = this.getNodeParameter('analyzer').split('::')[0];
                      const requestResult = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/analyzer/${selectedAnalyzerId}`);
                      const returnData = [];
                      for (const dataType of requestResult.dataTypeList) {
                          returnData.push({
                              name: (0, upperFirst_1.default)(dataType),
                              value: dataType,
                          });
                      }
                      return returnData;
                  },
                  async loadDataTypeOptions() {
                      const selectedResponderId = this.getNodeParameter('responder').split('::')[0];
                      const requestResult = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/responder/${selectedResponderId}`);
                      const returnData = [];
                      for (const dataType of requestResult.dataTypeList) {
                          returnData.push({
                              value: dataType.split(':')[1],
                              name: changeCase.capitalCase(dataType.split(':')[1]),
                          });
                      }
                      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 === 'analyzer') {
                      if (operation === 'execute') {
                          let force = false;
                          const analyzer = this.getNodeParameter('analyzer', i);
                          const observableType = this.getNodeParameter('observableType', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const tlp = this.getNodeParameter('tlp', i);
                          const body = {
                              dataType: observableType,
                              tlp,
                          };
                          if (additionalFields.force === true) {
                              force = true;
                          }
                          if (observableType === 'file') {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              const fileBufferData = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              const options = {
                                  formData: {
                                      data: {
                                          value: fileBufferData,
                                          options: {
                                              contentType: binaryData.mimeType,
                                              filename: binaryData.fileName,
                                          },
                                      },
                                      _json: JSON.stringify({
                                          dataType: observableType,
                                          tlp,
                                      }),
                                  },
                              };
                              responseData = (await GenericFunctions_1.cortexApiRequest.call(this, 'POST', `/analyzer/${analyzer.split('::')[0]}/run`, {}, { force }, '', options));
                              continue;
                          }
                          else {
                              const observableValue = this.getNodeParameter('observableValue', i);
                              body.data = observableValue;
                              responseData = (await GenericFunctions_1.cortexApiRequest.call(this, 'POST', `/analyzer/${analyzer.split('::')[0]}/run`, body, { force }));
                          }
                          if (additionalFields.timeout) {
                              responseData = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/job/${responseData.id}/waitreport`, {}, { atMost: `${additionalFields.timeout}second` });
                          }
                      }
                  }
                  if (resource === 'job') {
                      if (operation === 'get') {
                          const jobId = this.getNodeParameter('jobId', i);
                          responseData = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/job/${jobId}`);
                      }
                      if (operation === 'report') {
                          const jobId = this.getNodeParameter('jobId', i);
                          responseData = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/job/${jobId}/report`);
                      }
                  }
                  if (resource === 'responder') {
                      if (operation === 'execute') {
                          const responderId = this.getNodeParameter('responder', i).split('::')[0];
                          const entityType = this.getNodeParameter('entityType', i);
                          const isJSON = this.getNodeParameter('jsonObject', i);
                          let body;
                          if (isJSON) {
                              const entityJson = JSON.parse(this.getNodeParameter('objectData', i));
                              body = {
                                  responderId,
                                  label: (0, GenericFunctions_1.getEntityLabel)(entityJson),
                                  dataType: `thehive:${entityType}`,
                                  data: entityJson,
                                  tlp: entityJson.tlp || 2,
                                  pap: entityJson.pap || 2,
                                  message: entityJson.message || '',
                                  parameters: [],
                              };
                          }
                          else {
                              const values = this.getNodeParameter('parameters', i)
                                  .values;
                              body = {
                                  responderId,
                                  dataType: `thehive:${entityType}`,
                                  data: {
                                      _type: entityType,
                                      ...(0, GenericFunctions_1.prepareParameters)(values),
                                  },
                              };
                              if (entityType === 'alert') {
                                  const artifacts = body.data.artifacts;
                                  if (artifacts) {
                                      const artifactValues = artifacts.artifactValues;
                                      if (artifactValues) {
                                          const artifactData = [];
                                          for (const artifactvalue of artifactValues) {
                                              const element = {};
                                              element.message = artifactvalue.message;
                                              element.tags = (0, GenericFunctions_1.splitTags)(artifactvalue.tags);
                                              element.dataType = artifactvalue.dataType;
                                              element.data = artifactvalue.data;
                                              if (artifactvalue.dataType === 'file') {
                                                  const binaryPropertyName = artifactvalue.binaryProperty;
                                                  const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                                  element.data = `${binaryData.fileName};${binaryData.mimeType};${binaryData.data}`;
                                              }
                                              artifactData.push(element);
                                          }
                                          body.data.artifacts = artifactData;
                                      }
                                  }
                              }
                              if (entityType === 'case_artifact') {
                                  if (body.data.dataType === 'file') {
                                      const binaryPropertyName = body.data
                                          .binaryPropertyName;
                                      const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                      const fileBufferData = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                                      const sha256 = (0, crypto_1.createHash)('sha256').update(fileBufferData).digest('hex');
                                      body.data.attachment = {
                                          name: binaryData.fileName,
                                          hashes: [
                                              sha256,
                                              (0, crypto_1.createHash)('sha1').update(fileBufferData).digest('hex'),
                                              (0, crypto_1.createHash)('md5').update(fileBufferData).digest('hex'),
                                          ],
                                          size: fileBufferData.byteLength,
                                          contentType: binaryData.mimeType,
                                          id: sha256,
                                      };
                                      delete body.data.binaryPropertyName;
                                  }
                              }
                              body = {
                                  label: (0, GenericFunctions_1.getEntityLabel)(body.data),
                                  ...body,
                              };
                          }
                          responseData = (await GenericFunctions_1.cortexApiRequest.call(this, 'POST', `/responder/${responderId}/run`, body));
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else if (responseData !== undefined) {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Cortex = Cortex;
  //# sourceMappingURL=Cortex.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CortexApi = void 0;
  class CortexApi {
      constructor() {
          this.name = 'cortexApi';
          this.displayName = 'Cortex API';
          this.documentationUrl = 'cortex';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'cortexApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Cortex Instance',
                  name: 'host',
                  type: 'string',
                  description: 'The URL of the Cortex instance',
                  default: '',
                  placeholder: 'https://localhost:9001',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.cortexApiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.host}}',
                  url: '/api/analyzer',
              },
          };
      }
  }
  exports.CortexApi = CortexApi;
  //# sourceMappingURL=CortexApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CortexApi = void 0;
  class CortexApi {
      constructor() {
          this.name = 'cortexApi';
          this.displayName = 'Cortex API';
          this.documentationUrl = 'cortex';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'cortexApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Cortex Instance',
                  name: 'host',
                  type: 'string',
                  description: 'The URL of the Cortex instance',
                  default: '',
                  placeholder: 'https://localhost:9001',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.cortexApiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.host}}',
                  url: '/api/analyzer',
              },
          };
      }
  }
  exports.CortexApi = CortexApi;
  //# sourceMappingURL=CortexApi.credentials.js.map

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

  # Cortex node

  Use the Cortex node to automate work in Cortex, and integrate Cortex with other applications. n8n has built-in support for a wide range of Cortex features, including executing analyzers, and responders, as well as getting job details.

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

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

  ## Operations

  * Analyzer
      * Execute Analyzer
  * Job
      * Get job details
      * Get job report
  * Responder
      * Execute Responder

  ## Templates and examples

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

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

example_workflow:
  {"name":"Cortex Example Workflow","nodes":[{"parameters":{"resource":"analyzer","dynamic_property":null},"id":"maalmrh3zdlz8h0amup6rs","name":"Cortex","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":"analyzer","required":true,"description":"Choose a resource","options":[{"name":"Analyzer","value":"analyzer"},{"name":"Job","value":"job"},{"name":"Responder","value":"responder"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AnalyzerDescriptions_1.analyzersOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AnalyzerDescriptions_1.analyzerFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ResponderDescription_1.respondersOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ResponderDescription_1.responderFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...JobDescription_1.jobOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...JobDescription_1.jobFields"}]


node_type: n8n-nodes-base.CrateDb
name: CrateDb
display_name: CrateDB
description: Add and update data in CrateDB
category: input
icon: file:cratedb.png
code_hash: 704a03f54931b635bbfaf8d0beb88dca10188c162ebc6170338ec17dfbecd649
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.CrateDb
documentation_title: CrateDB node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"cratedb","description":"Templates for cratedb"}]
related_resources: []
required_scopes: []
parameter_schemas: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:26
updated_at: 2025-06-12 08:58:26
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.CrateDb = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const genericFunctions_1 = require("../Postgres/v1/genericFunctions");
  const pg_promise_1 = __importDefault(require("pg-promise"));
  class CrateDb {
      constructor() {
          this.description = {
              displayName: 'CrateDB',
              name: 'crateDb',
              icon: 'file:cratedb.png',
              group: ['input'],
              version: 1,
              description: 'Add and update data in CrateDB',
              defaults: {
                  name: 'CrateDB',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'crateDb',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Execute Query',
                              value: 'executeQuery',
                              description: 'Execute an SQL query',
                              action: 'Execute a SQL query',
                          },
                          {
                              name: 'Insert',
                              value: 'insert',
                              description: 'Insert rows in database',
                              action: 'Insert rows in database',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update rows in database',
                              action: 'Update rows in database',
                          },
                      ],
                      default: 'insert',
                  },
                  {
                      displayName: 'Query',
                      name: 'query',
                      type: 'string',
                      noDataExpression: true,
                      typeOptions: {
                          editor: 'sqlEditor',
                          rows: 5,
                          sqlDialect: 'PostgreSQL',
                      },
                      displayOptions: {
                          show: {
                              operation: ['executeQuery'],
                          },
                      },
                      default: '',
                      placeholder: 'SELECT id, name FROM product WHERE quantity > $1 AND price <= $2',
                      required: true,
                      description: 'The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.',
                  },
                  {
                      displayName: 'Schema',
                      name: 'schema',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: 'doc',
                      required: true,
                      description: 'Name of the schema the table belongs to',
                  },
                  {
                      displayName: 'Table',
                      name: 'table',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the table in which to insert data to',
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      placeholder: 'id,name,description',
                      description: 'Comma-separated list of the properties which should used as columns for the new rows',
                  },
                  {
                      displayName: 'Schema',
                      name: 'schema',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: 'doc',
                      required: true,
                      description: 'Name of the schema the table belongs to',
                  },
                  {
                      displayName: 'Table',
                      name: 'table',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the table in which to update data in',
                  },
                  {
                      displayName: 'Update Key',
                      name: 'updateKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: 'id',
                      required: true,
                      description: 'Comma-separated list of the properties which decides which rows in the database should be updated. Normally that would be "id".',
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: '',
                      placeholder: 'name,description',
                      description: 'Comma-separated list of the properties which should used as columns for rows to update',
                  },
                  {
                      displayName: 'Return Fields',
                      name: 'returnFields',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert', 'update'],
                          },
                      },
                      default: '*',
                      description: 'Comma-separated list of the fields that the operation will return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      options: [
                          {
                              displayName: 'Mode',
                              name: 'mode',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Independently',
                                      value: 'independently',
                                      description: 'Execute each query independently',
                                  },
                                  {
                                      name: 'Multiple Queries',
                                      value: 'multiple',
                                      description: '<b>Default</b>. Sends multiple queries at once to database.',
                                  },
                              ],
                              default: 'multiple',
                              description: 'The way queries should be sent to database. Can be used in conjunction with <b>Continue on Fail</b>. See <a href="https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.cratedb/">the docs</a> for more examples.',
                          },
                          {
                              displayName: 'Query Parameters',
                              name: 'queryParams',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['executeQuery'],
                                  },
                              },
                              default: '',
                              placeholder: 'quantity,price',
                              description: 'Comma-separated list of properties which should be used as query parameters',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          var _a;
          const credentials = await this.getCredentials('crateDb');
          const pgp = (0, pg_promise_1.default)();
          const config = {
              host: credentials.host,
              port: credentials.port,
              database: credentials.database,
              user: credentials.user,
              password: credentials.password,
              ssl: !['disable', undefined].includes(credentials.ssl),
              sslmode: credentials.ssl || 'disable',
          };
          const db = pgp(config);
          let returnItems = [];
          const items = this.getInputData();
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'executeQuery') {
              const queryResult = await genericFunctions_1.pgQueryV2.call(this, pgp, db, items, this.continueOnFail(), {
                  resolveExpression: true,
              });
              returnItems = this.helpers.returnJsonArray(queryResult);
          }
          else if (operation === 'insert') {
              const insertData = await (0, genericFunctions_1.pgInsert)(this.getNodeParameter, pgp, db, items, this.continueOnFail());
              for (let i = 0; i < insertData.length; i++) {
                  returnItems.push({
                      json: insertData[i],
                  });
              }
          }
          else if (operation === 'update') {
              const additionalFields = this.getNodeParameter('additionalFields', 0);
              const mode = (_a = additionalFields.mode) !== null && _a !== void 0 ? _a : 'multiple';
              if (mode === 'independently') {
                  const updateItems = await (0, genericFunctions_1.pgUpdate)(this.getNodeParameter, pgp, db, items, this.continueOnFail());
                  returnItems = this.helpers.returnJsonArray(updateItems);
              }
              else if (mode === 'multiple') {
                  const table = this.getNodeParameter('table', 0);
                  const schema = this.getNodeParameter('schema', 0);
                  const updateKeys = this.getNodeParameter('updateKey', 0)
                      .split(',')
                      .map((column) => column.trim());
                  const columns = this.getNodeParameter('columns', 0)
                      .split(',')
                      .map((column) => column.trim());
                  const queryColumns = columns.slice();
                  updateKeys.forEach((updateKey) => {
                      if (!queryColumns.includes(updateKey)) {
                          columns.unshift(updateKey);
                          queryColumns.unshift('?' + updateKey);
                      }
                  });
                  const cs = new pgp.helpers.ColumnSet(queryColumns, { table: { table, schema } });
                  const where = ' WHERE ' +
                      updateKeys
                          .map((updateKey) => pgp.as.name(updateKey) + ' = ${' + updateKey + '}')
                          .join(' AND ');
                  const returning = (0, genericFunctions_1.generateReturning)(pgp, this.getNodeParameter('returnFields', 0));
                  const queries = [];
                  for (let i = 0; i < items.length; i++) {
                      const itemCopy = (0, genericFunctions_1.getItemCopy)(items[i], columns);
                      queries.push(pgp.helpers.update(itemCopy, cs) +
                          pgp.as.format(where, itemCopy) +
                          returning);
                  }
                  await db.multi(pgp.helpers.concat(queries));
                  returnItems = this.helpers.returnJsonArray((0, genericFunctions_1.getItemsCopy)(items, columns));
              }
          }
          else {
              await db.$pool.end();
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`);
          }
          await db.$pool.end();
          return [returnItems];
      }
  }
  exports.CrateDb = CrateDb;
  //# sourceMappingURL=CrateDb.node.js.map

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

  # CrateDB node

  Use the CrateDB node to automate work in CrateDB, and integrate CrateDB with other applications. n8n has built-in support for a wide range of CrateDB features, including executing, inserting, and updating rows in the database.

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

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

  ## Operations

  * Execute an SQL query
  * Insert rows in database
  * Update rows in database

  ## Templates and examples

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

  ## Node reference

  ### Specify a column's data type

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

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

example_workflow:
  {"name":"CrateDB Example Workflow","nodes":[{"parameters":{"operation":"executeQuery","query":"example-value","schema":"doc","table":"example-value","columns":"example-value","updateKey":"id","returnFields":"*","additionalFields":{}},"id":"2bhpqezubp989p7z4vibi","name":"CrateDB","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"operation":"executeQuery","query":"example-value","schema":"doc","table":"example-value","columns":"example-value","updateKey":"id","returnFields":"*","additionalFields":{}}

properties_schema:
  [{"displayName":"Operation","name":"operation","type":"options","default":"insert","description":"Execute an SQL query","options":[{"name":"Execute Query","value":"executeQuery","description":"Execute an SQL query"},{"name":"Insert","value":"insert","description":"Insert rows in database"},{"name":"Update","value":"update","description":"Update rows in database"}]},{"displayName":"Query","name":"query","type":"string","default":"","required":true,"description":"The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.","placeholder":"SELECT id, name FROM product WHERE quantity > $1 AND price <= $2"},{"displayName":"Schema","name":"schema","type":"string","default":"doc","required":true,"description":"Name of the schema the table belongs to"},{"displayName":"Table","name":"table","type":"string","default":"","required":true,"description":"Name of the table in which to insert data to"},{"displayName":"Columns","name":"columns","type":"string","default":"","description":"Comma-separated list of the properties which should used as columns for the new rows","placeholder":"id,name,description"},{"displayName":"Schema","name":"schema","type":"string","default":"doc","required":true,"description":"Name of the schema the table belongs to"},{"displayName":"Table","name":"table","type":"string","default":"","required":true,"description":"Name of the table in which to update data in"},{"displayName":"Update Key","name":"updateKey","type":"string","default":"id","required":true,"description":"Comma-separated list of the properties which decides which rows in the database should be updated. Normally that would be "},{"displayName":"Columns","name":"columns","type":"string","default":"","description":"Comma-separated list of the properties which should used as columns for rows to update","placeholder":"name,description"},{"displayName":"Return Fields","name":"returnFields","type":"string","default":"*","description":"Comma-separated list of the fields that the operation will return"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Execute each query independently","placeholder":"Add Field"}]


node_type: n8n-nodes-base.CrowdDev
name: CrowdDev
display_name: crowd.dev
category: transform
icon: file:crowdDev.svg
code_hash: b178a065b61c6a7c856f8750043d0f368f7c2561ccb062a045c83c17eabe4328
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.CrowdDev
documentation_title: crowd.dev node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"crowddev","description":"Templates for crowddev"}]
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:26
updated_at: 2025-06-12 08:58:26
description:
  crowd.dev is an open-source suite of community and data tools built to unlock community-led growth for your organization.

source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CrowdDev = void 0;
  const descriptions_1 = require("./descriptions");
  class CrowdDev {
      constructor() {
          this.description = {
              displayName: 'crowd.dev',
              name: 'crowdDev',
              icon: 'file:crowdDev.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
              description: 'crowd.dev is an open-source suite of community and data tools built to unlock community-led growth for your organization.',
              defaults: {
                  name: 'crowd.dev',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'crowdDevApi',
                      required: true,
                  },
              ],
              requestDefaults: {
                  baseURL: '={{$credentials.url}}/api/tenant/{{$credentials.tenantId}}',
                  json: true,
                  skipSslCertificateValidation: '={{ $credentials.allowUnauthorizedCerts }}',
              },
              properties: descriptions_1.allProperties,
          };
      }
  }
  exports.CrowdDev = CrowdDev;
  //# sourceMappingURL=CrowdDev.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CrowdDevApi = void 0;
  class CrowdDevApi {
      constructor() {
          this.name = 'crowdDevApi';
          this.displayName = 'crowd.dev API';
          this.documentationUrl = 'crowddev';
          this.properties = [
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: 'https://app.crowd.dev',
              },
              {
                  displayName: 'Tenant ID',
                  name: 'tenantId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Token',
                  name: 'token',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '={{"Bearer " + $credentials.token}}',
                  },
              },
          };
          this.test = {
              request: {
                  method: 'POST',
                  baseURL: '={{$credentials.url.replace(/\\/$/, "") + "/api/tenant/" + $credentials.tenantId}}',
                  url: '/member/query',
                  skipSslCertificateValidation: '={{ $credentials.allowUnauthorizedCerts }}',
                  body: {
                      limit: 1,
                      offset: 0,
                  },
              },
          };
      }
  }
  exports.CrowdDevApi = CrowdDevApi;
  //# sourceMappingURL=CrowdDevApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CrowdDevApi = void 0;
  class CrowdDevApi {
      constructor() {
          this.name = 'crowdDevApi';
          this.displayName = 'crowd.dev API';
          this.documentationUrl = 'crowddev';
          this.properties = [
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: 'https://app.crowd.dev',
              },
              {
                  displayName: 'Tenant ID',
                  name: 'tenantId',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Token',
                  name: 'token',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '={{"Bearer " + $credentials.token}}',
                  },
              },
          };
          this.test = {
              request: {
                  method: 'POST',
                  baseURL: '={{$credentials.url.replace(/\\/$/, "") + "/api/tenant/" + $credentials.tenantId}}',
                  url: '/member/query',
                  skipSslCertificateValidation: '={{ $credentials.allowUnauthorizedCerts }}',
                  body: {
                      limit: 1,
                      offset: 0,
                  },
              },
          };
      }
  }
  exports.CrowdDevApi = CrowdDevApi;
  //# sourceMappingURL=CrowdDevApi.credentials.js.map

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

  # crowd.dev node

  Use the crowd.dev node to automate work in crowd.dev and integrate crowd.dev with other applications. n8n has built-in support for a wide range of crowd.dev features, which includes creating, updating, and deleting members, notes, organizations, and tasks.

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

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

  ## Operations

  * Activity
  	* Create or Update with a Member
  	* Create
  * Automation
  	* Create
  	* Destroy
  	* Find
  	* List
  	* Update
  * Member
  	* Create or Update
  	* Delete
  	* Find
  	* Update
  * Note
  	* Create
  	* Delete
  	* Find
  	* Update
  * Organization
  	* Create
  	* Delete
  	* Find
  	* Update
  * Task
  	* Create
  	* Delete
  	* Find
  	* Update

  ## Templates and examples

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

  ## Related resources

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

  Refer to [crowd.dev's documentation](https://docs.crowd.dev/reference/getting-started-with-crowd-dev-api){:target=_blank .external-link} for more information about the service.

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

related_resources:
  [{"title":"here","url":"/integrations/builtin/trigger-nodes/n8n-nodes-base.crowddevtrigger.md","type":"documentation"},{"title":"crowd.dev's documentation","url":"https://docs.crowd.dev/reference/getting-started-with-crowd-dev-api","type":"external"}]

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


node_type: n8n-nodes-base.Crypto
name: Crypto
display_name: Crypto
description: Provide cryptographic utilities
category: transform
icon: fa:key
code_hash: 7a50ea2285a5de3700af151f5206c08e3d41cc364c489065753c65892983c9f9
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.Crypto
documentation_title: Crypto
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"crypto","description":"Templates for crypto"}]
related_resources: []
required_scopes: []
parameter_schemas: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:26
updated_at: 2025-06-12 08:58:26
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.Crypto = void 0;
  const set_1 = __importDefault(require("lodash/set"));
  const n8n_workflow_1 = require("n8n-workflow");
  const crypto_1 = require("crypto");
  const stream_1 = __importDefault(require("stream"));
  const util_1 = require("util");
  const uuid_1 = require("uuid");
  const pipeline = (0, util_1.promisify)(stream_1.default.pipeline);
  const unsupportedAlgorithms = [
      'RSA-MD4',
      'RSA-MDC2',
      'md4',
      'md4WithRSAEncryption',
      'mdc2',
      'mdc2WithRSA',
  ];
  const supportedAlgorithms = (0, crypto_1.getHashes)()
      .filter((algorithm) => !unsupportedAlgorithms.includes(algorithm))
      .map((algorithm) => ({ name: algorithm, value: algorithm }));
  class Crypto {
      constructor() {
          this.description = {
              displayName: 'Crypto',
              name: 'crypto',
              icon: 'fa:key',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["action"]}}',
              description: 'Provide cryptographic utilities',
              defaults: {
                  name: 'Crypto',
                  color: '#408000',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Action',
                      name: 'action',
                      type: 'options',
                      options: [
                          {
                              name: 'Generate',
                              description: 'Generate random string',
                              value: 'generate',
                              action: 'Generate random string',
                          },
                          {
                              name: 'Hash',
                              description: 'Hash a text or file in a specified format',
                              value: 'hash',
                              action: 'Hash a text or file in a specified format',
                          },
                          {
                              name: 'Hmac',
                              description: 'Hmac a text or file in a specified format',
                              value: 'hmac',
                              action: 'HMAC a text or file in a specified format',
                          },
                          {
                              name: 'Sign',
                              description: 'Sign a string using a private key',
                              value: 'sign',
                              action: 'Sign a string using a private key',
                          },
                      ],
                      default: 'hash',
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      displayOptions: {
                          show: {
                              action: ['hash'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'MD5',
                              value: 'MD5',
                          },
                          {
                              name: 'SHA256',
                              value: 'SHA256',
                          },
                          {
                              name: 'SHA3-256',
                              value: 'SHA3-256',
                          },
                          {
                              name: 'SHA3-384',
                              value: 'SHA3-384',
                          },
                          {
                              name: 'SHA3-512',
                              value: 'SHA3-512',
                          },
                          {
                              name: 'SHA384',
                              value: 'SHA384',
                          },
                          {
                              name: 'SHA512',
                              value: 'SHA512',
                          },
                      ],
                      default: 'MD5',
                      description: 'The hash type to use',
                      required: true,
                  },
                  {
                      displayName: 'Binary Data',
                      name: 'binaryData',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['hash', 'hmac'],
                          },
                      },
                      description: 'Whether the data to hashed should be taken from binary field',
                  },
                  {
                      displayName: 'Binary Property Name',
                      name: 'binaryPropertyName',
                      displayOptions: {
                          show: {
                              action: ['hash', 'hmac'],
                              binaryData: [true],
                          },
                      },
                      type: 'string',
                      default: 'data',
                      description: 'Name of the binary property which contains the input data',
                      required: true,
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      displayOptions: {
                          show: {
                              action: ['hash'],
                              binaryData: [false],
                          },
                      },
                      type: 'string',
                      default: '',
                      description: 'The value that should be hashed',
                      required: true,
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['hash'],
                          },
                      },
                      description: 'Name of the property to which to write the hash',
                  },
                  {
                      displayName: 'Encoding',
                      name: 'encoding',
                      displayOptions: {
                          show: {
                              action: ['hash'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'BASE64',
                              value: 'base64',
                          },
                          {
                              name: 'HEX',
                              value: 'hex',
                          },
                      ],
                      default: 'hex',
                      required: true,
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'MD5',
                              value: 'MD5',
                          },
                          {
                              name: 'SHA256',
                              value: 'SHA256',
                          },
                          {
                              name: 'SHA3-256',
                              value: 'SHA3-256',
                          },
                          {
                              name: 'SHA3-384',
                              value: 'SHA3-384',
                          },
                          {
                              name: 'SHA3-512',
                              value: 'SHA3-512',
                          },
                          {
                              name: 'SHA384',
                              value: 'SHA384',
                          },
                          {
                              name: 'SHA512',
                              value: 'SHA512',
                          },
                      ],
                      default: 'MD5',
                      description: 'The hash type to use',
                      required: true,
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                              binaryData: [false],
                          },
                      },
                      type: 'string',
                      default: '',
                      description: 'The value of which the hmac should be created',
                      required: true,
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                          },
                      },
                      description: 'Name of the property to which to write the hmac',
                  },
                  {
                      displayName: 'Secret',
                      name: 'secret',
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                          },
                      },
                      type: 'string',
                      typeOptions: { password: true },
                      default: '',
                      required: true,
                  },
                  {
                      displayName: 'Encoding',
                      name: 'encoding',
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'BASE64',
                              value: 'base64',
                          },
                          {
                              name: 'HEX',
                              value: 'hex',
                          },
                      ],
                      default: 'hex',
                      required: true,
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      displayOptions: {
                          show: {
                              action: ['sign'],
                              binaryData: [false],
                          },
                      },
                      type: 'string',
                      default: '',
                      description: 'The value that should be signed',
                      required: true,
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['sign'],
                          },
                      },
                      description: 'Name of the property to which to write the signed value',
                  },
                  {
                      displayName: 'Algorithm Name or ID',
                      name: 'algorithm',
                      displayOptions: {
                          show: {
                              action: ['sign'],
                          },
                      },
                      type: 'options',
                      description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                      options: supportedAlgorithms,
                      default: '',
                      required: true,
                  },
                  {
                      displayName: 'Encoding',
                      name: 'encoding',
                      displayOptions: {
                          show: {
                              action: ['sign'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'BASE64',
                              value: 'base64',
                          },
                          {
                              name: 'HEX',
                              value: 'hex',
                          },
                      ],
                      default: 'hex',
                      required: true,
                  },
                  {
                      displayName: 'Private Key',
                      name: 'privateKey',
                      displayOptions: {
                          show: {
                              action: ['sign'],
                          },
                      },
                      type: 'string',
                      description: 'Private key to use when signing the string',
                      default: '',
                      required: true,
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['generate'],
                          },
                      },
                      description: 'Name of the property to which to write the random string',
                  },
                  {
                      displayName: 'Type',
                      name: 'encodingType',
                      displayOptions: {
                          show: {
                              action: ['generate'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'ASCII',
                              value: 'ascii',
                          },
                          {
                              name: 'BASE64',
                              value: 'base64',
                          },
                          {
                              name: 'HEX',
                              value: 'hex',
                          },
                          {
                              name: 'UUID',
                              value: 'uuid',
                          },
                      ],
                      default: 'uuid',
                      description: 'Encoding that will be used to generate string',
                      required: true,
                  },
                  {
                      displayName: 'Length',
                      name: 'stringLength',
                      type: 'number',
                      default: 32,
                      description: 'Length of the generated string',
                      displayOptions: {
                          show: {
                              action: ['generate'],
                              encodingType: ['ascii', 'base64', 'hex'],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const action = this.getNodeParameter('action', 0);
          let item;
          for (let i = 0; i < length; i++) {
              try {
                  item = items[i];
                  const dataPropertyName = this.getNodeParameter('dataPropertyName', i);
                  const value = this.getNodeParameter('value', i, '');
                  let newValue;
                  let binaryProcessed = false;
                  if (action === 'generate') {
                      const encodingType = this.getNodeParameter('encodingType', i);
                      if (encodingType === 'uuid') {
                          newValue = (0, uuid_1.v4)();
                      }
                      else {
                          const stringLength = this.getNodeParameter('stringLength', i);
                          if (encodingType === 'base64') {
                              newValue = (0, crypto_1.randomBytes)(stringLength)
                                  .toString(encodingType)
                                  .replace(/\W/g, '')
                                  .slice(0, stringLength);
                          }
                          else {
                              newValue = (0, crypto_1.randomBytes)(stringLength)
                                  .toString(encodingType)
                                  .slice(0, stringLength);
                          }
                      }
                  }
                  if (action === 'hash' || action === 'hmac') {
                      const type = this.getNodeParameter('type', i);
                      const encoding = this.getNodeParameter('encoding', i);
                      const hashOrHmac = action === 'hash'
                          ? (0, crypto_1.createHash)(type)
                          : (0, crypto_1.createHmac)(type, this.getNodeParameter('secret', i));
                      if (this.getNodeParameter('binaryData', i)) {
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          if (binaryData.id) {
                              const binaryStream = await this.helpers.getBinaryStream(binaryData.id);
                              hashOrHmac.setEncoding(encoding);
                              await pipeline(binaryStream, hashOrHmac);
                              newValue = hashOrHmac.read();
                          }
                          else {
                              newValue = hashOrHmac
                                  .update(Buffer.from(binaryData.data, n8n_workflow_1.BINARY_ENCODING))
                                  .digest(encoding);
                          }
                          binaryProcessed = true;
                      }
                      else {
                          newValue = hashOrHmac.update(value).digest(encoding);
                      }
                  }
                  if (action === 'sign') {
                      const algorithm = this.getNodeParameter('algorithm', i);
                      const encoding = this.getNodeParameter('encoding', i);
                      const privateKey = this.getNodeParameter('privateKey', i);
                      const sign = (0, crypto_1.createSign)(algorithm);
                      sign.write(value);
                      sign.end();
                      newValue = sign.sign(privateKey, encoding);
                  }
                  let newItem;
                  if (dataPropertyName.includes('.')) {
                      newItem = {
                          json: (0, n8n_workflow_1.deepCopy)(item.json),
                          pairedItem: {
                              item: i,
                          },
                      };
                  }
                  else {
                      newItem = {
                          json: { ...item.json },
                          pairedItem: {
                              item: i,
                          },
                      };
                  }
                  if (item.binary !== undefined && !binaryProcessed) {
                      newItem.binary = item.binary;
                  }
                  (0, set_1.default)(newItem, `json.${dataPropertyName}`, newValue);
                  returnData.push(newItem);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: i,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Crypto = Crypto;
  //# sourceMappingURL=Crypto.node.js.map

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

  # Crypto

  Use the Crypto node to encrypt data in workflows.

  ## Actions

  * [**Generate** a random string](#generate-parameters)
  * [**Hash** a text or file](#hash-parameters) in a specified format
  * [**Hmac** a text or file](#hmac-parameters) in a specified format
  * [**Sign** a string](#sign-parameters) using a private key

  ## Node parameters

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

  Node parameters depend on the action you select.

  ### Generate parameters

  * **Property Name**: Enter the name of the property to write the random string to.
  * **Type**: Select the encoding type to use to generate the string. Choose from:
  	* **ASCII**
  	* **BASE64**
  	* **HEX**
  	* **UUID**

  ### Hash parameters

  * **Type**: Select the hash type to use. Choose from:
  	* **MD5**
  	* **SHA256**
  	* **SHA3-256**
  	* **SHA3-384**
  	* **SHA3-512**
  	* **SHA385**
  	* **SHA512**
  * **Binary File**: Turn this parameter on if the data you want to hash is from a binary file.
  	* **Value**: If you turn off **Binary File**, enter the value you want to hash.
  	* **Binary Property Name**: If you turn on **Binary File**, enter the name of the binary property that contains the data you want to hash.
  * **Property Name**: Enter the name of the property you want to write the hash to.
  * **Encoding**: Select the encoding type to use. Choose from:
  	* **BASE64**
  	* **HEX**

  ### Hmac parameters

  * **Binary File**: Turn this parameter on if the data you want to encrypt is from a binary file.
  	* **Value**: If you turn off **Binary File**, enter the value you want to encrypt.
  	* **Binary Property Name**: If you turn on **Binary File**, enter the name of the binary property that contains the data you want to encrypt.
  * **Type**: Select the encryption type to use. Choose from:
  	* **MD5**
  	* **SHA256**
  	* **SHA3-256**
  	* **SHA3-384**
  	* **SHA3-512**
  	* **SHA385**
  	* **SHA512**
  * **Property Name**: Enter the name of the property you want to write the hash to.
  * **Secret**: Enter the secret or secret key used for decoding.
  * **Encoding**: Select the encoding type to use. Choose from:
  	* **BASE64**
  	* **HEX**

  ### Sign parameters

  * **Value**: Enter the value you want to sign.
  * **Property Name**: Enter the name of the property you want to write the signed value to.
  * **Algorithm Name or ID**: Choose an algorithm name from the list or specify an ID using an [expression](/code/expressions.md).
  * **Encoding**: Select the encoding type to use. Choose from:
  	* **BASE64**
  	* **HEX**
  * **Private Key**: Enter a private key to use when signing the string.

  ## Templates and examples

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

troubleshooting_info:
  [{"issue":"Actions","solution":"* [**Generate** a random string](#generate-parameters)\n* [**Hash** a text or file](#hash-parameters) in a specified format\n* [**Hmac** a text or file](#hmac-parameters) in a specified format\n* [**Sign** a string](#sign-parameters) using a private key"},{"issue":"Node parameters","solution":"--8<-- \"_snippets/integrations/builtin/app-nodes/ai-tools.md\""},{"issue":"Generate parameters","solution":"* **Property Name**: Enter the name of the property to write the random string to.\n* **Type**: Select the encoding type to use to generate the string. Choose from:\n\t* **ASCII**\n\t* **BASE64**\n\t* **HEX**\n\t* **UUID**"},{"issue":"Hash parameters","solution":"* **Type**: Select the hash type to use. Choose from:\n\t* **MD5**\n\t* **SHA256**\n\t* **SHA3-256**\n\t* **SHA3-384**\n\t* **SHA3-512**\n\t* **SHA385**\n\t* **SHA512**\n* **Binary File**: Turn this parameter on if the data you want to hash is from a binary file.\n\t* **Value**: If you turn off **Binary File**, enter the value you want to hash.\n\t* **Binary Property Name**: If you turn on **Binary File**, enter the name of the binary property that contains the data you want to hash.\n* **Property Name**: Enter the name of the property you want to write the hash to.\n* **Encoding**: Select the encoding type to use. Choose from:\n\t* **BASE64**\n\t* **HEX**"},{"issue":"Hmac parameters","solution":"* **Binary File**: Turn this parameter on if the data you want to encrypt is from a binary file.\n\t* **Value**: If you turn off **Binary File**, enter the value you want to encrypt.\n\t* **Binary Property Name**: If you turn on **Binary File**, enter the name of the binary property that contains the data you want to encrypt.\n* **Type**: Select the encryption type to use. Choose from:\n\t* **MD5**\n\t* **SHA256**\n\t* **SHA3-256**\n\t* **SHA3-384**\n\t* **SHA3-512**\n\t* **SHA385**\n\t* **SHA512**\n* **Property Name**: Enter the name of the property you want to write the hash to.\n* **Secret**: Enter the secret or secret key used for decoding.\n* **Encoding**: Select the encoding type to use. Choose from:\n\t* **BASE64**\n\t* **HEX**"},{"issue":"Sign parameters","solution":"* **Value**: Enter the value you want to sign.\n* **Property Name**: Enter the name of the property you want to write the signed value to.\n* **Algorithm Name or ID**: Choose an algorithm name from the list or specify an ID using an [expression](/code/expressions.md).\n* **Encoding**: Select the encoding type to use. Choose from:\n\t* **BASE64**\n\t* **HEX**\n* **Private Key**: Enter a private key to use when signing the string."}]

example_workflow:
  {"name":"Crypto Example Workflow","nodes":[{"parameters":{"action":"generate","type":"MD5","binaryData":false,"binaryPropertyName":"Example Name","value":"example-value","dataPropertyName":"Example Name","encoding":"base64","secret":"example-value","algorithm":"","privateKey":"example-value","encodingType":"ascii","stringLength":32},"id":"s2rbfae0057hiai17h8ic7","name":"Crypto","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"action":"generate","type":"MD5","binaryData":false,"binaryPropertyName":"Example Name","value":"example-value","dataPropertyName":"Example Name","encoding":"base64","secret":"example-value","algorithm":"","privateKey":"example-value","encodingType":"ascii","stringLength":32}

properties_schema:
  [{"displayName":"Action","name":"action","type":"options","default":"hash","description":"Generate random string","options":[{"name":"Generate","value":"generate","description":"Generate random string"},{"name":"Hash","value":"hash","description":"Hash a text or file in a specified format"},{"name":"Hmac","value":"hmac","description":"Hmac a text or file in a specified format"},{"name":"Sign","value":"sign","description":"Sign a string using a private key"}]},{"displayName":"Type","name":"type","type":"options","default":"MD5","required":true,"description":"The hash type to use","options":[{"name":"MD5","value":"MD5"},{"name":"SHA256","value":"SHA256"},{"name":"SHA3-256","value":"SHA3-256"},{"name":"SHA3-384","value":"SHA3-384"},{"name":"SHA3-512","value":"SHA3-512"},{"name":"SHA384","value":"SHA384"},{"name":"SHA512","value":"SHA512"}]},{"displayName":"Binary Data","name":"binaryData","type":"boolean","default":false,"required":true,"description":"Whether the data to hashed should be taken from binary field"},{"displayName":"Binary Property Name","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Name of the binary property which contains the input data"},{"displayName":"Value","name":"value","type":"string","default":"","required":true,"description":"The value that should be hashed"},{"displayName":"Property Name","name":"dataPropertyName","type":"string","default":"data","required":true,"description":"Name of the property to which to write the hash"},{"displayName":"Encoding","name":"encoding","type":"options","default":"hex","required":true,"options":[{"name":"BASE64","value":"base64"},{"name":"HEX","value":"hex"}]},{"displayName":"Type","name":"type","type":"options","default":"MD5","required":true,"description":"The hash type to use","options":[{"name":"MD5","value":"MD5"},{"name":"SHA256","value":"SHA256"},{"name":"SHA3-256","value":"SHA3-256"},{"name":"SHA3-384","value":"SHA3-384"},{"name":"SHA3-512","value":"SHA3-512"},{"name":"SHA384","value":"SHA384"},{"name":"SHA512","value":"SHA512"}]},{"displayName":"Value","name":"value","type":"string","default":"","required":true,"description":"The value of which the hmac should be created"},{"displayName":"Property Name","name":"dataPropertyName","type":"string","default":"data","required":true,"description":"Name of the property to which to write the hmac"},{"displayName":"Secret","name":"secret","type":"string","default":"","required":true},{"displayName":"Encoding","name":"encoding","type":"options","default":"hex","required":true,"options":[{"name":"BASE64","value":"base64"},{"name":"HEX","value":"hex"}]},{"displayName":"Value","name":"value","type":"string","default":"","required":true,"description":"The value that should be signed"},{"displayName":"Property Name","name":"dataPropertyName","type":"string","default":"data","required":true,"description":"Name of the property to which to write the signed value"},{"displayName":"Algorithm Name or ID","name":"algorithm","type":"options","default":"","required":true,"description":"Choose from the list, or specify an ID using an <a href="},{"displayName":"Encoding","name":"encoding","type":"options","default":"hex","required":true,"options":[{"name":"BASE64","value":"base64"},{"name":"HEX","value":"hex"}]},{"displayName":"Private Key","name":"privateKey","type":"string","default":"","required":true,"description":"Private key to use when signing the string"},{"displayName":"Property Name","name":"dataPropertyName","type":"string","default":"data","required":true,"description":"Name of the property to which to write the random string"},{"displayName":"Type","name":"encodingType","type":"options","default":"uuid","required":true,"description":"Encoding that will be used to generate string","options":[{"name":"ASCII","value":"ascii"},{"name":"BASE64","value":"base64"},{"name":"HEX","value":"hex"},{"name":"UUID","value":"uuid"}]},{"displayName":"Length","name":"stringLength","type":"number","default":32,"description":"Length of the generated string"}]


node_type: n8n-nodes-base.CustomerIo
name: CustomerIo
display_name: Customer.io
description: Consume Customer.io API
category: output
icon: file:customerio.svg
code_hash: cea979a578e3bfc8f652d96a2b0de3466bef19f7a53deab9ce49df57f9137c63
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.CustomerIo
documentation_title: Customer.io node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"customerio","description":"Templates for customerio"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"customer","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:26
updated_at: 2025-06-12 08:58:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CustomerIo = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const CampaignDescription_1 = require("./CampaignDescription");
  const CustomerDescription_1 = require("./CustomerDescription");
  const EventDescription_1 = require("./EventDescription");
  const SegmentDescription_1 = require("./SegmentDescription");
  class CustomerIo {
      constructor() {
          this.description = {
              displayName: 'Customer.io',
              name: 'customerIo',
              icon: 'file:customerio.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Customer.io API',
              defaults: {
                  name: 'Customer.io',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'customerIoApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Customer',
                              value: 'customer',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Campaign',
                              value: 'campaign',
                          },
                          {
                              name: 'Segment',
                              value: 'segment',
                          },
                      ],
                      default: 'customer',
                  },
                  ...CampaignDescription_1.campaignOperations,
                  ...CampaignDescription_1.campaignFields,
                  ...CustomerDescription_1.customerOperations,
                  ...CustomerDescription_1.customerFields,
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...SegmentDescription_1.segmentOperations,
                  ...SegmentDescription_1.segmentFields,
              ],
          };
      }
      async execute() {
          const returnData = [];
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const body = {};
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'campaign') {
                      if (operation === 'get') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          const endpoint = `/campaigns/${campaignId}`;
                          responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'GET', endpoint, body, 'beta');
                          responseData = responseData.campaign;
                      }
                      if (operation === 'getAll') {
                          const endpoint = '/campaigns';
                          responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'GET', endpoint, body, 'beta');
                          responseData = responseData.campaigns;
                      }
                      if (operation === 'getMetrics') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              const period = this.getNodeParameter('period', i);
                              let endpoint = `/campaigns/${campaignId}/metrics`;
                              if (period !== 'days') {
                                  endpoint = `${endpoint}?period=${period}`;
                              }
                              if (additionalFields.steps) {
                                  body.steps = additionalFields.steps;
                              }
                              if (additionalFields.type) {
                                  if (additionalFields.type === 'urbanAirship') {
                                      additionalFields.type = 'urban_airship';
                                  }
                                  else {
                                      body.type = additionalFields.type;
                                  }
                              }
                              responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'GET', endpoint, body, 'beta');
                              responseData = responseData.metric;
                          }
                      }
                  }
                  if (resource === 'customer') {
                      if (operation === 'upsert') {
                          const id = this.getNodeParameter('id', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.customProperties) {
                                  const data = {};
                                  additionalFields.customProperties.customProperty.map((property) => {
                                      data[property.key] = property.value;
                                  });
                                  body.data = data;
                              }
                              if (additionalFields.email) {
                                  body.email = additionalFields.email;
                              }
                              if (additionalFields.createdAt) {
                                  body.created_at = new Date(additionalFields.createdAt).getTime() / 1000;
                              }
                          }
                          const endpoint = `/customers/${id}`;
                          responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'PUT', endpoint, body, 'tracking');
                          responseData = Object.assign({ id }, body);
                      }
                      if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          body.id = id;
                          const endpoint = `/customers/${id}`;
                          await GenericFunctions_1.customerIoApiRequest.call(this, 'DELETE', endpoint, body, 'tracking');
                          responseData = {
                              success: true,
                          };
                      }
                  }
                  if (resource === 'event') {
                      if (operation === 'track') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const eventName = this.getNodeParameter('eventName', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          body.name = eventName;
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              const data = {};
                              if (additionalFields.customAttributes) {
                                  additionalFields.customAttributes.customAttribute.map((property) => {
                                      data[property.key] = property.value;
                                  });
                              }
                              if (additionalFields.type) {
                                  data.type = additionalFields.type;
                              }
                              body.data = data;
                          }
                          const endpoint = `/customers/${customerId}/events`;
                          await GenericFunctions_1.customerIoApiRequest.call(this, 'POST', endpoint, body, 'tracking');
                          responseData = {
                              success: true,
                          };
                      }
                      if (operation === 'trackAnonymous') {
                          const eventName = this.getNodeParameter('eventName', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          body.name = eventName;
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              const data = {};
                              if (additionalFields.customAttributes) {
                                  additionalFields.customAttributes.customAttribute.map((property) => {
                                      data[property.key] = property.value;
                                  });
                              }
                              body.data = data;
                          }
                          const endpoint = '/events';
                          await GenericFunctions_1.customerIoApiRequest.call(this, 'POST', endpoint, body, 'tracking');
                          responseData = {
                              success: true,
                          };
                      }
                  }
                  if (resource === 'segment') {
                      const segmentId = this.getNodeParameter('segmentId', i);
                      const customerIds = this.getNodeParameter('customerIds', i);
                      body.id = segmentId;
                      body.ids = customerIds.split(',');
                      let endpoint = '';
                      if (operation === 'add') {
                          endpoint = `/segments/${segmentId}/add_customers`;
                      }
                      else {
                          endpoint = `/segments/${segmentId}/remove_customers`;
                      }
                      responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'POST', endpoint, body, 'tracking');
                      responseData = {
                          success: true,
                      };
                  }
                  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.CustomerIo = CustomerIo;
  //# sourceMappingURL=CustomerIo.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CustomerIoApi = void 0;
  class CustomerIoApi {
      constructor() {
          this.name = 'customerIoApi';
          this.displayName = 'Customer.io API';
          this.documentationUrl = 'customerIo';
          this.properties = [
              {
                  displayName: 'Tracking API Key',
                  name: 'trackingApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Required for tracking API',
                  required: true,
              },
              {
                  displayName: 'Region',
                  name: 'region',
                  type: 'options',
                  options: [
                      {
                          name: 'EU region',
                          value: 'track-eu.customer.io',
                      },
                      {
                          name: 'Global region',
                          value: 'track.customer.io',
                      },
                  ],
                  default: 'track.customer.io',
                  description: 'Should be set based on your account region',
                  hint: 'The region will be omited when being used with the HTTP node',
                  required: true,
              },
              {
                  displayName: 'Tracking Site ID',
                  name: 'trackingSiteId',
                  type: 'string',
                  default: '',
                  description: 'Required for tracking API',
              },
              {
                  displayName: 'App API Key',
                  name: 'appApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Required for App API',
              },
          ];
      }
      async authenticate(credentials, requestOptions) {
          const url = requestOptions.url ? requestOptions.url : requestOptions.uri;
          if (url.includes('track') || url.includes('api.customer.io')) {
              const basicAuthKey = Buffer.from(`${credentials.trackingSiteId}:${credentials.trackingApiKey}`).toString('base64');
              Object.assign(requestOptions.headers, { Authorization: `Basic ${basicAuthKey}` });
          }
          else if (url.includes('beta-api.customer.io')) {
              Object.assign(requestOptions.headers, {
                  Authorization: `Bearer ${credentials.appApiKey}`,
              });
          }
          else {
              throw new Error('Unknown way of authenticating');
          }
          return requestOptions;
      }
  }
  exports.CustomerIoApi = CustomerIoApi;
  //# sourceMappingURL=CustomerIoApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CustomerIoApi = void 0;
  class CustomerIoApi {
      constructor() {
          this.name = 'customerIoApi';
          this.displayName = 'Customer.io API';
          this.documentationUrl = 'customerIo';
          this.properties = [
              {
                  displayName: 'Tracking API Key',
                  name: 'trackingApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Required for tracking API',
                  required: true,
              },
              {
                  displayName: 'Region',
                  name: 'region',
                  type: 'options',
                  options: [
                      {
                          name: 'EU region',
                          value: 'track-eu.customer.io',
                      },
                      {
                          name: 'Global region',
                          value: 'track.customer.io',
                      },
                  ],
                  default: 'track.customer.io',
                  description: 'Should be set based on your account region',
                  hint: 'The region will be omited when being used with the HTTP node',
                  required: true,
              },
              {
                  displayName: 'Tracking Site ID',
                  name: 'trackingSiteId',
                  type: 'string',
                  default: '',
                  description: 'Required for tracking API',
              },
              {
                  displayName: 'App API Key',
                  name: 'appApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Required for App API',
              },
          ];
      }
      async authenticate(credentials, requestOptions) {
          const url = requestOptions.url ? requestOptions.url : requestOptions.uri;
          if (url.includes('track') || url.includes('api.customer.io')) {
              const basicAuthKey = Buffer.from(`${credentials.trackingSiteId}:${credentials.trackingApiKey}`).toString('base64');
              Object.assign(requestOptions.headers, { Authorization: `Basic ${basicAuthKey}` });
          }
          else if (url.includes('beta-api.customer.io')) {
              Object.assign(requestOptions.headers, {
                  Authorization: `Bearer ${credentials.appApiKey}`,
              });
          }
          else {
              throw new Error('Unknown way of authenticating');
          }
          return requestOptions;
      }
  }
  exports.CustomerIoApi = CustomerIoApi;
  //# sourceMappingURL=CustomerIoApi.credentials.js.map

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

  # Customer.io node

  Use the Customer.io node to automate work in Customer.io, and integrate Customer.io with other applications. n8n has built-in support for a wide range of Customer.io features, including creating and updating customers, tracking events, and getting campaigns.

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

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

  ## Operations

  * Customer
      * Create/Update a customer.
      * Delete a customer.
  * Event
      * Track a customer event.
      * Track an anonymous event.
  * Campaign
      * Get
      * Get All
      * Get Metrics
  * Segment
      * Add Customer
      * Remove Customer

  ## Templates and examples

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

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

example_workflow:
  {"name":"Customer.io Example Workflow","nodes":[{"parameters":{"resource":"customer","dynamic_property":null},"id":"ytkvgbazpejhngcnjqr886","name":"Customer.io","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":"customer","options":[{"name":"Customer","value":"customer"},{"name":"Event","value":"event"},{"name":"Campaign","value":"campaign"},{"name":"Segment","value":"segment"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CampaignDescription_1.campaignOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CampaignDescription_1.campaignFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CustomerDescription_1.customerOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CustomerDescription_1.customerFields"},{"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":"...SegmentDescription_1.segmentOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SegmentDescription_1.segmentFields"}]


node_type: n8n-nodes-base.DebugHelper
name: DebugHelper
display_name: DebugHelper
description: Causes problems intentionally and generates useful data for debugging
category: output
icon: file:DebugHelper.svg
code_hash: 99860b55ee895e997c0b43cadcbc1cd28f38a4470e193192da8c35415129dd2e
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.DebugHelper
documentation_title: Debug Helper
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"debughelper","description":"Templates for debughelper"}]
related_resources: []
required_scopes: []
parameter_schemas: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:27
updated_at: 2025-06-12 08:58:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DebugHelper = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const randomData_1 = require("./randomData");
  const minifaker_1 = require("minifaker");
  const functions_1 = require("./functions");
  class DebugHelper {
      constructor() {
          this.description = {
              displayName: 'DebugHelper',
              name: 'debugHelper',
              icon: 'file:DebugHelper.svg',
              group: ['output'],
              subtitle: '={{$parameter["category"]}}',
              description: 'Causes problems intentionally and generates useful data for debugging',
              version: 1,
              defaults: {
                  name: 'DebugHelper',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [],
              properties: [
                  {
                      displayName: 'Category',
                      name: 'category',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Do Nothing',
                              value: 'doNothing',
                              description: 'Does nothing',
                          },
                          {
                              name: 'Throw Error',
                              value: 'throwError',
                              description: 'Throws an error with the specified type and message',
                          },
                          {
                              name: 'Out Of Memory',
                              value: 'oom',
                              description: 'Generates a large amount of memory to cause an out of memory error',
                          },
                          {
                              name: 'Generate Random Data',
                              value: 'randomData',
                              description: 'Generates random data sets',
                          },
                      ],
                      default: 'throwError',
                  },
                  {
                      displayName: 'Error Type',
                      name: 'throwErrorType',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'NodeApiError',
                              value: 'NodeApiError',
                          },
                          {
                              name: 'NodeOperationError',
                              value: 'NodeOperationError',
                          },
                          {
                              name: 'Error',
                              value: 'Error',
                          },
                      ],
                      default: 'NodeApiError',
                      displayOptions: {
                          show: {
                              category: ['throwError'],
                          },
                      },
                  },
                  {
                      displayName: 'Error Message',
                      name: 'throwErrorMessage',
                      type: 'string',
                      default: 'Node has thrown an error',
                      description: 'The message to send as part of the error',
                      displayOptions: {
                          show: {
                              category: ['throwError'],
                          },
                      },
                  },
                  {
                      displayName: 'Memory Size to Generate',
                      name: 'memorySizeValue',
                      type: 'number',
                      default: 10,
                      description: 'The approximate amount of memory to generate. Be generous...',
                      displayOptions: {
                          show: {
                              category: ['oom'],
                          },
                      },
                  },
                  {
                      displayName: 'Data Type',
                      name: 'randomDataType',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Address',
                              value: 'address',
                          },
                          {
                              name: 'Coordinates',
                              value: 'latLong',
                          },
                          {
                              name: 'Credit Card',
                              value: 'creditCard',
                          },
                          {
                              name: 'Email',
                              value: 'email',
                          },
                          {
                              name: 'IPv4',
                              value: 'ipv4',
                          },
                          {
                              name: 'IPv6',
                              value: 'ipv6',
                          },
                          {
                              name: 'MAC',
                              value: 'macAddress',
                          },
                          {
                              name: 'NanoIds',
                              value: 'nanoid',
                          },
                          {
                              name: 'URL',
                              value: 'url',
                          },
                          {
                              name: 'User Data',
                              value: 'user',
                          },
                          {
                              name: 'UUID',
                              value: 'uuid',
                          },
                          {
                              name: 'Version',
                              value: 'semver',
                          },
                      ],
                      default: 'user',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                          },
                      },
                  },
                  {
                      displayName: 'NanoId Alphabet',
                      name: 'nanoidAlphabet',
                      type: 'string',
                      default: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
                      description: 'The alphabet to use for generating the nanoIds',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                              randomDataType: ['nanoid'],
                          },
                      },
                  },
                  {
                      displayName: 'NanoId Length',
                      name: 'nanoidLength',
                      type: 'string',
                      default: '16',
                      description: 'The length of each nanoIds',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                              randomDataType: ['nanoid'],
                          },
                      },
                  },
                  {
                      displayName: 'Seed',
                      name: 'randomDataSeed',
                      type: 'string',
                      default: '',
                      placeholder: 'Leave empty for random seed',
                      description: 'If set, seed to use for generating the data (same seed will generate the same data)',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                          },
                      },
                  },
                  {
                      displayName: 'Number of Items to Generate',
                      name: 'randomDataCount',
                      type: 'number',
                      default: 10,
                      description: 'The number of random data items to generate into an array',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                          },
                      },
                  },
                  {
                      displayName: 'Output as Single Array',
                      name: 'randomDataSingleArray',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to output a single array instead of multiple items',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const category = this.getNodeParameter('category', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  switch (category) {
                      case 'doNothing':
                          break;
                      case 'throwError':
                          const throwErrorType = this.getNodeParameter('throwErrorType', 0);
                          const throwErrorMessage = this.getNodeParameter('throwErrorMessage', 0);
                          switch (throwErrorType) {
                              case 'NodeApiError':
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: throwErrorMessage }, { message: throwErrorMessage });
                              case 'NodeOperationError':
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), throwErrorMessage, {
                                      message: throwErrorMessage,
                                  });
                              case 'Error':
                                  throw new Error(throwErrorMessage);
                              default:
                                  break;
                          }
                      case 'oom':
                          const memorySizeValue = this.getNodeParameter('memorySizeValue', 0);
                          (0, functions_1.runGarbageCollector)();
                          const memUsed = (0, functions_1.generateGarbageMemory)(memorySizeValue);
                          items[i].json = memUsed;
                          returnData.push(items[i]);
                          break;
                      case 'randomData':
                          const randomDataType = this.getNodeParameter('randomDataType', 0);
                          const randomDataCount = this.getNodeParameter('randomDataCount', 0);
                          const randomDataSeed = this.getNodeParameter('randomDataSeed', 0);
                          const randomDataSingleArray = this.getNodeParameter('randomDataSingleArray', 0);
                          const newItem = {
                              json: {},
                              pairedItem: { item: i },
                          };
                          if (randomDataSeed !== '') {
                              (0, minifaker_1.setSeed)(randomDataSeed);
                          }
                          let randomFn = randomData_1.generateRandomUser;
                          switch (randomDataType) {
                              case 'user':
                                  randomFn = randomData_1.generateRandomUser;
                                  break;
                              case 'email':
                                  randomFn = randomData_1.generateRandomEmail;
                                  break;
                              case 'address':
                                  randomFn = randomData_1.generateRandomAddress;
                                  break;
                              case 'creditCard':
                                  randomFn = randomData_1.generateCreditCard;
                                  break;
                              case 'uuid':
                                  randomFn = randomData_1.generateUUID;
                                  break;
                              case 'macAddress':
                                  randomFn = randomData_1.generateMAC;
                                  break;
                              case 'ipv4':
                                  randomFn = randomData_1.generateIPv4;
                                  break;
                              case 'ipv6':
                                  randomFn = randomData_1.generateIPv6;
                                  break;
                              case 'latLong':
                                  randomFn = randomData_1.generateLocation;
                                  break;
                              case 'semver':
                                  randomFn = randomData_1.generateVersion;
                                  break;
                              case 'url':
                                  randomFn = randomData_1.generateURL;
                                  break;
                              case 'nanoid':
                                  const nanoidAlphabet = this.getNodeParameter('nanoidAlphabet', 0);
                                  const nanoidLength = this.getNodeParameter('nanoidLength', 0);
                                  randomFn = () => (0, randomData_1.generateNanoid)(nanoidAlphabet, nanoidLength);
                                  break;
                          }
                          const generatedItems = (0, minifaker_1.array)(randomDataCount, randomFn);
                          if (randomDataSingleArray) {
                              newItem.json = { generatedItems };
                              returnData.push(newItem);
                          }
                          else {
                              for (const generatedItem of generatedItems) {
                                  returnData.push({
                                      json: generatedItem,
                                      pairedItem: { item: i },
                                  });
                              }
                          }
                          break;
                      default:
                          break;
                  }
              }
              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.DebugHelper = DebugHelper;
  //# sourceMappingURL=DebugHelper.node.js.map

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

  # Debug Helper

  Use the Debug Helper node to trigger different error types or generate random datasets to help test n8n workflows.

  ## Operations

  Define the operation by selecting the **Category**:

  * **Do Nothing**: Don't do anything.
  * [**Throw Error**](#throw-error): Throw an error with the specified type and message.
  * [**Out Of Memory**](#out-of-memory): Generate a specific memory size to simulate being out of memory.
  * [**Generate Random Data**](#generate-random-data): Generate some random data in a selected format.

  ## Node parameters

  The node parameters depend on the **Category** selected. The **Do Nothing** Category has no other parameters.

  ### Throw Error

  * **Error Type**: Select the type of error to throw. Choose from:
  	* **NodeApiError**
  	* **NodeOperationError**
  	* **Error**
  * **Error Message**: Enter the error message to throw.

  ### Out Of Memory

  The Out of Memory Category adds one parameter, the **Memory Size to Generate**. Enter the approximate amount of memory to generate.

  ### Generate Random Data

  * **Data Type**: Choose the type of random data you'd like to generate. Options include:
  	* **Address**
  	* **Coordinates**
  	* **Credit Card**
  	* **Email**
  	* **IPv4**
  	* **IPv6**
  	* **MAC**
  	* **Nanoids**: If you select this data type, you'll also need to enter:
  		* **Nanoid Alphabet**: The alphabet the generator will use to generate the nanoids.
  		* **Nanoid Length**: The length of each nanoid.
  	* **URL**
  	* **User Data**
  	* **UUID**
  	* **Version**
  * **Seed**: If you'd like to generate the data using a specific seed, enter it here. This ensures the data gets generated consistently. If you'd rather use random data generation, leave this field empty.
  * **Number of Items to Generate**: Enter the number of random items you'd like to generate.
  * **Output as Single Array**: Whether to generate the data as a single array (turned on) or multiple items (turned off).

  ## Templates and examples

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

troubleshooting_info:
  [{"issue":"Node parameters","solution":"The node parameters depend on the **Category** selected. The **Do Nothing** Category has no other parameters."},{"issue":"Throw Error","solution":"* **Error Type**: Select the type of error to throw. Choose from:\n\t* **NodeApiError**\n\t* **NodeOperationError**\n\t* **Error**\n* **Error Message**: Enter the error message to throw."},{"issue":"Out Of Memory","solution":"The Out of Memory Category adds one parameter, the **Memory Size to Generate**. Enter the approximate amount of memory to generate."},{"issue":"Generate Random Data","solution":"* **Data Type**: Choose the type of random data you'd like to generate. Options include:\n\t* **Address**\n\t* **Coordinates**\n\t* **Credit Card**\n\t* **Email**\n\t* **IPv4**\n\t* **IPv6**\n\t* **MAC**\n\t* **Nanoids**: If you select this data type, you'll also need to enter:\n\t\t* **Nanoid Alphabet**: The alphabet the generator will use to generate the nanoids.\n\t\t* **Nanoid Length**: The length of each nanoid.\n\t* **URL**\n\t* **User Data**\n\t* **UUID**\n\t* **Version**\n* **Seed**: If you'd like to generate the data using a specific seed, enter it here. This ensures the data gets generated consistently. If you'd rather use random data generation, leave this field empty.\n* **Number of Items to Generate**: Enter the number of random items you'd like to generate.\n* **Output as Single Array**: Whether to generate the data as a single array (turned on) or multiple items (turned off)."}]

example_workflow:
  {"name":"DebugHelper Example Workflow","nodes":[{"parameters":{"category":"doNothing","throwErrorType":"NodeApiError","throwErrorMessage":"Node has thrown an error","memorySizeValue":10,"randomDataType":"address","nanoidAlphabet":"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","nanoidLength":"16","randomDataSeed":"example-value","randomDataCount":10,"randomDataSingleArray":false},"id":"03agbg5cj68e0rbbf4inllb","name":"DebugHelper","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"category":"doNothing","throwErrorType":"NodeApiError","throwErrorMessage":"Node has thrown an error","memorySizeValue":10,"randomDataType":"address","nanoidAlphabet":"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","nanoidLength":"16","randomDataSeed":"example-value","randomDataCount":10,"randomDataSingleArray":false}

properties_schema:
  [{"displayName":"Category","name":"category","type":"options","default":"throwError","description":"Does nothing","options":[{"name":"Do Nothing","value":"doNothing","description":"Does nothing"},{"name":"Throw Error","value":"throwError","description":"Throws an error with the specified type and message"},{"name":"Out Of Memory","value":"oom","description":"Generates a large amount of memory to cause an out of memory error"},{"name":"Generate Random Data","value":"randomData","description":"Generates random data sets"}]},{"displayName":"Error Type","name":"throwErrorType","type":"options","default":"NodeApiError","options":[{"name":"NodeApiError","value":"NodeApiError"},{"name":"NodeOperationError","value":"NodeOperationError"},{"name":"Error","value":"Error"}]},{"displayName":"Error Message","name":"throwErrorMessage","type":"string","default":"Node has thrown an error","description":"The message to send as part of the error"},{"displayName":"Memory Size to Generate","name":"memorySizeValue","type":"number","default":10,"description":"The approximate amount of memory to generate. Be generous..."},{"displayName":"Data Type","name":"randomDataType","type":"options","default":"user","options":[{"name":"Address","value":"address"},{"name":"Coordinates","value":"latLong"},{"name":"Credit Card","value":"creditCard"},{"name":"Email","value":"email"},{"name":"IPv4","value":"ipv4"},{"name":"IPv6","value":"ipv6"},{"name":"MAC","value":"macAddress"},{"name":"NanoIds","value":"nanoid"},{"name":"URL","value":"url"},{"name":"User Data","value":"user"},{"name":"UUID","value":"uuid"},{"name":"Version","value":"semver"}]},{"displayName":"NanoId Alphabet","name":"nanoidAlphabet","type":"string","default":"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","description":"The alphabet to use for generating the nanoIds"},{"displayName":"NanoId Length","name":"nanoidLength","type":"string","default":"16","description":"The length of each nanoIds"},{"displayName":"Seed","name":"randomDataSeed","type":"string","default":"","description":"If set, seed to use for generating the data (same seed will generate the same data)","placeholder":"Leave empty for random seed"},{"displayName":"Number of Items to Generate","name":"randomDataCount","type":"number","default":10,"description":"The number of random data items to generate into an array"},{"displayName":"Output as Single Array","name":"randomDataSingleArray","type":"boolean","default":false,"description":"Whether to output a single array instead of multiple items"}]


node_type: n8n-nodes-base.Discourse
name: Discourse
display_name: Discourse
description: Consume Discourse API
category: input
icon: file:discourse.svg
code_hash: 2f5ce8de0ffd9c8043ec6593bec94991a63023117f784366a8628ec0778e08cf
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Discourse
documentation_title: Discourse node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"discourse","description":"Templates for discourse"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"category","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:27
updated_at: 2025-06-12 08:58:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Discourse = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const PostDescription_1 = require("./PostDescription");
  const CategoryDescription_1 = require("./CategoryDescription");
  const GroupDescription_1 = require("./GroupDescription");
  const UserDescription_1 = require("./UserDescription");
  const UserGroupDescription_1 = require("./UserGroupDescription");
  class Discourse {
      constructor() {
          this.description = {
              displayName: 'Discourse',
              name: 'discourse',
              icon: 'file:discourse.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Discourse API',
              defaults: {
                  name: 'Discourse',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'discourseApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Category',
                              value: 'category',
                          },
                          {
                              name: 'Group',
                              value: 'group',
                          },
                          {
                              name: 'Post',
                              value: 'post',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                          {
                              name: 'User Group',
                              value: 'userGroup',
                          },
                      ],
                      default: 'post',
                  },
                  ...CategoryDescription_1.categoryOperations,
                  ...CategoryDescription_1.categoryFields,
                  ...GroupDescription_1.groupOperations,
                  ...GroupDescription_1.groupFields,
                  ...PostDescription_1.postOperations,
                  ...PostDescription_1.postFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
                  ...UserGroupDescription_1.userGroupOperations,
                  ...UserGroupDescription_1.userGroupFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCategories() {
                      const returnData = [];
                      const { category_list } = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', '/categories.json');
                      for (const category of category_list.categories) {
                          returnData.push({
                              name: category.name,
                              value: category.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'category') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const color = this.getNodeParameter('color', i);
                          const textColor = this.getNodeParameter('textColor', i);
                          const body = {
                              name,
                              color,
                              text_color: textColor,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'POST', '/categories.json', body);
                          responseData = responseData.category;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', '/categories.json', {}, qs);
                          responseData = responseData.category_list.categories;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const categoryId = this.getNodeParameter('categoryId', i);
                          const name = this.getNodeParameter('name', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              name,
                          };
                          Object.assign(body, updateFields);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'PUT', `/categories/${categoryId}.json`, body);
                          responseData = responseData.category;
                      }
                  }
                  if (resource === 'group') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'POST', '/admin/groups.json', {
                              group: body,
                          });
                          responseData = responseData.basic_group;
                      }
                      if (operation === 'get') {
                          const name = this.getNodeParameter('name', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', `/groups/${name}`, {}, qs);
                          responseData = responseData.group;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', '/groups.json', {}, qs);
                          responseData = responseData.groups;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const groupId = this.getNodeParameter('groupId', i);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'PUT', `/groups/${groupId}.json`, {
                              group: body,
                          });
                      }
                  }
                  if (resource === 'post') {
                      if (operation === 'create') {
                          const content = this.getNodeParameter('content', i);
                          const title = this.getNodeParameter('title', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              title,
                              raw: content,
                          };
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'POST', '/posts.json', body);
                      }
                      if (operation === 'get') {
                          const postId = this.getNodeParameter('postId', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', `/posts/${postId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = this.getNodeParameter('limit', i, 0);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', '/posts.json', {}, qs);
                          responseData = responseData.latest_posts;
                          let lastPost = responseData.pop();
                          let previousLastPostID;
                          while (lastPost.id !== previousLastPostID) {
                              if (limit && responseData.length > limit) {
                                  break;
                              }
                              const chunk = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', `/posts.json?before=${lastPost.id}`, {}, qs);
                              responseData = responseData.concat(chunk.latest_posts);
                              previousLastPostID = lastPost.id;
                              lastPost = responseData.pop();
                          }
                          responseData.push(lastPost);
                          if (!returnAll) {
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const postId = this.getNodeParameter('postId', i);
                          const content = this.getNodeParameter('content', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              raw: content,
                          };
                          Object.assign(body, updateFields);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'PUT', `/posts/${postId}.json`, body);
                          responseData = responseData.post;
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const email = this.getNodeParameter('email', i);
                          const password = this.getNodeParameter('password', i);
                          const username = this.getNodeParameter('username', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                              password,
                              email,
                              username,
                          };
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'POST', '/users.json', body);
                      }
                      if (operation === 'get') {
                          const by = this.getNodeParameter('by', i);
                          let endpoint = '';
                          if (by === 'username') {
                              const username = this.getNodeParameter('username', i);
                              endpoint = `/users/${username}`;
                          }
                          else if (by === 'externalId') {
                              const externalId = this.getNodeParameter('externalId', i);
                              endpoint = `/u/by-external/${externalId}.json`;
                          }
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', endpoint);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const flag = this.getNodeParameter('flag', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', `/admin/users/list/${flag}.json`, {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  if (resource === 'userGroup') {
                      if (operation === 'add') {
                          const usernames = this.getNodeParameter('usernames', i);
                          const groupId = this.getNodeParameter('groupId', i);
                          const body = {
                              usernames,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'PUT', `/groups/${groupId}/members.json`, body);
                      }
                      if (operation === 'remove') {
                          const usernames = this.getNodeParameter('usernames', i);
                          const groupId = this.getNodeParameter('groupId', i);
                          const body = {
                              usernames,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'DELETE', `/groups/${groupId}/members.json`, 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.Discourse = Discourse;
  //# sourceMappingURL=Discourse.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DiscourseApi = void 0;
  class DiscourseApi {
      constructor() {
          this.name = 'discourseApi';
          this.displayName = 'Discourse API';
          this.documentationUrl = 'discourse';
          this.properties = [
              {
                  displayName: 'URL',
                  name: 'url',
                  required: true,
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Username',
                  name: 'username',
                  required: true,
                  type: 'string',
                  default: '',
              },
          ];
          this.test = {
              request: {
                  baseURL: '={{$credentials.url}}',
                  url: '/groups.json',
                  method: 'GET',
              },
          };
      }
      async authenticate(credentials, requestOptions) {
          requestOptions.headers = {
              'Api-Key': credentials.apiKey,
              'Api-Username': credentials.username,
          };
          if (requestOptions.method === 'GET') {
              delete requestOptions.body;
          }
          return requestOptions;
      }
  }
  exports.DiscourseApi = DiscourseApi;
  //# sourceMappingURL=DiscourseApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DiscourseApi = void 0;
  class DiscourseApi {
      constructor() {
          this.name = 'discourseApi';
          this.displayName = 'Discourse API';
          this.documentationUrl = 'discourse';
          this.properties = [
              {
                  displayName: 'URL',
                  name: 'url',
                  required: true,
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Username',
                  name: 'username',
                  required: true,
                  type: 'string',
                  default: '',
              },
          ];
          this.test = {
              request: {
                  baseURL: '={{$credentials.url}}',
                  url: '/groups.json',
                  method: 'GET',
              },
          };
      }
      async authenticate(credentials, requestOptions) {
          requestOptions.headers = {
              'Api-Key': credentials.apiKey,
              'Api-Username': credentials.username,
          };
          if (requestOptions.method === 'GET') {
              delete requestOptions.body;
          }
          return requestOptions;
      }
  }
  exports.DiscourseApi = DiscourseApi;
  //# sourceMappingURL=DiscourseApi.credentials.js.map

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

  # Discourse node

  Use the Discourse node to automate work in Discourse, and integrate Discourse with other applications. n8n has built-in support for a wide range of Discourse features, including creating, getting, updating, and removing categories, groups, posts, and users.

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

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

  ## Operations

  * Category
      * Create a category
      * Get all categories
      * Update a category
  * Group
      * Create a group
      * Get a group
      * Get all groups
      * Update a group
  * Post
      * Create a post
      * Get a post
      * Get all posts
      * Update a post
  * User
      * Create a user
      * Get a user
      * Get all users
  * User Group
      * Create a user to group
      * Remove user from group

  ## Templates and examples

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

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

example_workflow:
  {"name":"Discourse Example Workflow","nodes":[{"parameters":{"resource":"category","dynamic_property":null},"id":"hmos1au5evi09hbyd2hbi0k","name":"Discourse","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":"post","options":[{"name":"Category","value":"category"},{"name":"Group","value":"group"},{"name":"Post","value":"post"},{"name":"User","value":"user"},{"name":"User Group","value":"userGroup"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CategoryDescription_1.categoryOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...CategoryDescription_1.categoryFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...GroupDescription_1.groupOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...GroupDescription_1.groupFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PostDescription_1.postOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PostDescription_1.postFields"},{"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":"...UserGroupDescription_1.userGroupOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserGroupDescription_1.userGroupFields"}]


node_type: n8n-nodes-base.Demio
name: Demio
display_name: Demio
description: Consume the Demio API
category: output
icon: file:demio.svg
code_hash: d6ea744bbf875d383eda88e547a021439f0d054f320f0c969131e2c79ffbec5f
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Demio
documentation_title: Demio node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"demio","description":"Templates for demio"}]
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:27
updated_at: 2025-06-12 08:58:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Demio = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const EventDescription_1 = require("./EventDescription");
  const ReportDescription_1 = require("./ReportDescription");
  class Demio {
      constructor() {
          this.description = {
              displayName: 'Demio',
              name: 'demio',
              icon: 'file:demio.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Demio API',
              defaults: {
                  name: 'Demio',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'demioApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Report',
                              value: 'report',
                          },
                      ],
                      default: 'event',
                  },
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...ReportDescription_1.reportOperations,
                  ...ReportDescription_1.reportFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getEvents() {
                      const returnData = [];
                      const events = await GenericFunctions_1.demioApiRequest.call(this, 'GET', '/events', {}, { type: 'upcoming' });
                      for (const event of events) {
                          returnData.push({
                              name: event.name,
                              value: event.id,
                          });
                      }
                      return returnData;
                  },
                  async getEventSessions() {
                      const eventId = this.getCurrentNodeParameter('eventId');
                      const qs = {};
                      const resource = this.getCurrentNodeParameter('resource');
                      if (resource !== 'report') {
                          qs.active = true;
                      }
                      const returnData = [];
                      const { dates } = await GenericFunctions_1.demioApiRequest.call(this, 'GET', `/event/${eventId}`, {});
                      for (const date of dates) {
                          returnData.push({
                              name: date.datetime,
                              value: date.date_id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a;
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'event') {
                      if (operation === 'get') {
                          const id = this.getNodeParameter('eventId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.date_id !== undefined) {
                              responseData = await GenericFunctions_1.demioApiRequest.call(this, 'GET', `/event/${id}/date/${additionalFields.date_id}`);
                          }
                          else {
                              Object.assign(qs, additionalFields);
                              responseData = await GenericFunctions_1.demioApiRequest.call(this, 'GET', `/event/${id}`, {}, qs);
                          }
                      }
                      if (operation === 'getAll') {
                          const filters = this.getNodeParameter('filters', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          Object.assign(qs, filters);
                          responseData = await GenericFunctions_1.demioApiRequest.call(this, 'GET', '/events', {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'register') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const firstName = this.getNodeParameter('firstName', i);
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name: firstName,
                              email,
                              id: eventId,
                          };
                          Object.assign(body, additionalFields);
                          if (additionalFields.customFieldsUi) {
                              const customFields = ((_a = additionalFields.customFieldsUi) === null || _a === void 0 ? void 0 : _a.customFieldsValues) || [];
                              const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.value }), {});
                              Object.assign(body, data);
                              delete additionalFields.customFields;
                          }
                          responseData = await GenericFunctions_1.demioApiRequest.call(this, 'PUT', '/event/register', body);
                      }
                  }
                  if (resource === 'report') {
                      if (operation === 'get') {
                          const sessionId = this.getNodeParameter('dateId', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          responseData = await GenericFunctions_1.demioApiRequest.call(this, 'GET', `/report/${sessionId}/participants`, {}, qs);
                          responseData = responseData.participants;
                      }
                  }
                  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.Demio = Demio;
  //# sourceMappingURL=Demio.node.js.map

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

  // --- Next Credential File ---

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

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

  # Demio node

  Use the Demio node to automate work in Demio, and integrate Demio with other applications. n8n has built-in support for a wide range of Demio features, including getting, and registering events and reports.

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

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

  ## Operations

  * Event
      * Get an event
      * Get all events
      * Register someone to an event
  * Report
      * Get an event report

  ## Templates and examples

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"event","options":[{"name":"Event","value":"event"},{"name":"Report","value":"report"}]},{"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":"...ReportDescription_1.reportOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ReportDescription_1.reportFields"}]


node_type: n8n-nodes-base.Dhl
name: Dhl
display_name: DHL
description: Consume DHL API
category: input
icon: file:dhl.svg
code_hash: 5ba971626f7a362156d95e63342aa84feae7892e38bf3e03ba7b6fd0027b98f6
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Dhl
documentation_title: DHL node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"dhl","description":"Templates for dhl"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"shipment","operation":"get","trackingNumber":"example-value","options":{}}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:27
updated_at: 2025-06-12 08:58:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Dhl = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Dhl {
      constructor() {
          this.description = {
              displayName: 'DHL',
              name: 'dhl',
              icon: 'file:dhl.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume DHL API',
              defaults: {
                  name: 'DHL',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'dhlApi',
                      required: true,
                      testedBy: 'dhlApiCredentialTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'hidden',
                      options: [
                          {
                              name: 'Shipment',
                              value: 'shipment',
                          },
                      ],
                      default: 'shipment',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['shipment'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Tracking Details',
                              value: 'get',
                              action: 'Get tracking details for a shipment',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Tracking Number',
                      name: 'trackingNumber',
                      type: 'string',
                      required: true,
                      default: '',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: "Recipient's Postal Code",
                              name: 'recipientPostalCode',
                              type: 'string',
                              default: '',
                              description: "DHL will return more detailed information on the shipment when you provide the Recipient's Postal Code - it acts as a verification step",
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async dhlApiCredentialTest(credential) {
                      try {
                          await GenericFunctions_1.validateCredentials.call(this, credential.data);
                      }
                      catch (error) {
                          if (error.statusCode === 401) {
                              return {
                                  status: 'Error',
                                  message: 'The API Key included in the request is invalid',
                              };
                          }
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'shipment') {
                      if (operation === 'get') {
                          const trackingNumber = this.getNodeParameter('trackingNumber', i);
                          const options = this.getNodeParameter('options', i);
                          qs = {
                              trackingNumber,
                          };
                          Object.assign(qs, options);
                          responseData = await GenericFunctions_1.dhlApiRequest.call(this, 'GET', '/track/shipments', {}, qs);
                          returnData.push(...responseData.shipments);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.description });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Dhl = Dhl;
  //# sourceMappingURL=Dhl.node.js.map

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

  // --- Next Credential File ---

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

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

  # DHL node

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

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

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

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

  ## Operations

  * Shipment
      * Get Tracking Details

  ## Templates and examples

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

example_workflow:
  {"name":"DHL Example Workflow","nodes":[{"parameters":{"resource":"shipment","operation":"get","trackingNumber":"example-value","options":{}},"id":"jyu2w7gtyt9pvp2tcmnfj","name":"DHL","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"hidden","default":"shipment"},{"displayName":"Operation","name":"operation","type":"options","default":"get","options":[{"name":"Get Tracking Details","value":"get"}]},{"displayName":"Tracking Number","name":"trackingNumber","type":"string","default":"","required":true},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"DHL will return more detailed information on the shipment when you provide the Recipient","placeholder":"Add Option"}]


node_type: n8n-nodes-base.Drift
name: Drift
display_name: Drift
description: Consume Drift API
category: output
icon: file:drift.png
code_hash: 0f95bfe43e877d5dbf5e06e74b9a9896c10df575ba3080ff99a30f95cb5f3625
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Drift
documentation_title: Drift node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"drift","description":"Templates for drift"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"authentication":"accessToken","resource":"contact","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:27
updated_at: 2025-06-12 08:58:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Drift = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ContactDescription_1 = require("./ContactDescription");
  class Drift {
      constructor() {
          this.description = {
              displayName: 'Drift',
              name: 'drift',
              icon: 'file:drift.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Drift API',
              defaults: {
                  name: 'Drift',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'driftApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'driftOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'accessToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                      ],
                      default: 'contact',
                  },
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
              ],
          };
      }
      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 === 'contact') {
                      if (operation === 'create') {
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                          };
                          if (additionalFields.name) {
                              body.name = additionalFields.name;
                          }
                          if (additionalFields.phone) {
                              body.phone = additionalFields.phone;
                          }
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'POST', '/contacts', {
                              attributes: body,
                          });
                          responseData = responseData.data;
                      }
                      if (operation === 'update') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.phone) {
                              body.phone = updateFields.phone;
                          }
                          if (updateFields.email) {
                              body.email = updateFields.email;
                          }
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'PATCH', `/contacts/${contactId}`, {
                              attributes: body,
                          });
                          responseData = responseData.data;
                      }
                      if (operation === 'get') {
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'GET', `/contacts/${contactId}`);
                          responseData = responseData.data;
                      }
                      if (operation === 'getCustomAttributes') {
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'GET', '/contacts/attributes');
                          responseData = responseData.data.properties;
                      }
                      if (operation === 'delete') {
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'DELETE', `/contacts/${contactId}`);
                          responseData = { success: true };
                      }
                  }
                  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.Drift = Drift;
  //# sourceMappingURL=Drift.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DriftApi = void 0;
  class DriftApi {
      constructor() {
          this.name = 'driftApi';
          this.displayName = 'Drift API';
          this.documentationUrl = 'drift';
          this.properties = [
              {
                  displayName: 'Personal Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Visit your account details page, and grab the Access Token. See <a href="https://devdocs.drift.com/docs/quick-start">Drift auth</a>.',
              },
          ];
      }
  }
  exports.DriftApi = DriftApi;
  //# sourceMappingURL=DriftApi.credentials.js.map

  // --- Next Credential File ---

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

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DriftApi = void 0;
  class DriftApi {
      constructor() {
          this.name = 'driftApi';
          this.displayName = 'Drift API';
          this.documentationUrl = 'drift';
          this.properties = [
              {
                  displayName: 'Personal Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Visit your account details page, and grab the Access Token. See <a href="https://devdocs.drift.com/docs/quick-start">Drift auth</a>.',
              },
          ];
      }
  }
  exports.DriftApi = DriftApi;
  //# sourceMappingURL=DriftApi.credentials.js.map

  // --- Next Credential File ---

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

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

  # Drift node

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

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

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

  ## Operations

  * Contact
      * Create a contact
      * Get custom attributes
      * Delete a contact
      * Get a contact
      * Update a contact

  ## Templates and examples

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

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

example_workflow:
  {"name":"Drift Example Workflow","nodes":[{"parameters":{"authentication":"accessToken","resource":"contact","dynamic_property":null},"id":"x7evxucxpam3z194spph","name":"Drift","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":"accessToken","options":[{"name":"Access Token","value":"accessToken"},{"name":"OAuth2","value":"oAuth2"}]},{"displayName":"Resource","name":"resource","type":"options","default":"contact","options":[{"name":"Contact","value":"contact"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContactDescription_1.contactOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ContactDescription_1.contactFields"}]


node_type: n8n-nodes-base.Disqus
name: Disqus
display_name: Disqus
description: Access data on Disqus
category: input
icon: file:disqus.png
code_hash: c60402500e1aea71c7e4e7a76fe768b72f3894831b6a69851fd8ec5bdfa43931
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Disqus
documentation_title: Disqus node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"disqus","description":"Templates for disqus"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:27
updated_at: 2025-06-12 08:58:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Disqus = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Disqus {
      constructor() {
          this.description = {
              displayName: 'Disqus',
              name: 'disqus',
              icon: 'file:disqus.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Access data on Disqus',
              defaults: {
                  name: 'Disqus',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'disqusApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Forum',
                              value: 'forum',
                          },
                      ],
                      default: 'forum',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Return forum details',
                              action: 'Get a forum',
                          },
                          {
                              name: 'Get All Categories',
                              value: 'getCategories',
                              description: 'Return a list of categories within a forum',
                              action: 'Get all categories in a forum',
                          },
                          {
                              name: 'Get All Threads',
                              value: 'getThreads',
                              description: 'Return a list of threads within a forum',
                              action: 'Get all threads in a forum',
                          },
                          {
                              name: 'Get All Posts',
                              value: 'getPosts',
                              description: 'Return a list of posts within a forum',
                              action: 'Get all posts in a forum',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Forum Name',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['forum'],
                          },
                      },
                      description: 'The short name(aka ID) of the forum to get',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['forum'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Attach',
                              name: 'attach',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Counters',
                                      value: 'counters',
                                  },
                                  {
                                      name: 'followsForum',
                                      value: 'followsForum',
                                  },
                                  {
                                      name: 'forumCanDisableAds',
                                      value: 'forumCanDisableAds',
                                  },
                                  {
                                      name: 'forumDaysAlive',
                                      value: 'forumDaysAlive',
                                  },
                                  {
                                      name: 'forumFeatures',
                                      value: 'forumFeatures',
                                  },
                                  {
                                      name: 'forumForumCategory',
                                      value: 'forumForumCategory',
                                  },
                                  {
                                      name: 'forumIntegration',
                                      value: 'forumIntegration',
                                  },
                                  {
                                      name: 'forumNewPolicy',
                                      value: 'forumNewPolicy',
                                  },
                                  {
                                      name: 'forumPermissions',
                                      value: 'forumPermissions',
                                  },
                              ],
                              default: [],
                          },
                          {
                              displayName: 'Related',
                              name: 'related',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'author',
                                      value: 'author',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                      ],
                  },
                  {
                      displayName: 'Forum Name',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getPosts'],
                              resource: ['forum'],
                          },
                      },
                      description: 'The short name(aka ID) of the forum to get',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getPosts'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getPosts'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getPosts'],
                              resource: ['forum'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Filters',
                              name: 'filters',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Has_Bad_Word',
                                      value: 'Has_Bad_Word',
                                  },
                                  {
                                      name: 'Has_Link',
                                      value: 'Has_Link',
                                  },
                                  {
                                      name: 'Has_Low_Rep_Author',
                                      value: 'Has_Low_Rep_Author',
                                  },
                                  {
                                      name: 'Has_Media',
                                      value: 'Has_Media',
                                  },
                                  {
                                      name: 'Is_Anonymous',
                                      value: 'Is_Anonymous',
                                  },
                                  {
                                      name: 'Is_At_Flag_Limit',
                                      value: 'Is_At_Flag_Limit',
                                  },
                                  {
                                      name: 'Is_Flagged',
                                      value: 'Is_Flagged',
                                  },
                                  {
                                      name: 'Is_Toxic',
                                      value: 'Is_Toxic',
                                  },
                                  {
                                      name: 'Modified_By_Rule',
                                      value: 'Modified_By_Rule',
                                  },
                                  {
                                      name: 'No_Issue',
                                      value: 'No_Issue',
                                  },
                                  {
                                      name: 'Shadow_Banned',
                                      value: 'Shadow_Banned',
                                  },
                              ],
                              default: [],
                              description: 'You may specify filters for your response',
                          },
                          {
                              displayName: 'Include',
                              name: 'include',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Approved',
                                      value: 'approved',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                          {
                              displayName: 'Order',
                              name: 'order',
                              type: 'options',
                              options: [
                                  {
                                      name: 'ASC',
                                      value: 'asc',
                                  },
                                  {
                                      name: 'DESC',
                                      value: 'desc',
                                  },
                              ],
                              default: 'asc',
                              description: 'You may specify order to sort your response',
                          },
                          {
                              displayName: 'Query',
                              name: 'query',
                              type: 'string',
                              default: '',
                              description: 'You may specify query forChoices: asc, desc your response',
                          },
                          {
                              displayName: 'Related',
                              name: 'related',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Thread',
                                      value: 'thread',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                          {
                              displayName: 'Since',
                              name: 'since',
                              type: 'dateTime',
                              default: '',
                              description: 'Unix timestamp (or ISO datetime standard)',
                          },
                      ],
                  },
                  {
                      displayName: 'Forum Name',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getCategories'],
                              resource: ['forum'],
                          },
                      },
                      description: 'The short name(aka ID) of the forum to get Categories',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getCategories'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getCategories'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getCategories'],
                              resource: ['forum'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Order',
                              name: 'order',
                              type: 'options',
                              options: [
                                  {
                                      name: 'ASC',
                                      value: 'asc',
                                  },
                                  {
                                      name: 'DESC',
                                      value: 'desc',
                                  },
                              ],
                              default: 'asc',
                              description: 'You may specify order to sort your response',
                          },
                      ],
                  },
                  {
                      displayName: 'Forum Name',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getThreads'],
                              resource: ['forum'],
                          },
                      },
                      description: 'The short name(aka ID) of the forum to get Threads',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getThreads'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getThreads'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getThreads'],
                              resource: ['forum'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Related',
                              name: 'related',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'author',
                                      value: 'author',
                                  },
                                  {
                                      name: 'Forum',
                                      value: 'forum',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                          {
                              displayName: 'Include',
                              name: 'include',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Closed',
                                      value: 'closed',
                                  },
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Killed',
                                      value: 'killed',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                          {
                              displayName: 'Order',
                              name: 'order',
                              type: 'options',
                              options: [
                                  {
                                      name: 'ASC',
                                      value: 'asc',
                                  },
                                  {
                                      name: 'DESC',
                                      value: 'desc',
                                  },
                              ],
                              default: 'asc',
                              description: 'You may specify order to sort your response',
                          },
                          {
                              displayName: 'Since',
                              name: 'since',
                              type: 'dateTime',
                              default: '',
                              description: 'Unix timestamp (or ISO datetime standard)',
                          },
                          {
                              displayName: 'Thread',
                              name: 'thread',
                              type: 'string',
                              default: '',
                              description: 'Looks up a thread by ID. You may pass us the "ident" query type instead of an ID by including "forum". You may pass us the "link" query type to filter by URL. You must pass the "forum" if you do not have the Pro API Access addon.',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let endpoint = '';
          let requestMethod = '';
          let qs;
          for (let i = 0; i < items.length; i++) {
              try {
                  qs = {};
                  if (resource === 'forum') {
                      if (operation === 'get') {
                          requestMethod = 'GET';
                          endpoint = 'forums/details.json';
                          const id = this.getNodeParameter('id', i);
                          qs.forum = id;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          try {
                              const responseData = await GenericFunctions_1.disqusApiRequest.call(this, requestMethod, qs, endpoint);
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.response), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          catch (error) {
                              throw error;
                          }
                      }
                      else if (operation === 'getPosts') {
                          requestMethod = 'GET';
                          endpoint = 'forums/listPosts.json';
                          const id = this.getNodeParameter('id', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs.forum = id;
                          qs.limit = 100;
                          try {
                              let responseData = {};
                              if (returnAll) {
                                  responseData.response = await GenericFunctions_1.disqusApiRequestAllItems.call(this, requestMethod, qs, endpoint);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.limit = limit;
                                  responseData = await GenericFunctions_1.disqusApiRequest.call(this, requestMethod, qs, endpoint);
                              }
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.response), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          catch (error) {
                              throw error;
                          }
                      }
                      else if (operation === 'getCategories') {
                          requestMethod = 'GET';
                          endpoint = 'forums/listCategories.json';
                          const id = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          qs.forum = id;
                          qs.limit = 100;
                          try {
                              let responseData = {};
                              if (returnAll) {
                                  responseData.response = await GenericFunctions_1.disqusApiRequestAllItems.call(this, requestMethod, qs, endpoint);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.limit = limit;
                                  responseData = (await GenericFunctions_1.disqusApiRequest.call(this, requestMethod, qs, endpoint));
                              }
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.response), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          catch (error) {
                              throw error;
                          }
                      }
                      else if (operation === 'getThreads') {
                          requestMethod = 'GET';
                          endpoint = 'forums/listThreads.json';
                          const id = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs.forum = id;
                          qs.limit = 100;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          try {
                              let responseData = {};
                              if (returnAll) {
                                  responseData.response = await GenericFunctions_1.disqusApiRequestAllItems.call(this, requestMethod, qs, endpoint);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.limit = limit;
                                  responseData = await GenericFunctions_1.disqusApiRequest.call(this, requestMethod, qs, endpoint);
                              }
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.response), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          catch (error) {
                              throw error;
                          }
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
              }
              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.Disqus = Disqus;
  //# sourceMappingURL=Disqus.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DisqusApi = void 0;
  class DisqusApi {
      constructor() {
          this.name = 'disqusApi';
          this.displayName = 'Disqus API';
          this.documentationUrl = 'disqus';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Visit your account details page, and grab the Access Token. See <a href="https://disqus.com/api/docs/auth/">Disqus auth</a>.',
              },
          ];
      }
  }
  exports.DisqusApi = DisqusApi;
  //# sourceMappingURL=DisqusApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DisqusApi = void 0;
  class DisqusApi {
      constructor() {
          this.name = 'disqusApi';
          this.displayName = 'Disqus API';
          this.documentationUrl = 'disqus';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Visit your account details page, and grab the Access Token. See <a href="https://disqus.com/api/docs/auth/">Disqus auth</a>.',
              },
          ];
      }
  }
  exports.DisqusApi = DisqusApi;
  //# sourceMappingURL=DisqusApi.credentials.js.map

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

  # Disqus node

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

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

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

  ## Operations

  * Forum
      * Return forum details
      * Return a list of categories within a forum
      * Return a list of threads within a forum
      * Return a list of posts within a forum

  ## Templates and examples

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

example_workflow:
  {"name":"Disqus Example Workflow","nodes":[{"parameters":{"resource":"forum","operation":"get","id":"example-value","additionalFields":{},"returnAll":false,"limit":100},"id":"79ojcxxos96zk33lovm77a","name":"Disqus","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"resource":"forum","operation":"get","id":"example-value","additionalFields":{},"returnAll":false,"limit":100}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"forum","options":[{"name":"Forum","value":"forum"}]},{"displayName":"Operation","name":"operation","type":"options","default":"get","description":"Return forum details","options":[{"name":"Get","value":"get","description":"Return forum details"},{"name":"Get All Categories","value":"getCategories","description":"Return a list of categories within a forum"},{"name":"Get All Threads","value":"getThreads","description":"Return a list of threads within a forum"},{"name":"Get All Posts","value":"getPosts","description":"Return a list of posts within a forum"}]},{"displayName":"Forum Name","name":"id","type":"string","default":"","required":true,"description":"The short name(aka ID) of the forum to get"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"You may specify relations to include with your response","placeholder":"Add Field"},{"displayName":"Forum Name","name":"id","type":"string","default":"","required":true,"description":"The short name(aka ID) of the forum to get"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":100,"description":"Max number of results to return"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"You may specify filters for your response","placeholder":"Add Field"},{"displayName":"Forum Name","name":"id","type":"string","default":"","required":true,"description":"The short name(aka ID) of the forum to get Categories"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":100,"description":"Max number of results to return"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"You may specify order to sort your response","placeholder":"Add Field"},{"displayName":"Forum Name","name":"id","type":"string","default":"","required":true,"description":"The short name(aka ID) of the forum to get Threads"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":100,"description":"Max number of results to return"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"You may specify relations to include with your response","placeholder":"Add Field"}]


