# nodes

node_type: n8n-nodes-base.Crypto
name: Crypto
display_name: Crypto
description: Provide cryptographic utilities
category: Other
code_hash: 7a50ea2285a5de3700af151f5206c08e3d41cc364c489065753c65892983c9f9
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.crypto
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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') ]]

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"92cfe075-6f68-47fb-94b0-e8dd25c64e3d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"a4a77c788ef901d27381e08580658be1c5093f9a903380ca94c3b1713aead106"}}


node_type: n8n-nodes-base.DeepL
name: DeepL
display_name: DeepL
description: Translate data using DeepL
category: Other
code_hash: 2f0799ff8ae4cf89ec968e13020a9731fa3ab1c20901ec795d3ba76c39ab01da
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/deepl
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DeepL = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const TextDescription_1 = require("./TextDescription");
  class DeepL {
      constructor() {
          this.description = {
              displayName: 'DeepL',
              name: 'deepL',
              icon: 'file:deepl.svg',
              group: ['input', 'output'],
              version: 1,
              description: 'Translate data using DeepL',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'DeepL',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'deepLApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Language',
                              value: 'language',
                          },
                      ],
                      default: 'language',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['language'],
                          },
                      },
                      options: [
                          {
                              name: 'Translate',
                              value: 'translate',
                              description: 'Translate data',
                              action: 'Translate a language',
                          },
                      ],
                      default: 'translate',
                  },
                  ...TextDescription_1.textOperations,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLanguages() {
                      const returnData = [];
                      const languages = await GenericFunctions_1.deepLApiRequest.call(this, 'GET', '/languages', {}, { type: 'target' });
                      for (const language of languages) {
                          returnData.push({
                              name: language.name,
                              value: language.language,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          const responseData = [];
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', i);
                  const operation = this.getNodeParameter('operation', i);
                  const additionalFields = this.getNodeParameter('additionalFields', i);
                  if (resource === 'language') {
                      if (operation === 'translate') {
                          let body = {};
                          const text = this.getNodeParameter('text', i);
                          const translateTo = this.getNodeParameter('translateTo', i);
                          body = { target_lang: translateTo, text };
                          if (additionalFields.sourceLang !== undefined) {
                              body.source_lang = ['EN-GB', 'EN-US'].includes(additionalFields.sourceLang)
                                  ? 'EN'
                                  : additionalFields.sourceLang;
                          }
                          const { translations } = await GenericFunctions_1.deepLApiRequest.call(this, 'GET', '/translate', body);
                          const [translation] = translations;
                          const translationJsonArray = this.helpers.returnJsonArray(translation);
                          const executionData = this.helpers.constructExecutionMetaData(translationJsonArray, {
                              itemData: { item: i },
                          });
                          responseData.push(...executionData);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = {
                          json: {},
                          error: error.message,
                          itemIndex: i,
                      };
                      responseData.push(executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [responseData];
      }
  }
  exports.DeepL = DeepL;
  //# sourceMappingURL=DeepL.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: DeepL credentials
  description: Documentation for DeepL credentials. Use these credentials to authenticate DeepL in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # DeepL credentials

  You can use these credentials to authenticate the following nodes:

  - [DeepL](/integrations/builtin/app-nodes/n8n-nodes-base.deepl.md)


  ## Prerequisites

  Create a [DeepL developer](https://www.deepl.com/pro-api){:target=_blank .external-link} account. n8n works with both Free and Pro API Plans.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [DeepL's API documentation](https://developers.deepl.com/docs){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Refer to [DeepL's Authentication documentation](https://developers.deepl.com/docs/getting-started/auth#authentication){:target=_blank .external-link} for more information on getting your API key.
  - To identify which **API Plan** you're on. DeepL has different API endpoints for each plan, so be sure you select the correct one:
      - Pro Plan
      - Free Plan

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"f95dd0b2-0478-47f0-8ee2-ee057b856384","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"aca566d68553b3d9cb0d8d9f256dc26e594636dd18489501b30350df17e2713e"}}


node_type: n8n-nodes-base.Demio
name: Demio
display_name: Demio
description: Consume the Demio API
category: Other
code_hash: d6ea744bbf875d383eda88e547a021439f0d054f320f0c969131e2c79ffbec5f
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/demio
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Demio credentials
  description: Documentation for Demio credentials. Use these credentials to authenticate Demio in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Demio credentials

  You can use these credentials to authenticate the following nodes:

  - [Demio](/integrations/builtin/app-nodes/n8n-nodes-base.demio.md)


  ## Prerequisites

  Create a [Demio](https://demio.com/) account.

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**
  - An **API Secret**

  You must have Owner status in Demio to generate API keys and secrets. To view and generate API keys and secrets, go to **Account Settings > API**. Refer to the [Demio Account Owner Settings documentation](https://help.demio.com/en/articles/6456716-account-owner-settings){:target=_blank .external-link} for more detailed steps.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"01aa15b4-ccb1-4167-a3ff-3c5d0d4e4e85","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"9ae0e5fb34b531ad4ed14b2c4be3d1c2eadeb0c5e5f5e0ae111815854c7dfc5f"}}


node_type: n8n-nodes-base.Dhl
name: Dhl
display_name: DHL
description: Consume DHL API
category: Other
code_hash: 5ba971626f7a362156d95e63342aa84feae7892e38bf3e03ba7b6fd0027b98f6
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/dhl
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: DHL credentials
  description: Documentation for DHL credentials. Use these credentials to authenticate DHL in n8n, a workflow automation platform.
  contentType: [integration, reference]
  priority: medium
  ---

  # DHL credentials

  You can use these credentials to authenticate the following nodes:

  - [DHL](/integrations/builtin/app-nodes/n8n-nodes-base.dhl.md)

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [DHL's Developer documentation](https://support-developer.dhl.com/support/home){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need a [DHL Developer](https://developer.dhl.com/user/register){:target=_blank .external-link} account and:

  - An **API Key**

  To get an API key, create an app:

  1. In the DHL Developer portal, select the user icon to open your [User Apps](https://developer.dhl.com/user/apps){:target=_blank .external-link}.
  2. Select **+ Create App**.
  3. Enter an **App name**, like `n8n integration`.
  4. Enter a **Machine name**, like `n8n_integration`.
  4. In **SELECT APIs**, select **Shipment Tracking - Unified**. The API is added to the **Add API to app** section.
  5. In the **Add API to app** section, select the **+** next to the **Shipment Tracking - Unified** API.
  6. Select **Create App**. The **Apps** page opens, displaying the app you just created.
  7. Select the app you just created to view its details.
  8. Select **Show key** next to **API Key**.
  9. Copy the **API Key** and enter it in your n8n credential.

  Refer to [How to create an app?](https://support-developer.dhl.com/support/solutions/articles/47001177011-how-to-create-an-app-){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"948b065b-3ea1-40f3-a415-0b29ce2a27fe","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"9ab05031422066062db09befa0e26e6ccf415c59402568284d4c63b406e769ed"}}


node_type: n8n-nodes-base.Discord
name: Discord
display_name: Discord
description: Sends data to Discord
category: Other
code_hash: 4995f9ca5c5b57d2486c2e320cc7505238e7f2260861f7e321b44b45ccabeb00
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/discord
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Discord = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class Discord {
      constructor() {
          this.description = {
              displayName: 'Discord',
              name: 'discord',
              icon: 'file:discord.svg',
              group: ['output'],
              version: 1,
              description: 'Sends data to Discord',
              defaults: {
                  name: 'Discord',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Webhook URL',
                      name: 'webhookUri',
                      type: 'string',
                      required: true,
                      default: '',
                      placeholder: 'https://discord.com/api/webhooks/ID/TOKEN',
                  },
                  {
                      displayName: 'Content',
                      name: 'text',
                      type: 'string',
                      typeOptions: {
                          maxValue: 2000,
                      },
                      default: '',
                      placeholder: 'Hello World!',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Allowed Mentions',
                              name: 'allowedMentions',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Attachments',
                              name: 'attachments',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Avatar URL',
                              name: 'avatarUrl',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Components',
                              name: 'components',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Embeds',
                              name: 'embeds',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Flags',
                              name: 'flags',
                              type: 'number',
                              default: '',
                          },
                          {
                              displayName: 'JSON Payload',
                              name: 'payloadJson',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Username',
                              name: 'username',
                              type: 'string',
                              default: '',
                              placeholder: 'User',
                          },
                          {
                              displayName: 'TTS',
                              name: 'tts',
                              type: 'boolean',
                              default: false,
                              description: 'Whether this message be sent as a Text To Speech message',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          var _a;
          const returnData = [];
          const webhookUri = this.getNodeParameter('webhookUri', 0, '');
          if (!webhookUri)
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Webhook uri is required.');
          const items = this.getInputData();
          const length = items.length;
          for (let i = 0; i < length; i++) {
              const body = {};
              const iterationWebhookUri = this.getNodeParameter('webhookUri', i);
              body.content = this.getNodeParameter('text', i);
              const options = this.getNodeParameter('options', i);
              if (!body.content && !options.embeds) {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Either content or embeds must be set.', {
                      itemIndex: i,
                  });
              }
              if (options.embeds) {
                  try {
                      body.embeds = JSON.parse(options.embeds);
                  }
                  catch (e) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Embeds must be valid JSON.', {
                          itemIndex: i,
                      });
                  }
                  if (!Array.isArray(body.embeds)) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Embeds must be an array of embeds.', {
                          itemIndex: i,
                      });
                  }
              }
              if (options.username) {
                  body.username = options.username;
              }
              if (options.components) {
                  try {
                      body.components = JSON.parse(options.components);
                  }
                  catch (e) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Components must be valid JSON.', {
                          itemIndex: i,
                      });
                  }
              }
              if (options.allowed_mentions) {
                  body.allowed_mentions = (0, n8n_workflow_1.jsonParse)(options.allowed_mentions);
              }
              if (options.avatarUrl) {
                  body.avatar_url = options.avatarUrl;
              }
              if (options.flags) {
                  body.flags = options.flags;
              }
              if (options.tts) {
                  body.tts = options.tts;
              }
              if (options.payloadJson) {
                  body.payload_json = (0, n8n_workflow_1.jsonParse)(options.payloadJson);
              }
              if (options.attachments) {
                  body.attachments = (0, n8n_workflow_1.jsonParse)(options.attachments);
              }
              if (!body.content)
                  delete body.content;
              if (!body.username)
                  delete body.username;
              if (!body.avatar_url)
                  delete body.avatar_url;
              if (!body.embeds)
                  delete body.embeds;
              if (!body.allowed_mentions)
                  delete body.allowed_mentions;
              if (!body.flags)
                  delete body.flags;
              if (!body.components)
                  delete body.components;
              if (!body.payload_json)
                  delete body.payload_json;
              if (!body.attachments)
                  delete body.attachments;
              let requestOptions;
              if (!body.payload_json) {
                  requestOptions = {
                      resolveWithFullResponse: true,
                      method: 'POST',
                      body,
                      uri: iterationWebhookUri,
                      headers: {
                          'content-type': 'application/json; charset=utf-8',
                      },
                      json: true,
                  };
              }
              else {
                  requestOptions = {
                      resolveWithFullResponse: true,
                      method: 'POST',
                      body,
                      uri: iterationWebhookUri,
                      headers: {
                          'content-type': 'multipart/form-data; charset=utf-8',
                      },
                  };
              }
              let maxTries = 5;
              let response;
              do {
                  try {
                      response = await this.helpers.request(requestOptions);
                      const resetAfter = response.headers['x-ratelimit-reset-after'] * 1000;
                      const remainingRatelimit = response.headers['x-ratelimit-remaining'];
                      if (!+remainingRatelimit) {
                          await (0, n8n_workflow_1.sleep)(resetAfter !== null && resetAfter !== void 0 ? resetAfter : 1000);
                      }
                      break;
                  }
                  catch (error) {
                      if (error.statusCode === 429) {
                          const retryAfter = ((_a = error.response) === null || _a === void 0 ? void 0 : _a.headers['retry-after']) || 1000;
                          await (0, n8n_workflow_1.sleep)(+retryAfter);
                          continue;
                      }
                      throw error;
                  }
              } while (--maxTries);
              if (maxTries <= 0) {
                  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
                      error: 'Could not send Webhook message. Max amount of rate-limit retries reached.',
                  });
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Discord = Discord;
  //# sourceMappingURL=Discord.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Discord credentials
  description: Documentation for Discord credentials. Use these credentials to authenticate Discord in n8n, a workflow automation platform.
  contentType: [integration, reference]
  priority: high
  ---

  # Discord credentials

  You can use these credentials to authenticate the following nodes:

  - [Discord](/integrations/builtin/app-nodes/n8n-nodes-base.discord/index.md)

  ## Prerequisites

  - Create a [Discord](https://www.discord.com/){:target=_blank .external-link} account.
  - For Bot and OAuth2 credentials:
      - [Set up your local developer environment](https://discord.com/developers/docs/quick-start/getting-started#step-0-project-setup){:target=_blank .external-link}.
      - [Create an application and a bot user](https://discord.com/developers/docs/quick-start/getting-started#step-1-creating-an-app){:target=_blank .external-link}.
  - For webhook credentials, [create a webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks){:target=_blank .external-link}.

  ## Supported authentication methods

  - Bot
  - OAuth2
  - Webhook

  Not sure which method to use? Refer to [Choose an authentication method](#choose-an-authentication-method) for more guidance.

  ## Related resources

  Refer to [Discord's Developer documentation](https://discord.com/developers/docs/intro){:target=_blank .external-link} for more information about the service.

  ## Using bot

  Use this method if you want to add the bot to your Discord server using a bot token rather than OAuth2.

  To configure this credential, you'll need:

  - A **Bot Token**: Generated once you create an application with a bot.

  To create an application with a bot and generate the **Bot Token**:

  1. If you don't have one already, create an app in the [developer portal](https://discord.com/developers/applications?new_application=true){:target=_blank .external-link}.
  2. Enter a **Name** for your app.
  3. Select **Create**.
  4. Select **Bot** from the left menu.
  5. Under **Token**, select **Reset Token** to generate a new bot token. 
  6. Copy the token and add it to your n8n credential.
  7. In **Bot > Privileged Gateway Intents**, add any privileged intents you want your bot to have. Refer to [Configuring your bot](https://discord.com/developers/docs/quick-start/getting-started#configuring-your-bot){:target=_blank .external-link} for more information on privileged intents.
      - n8n recommends activating **SERVER MEMBERS INTENT: Required for your bot to receive events listed under GUILD_MEMBERS**. 
  8. In **Installation > Installation Contexts**, select the installation contexts you want your bot to use:
      - Select **Guild Install** for server-installed apps. (Most common for n8n users.)
      - Select **User Install** for user-installed apps. (Less common for n8n users, but may be useful for testing.)
      - Refer to Discord's [Choosing installation contexts](https://discord.com/developers/docs/quick-start/getting-started#choosing-installation-contexts){:target=_blank .external-link} documentation for more information about these installation contexts.
  9. In **Installation > Install Link**, select **Discord Provided Link** if it's not already selected.
  10. Still on the **Installation** page, in the **Default Install Settings** section, select `applications.commands` and `bot` scopes. Refer to Discord's [Scopes](https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes){:target=_blank .external-link} documentation for more information about these and other scopes.
  11. Add permissions on the **Bot > Bot Permissions** page. Refer to Discord's [Permissions](https://discord.com/developers/docs/topics/permissions){:target=_blank .external-link} documentation for more information. n8n recommends selecting these permissions for the [Discord](/integrations/builtin/app-nodes/n8n-nodes-base.discord/index.md) node:
      - Manage Roles
      - Manage Channels
      - Read Messages/View Channels
      - Send Messages
      - Create Public Threads
      - Create Private Threads
      - Send Messages in Threads
      - Send TTS Messages
      - Manage Messages
      - Manage Threads
      - Embed Links
      - Attach Files
      - Read Message History
      - Add Reactions
  12. Add the app to your server or test server:
      1. Go to **Installation > Install Link** and copy the link listed there.
      2. Paste the link in your browser and hit Enter.
      1. Select **Add to server** in the installation prompt.
      1. Once your app's added to your server, you'll see it in the member list.

  These steps outline the basic functionality needed to set up your n8n credential. Refer to the [Discord Creating an App](https://discord.com/developers/docs/quick-start/getting-started#step-1-creating-an-app){:target=_blank .external-link} guide for more information on creating an app, especially:

  - [Fetching your credentials](https://discord.com/developers/docs/quick-start/getting-started#fetching-your-credentials){:target=_blank .external-link} for getting your app's credentials into your local developer environment.
  - [Handling interactivity](https://discord.com/developers/docs/quick-start/getting-started#step-3-handling-interactivity){:target=_blank .external-link} for information on setting up public endpoints for interactive `/slash` commands.

  ## Using OAuth2

  Use this method if you want to add the bot to Discord servers using the OAuth2 flow, which simplifies the process for those installing your app.

  To configure this credential, you'll need:

  - A **Client ID**
  - A **Client Secret**
  - Choose whether to send **Authentication** in the **Header** or **Body**
  - A **Bot Token**

  For details on creating an application with a bot and generating the token, follow the same steps as in [Using bot](#using-bot) above.

  Then:

  1. Copy the **Bot Token** you generate and add it into the n8n credential.
  2. Open the **OAuth2** page in your Discord application to access your **Client ID** and generate a **Client Secret**. Add these to your n8n credential.
  3. From n8n, copy the **OAuth Redirect URL** and add it into the Discord application in **OAuth2 > Redirects**. Be sure you save these changes.

  ## Using webhook

  To configure this credential, you'll need:

  - A **Webhook URL**: Generated once you create a webhook.

  To get a Webhook URL, you create a webhook and copy the URL that gets generated:

  1. Open your Discord **Server Settings** and open the **Integrations** tab.
  2. Select **Create Webhook** to create a new webhook.
  3. Give your webhook a **Name** that makes sense.
  3. Select the **avatar** next to the **Name** to edit or upload a new avatar.
  4. In the **CHANNEL** dropdown, select the channel the webhook should post to.
  5. Select **Copy Webhook URL** to copy the Webhook URL. Enter this URL in your n8n credential.

  Refer to the [Discord Making a Webhook documentation](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks){:target=_blank .external-link} for more information.

  ## Choose an authentication method

  The simplest installation is a **webhook**. You create and add webhooks to a single channel on a Discord server. Webhooks can post messages to a channel. They don't require a bot user or authentication. But they can't listen or respond to user requests or commands. If you need a straightforward way to send messages to a channel without the need for interaction or feedback, use a webhook.

  A **bot** is an interactive step up from a webhook. You add bots to the Discord server (referred to as a `guild` in the Discord API documentation) or to user accounts. Bots added to the server can interact with users on all the server's channels. They can manage channels, send and retrieve messages, retrieve the list of all users, and change their roles. If you need to build an interactive, complex, or multi-step workflow, use a bot.

  **OAuth2** is basically a **bot** that uses an OAuth2 flow rather than just the bot token. As with bots, you add these to the Discord server or to user accounts. These credentials offer the same functionalities as bots, but they can simplify the installation of the bot on your server.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"8f13c403-fbba-429b-b6cc-dca7bb1142c7","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"750571c4c60ecbd0f4e4f98f6334cfc16177aa2a33a020b03a943b47c0aea3c7"}}


node_type: n8n-nodes-base.Discourse
name: Discourse
display_name: Discourse
description: Consume Discourse API
category: Other
code_hash: 2f5ce8de0ffd9c8043ec6593bec94991a63023117f784366a8628ec0778e08cf
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/discourse
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Discourse credentials
  description: Documentation for Discourse credentials. Use these credentials to authenticate Discourse in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Discourse credentials

  You can use these credentials to authenticate the following nodes:

  - [Discourse](/integrations/builtin/app-nodes/n8n-nodes-base.discourse.md)

  ## Prerequisites

  - Host an instance of [Discourse](https://discourse.org/)
  - Create an account on your hosted instance and make sure that you are an admin

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - The **URL** of your Discourse instance, for example `https://community.n8n.io`
  - An **API Key**: Create an API key through the Discourse admin panel. Refer to the [Discourse create and configure an API key documentation](https://meta.discourse.org/t/create-and-configure-an-api-key/230124){:target=_blank .external-link} for instructions on creating an API key and specifying a username.
  - A **Username**: Use your own name, `system`, or another user.

  Refer to the Authentication section of the [Discourse API documentation](https://docs.discourse.org/){:target=_blank .external-link} for examples.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"8127f6a3-2ed7-4738-8e46-6258ec05c41d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"8324f48815a37a206b18f07075849429e510a03e81630b262e33eb345ba6831f"}}


node_type: n8n-nodes-base.Disqus
name: Disqus
display_name: Disqus
description: Access data on Disqus
category: Other
code_hash: c60402500e1aea71c7e4e7a76fe768b72f3894831b6a69851fd8ec5bdfa43931
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/disqus
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Disqus credentials
  description: Documentation for Disqus credentials. Use these credentials to authenticate Disqus in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Disqus credentials

  You can use these credentials to authenticate the following nodes:

  - [Disqus](/integrations/builtin/app-nodes/n8n-nodes-base.disqus.md)

  ## Prerequisites

  - Create a [Disqus](https://www.disqus.com/){:target=_blank .external-link} account.
  - Register an [API application](https://help.disqus.com/en/articles/1717083-how-to-create-an-api-application){:target=_blank .external-link}.

  ## Supported authentication methods

  - API access token

  ## Related resources

  Refer to [Disqus's API documentation](https://disqus.com/api/docs/){:target=_blank .external-link} for more information about the service.

  ## Using API access token

  To configure this credential, you'll need:

  - An **Access Token**: Once you've registered an API application, copy the **API Key** and add it to n8n as the **Access Token**.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"1501ac8e-85b6-4273-aa15-bf477ed5d595","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"5ca8c05347636574d8806f9c130e24ad2c189ca089de60c7d105750c7c62c90c"}}


node_type: n8n-nodes-base.Drift
name: Drift
display_name: Drift
description: Consume Drift API
category: Other
code_hash: 0f95bfe43e877d5dbf5e06e74b9a9896c10df575ba3080ff99a30f95cb5f3625
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/drift
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Drift credentials
  description: Documentation for Drift credentials. Use these credentials to authenticate Drift in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Drift credentials

  You can use these credentials to authenticate the following nodes:

  - [Drift](/integrations/builtin/app-nodes/n8n-nodes-base.drift.md)

  ## Prerequisites

  - Create a [Drift](https://www.drift.com/){:target=_blank .external-link} account.
  - [Create a Drift app](https://devdocs.drift.com/docs/quick-start#3-install-it-to-your-drift-account-){:target=_blank .external-link}.

  ## Supported authentication methods

  - API personal access token
  - OAuth2

  ## Related resources

  Refer to [Drift's API documentation](https://devdocs.drift.com/docs/using-drift-apis){:target=_blank .external-link} for more information about the service.

  ## Using API personal access token

  To configure this credential, you'll need:

  - A **Personal Access Token**: To get a token, [create a Drift app](https://devdocs.drift.com/docs/quick-start#3-install-it-to-your-drift-account-){:target=_blank .external-link}. [Install the app](https://devdocs.drift.com/docs/quick-start#3-install-it-to-your-drift-account-){:target=_blank .external-link} to generate an OAuth Access token. Add this to the n8n credential as your **Personal Access Token**.

  ## Using OAuth2

  --8<-- "_snippets/integrations/builtin/credentials/cloud-oauth-button.md"

  If you need to configure OAuth2 from scratch or need more detail on what's happening in the OAuth web flow, refer to the instructions in the [Drift Authentication and Scopes documentation](https://devdocs.drift.com/docs/authentication-and-scopes){:target=_blank .external-link} to set up OAuth for your app.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"731dab08-219f-43d6-9297-79f2b5d8ebc4","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"2d3b9e7a7c964368fe843b5d70379027de1af5f9284372cda0ce438576833ab7"}}


node_type: n8n-nodes-base.DebugHelper
name: DebugHelper
display_name: DebugHelper
description: Causes problems intentionally and generates useful data for debugging
category: Other
code_hash: 99860b55ee895e997c0b43cadcbc1cd28f38a4470e193192da8c35415129dd2e
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.debughelper
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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') ]]

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b1301ba8-e52a-41fa-80a8-88d22a158f68","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"48055517d3defaba22d0145171990fb754ae4acc177d1625f6ea26a35b6a94cf"}}


node_type: n8n-nodes-base.E2eTest
name: E2eTest
display_name: E2E Test
description: Dummy node used for e2e testing
category: Other
code_hash: 2bdc344d2866f7e3a961538270c732f5f44ed4b8e88d8287b757f159df2aac08
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.E2eTest = void 0;
  const mock_1 = require("./mock");
  class E2eTest {
      constructor() {
          this.description = {
              displayName: 'E2E Test',
              name: 'e2eTest',
              icon: 'fa:play',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"]}}',
              description: 'Dummy node used for e2e testing',
              defaults: {
                  name: 'E2E Test',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Remote Options',
                              value: 'remoteOptions',
                          },
                          {
                              name: 'Resource Locator',
                              value: 'resourceLocator',
                          },
                          {
                              name: 'Resource Mapping Component',
                              value: 'resourceMapper',
                          },
                      ],
                      default: 'remoteOptions',
                  },
                  {
                      displayName: 'Field ID',
                      name: 'fieldId',
                      type: 'string',
                      default: '',
                  },
                  {
                      displayName: 'Remote Options Name or ID',
                      name: 'remoteOptions',
                      description: 'Remote options to load. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                      type: 'options',
                      typeOptions: {
                          loadOptionsDependsOn: ['fieldId'],
                          loadOptionsMethod: 'getOptions',
                      },
                      required: true,
                      default: [],
                      displayOptions: {
                          show: {
                              operation: ['remoteOptions'],
                          },
                      },
                  },
                  {
                      displayName: 'Resource Locator',
                      name: 'rlc',
                      type: 'resourceLocator',
                      default: { mode: 'list', value: '' },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['resourceLocator'],
                          },
                      },
                      modes: [
                          {
                              displayName: 'From List',
                              name: 'list',
                              type: 'list',
                              typeOptions: {
                                  searchListMethod: 'optionsSearch',
                                  searchable: true,
                              },
                          },
                          {
                              displayName: 'By URL',
                              name: 'url',
                              type: 'string',
                              placeholder: 'https://example.com/user/a4071e98-7d40-41fb-8911-ce3e7bf94fb2',
                              validation: [
                                  {
                                      type: 'regex',
                                      properties: {
                                          regex: 'https://example.com/user/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}',
                                          errorMessage: 'Not a valid example URL',
                                      },
                                  },
                              ],
                              extractValue: {
                                  type: 'regex',
                                  regex: 'https://example.com/user/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})',
                              },
                          },
                          {
                              displayName: 'ID',
                              name: 'id',
                              type: 'string',
                              validation: [
                                  {
                                      type: 'regex',
                                      properties: {
                                          regex: '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}',
                                          errorMessage: 'Not a valid UUI',
                                      },
                                  },
                              ],
                              placeholder: 'a4071e98-7d40-41fb-8911-ce3e7bf94fb2',
                          },
                      ],
                  },
                  {
                      displayName: 'Resource Mapping Component',
                      name: 'resourceMapper',
                      type: 'resourceMapper',
                      noDataExpression: true,
                      default: {
                          mappingMode: 'defineBelow',
                          value: null,
                      },
                      required: true,
                      typeOptions: {
                          loadOptionsDependsOn: ['fieldId'],
                          resourceMapper: {
                              resourceMapperMethod: 'getMappingColumns',
                              mode: 'upsert',
                              fieldWords: {
                                  singular: 'column',
                                  plural: 'columns',
                              },
                              addAllFields: true,
                              multiKeyMatch: false,
                          },
                      },
                      displayOptions: {
                          show: {
                              operation: ['resourceMapper'],
                          },
                      },
                  },
                  {
                      displayName: 'Other Non Important Field',
                      name: 'otherField',
                      type: 'string',
                      default: '',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getOptions() {
                      return mock_1.remoteOptions;
                  },
              },
              listSearch: {
                  async optionsSearch(filter, paginationToken) {
                      const pageSize = 5;
                      let results = mock_1.searchOptions;
                      if (filter) {
                          results = results.filter((option) => option.name.includes(filter));
                      }
                      const offset = paginationToken ? parseInt(paginationToken, 10) : 0;
                      results = results.slice(offset, offset + pageSize);
                      return {
                          results,
                          paginationToken: offset + pageSize,
                      };
                  },
              },
              resourceMapping: {
                  async getMappingColumns() {
                      return mock_1.resourceMapperFields;
                  },
              },
          };
      }
      async execute() {
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'resourceMapper') {
              const rmValue = this.getNodeParameter('resourceMapper.value', 0);
              if (rmValue) {
                  return [[{ json: rmValue }]];
              }
          }
          return [mock_1.returnData];
      }
  }
  exports.E2eTest = E2eTest;
  //# sourceMappingURL=E2eTest.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"f2cf1f11-480c-4a89-88fe-c248b8a1a01c","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"1087ceb7ba4a8be929e573abb4ea6a8ac055fd833c4921f7e68f137000df0bfe"}}


node_type: n8n-nodes-base.EmailReadImap
name: EmailReadImap
display_name: Email Trigger (IMAP)
description: Triggers the workflow when a new email is received
category: Other
code_hash: b3d4946398bf3fb32954b1d50cef910b0831f468d4d364cf5288676b41d43a53
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.EmailReadImap = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const EmailReadImapV1_node_1 = require("./v1/EmailReadImapV1.node");
  const EmailReadImapV2_node_1 = require("./v2/EmailReadImapV2.node");
  class EmailReadImap extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Email Trigger (IMAP)',
              name: 'emailReadImap',
              icon: 'fa:inbox',
              group: ['trigger'],
              description: 'Triggers the workflow when a new email is received',
              defaultVersion: 2,
          };
          const nodeVersions = {
              1: new EmailReadImapV1_node_1.EmailReadImapV1(baseDescription),
              2: new EmailReadImapV2_node_1.EmailReadImapV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.EmailReadImap = EmailReadImap;
  //# sourceMappingURL=EmailReadImap.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"6aa1799f-00f8-4221-a684-56ab40ea2886","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"f297248f11b3e22963249ac78013725f0f4611973b7d06594a0a3473d9570640"}}


node_type: n8n-nodes-base.Dropbox
name: Dropbox
display_name: Dropbox
description: Access data on Dropbox
category: Other
code_hash: 2c1ed766c39f4be2f863f96b50ead7190d2e4a9f8197ac574ea1410e58165ea2
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/dropbox
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Dropbox = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Dropbox {
      constructor() {
          this.description = {
              displayName: 'Dropbox',
              name: 'dropbox',
              icon: 'file:dropbox.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Access data on Dropbox',
              defaults: {
                  name: 'Dropbox',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'dropboxApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'dropboxOAuth2Api',
                      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',
                      description: 'Means of authenticating with the service',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Folder',
                              value: 'folder',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                          },
                      ],
                      default: 'file',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Copy',
                              value: 'copy',
                              description: 'Copy a file',
                              action: 'Copy a file',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a file',
                              action: 'Delete a file',
                          },
                          {
                              name: 'Download',
                              value: 'download',
                              description: 'Download a file',
                              action: 'Download a file',
                          },
                          {
                              name: 'Move',
                              value: 'move',
                              description: 'Move a file',
                              action: 'Move a file',
                          },
                          {
                              name: 'Upload',
                              value: 'upload',
                              description: 'Upload a file',
                              action: 'Upload a file',
                          },
                      ],
                      default: 'upload',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['folder'],
                          },
                      },
                      options: [
                          {
                              name: 'Copy',
                              value: 'copy',
                              description: 'Copy a folder',
                              action: 'Copy a folder',
                          },
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a folder',
                              action: 'Create a folder',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a folder',
                              action: 'Delete a folder',
                          },
                          {
                              name: 'List',
                              value: 'list',
                              description: 'Return the files and folders in a given folder',
                              action: 'List a folder',
                          },
                          {
                              name: 'Move',
                              value: 'move',
                              description: 'Move a folder',
                              action: 'Move a folder',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['search'],
                          },
                      },
                      options: [
                          {
                              name: 'Query',
                              value: 'query',
                              action: 'Query',
                          },
                      ],
                      default: 'query',
                  },
                  {
                      displayName: 'From Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['copy'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/original.txt',
                      description: 'The path of file or folder to copy',
                  },
                  {
                      displayName: 'To Path',
                      name: 'toPath',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['copy'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/copy.txt',
                      description: 'The destination path of file or folder',
                  },
                  {
                      displayName: 'Delete Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The path to delete. Can be a single file or a whole folder.',
                  },
                  {
                      displayName: 'From Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['move'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/old_name.txt',
                      description: 'The path of file or folder to move',
                  },
                  {
                      displayName: 'To Path',
                      name: 'toPath',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['move'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/new_name.txt',
                      description: 'The new path of file or folder',
                  },
                  {
                      displayName: 'File Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The file path of the file to download. Has to contain the full path.',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      description: 'Name of the binary property to which to write the data of the read file',
                  },
                  {
                      displayName: 'File Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The file path of the file to upload. Has to contain the full path. The parent folder has to exist. Existing files get overwritten.',
                  },
                  {
                      displayName: 'Binary Data',
                      name: 'binaryData',
                      type: 'boolean',
                      default: false,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      description: 'Whether the data to upload should be taken from binary field',
                  },
                  {
                      displayName: 'File Content',
                      name: 'fileContent',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                              binaryData: [false],
                          },
                      },
                      placeholder: '',
                      description: 'The text content of the file to upload',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                              binaryData: [true],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file to be uploaded',
                  },
                  {
                      displayName: 'Query',
                      name: 'query',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['query'],
                              resource: ['search'],
                          },
                      },
                      description: 'The string to search for. May match across multiple fields based on the request arguments.',
                  },
                  {
                      displayName: 'File Status',
                      name: 'fileStatus',
                      type: 'options',
                      options: [
                          {
                              name: 'Active',
                              value: 'active',
                          },
                          {
                              name: 'Deleted',
                              value: 'deleted',
                          },
                      ],
                      default: 'active',
                      displayOptions: {
                          show: {
                              operation: ['query'],
                              resource: ['search'],
                          },
                      },
                      description: 'The string to search for. May match across multiple fields based on the request arguments.',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['query'],
                              resource: ['search'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      displayOptions: {
                          show: {
                              resource: ['search'],
                              operation: ['query'],
                              returnAll: [false],
                          },
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Simplify',
                      name: 'simple',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['query'],
                              resource: ['search'],
                          },
                      },
                      default: true,
                      description: 'Whether to return a simplified version of the response instead of the raw data',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['search'],
                              operation: ['query'],
                          },
                      },
                      options: [
                          {
                              displayName: 'File Categories',
                              name: 'file_categories',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Audio (mp3, qav, mid, etc.)',
                                      value: 'audio',
                                  },
                                  {
                                      name: 'Document (doc, docx, txt, etc.)',
                                      value: 'document',
                                  },
                                  {
                                      name: 'Dropbox Paper',
                                      value: 'paper',
                                  },
                                  {
                                      name: 'Folder',
                                      value: 'folder',
                                  },
                                  {
                                      name: 'Image (jpg, png, gif, etc.)',
                                      value: 'image',
                                  },
                                  {
                                      name: 'Other',
                                      value: 'other',
                                  },
                                  {
                                      name: 'PDF',
                                      value: 'pdf',
                                  },
                                  {
                                      name: 'Presentation (ppt, pptx, key, etc.)',
                                      value: 'presentation',
                                  },
                                  {
                                      name: 'Spreadsheet (xlsx, xls, csv, etc.)',
                                      value: 'spreadsheet',
                                  },
                                  {
                                      name: 'Video (avi, wmv, mp4, etc.)',
                                      value: 'video',
                                  },
                              ],
                              default: [],
                          },
                          {
                              displayName: 'File Extensions',
                              name: 'file_extensions',
                              type: 'string',
                              default: '',
                              description: 'Multiple file extensions can be set separated by comma. Example: jpg,pdf.',
                          },
                          {
                              displayName: 'Folder',
                              name: 'path',
                              type: 'string',
                              default: '',
                              description: 'If this field is not specified, this module searches the entire Dropbox',
                          },
                      ],
                  },
                  {
                      displayName: 'Folder',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['folder'],
                          },
                      },
                      placeholder: '/invoices/2019',
                      description: 'The folder to create. The parent folder has to exist.',
                  },
                  {
                      displayName: 'Folder Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                              resource: ['folder'],
                          },
                      },
                      placeholder: '/invoices/2019/',
                      description: 'The path of which to list the content',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                              resource: ['folder'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      displayOptions: {
                          show: {
                              resource: ['folder'],
                              operation: ['list'],
                              returnAll: [false],
                          },
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['folder'],
                              operation: ['list'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Include Deleted',
                              name: 'include_deleted',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the results will include entries for files and folders that used to exist but were deleted. The default for this field is False.',
                          },
                          {
                              displayName: 'Include Shared Members',
                              name: 'include_has_explicit_shared_members',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the results will include a flag for each file indicating whether or not that file has any explicit members. The default for this field is False.',
                          },
                          {
                              displayName: 'Include Mounted Folders',
                              name: 'include_mounted_folders',
                              type: 'boolean',
                              default: true,
                              description: 'Whether the results will include entries under mounted folders which includes app folder, shared folder and team folder. The default for this field is True.',
                          },
                          {
                              displayName: 'Include Non Downloadable Files',
                              name: 'include_non_downloadable_files',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to include files that are not downloadable, i.e. Google Docs. The default for this field is True.',
                          },
                          {
                              displayName: 'Recursive',
                              name: 'recursive',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders. The default for this field is False.',
                          },
                      ],
                  },
              ],
          };
      }
      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 returnAll = false;
          let property = '';
          let body;
          let options;
          const query = {};
          let headers = {};
          let simple = false;
          const { accessType } = await GenericFunctions_1.getCredentials.call(this);
          if (accessType === 'full') {
              const { root_info: { root_namespace_id }, } = await GenericFunctions_1.getRootDirectory.call(this);
              headers = {
                  'dropbox-api-path-root': JSON.stringify({
                      '.tag': 'root',
                      root: root_namespace_id,
                  }),
              };
          }
          for (let i = 0; i < items.length; i++) {
              try {
                  body = {};
                  if (resource === 'file') {
                      if (operation === 'download') {
                          requestMethod = 'POST';
                          query.arg = JSON.stringify({
                              path: this.getNodeParameter('path', i),
                          });
                          endpoint = 'https://content.dropboxapi.com/2/files/download';
                      }
                      else if (operation === 'upload') {
                          requestMethod = 'POST';
                          headers['Content-Type'] = 'application/octet-stream';
                          query.arg = JSON.stringify({
                              mode: 'overwrite',
                              path: this.getNodeParameter('path', i),
                          });
                          endpoint = 'https://content.dropboxapi.com/2/files/upload';
                          options = { json: false };
                          if (this.getNodeParameter('binaryData', i)) {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              this.helpers.assertBinaryData(i, binaryPropertyName);
                              body = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          }
                          else {
                              body = Buffer.from(this.getNodeParameter('fileContent', i), 'utf8');
                          }
                      }
                  }
                  else if (resource === 'folder') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          body = {
                              path: this.getNodeParameter('path', i),
                          };
                          endpoint = 'https://api.dropboxapi.com/2/files/create_folder_v2';
                      }
                      else if (operation === 'list') {
                          returnAll = this.getNodeParameter('returnAll', 0);
                          const filters = this.getNodeParameter('filters', i);
                          property = 'entries';
                          requestMethod = 'POST';
                          body = {
                              path: this.getNodeParameter('path', i),
                              limit: 1000,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              body.limit = limit;
                          }
                          Object.assign(body, filters);
                          endpoint = 'https://api.dropboxapi.com/2/files/list_folder';
                      }
                  }
                  else if (resource === 'search') {
                      if (operation === 'query') {
                          returnAll = this.getNodeParameter('returnAll', 0);
                          simple = this.getNodeParameter('simple', 0);
                          const filters = this.getNodeParameter('filters', i);
                          property = 'matches';
                          requestMethod = 'POST';
                          body = {
                              query: this.getNodeParameter('query', i),
                              options: {
                                  filename_only: true,
                              },
                          };
                          if (filters.file_extensions) {
                              filters.file_extensions = filters.file_extensions.split(',');
                          }
                          Object.assign(body.options, filters);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              Object.assign(body.options, { max_results: limit });
                          }
                          endpoint = 'https://api.dropboxapi.com/2/files/search_v2';
                      }
                  }
                  if (['file', 'folder', 'search'].includes(resource)) {
                      if (operation === 'copy') {
                          requestMethod = 'POST';
                          body = {
                              from_path: this.getNodeParameter('path', i),
                              to_path: this.getNodeParameter('toPath', i),
                          };
                          endpoint = 'https://api.dropboxapi.com/2/files/copy_v2';
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'POST';
                          body = {
                              path: this.getNodeParameter('path', i),
                          };
                          endpoint = 'https://api.dropboxapi.com/2/files/delete_v2';
                      }
                      else if (operation === 'move') {
                          requestMethod = 'POST';
                          body = {
                              from_path: this.getNodeParameter('path', i),
                              to_path: this.getNodeParameter('toPath', i),
                          };
                          endpoint = 'https://api.dropboxapi.com/2/files/move_v2';
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  if (resource === 'file' && operation === 'download') {
                      options = { encoding: null };
                  }
                  let responseData;
                  if (returnAll) {
                      responseData = await GenericFunctions_1.dropboxpiRequestAllItems.call(this, property, requestMethod, endpoint, body, query, headers);
                  }
                  else {
                      responseData = await GenericFunctions_1.dropboxApiRequest.call(this, requestMethod, endpoint, body, query, headers, options);
                  }
                  if (resource === 'file' && operation === 'upload') {
                      const data = JSON.parse(responseData);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(data), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (resource === 'file' && operation === 'download') {
                      const newItem = {
                          json: items[i].json,
                          binary: {},
                          pairedItem: { item: i },
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      items[i] = newItem;
                      const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i);
                      const filePathDownload = this.getNodeParameter('path', i);
                      items[i].binary[dataPropertyNameDownload] = await this.helpers.prepareBinaryData(Buffer.from(responseData), filePathDownload);
                  }
                  else if (resource === 'folder' && operation === 'list') {
                      const propNames = {
                          id: 'id',
                          name: 'name',
                          client_modified: 'lastModifiedClient',
                          server_modified: 'lastModifiedServer',
                          rev: 'rev',
                          size: 'contentSize',
                          '.tag': 'type',
                          content_hash: 'contentHash',
                          path_lower: 'pathLower',
                          path_display: 'pathDisplay',
                          has_explicit_shared_members: 'hasExplicitSharedMembers',
                          is_downloadable: 'isDownloadable',
                      };
                      if (!returnAll) {
                          responseData = responseData.entries;
                      }
                      for (const item of responseData) {
                          const newItem = {};
                          for (const propName of Object.keys(propNames)) {
                              if (item[propName] !== undefined) {
                                  newItem[propNames[propName]] = item[propName];
                              }
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(newItem), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
                  else if (resource === 'search' && operation === 'query') {
                      let data = responseData;
                      if (returnAll) {
                          data = simple ? (0, GenericFunctions_1.simplify)(responseData) : responseData;
                      }
                      else {
                          data = simple
                              ? (0, GenericFunctions_1.simplify)(responseData[property])
                              : responseData[property];
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(data), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (resource === 'file' && operation === 'download') {
                          items[i].json = { error: error.message };
                      }
                      else {
                          returnData.push({ json: { error: error.message } });
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (resource === 'file' && operation === 'download') {
              return [items];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.Dropbox = Dropbox;
  //# sourceMappingURL=Dropbox.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Dropbox credentials
  description: Documentation for Dropbox credentials. Use these credentials to authenticate Dropbox in n8n, a workflow automation platform.
  contentType: [integration, reference]
  priority: medium
  ---

  # Dropbox credentials

  You can use these credentials to authenticate the following nodes:

  - [Dropbox](/integrations/builtin/app-nodes/n8n-nodes-base.dropbox.md)

  ## Supported authentication methods

  - API access token: Dropbox recommends this method for testing with your user account and granting a limited number of users access.
  - OAuth2: Dropbox recommends this method for production or for testing with more than 50 users.

  /// note | App reuse
  You can transition an app from the API access token to OAuth2 by creating a new credential in n8n for OAuth2 using the same app.
  ///

  ## Related resources

  Refer to [Dropbox's Developer documentation](https://www.dropbox.com/developers/documentation){:target=_blank .external-link} for more information about the service.

  ## Using access token

  To configure this credential, you'll need a [Dropbox](https://www.dropbox.com/developers){:target=_blank .external-link} developer account and:

  - An **Access Token**: Generated once you create a Dropbox app.
  - An **App Access Type**

  To set up the credential, create a Dropbox app:

  1. Open the [App Console](https://www.dropbox.com/developers/apps){:target=_blank .external-link} within the Dropbox developer portal.
  2. Select **Create app**.
  3. In **Choose an API**, select **Scoped access**.
  4. In **Choose the type of access you need**, choose whichever option best fits your use of the [Dropbox](/integrations/builtin/app-nodes/n8n-nodes-base.dropbox.md) node:
      - **App Folder** grants access to a single folder created specifically for your app.
      - **Full Dropbox** grants access to all files and folders in your user's Dropbox.
      - Refer to the [DBX Platform developer guide](https://www.dropbox.com/developers/reference/developer-guide){:target=_blank .external-link} for more information.
  5. In **Name your app**, enter a name for your app, like `n8n integration`.
  6. Check the box to agree to the **Dropbox API Terms and Conditions**.
  7. Select **Create app**. The app's **Settings** open.
  8. In the **OAuth 2** section, in **Generated access token**, select **Generate**.
  9. Copy the access token and enter it as the **Access Token** in your n8n credential.
  10. In n8n, select the same **App Access Type** you selected for your app.

  Refer to the [Dropbox App Console Settings documentation](https://www.dropbox.com/developers/reference/getting-started){:target=_blank .external-link} for more information.

  /// warning | User limits
  On the **Settings** tab, you can add other users to your app, even with the access token method. Once your app links 50 Dropbox users, you will have two weeks to apply for and receive production status approval before Dropbox freezes your app from linking more users.
  ///

  ## Using OAuth2

  --8<-- "_snippets/integrations/builtin/credentials/cloud-oauth-button.md"

  Cloud users need to select the **App Access Type**:

  - **App Folder** grants access to a single folder created specifically for your app.
  - **Full Dropbox** grants access to all files and folders in your user's Dropbox.
  - Refer to the [DBX Platform developer guide](https://www.dropbox.com/developers/reference/developer-guide){:target=_blank .external-link} for more information.

  If you're [self-hosting](/hosting/index.md) n8n, you'll need to configure OAuth2 manually:

  1. Open the [App Console](https://www.dropbox.com/developers/apps){:target=_blank .external-link} within the Dropbox developer portal.
  2. Select **Create app**.
  3. In **Choose an API**, select **Scoped access**.
  4. In **Choose the type of access you need**, choose whichever option best fits your use of the [Dropbox](/integrations/builtin/app-nodes/n8n-nodes-base.dropbox.md) node:
      - **App Folder** grants access to a single folder created specifically for your app.
      - **Full Dropbox** grants access to all files and folders in your user's Dropbox.
      - Refer to the [DBX Platform developer guide](https://www.dropbox.com/developers/reference/developer-guide){:target=_blank .external-link} for more information.
  5. In **Name your app**, enter a name for your app, like `n8n integration`.
  6. Check the box to agree to the **Dropbox API Terms and Conditions**.
  7. Select **Create app**. The app's **Settings** open.
  8. Copy the **App key** and enter it as the **Client ID** in your n8n credential.
  9. Copy the **Secret** and enter it as the **Client Secret** in your n8n credential.
  10. In n8n, copy the **OAuth Redirect URL** and enter it in the Dropbox **Redirect URIs**.
  11. In n8n, select the same **App Access Type** you selected for your app.

  Refer to the instructions in the [Dropbox Implementing OAuth documentation](https://developers.dropbox.com/oauth-guide#implementing-oauth){:target=_blank .external-link} for more information.

  For internal tools and limited usage, you can keep your app private. But if you'd like your app to be used by more than 50 users or you want to distribute it, you'll need to complete Dropbox's production approval process. Refer to **Production Approval** in the [DBX Platform developer guide](https://www.dropbox.com/developers/reference/developer-guide){:target=_blank .external-link} for more information.

  /// warning | User limits
  On the **Settings** tab, you can add other users to your app. Once your app links 50 Dropbox users, you will have two weeks to apply for and receive production status approval before Dropbox freezes your app from linking more users.
  ///

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b1e96f29-0d28-49a0-a32c-f1aa526448c2","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"94137066c631b6f76c9d6e2e9e2a273392dc94a2942e663e279c0797e0870a18"}}


node_type: n8n-nodes-base.Dropcontact
name: Dropcontact
display_name: Dropcontact
description: Find B2B emails and enrich contacts
category: Other
code_hash: cd7a9edf467fd1288617b3ecb6e11942c3dab69d3fc91a543624ca2bed582dc6
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/dropcontact
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Dropcontact = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunction_1 = require("./GenericFunction");
  class Dropcontact {
      constructor() {
          this.description = {
              displayName: 'Dropcontact',
              name: 'dropcontact',
              icon: 'file:dropcontact.svg',
              group: ['transform'],
              version: 1,
              description: 'Find B2B emails and enrich contacts',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Dropcontact',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'dropcontactApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      noDataExpression: true,
                      name: 'resource',
                      type: 'options',
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                      ],
                      default: 'contact',
                      required: true,
                  },
                  {
                      displayName: 'Operation',
                      noDataExpression: true,
                      name: 'operation',
                      type: 'options',
                      options: [
                          {
                              name: 'Enrich',
                              value: 'enrich',
                              description: 'Find B2B emails and enrich your contact from his name and his website',
                              action: 'Find B2B emails',
                          },
                          {
                              name: 'Fetch Request',
                              value: 'fetchRequest',
                          },
                      ],
                      default: 'enrich',
                      required: true,
                  },
                  {
                      displayName: 'Request ID',
                      name: 'requestId',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['fetchRequest'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['enrich'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Simplify Output (Faster)',
                      name: 'simplify',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['enrich'],
                          },
                      },
                      default: false,
                      description: 'When off, waits for the contact data before completing. Waiting time can be adjusted with Extend Wait Time option. When on, returns a request_id that can be used later in the Fetch Request operation.',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['enrich'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Company SIREN Number',
                              name: 'num_siren',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Company SIRET Code',
                              name: 'siret',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Company Name',
                              name: 'company',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Country',
                              name: 'country',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'First Name',
                              name: 'first_name',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Full Name',
                              name: 'full_name',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Last Name',
                              name: 'last_name',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'LinkedIn Profile',
                              name: 'linkedin',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Phone Number',
                              name: 'phone',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Website',
                              name: 'website',
                              type: 'string',
                              default: '',
                          },
                      ],
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['enrich'],
                          },
                      },
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Data Fetch Wait Time',
                              name: 'waitTime',
                              type: 'number',
                              typeOptions: {
                                  minValue: 1,
                              },
                              displayOptions: {
                                  show: {
                                      '/simplify': [false],
                                  },
                              },
                              default: 45,
                              description: 'When not simplifying the response, data will be fetched in two steps. This parameter controls how long to wait (in seconds) before trying the second step.',
                          },
                          {
                              displayName: 'French Company Enrich',
                              name: 'siren',
                              type: 'boolean',
                              default: false,
                              description: 'Whether you want the <a href="https://en.wikipedia.org/wiki/SIREN_code" target="_blank">SIREN number</a>, NAF code, TVA number, company address and informations about the company leader. Only applies to french companies.',
                          },
                          {
                              displayName: 'Language',
                              name: 'language',
                              type: 'options',
                              options: [
                                  {
                                      name: 'English',
                                      value: 'en',
                                  },
                                  {
                                      name: 'French',
                                      value: 'fr',
                                  },
                              ],
                              default: 'en',
                              description: 'Whether the response is in English or French',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const entryData = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          if (resource === 'contact') {
              if (operation === 'enrich') {
                  const options = this.getNodeParameter('options', 0);
                  const data = [];
                  const simplify = this.getNodeParameter('simplify', 0);
                  const siren = options.siren === true ? true : false;
                  const language = options.language ? options.language : 'en';
                  for (let i = 0; i < entryData.length; i++) {
                      const email = this.getNodeParameter('email', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {};
                      if (email !== '') {
                          body.email = email;
                      }
                      Object.assign(body, additionalFields);
                      data.push(body);
                  }
                  responseData = (await GenericFunction_1.dropcontactApiRequest.call(this, 'POST', '/batch', { data, siren, language }, {}));
                  if (!responseData.success) {
                      if (this.continueOnFail()) {
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: responseData.reason || 'invalid request' }), {
                              itemData: (0, GenericFunction_1.mapPairedItemsFrom)(entryData),
                          });
                          returnData.push(...executionData);
                      }
                      else {
                          throw new n8n_workflow_1.NodeApiError(this.getNode(), {
                              error: responseData.reason || 'invalid request',
                          });
                      }
                  }
                  if (!simplify) {
                      const waitTime = this.getNodeParameter('options.waitTime', 0, 45);
                      const delay = async (ms) => new Promise((res) => setTimeout(res, ms * 1000));
                      await delay(waitTime);
                      responseData = await GenericFunction_1.dropcontactApiRequest.call(this, 'GET', `/batch/${responseData.request_id}`, {}, {});
                      if (!responseData.success) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: responseData.reason }), {
                                  itemData: (0, GenericFunction_1.mapPairedItemsFrom)(entryData),
                              });
                              returnData.push(...executionData);
                          }
                          else {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), {
                                  error: responseData.reason,
                                  description: 'Hint: Increase the Wait Time to avoid this error',
                              });
                          }
                      }
                      else {
                          responseData.data.forEach((d, index) => {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(d), { itemData: { item: index } });
                              returnData.push(...executionData);
                          });
                      }
                  }
                  else {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), {
                          itemData: (0, GenericFunction_1.mapPairedItemsFrom)(entryData),
                      });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'fetchRequest') {
                  for (let i = 0; i < entryData.length; i++) {
                      const requestId = this.getNodeParameter('requestId', i);
                      responseData = (await GenericFunction_1.dropcontactApiRequest.call(this, 'GET', `/batch/${requestId}`, {}, {}));
                      if (!responseData.success) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: responseData.reason || 'invalid request' }), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          else {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), {
                                  error: responseData.reason || 'invalid request',
                              });
                          }
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.data), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
          }
          return [returnData];
      }
  }
  exports.Dropcontact = Dropcontact;
  //# sourceMappingURL=Dropcontact.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Dropcontact credentials
  description: Documentation for Dropcontact credentials. Use these credentials to authenticate Dropcontact in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Dropcontact credentials

  You can use these credentials to authenticate the following nodes:

  - [Dropcontact](/integrations/builtin/app-nodes/n8n-nodes-base.dropcontact.md)

  ## Prerequisites

  Create a developer account in [Dropcontact](https://app.dropcontact.com/signup){:target=_blank .external-link}.

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: To view your API key in Dropcontact, go to [**API**](https://app.dropcontact.com/api){:target=_blank .external-link}. Refer to the [Dropcontact API key documentation](https://support.dropcontact.com/article/237-how-to-use-the-dropcontact-api-key){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"21eaec7e-c3e8-46c1-a163-2b3557c8aee7","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"03276ffe339f4ddb0b9f4c971517b1d04885c9df6de459e16b80f7dc90dda99c"}}


node_type: n8n-nodes-base.ERPNext
name: ERPNext
display_name: ERPNext
description: Consume ERPNext API
category: Other
code_hash: 29efdfa1b7a2885ae746d55c9bf1487a1cb4ad084e0eae6cb82e06adccb14e19
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/erpnext
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ERPNext = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const DocumentDescription_1 = require("./DocumentDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utils_1 = require("./utils");
  class ERPNext {
      constructor() {
          this.description = {
              displayName: 'ERPNext',
              name: 'erpNext',
              icon: 'file:erpnext.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
              description: 'Consume ERPNext API',
              defaults: {
                  name: 'ERPNext',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'erpNextApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Document',
                              value: 'document',
                          },
                      ],
                      default: 'document',
                  },
                  ...DocumentDescription_1.documentOperations,
                  ...DocumentDescription_1.documentFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getDocTypes() {
                      const data = await GenericFunctions_1.erpNextApiRequestAllItems.call(this, 'data', 'GET', '/api/resource/DocType', {});
                      const docTypes = data.map(({ name }) => {
                          return { name, value: encodeURI(name) };
                      });
                      return (0, utils_1.processNames)(docTypes);
                  },
                  async getDocFilters() {
                      const docType = this.getCurrentNodeParameter('docType');
                      const { data } = await GenericFunctions_1.erpNextApiRequest.call(this, 'GET', `/api/resource/DocType/${docType}`, {});
                      const docFields = data.fields.map(({ label, fieldname }) => {
                          return { name: label, value: fieldname };
                      });
                      docFields.unshift({ name: '*', value: '*' });
                      return (0, utils_1.processNames)(docFields);
                  },
                  async getDocFields() {
                      const docType = this.getCurrentNodeParameter('docType');
                      const { data } = await GenericFunctions_1.erpNextApiRequest.call(this, 'GET', `/api/resource/DocType/${docType}`, {});
                      const docFields = data.fields.map(({ label, fieldname }) => {
                          return { name: label, value: fieldname };
                      });
                      return (0, utils_1.processNames)(docFields);
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let responseData;
          const body = {};
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              if (resource === 'document') {
                  if (operation === 'get') {
                      const docType = this.getNodeParameter('docType', i);
                      const documentName = this.getNodeParameter('documentName', i);
                      responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'GET', `/api/resource/${docType}/${documentName}`);
                      responseData = responseData.data;
                  }
                  if (operation === 'getAll') {
                      const docType = this.getNodeParameter('docType', i);
                      const endpoint = `/api/resource/${docType}`;
                      const { fields, filters } = this.getNodeParameter('options', i);
                      if (fields) {
                          if (fields.includes('*')) {
                              qs.fields = JSON.stringify(['*']);
                          }
                          else {
                              qs.fields = JSON.stringify(fields);
                          }
                      }
                      if (filters) {
                          qs.filters = JSON.stringify(filters.customProperty.map((filter) => {
                              return [docType, filter.field, (0, utils_1.toSQL)(filter.operator), filter.value];
                          }));
                      }
                      const returnAll = this.getNodeParameter('returnAll', i);
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', i);
                          qs.limit_page_length = limit;
                          qs.limit_start = 0;
                          responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'GET', endpoint, {}, qs);
                          responseData = responseData.data;
                      }
                      else {
                          responseData = await GenericFunctions_1.erpNextApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                      }
                  }
                  else if (operation === 'create') {
                      const properties = this.getNodeParameter('properties', i);
                      if (!properties.customProperty.length) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter at least one property for the document to create.', { itemIndex: i });
                      }
                      properties.customProperty.forEach((property) => {
                          body[property.field] = property.value;
                      });
                      const docType = this.getNodeParameter('docType', i);
                      responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'POST', `/api/resource/${docType}`, body);
                      responseData = responseData.data;
                  }
                  else if (operation === 'delete') {
                      const docType = this.getNodeParameter('docType', i);
                      const documentName = this.getNodeParameter('documentName', i);
                      responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'DELETE', `/api/resource/${docType}/${documentName}`);
                  }
                  else if (operation === 'update') {
                      const properties = this.getNodeParameter('properties', i);
                      if (!properties.customProperty.length) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter at least one property for the document to update.', { itemIndex: i });
                      }
                      properties.customProperty.forEach((property) => {
                          body[property.field] = property.value;
                      });
                      const docType = this.getNodeParameter('docType', i);
                      const documentName = this.getNodeParameter('documentName', i);
                      responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'PUT', `/api/resource/${docType}/${documentName}`, body);
                      responseData = responseData.data;
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.ERPNext = ERPNext;
  //# sourceMappingURL=ERPNext.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: ERPNext credentials
  description: Documentation for ERPNext credentials. Use these credentials to authenticate ERPNext in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # ERPNext credentials

  You can use these credentials to authenticate the following nodes:

  - [ERPNext](/integrations/builtin/app-nodes/n8n-nodes-base.erpnext.md)

  ## Prerequisites

  - Create an [ERPNext](https://erpnext.com) account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [ERPNext's documentation](https://docs.erpnext.com/docs/user/manual/en/introduction){:target=_blank .external-link} for more information about the service.

  Refer to [ERPNext's developer documentation](https://frappeframework.com/docs/user/en/introduction){:target=_blank .external-link} for more information about working with the framework.


  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Generate this from your own ERPNext user account in **Settings > My Settings > API Access**.
  - An **API Secret**: Generated with the API key.
  - Your ERPNext **Environment**:
      - For **Cloud-hosted**:
          - Your ERPNext **Subdomain**: Refer to the [FAQs](#how-to-find-the-subdomain-of-an-erpnext-cloud-hosted-account)
          - Your **Domain**: Choose between `erpnext.com` and `frappe.cloud`.
      - For **Self-hosted**:
          - The fully qualified **Domain** where you host ERPNext
  - Choose whether to **Ignore SSL Issues**: When selected, n8n will connect even if SSL certificate validation is unavailable.

  If you are an ERPNext System Manager, you can also generate API keys and secrets for other users. Refer to the [ERPNext Adding Users documentation](https://docs.erpnext.com/docs/user/manual/en/adding-users){:target=_blank .external-link} for more information.

  ## How to find the subdomain of an ERPNext cloud-hosted account

  You can find your ERPNext subdomain by reviewing the address bar of your browser. The string between `https://` and either `.erpnext.com` or `frappe.cloud` is your subdomain.

  For example, if the URL in the address bar is `https://n8n.erpnext.com`, the subdomain is `n8n`.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"6f773abc-ee0a-4598-8b47-6d1dc595841d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"c827d14f6f2ae69fd2e3ce9a1b116eea6b44d1e454134e083e3c20012e92f5e8"}}


node_type: n8n-nodes-base.EditImage
name: EditImage
display_name: Background Color
description: Adds a blur to the image and so makes it less sharp
category: Other
code_hash: 091299be6339bea30743c8263f8773f388c8c9ce936efa20be50765b608a38c7
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.editimage
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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.EditImage = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const gm_1 = __importDefault(require("gm"));
  const tmp_promise_1 = require("tmp-promise");
  const path_1 = require("path");
  const fs_1 = require("fs");
  const util_1 = require("util");
  const fsWriteFileAsync = (0, util_1.promisify)(fs_1.writeFile);
  const get_system_fonts_1 = __importDefault(require("get-system-fonts"));
  const nodeOperations = [
      {
          name: 'Blur',
          value: 'blur',
          description: 'Adds a blur to the image and so makes it less sharp',
          action: 'Blur Image',
      },
      {
          name: 'Border',
          value: 'border',
          description: 'Adds a border to the image',
          action: 'Border Image',
      },
      {
          name: 'Composite',
          value: 'composite',
          description: 'Composite image on top of another one',
          action: 'Composite Image',
      },
      {
          name: 'Create',
          value: 'create',
          description: 'Create a new image',
          action: 'Create Image',
      },
      {
          name: 'Crop',
          value: 'crop',
          description: 'Crops the image',
          action: 'Crop Image',
      },
      {
          name: 'Draw',
          value: 'draw',
          description: 'Draw on image',
          action: 'Draw Image',
      },
      {
          name: 'Rotate',
          value: 'rotate',
          description: 'Rotate image',
          action: 'Rotate Image',
      },
      {
          name: 'Resize',
          value: 'resize',
          description: 'Change the size of image',
          action: 'Resize Image',
      },
      {
          name: 'Shear',
          value: 'shear',
          description: 'Shear image along the X or Y axis',
          action: 'Shear Image',
      },
      {
          name: 'Text',
          value: 'text',
          description: 'Adds text to image',
          action: 'Apply Text to Image',
      },
      {
          name: 'Transparent',
          value: 'transparent',
          description: 'Make a color in image transparent',
          action: 'Add Transparency to Image',
      },
  ];
  const nodeOperationOptions = [
      {
          displayName: 'Background Color',
          name: 'backgroundColor',
          type: 'color',
          default: '#ffffff00',
          typeOptions: {
              showAlpha: true,
          },
          displayOptions: {
              show: {
                  operation: ['create'],
              },
          },
          description: 'The background color of the image to create',
      },
      {
          displayName: 'Image Width',
          name: 'width',
          type: 'number',
          default: 50,
          typeOptions: {
              minValue: 1,
          },
          displayOptions: {
              show: {
                  operation: ['create'],
              },
          },
          description: 'The width of the image to create',
      },
      {
          displayName: 'Image Height',
          name: 'height',
          type: 'number',
          default: 50,
          typeOptions: {
              minValue: 1,
          },
          displayOptions: {
              show: {
                  operation: ['create'],
              },
          },
          description: 'The height of the image to create',
      },
      {
          displayName: 'Primitive',
          name: 'primitive',
          type: 'options',
          displayOptions: {
              show: {
                  operation: ['draw'],
              },
          },
          options: [
              {
                  name: 'Circle',
                  value: 'circle',
              },
              {
                  name: 'Line',
                  value: 'line',
              },
              {
                  name: 'Rectangle',
                  value: 'rectangle',
              },
          ],
          default: 'rectangle',
          description: 'The primitive to draw',
      },
      {
          displayName: 'Color',
          name: 'color',
          type: 'color',
          default: '#ff000000',
          typeOptions: {
              showAlpha: true,
          },
          displayOptions: {
              show: {
                  operation: ['draw'],
              },
          },
          description: 'The color of the primitive to draw',
      },
      {
          displayName: 'Start Position X',
          name: 'startPositionX',
          type: 'number',
          default: 50,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['circle', 'line', 'rectangle'],
              },
          },
          description: 'X (horizontal) start position of the primitive',
      },
      {
          displayName: 'Start Position Y',
          name: 'startPositionY',
          type: 'number',
          default: 50,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['circle', 'line', 'rectangle'],
              },
          },
          description: 'Y (horizontal) start position of the primitive',
      },
      {
          displayName: 'End Position X',
          name: 'endPositionX',
          type: 'number',
          default: 250,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['circle', 'line', 'rectangle'],
              },
          },
          description: 'X (horizontal) end position of the primitive',
      },
      {
          displayName: 'End Position Y',
          name: 'endPositionY',
          type: 'number',
          default: 250,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['circle', 'line', 'rectangle'],
              },
          },
          description: 'Y (horizontal) end position of the primitive',
      },
      {
          displayName: 'Corner Radius',
          name: 'cornerRadius',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['rectangle'],
              },
          },
          description: 'The radius of the corner to create round corners',
      },
      {
          displayName: 'Text',
          name: 'text',
          typeOptions: {
              rows: 5,
          },
          type: 'string',
          default: '',
          placeholder: 'Text to render',
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Text to write on the image',
      },
      {
          displayName: 'Font Size',
          name: 'fontSize',
          type: 'number',
          default: 18,
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Size of the text',
      },
      {
          displayName: 'Font Color',
          name: 'fontColor',
          type: 'color',
          default: '#000000',
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Color of the text',
      },
      {
          displayName: 'Position X',
          name: 'positionX',
          type: 'number',
          default: 50,
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'X (horizontal) position of the text',
      },
      {
          displayName: 'Position Y',
          name: 'positionY',
          type: 'number',
          default: 50,
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Y (vertical) position of the text',
      },
      {
          displayName: 'Max Line Length',
          name: 'lineLength',
          type: 'number',
          typeOptions: {
              minValue: 1,
          },
          default: 80,
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Max amount of characters in a line before a line-break should get added',
      },
      {
          displayName: 'Blur',
          name: 'blur',
          type: 'number',
          typeOptions: {
              minValue: 0,
              maxValue: 1000,
          },
          default: 5,
          displayOptions: {
              show: {
                  operation: ['blur'],
              },
          },
          description: 'How strong the blur should be',
      },
      {
          displayName: 'Sigma',
          name: 'sigma',
          type: 'number',
          typeOptions: {
              minValue: 0,
              maxValue: 1000,
          },
          default: 2,
          displayOptions: {
              show: {
                  operation: ['blur'],
              },
          },
          description: 'The sigma of the blur',
      },
      {
          displayName: 'Border Width',
          name: 'borderWidth',
          type: 'number',
          default: 10,
          displayOptions: {
              show: {
                  operation: ['border'],
              },
          },
          description: 'The width of the border',
      },
      {
          displayName: 'Border Height',
          name: 'borderHeight',
          type: 'number',
          default: 10,
          displayOptions: {
              show: {
                  operation: ['border'],
              },
          },
          description: 'The height of the border',
      },
      {
          displayName: 'Border Color',
          name: 'borderColor',
          type: 'color',
          default: '#000000',
          displayOptions: {
              show: {
                  operation: ['border'],
              },
          },
          description: 'Color of the border',
      },
      {
          displayName: 'Composite Image Property',
          name: 'dataPropertyNameComposite',
          type: 'string',
          default: '',
          placeholder: 'data2',
          displayOptions: {
              show: {
                  operation: ['composite'],
              },
          },
          description: 'The name of the binary property which contains the data of the image to composite on top of image which is found in Property Name',
      },
      {
          displayName: 'Operator',
          name: 'operator',
          type: 'options',
          displayOptions: {
              show: {
                  operation: ['composite'],
              },
          },
          options: [
              {
                  name: 'Add',
                  value: 'Add',
              },
              {
                  name: 'Atop',
                  value: 'Atop',
              },
              {
                  name: 'Bumpmap',
                  value: 'Bumpmap',
              },
              {
                  name: 'Copy',
                  value: 'Copy',
              },
              {
                  name: 'Copy Black',
                  value: 'CopyBlack',
              },
              {
                  name: 'Copy Blue',
                  value: 'CopyBlue',
              },
              {
                  name: 'Copy Cyan',
                  value: 'CopyCyan',
              },
              {
                  name: 'Copy Green',
                  value: 'CopyGreen',
              },
              {
                  name: 'Copy Magenta',
                  value: 'CopyMagenta',
              },
              {
                  name: 'Copy Opacity',
                  value: 'CopyOpacity',
              },
              {
                  name: 'Copy Red',
                  value: 'CopyRed',
              },
              {
                  name: 'Copy Yellow',
                  value: 'CopyYellow',
              },
              {
                  name: 'Difference',
                  value: 'Difference',
              },
              {
                  name: 'Divide',
                  value: 'Divide',
              },
              {
                  name: 'In',
                  value: 'In',
              },
              {
                  name: 'Minus',
                  value: 'Minus',
              },
              {
                  name: 'Multiply',
                  value: 'Multiply',
              },
              {
                  name: 'Out',
                  value: 'Out',
              },
              {
                  name: 'Over',
                  value: 'Over',
              },
              {
                  name: 'Plus',
                  value: 'Plus',
              },
              {
                  name: 'Subtract',
                  value: 'Subtract',
              },
              {
                  name: 'Xor',
                  value: 'Xor',
              },
          ],
          default: 'Over',
          description: 'The operator to use to combine the images',
      },
      {
          displayName: 'Position X',
          name: 'positionX',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['composite'],
              },
          },
          description: 'X (horizontal) position of composite image',
      },
      {
          displayName: 'Position Y',
          name: 'positionY',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['composite'],
              },
          },
          description: 'Y (vertical) position of composite image',
      },
      {
          displayName: 'Width',
          name: 'width',
          type: 'number',
          default: 500,
          displayOptions: {
              show: {
                  operation: ['crop'],
              },
          },
          description: 'Crop width',
      },
      {
          displayName: 'Height',
          name: 'height',
          type: 'number',
          default: 500,
          displayOptions: {
              show: {
                  operation: ['crop'],
              },
          },
          description: 'Crop height',
      },
      {
          displayName: 'Position X',
          name: 'positionX',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['crop'],
              },
          },
          description: 'X (horizontal) position to crop from',
      },
      {
          displayName: 'Position Y',
          name: 'positionY',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['crop'],
              },
          },
          description: 'Y (vertical) position to crop from',
      },
      {
          displayName: 'Width',
          name: 'width',
          type: 'number',
          default: 500,
          displayOptions: {
              show: {
                  operation: ['resize'],
              },
          },
          description: 'New width of the image',
      },
      {
          displayName: 'Height',
          name: 'height',
          type: 'number',
          default: 500,
          displayOptions: {
              show: {
                  operation: ['resize'],
              },
          },
          description: 'New height of the image',
      },
      {
          displayName: 'Option',
          name: 'resizeOption',
          type: 'options',
          options: [
              {
                  name: 'Ignore Aspect Ratio',
                  value: 'ignoreAspectRatio',
                  description: 'Ignore aspect ratio and resize exactly to specified values',
              },
              {
                  name: 'Maximum Area',
                  value: 'maximumArea',
                  description: 'Specified values are maximum area',
              },
              {
                  name: 'Minimum Area',
                  value: 'minimumArea',
                  description: 'Specified values are minimum area',
              },
              {
                  name: 'Only if Larger',
                  value: 'onlyIfLarger',
                  description: 'Resize only if image is larger than width or height',
              },
              {
                  name: 'Only if Smaller',
                  value: 'onlyIfSmaller',
                  description: 'Resize only if image is smaller than width or height',
              },
              {
                  name: 'Percent',
                  value: 'percent',
                  description: 'Width and height are specified in percents',
              },
          ],
          default: 'maximumArea',
          displayOptions: {
              show: {
                  operation: ['resize'],
              },
          },
          description: 'How to resize the image',
      },
      {
          displayName: 'Rotate',
          name: 'rotate',
          type: 'number',
          typeOptions: {
              minValue: -360,
              maxValue: 360,
          },
          default: 0,
          displayOptions: {
              show: {
                  operation: ['rotate'],
              },
          },
          description: 'How much the image should be rotated',
      },
      {
          displayName: 'Background Color',
          name: 'backgroundColor',
          type: 'color',
          default: '#ffffffff',
          typeOptions: {
              showAlpha: true,
          },
          displayOptions: {
              show: {
                  operation: ['rotate'],
              },
          },
          description: 'The color to use for the background when image gets rotated by anything which is not a multiple of 90',
      },
      {
          displayName: 'Degrees X',
          name: 'degreesX',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['shear'],
              },
          },
          description: 'X (horizontal) shear degrees',
      },
      {
          displayName: 'Degrees Y',
          name: 'degreesY',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['shear'],
              },
          },
          description: 'Y (vertical) shear degrees',
      },
      {
          displayName: 'Color',
          name: 'color',
          type: 'color',
          default: '#ff0000',
          displayOptions: {
              show: {
                  operation: ['transparent'],
              },
          },
          description: 'The color to make transparent',
      },
  ];
  class EditImage {
      constructor() {
          this.description = {
              displayName: 'Edit Image',
              name: 'editImage',
              icon: 'fa:image',
              group: ['transform'],
              version: 1,
              description: 'Edits an image like blur, resize or adding border and text',
              defaults: {
                  name: 'Edit Image',
                  color: '#553399',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Get Information',
                              value: 'information',
                              description: 'Returns image information like resolution',
                          },
                          {
                              name: 'Multi Step',
                              value: 'multiStep',
                              description: 'Perform multiple operations',
                          },
                          ...nodeOperations,
                      ].sort((a, b) => {
                          if (a.name.toLowerCase() < b.name.toLowerCase()) {
                              return -1;
                          }
                          if (a.name.toLowerCase() > b.name.toLowerCase()) {
                              return 1;
                          }
                          return 0;
                      }),
                      default: 'border',
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      description: 'Name of the binary property in which the image data can be found',
                  },
                  {
                      displayName: 'Operations',
                      name: 'operations',
                      placeholder: 'Add Operation',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                          sortable: true,
                      },
                      displayOptions: {
                          show: {
                              operation: ['multiStep'],
                          },
                      },
                      description: 'The operations to perform',
                      default: {},
                      options: [
                          {
                              name: 'operations',
                              displayName: 'Operations',
                              values: [
                                  {
                                      displayName: 'Operation',
                                      name: 'operation',
                                      type: 'options',
                                      noDataExpression: true,
                                      options: nodeOperations,
                                      default: '',
                                  },
                                  ...nodeOperationOptions,
                                  {
                                      displayName: 'Font Name or ID',
                                      name: 'font',
                                      type: 'options',
                                      displayOptions: {
                                          show: {
                                              operation: ['text'],
                                          },
                                      },
                                      typeOptions: {
                                          loadOptionsMethod: 'getFonts',
                                      },
                                      default: 'default',
                                      description: 'The font to use. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                  },
                              ],
                          },
                      ],
                  },
                  ...nodeOperationOptions,
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          hide: {
                              operation: ['information'],
                          },
                      },
                      options: [
                          {
                              displayName: 'File Name',
                              name: 'fileName',
                              type: 'string',
                              default: '',
                              description: 'File name to set in binary data',
                          },
                          {
                              displayName: 'Font Name or ID',
                              name: 'font',
                              type: 'options',
                              displayOptions: {
                                  show: {
                                      '/operation': ['text'],
                                  },
                              },
                              typeOptions: {
                                  loadOptionsMethod: 'getFonts',
                              },
                              default: 'default',
                              description: 'The font to use. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Format',
                              name: 'format',
                              type: 'options',
                              options: [
                                  {
                                      name: 'bmp',
                                      value: 'bmp',
                                  },
                                  {
                                      name: 'gif',
                                      value: 'gif',
                                  },
                                  {
                                      name: 'jpeg',
                                      value: 'jpeg',
                                  },
                                  {
                                      name: 'png',
                                      value: 'png',
                                  },
                                  {
                                      name: 'tiff',
                                      value: 'tiff',
                                  },
                                  {
                                      name: 'WebP',
                                      value: 'webp',
                                  },
                              ],
                              default: 'jpeg',
                              description: 'Set the output image format',
                          },
                          {
                              displayName: 'Quality',
                              name: 'quality',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              default: 100,
                              displayOptions: {
                                  show: {
                                      format: ['jpeg', 'png', 'tiff'],
                                  },
                              },
                              description: 'Sets the jpeg|png|tiff compression level from 0 to 100 (best)',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getFonts() {
                      const files = await (0, get_system_fonts_1.default)();
                      const returnData = [];
                      files.forEach((entry) => {
                          const pathParts = (0, path_1.parse)(entry);
                          if (!pathParts.ext) {
                              return;
                          }
                          returnData.push({
                              name: pathParts.name,
                              value: entry,
                          });
                      });
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      returnData.unshift({
                          name: 'default',
                          value: 'default',
                      });
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let item;
          for (let itemIndex = 0; itemIndex < length; itemIndex++) {
              try {
                  item = items[itemIndex];
                  const operation = this.getNodeParameter('operation', itemIndex);
                  const dataPropertyName = this.getNodeParameter('dataPropertyName', itemIndex);
                  const options = this.getNodeParameter('options', itemIndex, {});
                  const cleanupFunctions = [];
                  let gmInstance;
                  const requiredOperationParameters = {
                      blur: ['blur', 'sigma'],
                      border: ['borderColor', 'borderWidth', 'borderHeight'],
                      create: ['backgroundColor', 'height', 'width'],
                      crop: ['height', 'positionX', 'positionY', 'width'],
                      composite: ['dataPropertyNameComposite', 'operator', 'positionX', 'positionY'],
                      draw: [
                          'color',
                          'cornerRadius',
                          'endPositionX',
                          'endPositionY',
                          'primitive',
                          'startPositionX',
                          'startPositionY',
                      ],
                      information: [],
                      resize: ['height', 'resizeOption', 'width'],
                      rotate: ['backgroundColor', 'rotate'],
                      shear: ['degreesX', 'degreesY'],
                      text: ['font', 'fontColor', 'fontSize', 'lineLength', 'positionX', 'positionY', 'text'],
                      transparent: ['color'],
                  };
                  let operations = [];
                  if (operation === 'multiStep') {
                      const operationsData = this.getNodeParameter('operations', itemIndex, {
                          operations: [],
                      });
                      operations = operationsData.operations;
                  }
                  else {
                      const operationParameters = {};
                      requiredOperationParameters[operation].forEach((parameterName) => {
                          try {
                              operationParameters[parameterName] = this.getNodeParameter(parameterName, itemIndex);
                          }
                          catch (error) { }
                      });
                      operations = [
                          {
                              operation,
                              ...operationParameters,
                          },
                      ];
                  }
                  if (operations[0].operation !== 'create') {
                      this.helpers.assertBinaryData(itemIndex, dataPropertyName);
                      const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(itemIndex, dataPropertyName);
                      gmInstance = (0, gm_1.default)(binaryDataBuffer);
                      gmInstance = gmInstance.background('transparent');
                  }
                  const newItem = {
                      json: item.json,
                      binary: {},
                      pairedItem: {
                          item: itemIndex,
                      },
                  };
                  if (operation === 'information') {
                      const imageData = await new Promise((resolve, reject) => {
                          gmInstance = gmInstance.identify((error, data) => {
                              if (error) {
                                  reject(error);
                                  return;
                              }
                              resolve(data);
                          });
                      });
                      newItem.json = imageData;
                  }
                  for (let i = 0; i < operations.length; i++) {
                      const operationData = operations[i];
                      if (operationData.operation === 'blur') {
                          gmInstance = gmInstance.blur(operationData.blur, operationData.sigma);
                      }
                      else if (operationData.operation === 'border') {
                          gmInstance = gmInstance
                              .borderColor(operationData.borderColor)
                              .border(operationData.borderWidth, operationData.borderHeight);
                      }
                      else if (operationData.operation === 'composite') {
                          const positionX = operationData.positionX;
                          const positionY = operationData.positionY;
                          const operator = operationData.operator;
                          const geometryString = (positionX >= 0 ? '+' : '') + positionX + (positionY >= 0 ? '+' : '') + positionY;
                          const binaryPropertyName = operationData.dataPropertyNameComposite;
                          this.helpers.assertBinaryData(itemIndex, binaryPropertyName);
                          const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(itemIndex, binaryPropertyName);
                          const { fd, path, cleanup } = await (0, tmp_promise_1.file)();
                          cleanupFunctions.push(cleanup);
                          await fsWriteFileAsync(fd, binaryDataBuffer);
                          if (operations[0].operation === 'create') {
                              gmInstance = (0, gm_1.default)(gmInstance.stream('png'))
                                  .compose(operator)
                                  .geometry(geometryString)
                                  .composite(path);
                          }
                          else {
                              gmInstance = gmInstance.compose(operator).geometry(geometryString).composite(path);
                          }
                          if (operations.length !== i + 1) {
                              gmInstance = (0, gm_1.default)(gmInstance.stream());
                          }
                      }
                      else if (operationData.operation === 'create') {
                          gmInstance = (0, gm_1.default)(operationData.width, operationData.height, operationData.backgroundColor);
                          if (!options.format) {
                              options.format = 'png';
                          }
                      }
                      else if (operationData.operation === 'crop') {
                          gmInstance = gmInstance.crop(operationData.width, operationData.height, operationData.positionX, operationData.positionY);
                      }
                      else if (operationData.operation === 'draw') {
                          gmInstance = gmInstance.fill(operationData.color);
                          if (operationData.primitive === 'line') {
                              gmInstance = gmInstance.drawLine(operationData.startPositionX, operationData.startPositionY, operationData.endPositionX, operationData.endPositionY);
                          }
                          else if (operationData.primitive === 'circle') {
                              gmInstance = gmInstance.drawCircle(operationData.startPositionX, operationData.startPositionY, operationData.endPositionX, operationData.endPositionY);
                          }
                          else if (operationData.primitive === 'rectangle') {
                              gmInstance = gmInstance.drawRectangle(operationData.startPositionX, operationData.startPositionY, operationData.endPositionX, operationData.endPositionY, operationData.cornerRadius || undefined);
                          }
                      }
                      else if (operationData.operation === 'resize') {
                          const resizeOption = operationData.resizeOption;
                          let option = '@';
                          if (resizeOption === 'ignoreAspectRatio') {
                              option = '!';
                          }
                          else if (resizeOption === 'minimumArea') {
                              option = '^';
                          }
                          else if (resizeOption === 'onlyIfSmaller') {
                              option = '<';
                          }
                          else if (resizeOption === 'onlyIfLarger') {
                              option = '>';
                          }
                          else if (resizeOption === 'percent') {
                              option = '%';
                          }
                          gmInstance = gmInstance.resize(operationData.width, operationData.height, option);
                      }
                      else if (operationData.operation === 'rotate') {
                          gmInstance = gmInstance.rotate(operationData.backgroundColor, operationData.rotate);
                      }
                      else if (operationData.operation === 'shear') {
                          gmInstance = gmInstance.shear(operationData.degreesX, operationData.degreesY);
                      }
                      else if (operationData.operation === 'text') {
                          const lines = [];
                          let currentLine = '';
                          operationData.text.split('\n').forEach((textLine) => {
                              textLine.split(' ').forEach((textPart) => {
                                  if (currentLine.length + textPart.length + 1 >
                                      operationData.lineLength) {
                                      lines.push(currentLine.trim());
                                      currentLine = `${textPart} `;
                                      return;
                                  }
                                  currentLine += `${textPart} `;
                              });
                              lines.push(currentLine.trim());
                              currentLine = '';
                          });
                          const renderText = lines.join('\n');
                          const font = options.font || operationData.font;
                          if (font && font !== 'default') {
                              gmInstance = gmInstance.font(font);
                          }
                          gmInstance = gmInstance
                              .fill(operationData.fontColor)
                              .fontSize(operationData.fontSize)
                              .drawText(operationData.positionX, operationData.positionY, renderText);
                      }
                      else if (operationData.operation === 'transparent') {
                          gmInstance = gmInstance.transparent(operationData.color);
                      }
                  }
                  if (item.binary !== undefined && newItem.binary) {
                      Object.assign(newItem.binary, item.binary);
                      if (newItem.binary[dataPropertyName]) {
                          newItem.binary[dataPropertyName] = (0, n8n_workflow_1.deepCopy)(newItem.binary[dataPropertyName]);
                      }
                  }
                  if (newItem.binary[dataPropertyName] === undefined) {
                      newItem.binary[dataPropertyName] = {
                          data: '',
                          mimeType: '',
                      };
                  }
                  if (options.quality !== undefined) {
                      gmInstance = gmInstance.quality(options.quality);
                  }
                  if (options.format !== undefined) {
                      gmInstance = gmInstance.setFormat(options.format);
                      newItem.binary[dataPropertyName].fileExtension = options.format;
                      newItem.binary[dataPropertyName].mimeType = `image/${options.format}`;
                      const fileName = newItem.binary[dataPropertyName].fileName;
                      if (fileName === null || fileName === void 0 ? void 0 : fileName.includes('.')) {
                          newItem.binary[dataPropertyName].fileName =
                              fileName.split('.').slice(0, -1).join('.') + '.' + options.format;
                      }
                  }
                  if (options.fileName !== undefined) {
                      newItem.binary[dataPropertyName].fileName = options.fileName;
                  }
                  returnData.push(await new Promise((resolve, reject) => {
                      gmInstance.toBuffer(async (error, buffer) => {
                          cleanupFunctions.forEach(async (cleanup) => cleanup());
                          if (error) {
                              return reject(error);
                          }
                          const binaryData = await this.helpers.prepareBinaryData(Buffer.from(buffer));
                          newItem.binary[dataPropertyName] = {
                              ...newItem.binary[dataPropertyName],
                              ...binaryData,
                          };
                          return resolve(newItem);
                      });
                  }));
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.EditImage = EditImage;
  //# sourceMappingURL=EditImage.node.js.map

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

  # Edit Image

  Use the Edit Image node to manipulate and edit images.

  /// note | Dependencies
  1. If you aren't running n8n on Docker, you need to install [GraphicsMagick](http://www.graphicsmagick.org/README.html){:target=_blank .external-link}.
  2. You need to use a node such as the [Read/Write Files from Disk](/integrations/builtin/core-nodes/n8n-nodes-base.readwritefile.md) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/index.md) node to pass the image file as a data property to the Edit Image node.
  ///

  ## Operations

  - Add a **Blur** to the image to reduce sharpness
  - Add a **Border** to the image
  - **Composite** an image on top of another image
  - **Create** a new image
  - **Crop** the image
  - **Draw** on an image
  - **Get Information** about the image
  - **Multi Step** perform multiple operations on the image
  - **Resize**: Change the size of the image
  - **Rotate** the image
  - **Shear** image along the X or Y axis
  - Add **Text** to the image
  - Make a color in image **Transparent**

  ## Node parameters

  The parameters for this node depend on the operation you select.

  ### Blur parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Blur**: Enter a number to set how strong the blur should be, between 0 and 1000. Higher numbers create blurrier images.
  * **Sigma**: Enter a number to set the stigma for the blur, between 0 and 1000. Higher numbers create blurrier images.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Border parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Border Width**: Enter the width of the border.
  * **Border Height**: Enter the height of the border.
  * **Border Color**: Set the color for the border. You can either enter a hex or select the color swatch to open a color picker.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Composite parameters

  * **Property Name**: Enter the name of the binary property that stores the image data. This image is your base image.
  * **Composite Image Property**: Enter the name of the binary property that stores image to composite on top of the **Property Name** image.
  * **Operator**: Select composite operator, which determines how the composite works. Options include:
  	* **Add**
  	* **Atop**
  	* **Bumpmap**
  	* **Copy**
  	* **Copy Black**
  	* **Copy Blue**
  	* **Copy Cyan**
  	* **Copy Green**
  	* **Copy Magenta**
  	* **Copy Opacity**
  	* **Copy Red**
  	* **Copy Yellow**
  	* **Difference**
  	* **Divide**
  	* **In**
  	* **Minus**
  	* **Multiply**
  	* **Out**
  	* **Over**
  	* **Plus**
  	* **Subtract**
  	* **Xor**
  * **Position X**: Enter the x axis position (horizontal) of the composite image.
  * **Position Y**: Enter the y axis position (vertical) of the composite image.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Create parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Background Color**: Set the background color for the image. You can either enter a hex or select the color swatch to open a color picker.
  * **Image Width**: Enter the width of the image.
  * **Image Height**: Enter the height of the image.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Crop parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Width**: Enter the width you'd like to crop to.
  * **Height**: Enter the height you'd like to crop to.
  * **Position X**: Enter the x axis position (horizontal) to start the crop from.
  * **Position Y**: Enter the y axis position (vertical) to start the crop from.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Draw parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Primitive**: Select the primitive shape to draw. Choose from:
  	* **Circle**
  	* **Line**
  	* **Rectangle**
  * **Color**: Set the color for the primitive. You can either enter a hex or select the color swatch to open a color picker.
  * **Start Position X**: Enter the x axis position (horizontal) to start drawing from.
  * **Start Position Y**: Enter the y axis position (vertical) to start drawing from.
  * **End Position X**: Enter the x axis position (horizontal) to stop drawing at.
  * **End Position Y**: Enter the y axis position (vertical) to start drawing at.
  * **Corner Radius**: Enter a number to set the corner radius. Adding a corner radius will round the corners of the drawn primitive.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Get Information parameters

  For this operation, you only need to add the **Property Name** of the binary property that stores the image data.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Multi Step parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Operations**: Add the operations you want the multi step operation to perform. You can use any of the other operations.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Resize parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Width**: Enter the new width you'd like for the image.
  * **Height**: Enter the new height you'd like for the image.
  * **Option**: Select how you'd like to resize the image. Choose from:
  	* **Ignore Aspect Ratio**: Ignore the aspect ratio and resize to the exact height and width you've entered.
  	* **Maximum Area**: The height and width you've entered is the maximum area/size for the image. The image maintains its aspect ratio and won't be larger than the height and/or width you've entered.
  	* **Minimum Area**: The height and width you've entered is the minimum area/size for the image. The image maintains its aspect ratio and won't be smaller than the height and/or width you've entered.
  	* **Only if Larger**: Resize the image only if it's larger than the width and height you entered. The image maintains its aspect ratio.
  	* **Only if Smaller**: Resize the image only if it's smaller than the width and height you entered. The image maintains its aspect ratio.
  	* **Percent**: Resize the image using the width and height as percentages of the original image.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Rotate parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Rotate**: Enter the number of degrees to rotate the image, from --360 to 360.
  * **Background Color**: Set the background color for the image. You can either enter a hex or select the color swatch to open a color picker. This color is used to fill in the empty background whenever the image is rotated by multiples of 90 degrees. If multipled of 90 degrees are used for the **Rotate** field, the background color isn't used.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Shear parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Degrees X**: Enter the number of degrees to shear from the x axis.
  * **Degrees Y**: Enter the number of degrees to shear from the y axis.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Text parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Text**: Enter the text you'd like to write on the image.
  * **Font Size**: Select the font size for the text.
  * **Font Color**: Set the font color. You can either enter a hex or select the color swatch to open a color picker.
  * **Position X**: Enter the x axis position (horizontal) to begin the text at.
  * **Position Y**: Enter the y axis position (vertical) to begin the text at.
  * **Max Line Length**: Enter the maximum amount of characters in a line before adding a line break.

  Refer to [Node options](#node-options) for optional configuration options.

  ### Transparent parameters

  * **Property Name**: Enter the name of the binary property that stores the image data.
  * **Color**: Set the color to make transparent. You can either enter a hex or select the color swatch to open a color picker.

  Refer to [Node options](#node-options) for optional configuration options.

  ## Node options

  - **File Name**: Enter the filename of the output file.
  - **Format**: Enter the image format of the output file. Choose from:
  	- **bmp**
  	- **gif**
  	- **jpeg**
  	- **png**
  	- **tiff**
  	- **WebP**

  The **Text** operation also includes the option for **Font Name or ID**. Select the text font from the dropdown or specify an ID using an [expression](/code/expressions.md).

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"98ccb19d-fa84-4631-9331-e48bf623e2eb","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"2f714856278a760fe2bc486a027c28375c01989a50d34e4129352897b883b1e9"}}


node_type: n8n-nodes-base.Egoi
name: Egoi
display_name: E-goi
description: Consume E-goi API
category: Other
code_hash: 7959ec1b723673e5851fff364a8c113937b48cf3ed38305425b2874697670c8a
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/egoi
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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.Egoi = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Egoi {
      constructor() {
          this.description = {
              displayName: 'E-goi',
              name: 'egoi',
              icon: 'file:egoi.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume E-goi API',
              defaults: {
                  name: 'E-goi',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'egoiApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                      ],
                      default: 'contact',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a member',
                              action: 'Create a member',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a member',
                              action: 'Get a member',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many members',
                              action: 'Get many members',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a member',
                              action: 'Update a member',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                      },
                      displayOptions: {
                          show: {
                              operation: ['getAll', 'create', 'update', 'get'],
                          },
                      },
                      default: '',
                      description: 'ID of list to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                          },
                      },
                      default: '',
                      description: 'Email address for a subscriber',
                  },
                  {
                      displayName: 'Contact ID',
                      name: 'contactId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['update'],
                          },
                      },
                      default: '',
                      description: 'Contact ID of the subscriber',
                  },
                  {
                      displayName: 'Resolve Data',
                      name: 'resolveData',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['create', 'update'],
                          },
                      },
                      default: true,
                      description: 'By default the response just includes the contact ID. If this option gets activated, it will resolve the data automatically.',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['contact'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Birth Date',
                              name: 'birth_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Birth date of a subscriber',
                          },
                          {
                              displayName: 'Cellphone',
                              name: 'cellphone',
                              type: 'string',
                              default: '',
                              description: 'Cellphone of a subscriber',
                          },
                          {
                              displayName: 'Extra Fields',
                              name: 'extraFieldsUi',
                              type: 'fixedCollection',
                              placeholder: 'Add Field',
                              default: {},
                              typeOptions: {
                                  multipleValues: true,
                              },
                              options: [
                                  {
                                      displayName: 'Extra Field',
                                      name: 'extraFieldValues',
                                      typeOptions: {
                                          multipleValueButtonText: 'Add Field',
                                      },
                                      values: [
                                          {
                                              displayName: 'Field Name or ID',
                                              name: 'field_id',
                                              type: 'options',
                                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getExtraFields',
                                                  loadOptionsDependsOn: ['list'],
                                              },
                                              default: '',
                                          },
                                          {
                                              displayName: 'Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'First Name',
                              name: 'first_name',
                              type: 'string',
                              default: '',
                              description: 'Name of a subscriber',
                          },
                          {
                              displayName: 'Last Name',
                              name: 'last_name',
                              type: 'string',
                              default: '',
                              description: 'Name of a subscriber',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Unconfirmed',
                                      value: 'unconfirmed',
                                  },
                                  {
                                      name: 'Active',
                                      value: 'active',
                                  },
                                  {
                                      name: 'Inactive',
                                      value: 'inactive',
                                  },
                                  {
                                      name: 'Removed',
                                      value: 'removed',
                                  },
                              ],
                              default: 'active',
                              description: "Subscriber's current status",
                          },
                          {
                              displayName: 'Tag Names or IDs',
                              name: 'tagIds',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getListTags',
                              },
                              default: [],
                              description: 'List of tag IDs to be added. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Birth Date',
                              name: 'birth_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Birth date of subscriber',
                          },
                          {
                              displayName: 'Cellphone',
                              name: 'cellphone',
                              type: 'string',
                              default: '',
                              description: 'Cellphone of subscriber',
                          },
                          {
                              displayName: 'Email',
                              name: 'email',
                              type: 'string',
                              placeholder: 'name@email.com',
                              default: '',
                              description: 'Email address for subscriber',
                          },
                          {
                              displayName: 'Extra Fields',
                              name: 'extraFieldsUi',
                              type: 'fixedCollection',
                              placeholder: 'Add Field',
                              default: {},
                              typeOptions: {
                                  multipleValues: true,
                              },
                              options: [
                                  {
                                      displayName: 'Extra Field',
                                      name: 'extraFieldValues',
                                      typeOptions: {
                                          multipleValueButtonText: 'Add Field',
                                      },
                                      values: [
                                          {
                                              displayName: 'Field Name or ID',
                                              name: 'field_id',
                                              type: 'options',
                                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getExtraFields',
                                                  loadOptionsDependsOn: ['list'],
                                              },
                                              default: '',
                                          },
                                          {
                                              displayName: 'Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'First Name',
                              name: 'first_name',
                              type: 'string',
                              default: '',
                              description: 'Name of subscriber',
                          },
                          {
                              displayName: 'Last Name',
                              name: 'last_name',
                              type: 'string',
                              default: '',
                              description: 'Name of subscriber',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Unconfirmed',
                                      value: 'unconfirmed',
                                  },
                                  {
                                      name: 'Active',
                                      value: 'active',
                                  },
                                  {
                                      name: 'Inactive',
                                      value: 'inactive',
                                  },
                                  {
                                      name: 'Removed',
                                      value: 'removed',
                                  },
                              ],
                              default: 'active',
                              description: "Subscriber's current status",
                          },
                          {
                              displayName: 'Tag Names or IDs',
                              name: 'tagIds',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getListTags',
                              },
                              default: [],
                              description: 'List of tag IDs to be added. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'By',
                      name: 'by',
                      type: 'options',
                      options: [
                          {
                              name: 'Contact ID',
                              value: 'id',
                          },
                          {
                              name: 'Email',
                              value: 'email',
                          },
                      ],
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['contact'],
                          },
                      },
                      default: 'id',
                      description: 'Search by',
                  },
                  {
                      displayName: 'Contact ID',
                      name: 'contactId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['get'],
                              by: ['id'],
                          },
                      },
                      default: '',
                      description: 'Contact ID of the subscriber',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['get'],
                              by: ['email'],
                          },
                      },
                      default: '',
                      description: 'Email address for subscriber',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['contact'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['contact'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 500,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Simplify',
                      name: 'simple',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['get', 'getAll'],
                              resource: ['contact'],
                          },
                      },
                      default: true,
                      description: 'Whether to return a simplified version of the response instead of the raw data',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLists() {
                      const returnData = [];
                      const lists = await GenericFunctions_1.egoiApiRequestAllItems.call(this, 'items', 'GET', '/lists');
                      for (const list of lists) {
                          const listName = list.internal_name;
                          const listId = list.list_id;
                          returnData.push({
                              name: listName,
                              value: listId,
                          });
                      }
                      return returnData;
                  },
                  async getExtraFields() {
                      const returnData = [];
                      const listId = this.getCurrentNodeParameter('list');
                      const extraFields = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', `/lists/${listId}/fields`);
                      for (const field of extraFields) {
                          if (field.type === 'extra') {
                              const fieldName = field.name;
                              const fieldId = field.field_id;
                              returnData.push({
                                  name: fieldName,
                                  value: fieldId,
                              });
                          }
                      }
                      return returnData;
                  },
                  async getListTags() {
                      const returnData = [];
                      const tagList = await GenericFunctions_1.egoiApiRequestAllItems.call(this, 'items', 'GET', '/tags');
                      for (const tag of tagList) {
                          const tagName = tag.name;
                          const tagId = tag.tag_id;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          let responseData;
          const returnData = [];
          const items = this.getInputData();
          const length = items.length;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'contact') {
                      if (operation === 'create') {
                          const listId = this.getNodeParameter('list', i);
                          const email = this.getNodeParameter('email', i);
                          const resolveData = this.getNodeParameter('resolveData', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              base: {
                                  email,
                              },
                              extra: [],
                          };
                          if (additionalFields.birth_date) {
                              additionalFields.birth_date = (0, moment_timezone_1.default)(additionalFields.birth_date).format('YYYY-MM-DD');
                          }
                          if (additionalFields.extraFieldsUi) {
                              const extraFields = additionalFields.extraFieldsUi
                                  .extraFieldValues;
                              if (extraFields) {
                                  body.extra = extraFields;
                              }
                          }
                          Object.assign(body.base, additionalFields);
                          responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'POST', `/lists/${listId}/contacts`, body);
                          const contactId = responseData.contact_id;
                          if (additionalFields.tagIds) {
                              const tags = additionalFields.tagIds;
                              for (const tag of tags) {
                                  await GenericFunctions_1.egoiApiRequest.call(this, 'POST', `/lists/${listId}/contacts/actions/attach-tag`, { tag_id: tag, contacts: [contactId] });
                              }
                          }
                          if (resolveData) {
                              responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', `/lists/${listId}/contacts/${contactId}`);
                          }
                      }
                      if (operation === 'get') {
                          const listId = this.getNodeParameter('list', i);
                          const simple = this.getNodeParameter('simple', i);
                          const by = this.getNodeParameter('by', 0);
                          let endpoint = '';
                          if (by === 'id') {
                              const contactId = this.getNodeParameter('contactId', i);
                              endpoint = `/lists/${listId}/contacts/${contactId}`;
                          }
                          else {
                              const email = this.getNodeParameter('email', i);
                              endpoint = `/lists/${listId}/contacts?email=${email}`;
                          }
                          responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', endpoint, {});
                          if (responseData.items) {
                              responseData = responseData.items;
                          }
                          if (simple) {
                              const data = (await GenericFunctions_1.simplify.call(this, [responseData], listId))[0];
                              responseData = {
                                  ...data,
                                  email_stats: responseData.email_stats,
                                  sms_stats: responseData.sms_stats,
                                  push_stats: responseData.push_stats,
                                  webpush_stats: responseData.webpush_stats,
                                  voice_stats: responseData.voice_stats,
                              };
                          }
                      }
                      if (operation === 'getAll') {
                          const listId = this.getNodeParameter('list', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const simple = this.getNodeParameter('simple', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.egoiApiRequestAllItems.call(this, 'items', 'GET', `/lists/${listId}/contacts`, {});
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', `/lists/${listId}/contacts`, {}, { limit });
                              responseData = responseData.items;
                          }
                          if (simple) {
                              responseData = await GenericFunctions_1.simplify.call(this, responseData, listId);
                          }
                      }
                      if (operation === 'update') {
                          const listId = this.getNodeParameter('list', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          const resolveData = this.getNodeParameter('resolveData', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              base: {},
                              extra: [],
                          };
                          if (updateFields.birth_date) {
                              updateFields.birth_date = (0, moment_timezone_1.default)(updateFields.birth_date).format('YYYY-MM-DD');
                          }
                          if (updateFields.extraFieldsUi) {
                              const extraFields = updateFields.extraFieldsUi
                                  .extraFieldValues;
                              if (extraFields) {
                                  body.extra = extraFields;
                              }
                          }
                          Object.assign(body.base, updateFields);
                          responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'PATCH', `/lists/${listId}/contacts/${contactId}`, body);
                          if (updateFields.tagIds) {
                              const tags = updateFields.tagIds;
                              for (const tag of tags) {
                                  await GenericFunctions_1.egoiApiRequest.call(this, 'POST', `/lists/${listId}/contacts/actions/attach-tag`, { tag_id: tag, contacts: [contactId] });
                              }
                          }
                          if (resolveData) {
                              responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', `/lists/${listId}/contacts/${contactId}`);
                          }
                      }
                  }
              }
              catch (error) {
                  if (!this.continueOnFail()) {
                      throw error;
                  }
                  else {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Egoi = Egoi;
  //# sourceMappingURL=Egoi.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: E-goi credentials
  description: Documentation for E-goi credentials. Use these credentials to authenticate E-goi in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # E-goi credentials

  You can use these credentials to authenticate the following nodes:

  - [E-goi](/integrations/builtin/app-nodes/n8n-nodes-base.egoi.md)

  ## Prerequisites

  Create an [E-goi](https://www.e-goi.com/) account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [E-goi's API documentation](https://developers.e-goi.com/api/v3/){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Refer to [E-goi's API key documentation](https://helpdesk.e-goi.com/511369-Whats-E-gois-API-and-where-do-I-find-my-API-key){:target=_blank .external-link} for instructions on generating and viewing an API key.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"2ef1a8c2-2bcd-4162-9145-6dda51ae0e2b","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"bb96681fd798054e8d4bfcc73839ab5546a4fe5f283026dfce9cab96865e90a3"}}


node_type: n8n-nodes-base.ElasticSecurity
name: ElasticSecurity
display_name: Elastic Security
description: Consume the Elastic Security API
category: Other
code_hash: d63c1501e626316617d40fe0f6070a3506e512574eba3c6663360949ee49cb87
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/elasticsecurity
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ElasticSecurity = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class ElasticSecurity {
      constructor() {
          this.description = {
              displayName: 'Elastic Security',
              name: 'elasticSecurity',
              icon: 'file:elasticSecurity.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Elastic Security API',
              defaults: {
                  name: 'Elastic Security',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'elasticSecurityApi',
                      required: true,
                      testedBy: 'elasticSecurityApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'options',
                      options: [
                          {
                              name: 'Case',
                              value: 'case',
                          },
                          {
                              name: 'Case Comment',
                              value: 'caseComment',
                          },
                          {
                              name: 'Case Tag',
                              value: 'caseTag',
                          },
                          {
                              name: 'Connector',
                              value: 'connector',
                          },
                      ],
                      default: 'case',
                  },
                  ...descriptions_1.caseOperations,
                  ...descriptions_1.caseFields,
                  ...descriptions_1.caseCommentOperations,
                  ...descriptions_1.caseCommentFields,
                  ...descriptions_1.caseTagOperations,
                  ...descriptions_1.caseTagFields,
                  ...descriptions_1.connectorOperations,
                  ...descriptions_1.connectorFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTags() {
                      const tags = (await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', '/cases/tags'));
                      return tags.map((tag) => ({ name: tag, value: tag }));
                  },
                  async getConnectors() {
                      const endpoint = '/cases/configure/connectors/_find';
                      const connectors = (await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', endpoint));
                      return connectors.map(({ name, id }) => ({ name, value: id }));
                  },
              },
              credentialTest: {
                  async elasticSecurityApiTest(credential) {
                      const { username, password, baseUrl: rawBaseUrl, } = credential.data;
                      const baseUrl = (0, GenericFunctions_1.tolerateTrailingSlash)(rawBaseUrl);
                      const token = Buffer.from(`${username}:${password}`).toString('base64');
                      const endpoint = '/cases/status';
                      const options = {
                          headers: {
                              Authorization: `Basic ${token}`,
                              'kbn-xsrf': true,
                          },
                          method: 'GET',
                          body: {},
                          qs: {},
                          uri: `${baseUrl}/api${endpoint}`,
                          json: true,
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          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 === 'case') {
                      if (operation === 'create') {
                          const body = {
                              title: this.getNodeParameter('title', i),
                              connector: {},
                              owner: 'securitySolution',
                              description: '',
                              tags: [],
                              settings: {
                                  syncAlerts: this.getNodeParameter('additionalFields.syncAlerts', i, false),
                              },
                          };
                          const connectorId = this.getNodeParameter('connectorId', i);
                          const { id: fetchedId, name: fetchedName, type: fetchedType, } = await GenericFunctions_1.getConnector.call(this, connectorId);
                          const selectedConnectorType = this.getNodeParameter('connectorType', i);
                          if (fetchedType !== selectedConnectorType) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Connector Type does not match the type of the connector in Connector Name', { itemIndex: i });
                          }
                          const connector = {
                              id: fetchedId,
                              name: fetchedName,
                              type: fetchedType,
                              fields: {},
                          };
                          if (selectedConnectorType === '.jira') {
                              connector.fields = {
                                  issueType: this.getNodeParameter('issueType', i),
                                  priority: this.getNodeParameter('priority', i),
                                  parent: null,
                              };
                          }
                          else if (selectedConnectorType === '.servicenow') {
                              connector.fields = {
                                  urgency: this.getNodeParameter('urgency', i),
                                  severity: this.getNodeParameter('severity', i),
                                  impact: this.getNodeParameter('impact', i),
                                  category: this.getNodeParameter('category', i),
                                  subcategory: null,
                              };
                          }
                          else if (selectedConnectorType === '.resilient') {
                              const rawIssueTypes = this.getNodeParameter('issueTypes', i);
                              connector.fields = {
                                  issueTypes: rawIssueTypes.split(',').map(Number),
                                  severityCode: this.getNodeParameter('severityCode', i),
                                  incidentTypes: null,
                              };
                          }
                          body.connector = connector;
                          const { syncAlerts, ...rest } = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'POST', '/cases', body);
                      }
                      else if (operation === 'delete') {
                          const caseId = this.getNodeParameter('caseId', i);
                          await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'DELETE', `/cases?ids=["${caseId}"]`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const caseId = this.getNodeParameter('caseId', i);
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const { tags, status } = this.getNodeParameter('filters', i);
                          const sortOptions = this.getNodeParameter('sortOptions', i);
                          qs.sortField = (_a = sortOptions.sortField) !== null && _a !== void 0 ? _a : 'createdAt';
                          qs.sortOrder = (_b = sortOptions.sortOrder) !== null && _b !== void 0 ? _b : 'asc';
                          if (status) {
                              qs.status = status;
                          }
                          if (tags === null || tags === void 0 ? void 0 : tags.length) {
                              qs.tags = tags.join(',');
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/cases/_find', {}, qs);
                      }
                      else if (operation === 'getStatus') {
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', '/cases/status');
                      }
                      else if (operation === 'update') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { syncAlerts, ...rest } = updateFields;
                          Object.assign(body, {
                              cases: [
                                  {
                                      id: caseId,
                                      version: await GenericFunctions_1.getVersion.call(this, `/cases/${caseId}`),
                                      ...(syncAlerts && { settings: { syncAlerts } }),
                                      ...rest,
                                  },
                              ],
                          });
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'PATCH', '/cases', body);
                      }
                  }
                  else if (resource === 'caseTag') {
                      if (operation === 'add') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const { title, connector, owner, description, settings, tags } = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`);
                          const tagToAdd = this.getNodeParameter('tag', i);
                          if (tags.includes(tagToAdd)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Cannot add tag "${tagToAdd}" to case ID ${caseId} because this case already has this tag.`, { itemIndex: i });
                          }
                          const body = {};
                          Object.assign(body, {
                              cases: [
                                  {
                                      id: caseId,
                                      title,
                                      connector,
                                      owner,
                                      description,
                                      settings,
                                      version: await GenericFunctions_1.getVersion.call(this, `/cases/${caseId}`),
                                      tags: [...tags, tagToAdd],
                                  },
                              ],
                          });
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'PATCH', '/cases', body);
                      }
                      else if (operation === 'remove') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const tagToRemove = this.getNodeParameter('tag', i);
                          const { title, connector, owner, description, settings, tags } = (await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`));
                          if (!tags.includes(tagToRemove)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Cannot remove tag "${tagToRemove}" from case ID ${caseId} because this case does not have this tag.`, { itemIndex: i });
                          }
                          const body = {};
                          Object.assign(body, {
                              cases: [
                                  {
                                      id: caseId,
                                      title,
                                      connector,
                                      owner,
                                      description,
                                      settings,
                                      version: await GenericFunctions_1.getVersion.call(this, `/cases/${caseId}`),
                                      tags: tags.filter((tag) => tag !== tagToRemove),
                                  },
                              ],
                          });
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'PATCH', '/cases', body);
                      }
                  }
                  else if (resource === 'caseComment') {
                      if (operation === 'add') {
                          const simple = this.getNodeParameter('simple', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              comment: this.getNodeParameter('comment', i),
                              type: 'user',
                              owner: additionalFields.owner || 'securitySolution',
                          };
                          const caseId = this.getNodeParameter('caseId', i);
                          const endpoint = `/cases/${caseId}/comments`;
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'POST', endpoint, body);
                          if (simple) {
                              const { comments } = responseData;
                              responseData = comments[comments.length - 1];
                          }
                      }
                      else if (operation === 'get') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const commentId = this.getNodeParameter('commentId', i);
                          const endpoint = `/cases/${caseId}/comments/${commentId}`;
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const endpoint = `/cases/${caseId}/comments`;
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'remove') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const commentId = this.getNodeParameter('commentId', i);
                          const endpoint = `/cases/${caseId}/comments/${commentId}`;
                          await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'update') {
                          const simple = this.getNodeParameter('simple', i);
                          const caseId = this.getNodeParameter('caseId', i);
                          const commentId = this.getNodeParameter('commentId', i);
                          const body = {
                              comment: this.getNodeParameter('comment', i),
                              id: commentId,
                              type: 'user',
                              owner: 'securitySolution',
                              version: await GenericFunctions_1.getVersion.call(this, `/cases/${caseId}/comments/${commentId}`),
                          };
                          const patchEndpoint = `/cases/${caseId}/comments`;
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'PATCH', patchEndpoint, body);
                          if (simple) {
                              const { comments } = responseData;
                              responseData = comments[comments.length - 1];
                          }
                      }
                  }
                  else if (resource === 'connector') {
                      if (operation === 'create') {
                          const connectorType = this.getNodeParameter('connectorType', i);
                          const body = {
                              connector_type_id: connectorType,
                              name: this.getNodeParameter('name', i),
                          };
                          if (connectorType === '.jira') {
                              body.config = {
                                  apiUrl: this.getNodeParameter('apiUrl', i),
                                  projectKey: this.getNodeParameter('projectKey', i),
                              };
                              body.secrets = {
                                  email: this.getNodeParameter('email', i),
                                  apiToken: this.getNodeParameter('apiToken', i),
                              };
                          }
                          else if (connectorType === '.resilient') {
                              body.config = {
                                  apiUrl: this.getNodeParameter('apiUrl', i),
                                  orgId: this.getNodeParameter('orgId', i),
                              };
                              body.secrets = {
                                  apiKeyId: this.getNodeParameter('apiKeyId', i),
                                  apiKeySecret: this.getNodeParameter('apiKeySecret', i),
                              };
                          }
                          else if (connectorType === '.servicenow') {
                              body.config = {
                                  apiUrl: this.getNodeParameter('apiUrl', i),
                              };
                              body.secrets = {
                                  username: this.getNodeParameter('username', i),
                                  password: this.getNodeParameter('password', i),
                              };
                          }
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'POST', '/actions/connector', 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.ElasticSecurity = ElasticSecurity;
  //# sourceMappingURL=ElasticSecurity.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Elastic Security credentials
  description: Documentation for Elastic Security credentials. Use these credentials to authenticate Elastic Security in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Elastic Security credentials

  You can use these credentials to authenticate the following nodes:

  - [Elastic Security](/integrations/builtin/app-nodes/n8n-nodes-base.elasticsecurity.md)

  ## Prerequisites

  - Create an [Elastic Security](https://www.elastic.co/security) account.
  - [Deploy](https://www.elastic.co/guide/en/cloud/current/ec-create-deployment.html) an application.

  ## Supported authentication methods

  - Basic auth
  - API Key

  ## Related resources

  Refer to [Elastic Security's documentation](https://www.elastic.co/guide/en/security/current/es-overview.html){:target=_blank .external-link} for more information about the service.

  ## Using basic auth

  To configure this credential, you'll need:

  - A **Username**: For the user account you log into Elasticsearch with.
  - A **Password**: For the user account you log into Elasticsearch with.
  - Your Elasticsearch application's **Base URL** (also known as the Elasticsearch application endpoint):

      1. In Elasticsearch, select the option to **Manage this deployment**.
      2. In the **Applications** section, copy the endpoint of the **Elasticsearch** application.
      3. Add this in n8n as the **Base URL**.

  /// note | Custom endpoint aliases
  If you add a [custom endpoint alias](https://www.elastic.co/guide/en/cloud/current/ec-regional-deployment-aliases.html){:target=_blank .external-link} to a deployment, update your n8n credential **Base URL** with the new endpoint.
  ///

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: For the user account you log into Elasticsearch with. Refer to Elasticsearch's [Create API key documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html){:target=_blank .external-link} for more information.
  - Your Elasticsearch application's **Base URL** (also known as the Elasticsearch application endpoint):

      1. In Elasticsearch, select the option to **Manage this deployment**.
      2. In the **Applications** section, copy the endpoint of the **Elasticsearch** application.
      3. Add this in n8n as the **Base URL**.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"15d2c73e-f12b-406a-88a3-00b90738d7fb","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"cb4ea0e190d086800ee7b7935c2f48d74011dd775005ce43d2463e788c8c5406"}}


node_type: n8n-nodes-base.Elasticsearch
name: Elasticsearch
display_name: Elasticsearch
description: Consume the Elasticsearch API
category: Other
code_hash: 1a912478e4feb858d6fae8d87b347488d464bc2349ae630d36f52c53db076273
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/elasticsearch
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
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.Elasticsearch = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  const omit_1 = __importDefault(require("lodash/omit"));
  class Elasticsearch {
      constructor() {
          this.description = {
              displayName: 'Elasticsearch',
              name: 'elasticsearch',
              icon: 'file:elasticsearch.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Elasticsearch API',
              defaults: {
                  name: 'Elasticsearch',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'elasticsearchApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Document',
                              value: 'document',
                          },
                          {
                              name: 'Index',
                              value: 'index',
                          },
                      ],
                      default: 'document',
                  },
                  ...descriptions_1.documentOperations,
                  ...descriptions_1.documentFields,
                  ...descriptions_1.indexOperations,
                  ...descriptions_1.indexFields,
              ],
          };
      }
      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++) {
              if (resource === 'document') {
                  if (operation === 'delete') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const documentId = this.getNodeParameter('documentId', i);
                      const endpoint = `/${indexId}/_doc/${documentId}`;
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'DELETE', endpoint);
                  }
                  else if (operation === 'get') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const documentId = this.getNodeParameter('documentId', i);
                      const qs = {};
                      const options = this.getNodeParameter('options', i);
                      if (Object.keys(options).length) {
                          Object.assign(qs, options);
                          qs._source = true;
                      }
                      const endpoint = `/${indexId}/_doc/${documentId}`;
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', endpoint, {}, qs);
                      const simple = this.getNodeParameter('simple', i);
                      if (simple) {
                          responseData = {
                              _id: responseData._id,
                              ...responseData._source,
                          };
                      }
                  }
                  else if (operation === 'getAll') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const body = {};
                      const qs = {};
                      const options = this.getNodeParameter('options', i);
                      if (Object.keys(options).length) {
                          const { query, ...rest } = options;
                          if (query) {
                              Object.assign(body, (0, n8n_workflow_1.jsonParse)(query, { errorMessage: "Invalid JSON in 'Query' option" }));
                          }
                          Object.assign(qs, rest);
                          qs._source = true;
                      }
                      const returnAll = this.getNodeParameter('returnAll', 0);
                      if (returnAll) {
                          qs.size = 10000;
                          if (qs.sort) {
                              responseData = await GenericFunctions_1.elasticsearchApiRequestAllItems.call(this, indexId, body, qs);
                          }
                          else {
                              responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', `/${indexId}/_search`, body, qs);
                              responseData = responseData.hits.hits;
                          }
                      }
                      else {
                          qs.size = this.getNodeParameter('limit', 0);
                          responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', `/${indexId}/_search`, body, qs);
                          responseData = responseData.hits.hits;
                      }
                      const simple = this.getNodeParameter('simple', 0);
                      if (simple) {
                          responseData = responseData.map((item) => {
                              return {
                                  _id: item._id,
                                  ...item._source,
                              };
                          });
                      }
                  }
                  else if (operation === 'create') {
                      const body = {};
                      const dataToSend = this.getNodeParameter('dataToSend', 0);
                      if (dataToSend === 'defineBelow') {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          fields.forEach(({ fieldId, fieldValue }) => (body[fieldId] = fieldValue));
                      }
                      else {
                          const inputData = items[i].json;
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputsToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of Object.keys(inputData)) {
                              if (inputsToIgnore.includes(key))
                                  continue;
                              body[key] = inputData[key];
                          }
                      }
                      const qs = {};
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (Object.keys(additionalFields).length) {
                          Object.assign(qs, (0, omit_1.default)(additionalFields, ['documentId']));
                      }
                      const indexId = this.getNodeParameter('indexId', i);
                      const { documentId } = additionalFields;
                      if (documentId) {
                          const endpoint = `/${indexId}/_doc/${documentId}`;
                          responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'PUT', endpoint, body);
                      }
                      else {
                          const endpoint = `/${indexId}/_doc`;
                          responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'POST', endpoint, body);
                      }
                  }
                  else if (operation === 'update') {
                      const body = { doc: {} };
                      const dataToSend = this.getNodeParameter('dataToSend', 0);
                      if (dataToSend === 'defineBelow') {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          fields.forEach(({ fieldId, fieldValue }) => (body.doc[fieldId] = fieldValue));
                      }
                      else {
                          const inputData = items[i].json;
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputsToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of Object.keys(inputData)) {
                              if (inputsToIgnore.includes(key))
                                  continue;
                              body.doc[key] = inputData[key];
                          }
                      }
                      const indexId = this.getNodeParameter('indexId', i);
                      const documentId = this.getNodeParameter('documentId', i);
                      const endpoint = `/${indexId}/_update/${documentId}`;
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'POST', endpoint, body);
                  }
              }
              else if (resource === 'index') {
                  if (operation === 'create') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const body = {};
                      const qs = {};
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (Object.keys(additionalFields).length) {
                          const { aliases, mappings, settings, ...rest } = additionalFields;
                          Object.assign(body, aliases, mappings, settings);
                          Object.assign(qs, rest);
                      }
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'PUT', `/${indexId}`);
                      responseData = { id: indexId, ...responseData };
                      delete responseData.index;
                  }
                  else if (operation === 'delete') {
                      const indexId = this.getNodeParameter('indexId', i);
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'DELETE', `/${indexId}`);
                      responseData = { success: true };
                  }
                  else if (operation === 'get') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const qs = {};
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (Object.keys(additionalFields).length) {
                          Object.assign(qs, additionalFields);
                      }
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', `/${indexId}`, {}, qs);
                      responseData = { id: indexId, ...responseData[indexId] };
                  }
                  else if (operation === 'getAll') {
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', '/_aliases');
                      responseData = Object.keys(responseData).map((index) => ({
                          indexId: index,
                      }));
                      const returnAll = this.getNodeParameter('returnAll', i);
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', i);
                          responseData = responseData.slice(0, limit);
                      }
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Elasticsearch = Elasticsearch;
  //# sourceMappingURL=Elasticsearch.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Elasticsearch credentials
  description: Documentation for Elasticsearch credentials. Use these credentials to authenticate Elasticsearch in n8n, a workflow automation platform.
  contentType: [integration, reference]
  priority: medium
  ---

  # Elasticsearch credentials

  You can use these credentials to authenticate the following nodes:

  - [Elasticsearch](/integrations/builtin/app-nodes/n8n-nodes-base.elasticsearch.md)

  ## Supported authentication methods

  - Basic auth

  ## Related resources

  Refer to [Elasticsearch's documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html){:target=_blank .external-link} for more information about the service.

  ## Using basic auth

  To configure this credential, you'll need an [Elasticsearch](https://www.elastic.co/){:target=_blank .external-link} account with a [deployment](https://www.elastic.co/guide/en/cloud/current/ec-create-deployment.html){:target=_blank .external-link} and:

  - A **Username**
  - A **Password**
  - Your Elasticsearch application's **Base URL** (also known as the Elasticsearch application endpoint)

  To set up the credential:

  1. Enter your Elasticsearch **Username**.
  2. Enter your Elasticsearch **Password**.
  3. In Elasticsearch, go to **Deployments**.
  4. Select your deployment.
  5. Select **Manage this deployment**.
  6. In the **Applications** section, copy the endpoint of the **Elasticsearch** application.
  7. Enter this in n8n as the **Base URL**.
  8. By default, n8n connects only if SSL certificate validation succeeds. If you'd like to connect even if SSL certificate validation fails, turn on **Ignore SSL Issues**.

  /// note | Custom endpoint aliases
  If you add a [custom endpoint alias](https://www.elastic.co/guide/en/cloud/current/ec-regional-deployment-aliases.html){:target=_blank .external-link} to a deployment, update your n8n credential **Base URL** with the new endpoint.
  ///

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"d9414c6e-dc4b-4b21-a42b-281538b8c4f1","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"2072a199116d60a58200487b1efe959f3159678da0f96aaf4ce68096414b22b6"}}


node_type: n8n-nodes-base.EmailSend
name: EmailSend
display_name: Send Email
description: Sends an email using SMTP protocol
category: Other
code_hash: d76e18808343c4d0a7c35db3213e8e69bdb684cdda5c613e60b184da12c76b4c
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:21
updated_at: 2025-06-08 08:05:21
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.EmailSend = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const EmailSendV1_node_1 = require("./v1/EmailSendV1.node");
  const EmailSendV2_node_1 = require("./v2/EmailSendV2.node");
  class EmailSend extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Send Email',
              name: 'emailSend',
              icon: 'fa:envelope',
              group: ['output'],
              defaultVersion: 2.1,
              description: 'Sends an email using SMTP protocol',
          };
          const nodeVersions = {
              1: new EmailSendV1_node_1.EmailSendV1(baseDescription),
              2: new EmailSendV2_node_1.EmailSendV2(baseDescription),
              2.1: new EmailSendV2_node_1.EmailSendV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.EmailSend = EmailSend;
  //# sourceMappingURL=EmailSend.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"9e5ffefb-2a89-4c51-ada1-0f982ca421e9","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"31f41ffd8cc42658e066c0e5083bfc2d6d8d5b9d6b229715cf051eed0f3eeea2"}}


node_type: n8n-nodes-base.Emelia
name: Emelia
display_name: Emelia
description: Consume the Emelia API
category: Other
code_hash: 6766c6cf35962c2279f103df5e159989ed84476fefdc6612dc6e482526b19271
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/emelia
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:21
updated_at: 2025-06-08 08:05:21
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.Emelia = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const CampaignDescription_1 = require("./CampaignDescription");
  const ContactListDescription_1 = require("./ContactListDescription");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  class Emelia {
      constructor() {
          this.description = {
              displayName: 'Emelia',
              name: 'emelia',
              icon: 'file:emelia.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Emelia API',
              defaults: {
                  name: 'Emelia',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'emeliaApi',
                      required: true,
                      testedBy: 'emeliaApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Campaign',
                              value: 'campaign',
                          },
                          {
                              name: 'Contact List',
                              value: 'contactList',
                          },
                      ],
                      default: 'campaign',
                      required: true,
                  },
                  ...CampaignDescription_1.campaignOperations,
                  ...CampaignDescription_1.campaignFields,
                  ...ContactListDescription_1.contactListOperations,
                  ...ContactListDescription_1.contactListFields,
              ],
          };
          this.methods = {
              credentialTest: {
                  emeliaApiTest: GenericFunctions_1.emeliaApiTest,
              },
              loadOptions: {
                  async getCampaigns() {
                      return GenericFunctions_1.loadResource.call(this, 'campaign');
                  },
                  async getContactLists() {
                      return GenericFunctions_1.loadResource.call(this, 'contactList');
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'campaign') {
                      if (operation === 'addContact') {
                          const contact = {
                              email: this.getNodeParameter('contactEmail', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(contact, 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.fieldName}`]: value.value }), {});
                              Object.assign(contact, data);
                              delete contact.customFieldsUi;
                          }
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation AddContactToCampaignHook($id: ID!, $contact: JSON!) {
  										addContactToCampaignHook(id: $id, contact: $contact)
  								}`,
                              operationName: 'AddContactToCampaignHook',
                              variables: {
                                  id: this.getNodeParameter('campaignId', i),
                                  contact,
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({
                              contactId: responseData.data.addContactToCampaignHook,
                          }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'create') {
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              operationName: 'createCampaign',
                              query: `
  									mutation createCampaign($name: String!) {
  										createCampaign(name: $name) {
  											_id
  											name
  											status
  											createdAt
  											provider
  											startAt
  											estimatedEnd
  										}
  									}`,
                              variables: {
                                  name: this.getNodeParameter('campaignName', i),
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.data.createCampaign), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'get') {
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									query campaign($id: ID!){
  										campaign(id: $id){
  											_id
  											name
  											status
  											createdAt
  											schedule{
  												dailyContact
  												dailyLimit
  												minInterval
  												maxInterval
  												trackLinks
  												trackOpens
  												timeZone
  												days
  												start
  												end
  												eventToStopMails
  											}
  											provider
  											startAt
  											recipients{
  												total_count
  											}
  											estimatedEnd
  										}
  									}`,
                              operationName: 'campaign',
                              variables: {
                                  id: this.getNodeParameter('campaignId', i),
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.data.campaign), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'getAll') {
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									query all_campaigns {
  										all_campaigns {
  											_id
  											name
  											status
  											createdAt
  											stats {
  												mailsSent
  												uniqueOpensPercent
  												opens
  												linkClickedPercent
  												repliedPercent
  												bouncedPercent
  												unsubscribePercent
  												progressPercent
  											}
  										}
  									}`,
                              operationName: 'all_campaigns',
                          });
                          let campaigns = responseData.data.all_campaigns;
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              campaigns = campaigns.slice(0, limit);
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(campaigns), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'pause') {
                          await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation pauseCampaign($id: ID!) {
  										pauseCampaign(id: $id)
  									}`,
                              operationName: 'pauseCampaign',
                              variables: {
                                  id: this.getNodeParameter('campaignId', i),
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'start') {
                          await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation startCampaign($id: ID!) {
  										startCampaign(id: $id)
  									}`,
                              operationName: 'startCampaign',
                              variables: {
                                  id: this.getNodeParameter('campaignId', i),
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'duplicate') {
                          const options = this.getNodeParameter('options', i);
                          const variables = {
                              fromId: this.getNodeParameter('campaignId', i),
                              name: this.getNodeParameter('campaignName', i),
                              copySettings: true,
                              copyMails: true,
                              copyContacts: false,
                              copyProvider: true,
                              ...options,
                          };
                          const { data: { duplicateCampaign }, } = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation duplicateCampaign(
  										$fromId: ID!
  										$name: String!
  										$copySettings: Boolean!
  										$copyMails: Boolean!
  										$copyContacts: Boolean!
  										$copyProvider: Boolean!
  									) {
  										duplicateCampaign(
  											fromId: $fromId
  											name: $name
  											copySettings: $copySettings
  											copyMails: $copyMails
  											copyContacts: $copyContacts
  											copyProvider: $copyProvider
  										)
  									}`,
                              operationName: 'duplicateCampaign',
                              variables,
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ _id: duplicateCampaign }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
                  else if (resource === 'contactList') {
                      if (operation === 'add') {
                          const contact = {
                              email: this.getNodeParameter('contactEmail', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(contact, additionalFields);
                          }
                          if (additionalFields.customFieldsUi) {
                              const customFields = ((_b = additionalFields.customFieldsUi) === null || _b === void 0 ? void 0 : _b.customFieldsValues) || [];
                              const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldName}`]: value.value }), {});
                              Object.assign(contact, data);
                              delete contact.customFieldsUi;
                          }
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation AddContactsToListHook($id: ID!, $contact: JSON!) {
  										addContactsToListHook(id: $id, contact: $contact)
  									}`,
                              operationName: 'AddContactsToListHook',
                              variables: {
                                  id: this.getNodeParameter('contactListId', i),
                                  contact,
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ contactId: responseData.data.addContactsToListHook }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'getAll') {
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									query contact_lists{
  										contact_lists{
  											_id
  											name
  											contactCount
  											fields
  											usedInCampaign
  										}
  									}`,
                              operationName: 'contact_lists',
                          });
                          let contactLists = responseData.data.contact_lists;
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              contactLists = contactLists.slice(0, limit);
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(contactLists), { 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.Emelia = Emelia;
  //# sourceMappingURL=Emelia.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Emelia credentials
  description: Documentation for Emelia credentials. Use these credentials to authenticate Emelia in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Emelia credentials

  You can use these credentials to authenticate the following nodes:

  - [Emelia](/integrations/builtin/app-nodes/n8n-nodes-base.emelia.md)
  - [Emelia Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.emeliatrigger.md)

  ## Prerequisites

  Create an [Emelia](https://emelia.io) account.

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: To generate an API Key in Emelia, access your **API Keys** by selecting the avatar in the top right (your **Settings**). Refer to the Authentication section of [Emelia's API documentation](https://docs.emelia.io/){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"957fe8a8-e4b7-4286-ac6a-46544c7fb356","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"cdd8873425f674279df210b48cc2019371746214d38d3f03e0fe72961d3b54ce"}}


node_type: n8n-nodes-base.ExecuteCommand
name: ExecuteCommand
display_name: Execute Command
description: Executes a command on the host
category: Other
code_hash: bf8ab1b48895981a9c275e2cb6b6d840dc705e9e3815ef70f3881402b51fe537
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executecommand/index
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:21
updated_at: 2025-06-08 08:05:21
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ExecuteCommand = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const child_process_1 = require("child_process");
  async function execPromise(command) {
      const returnData = {
          error: undefined,
          exitCode: 0,
          stderr: '',
          stdout: '',
      };
      return new Promise((resolve, _reject) => {
          (0, child_process_1.exec)(command, { cwd: process.cwd() }, (error, stdout, stderr) => {
              returnData.stdout = stdout.trim();
              returnData.stderr = stderr.trim();
              if (error) {
                  returnData.error = error;
              }
              resolve(returnData);
          }).on('exit', (code) => {
              returnData.exitCode = code || 0;
          });
      });
  }
  class ExecuteCommand {
      constructor() {
          this.description = {
              displayName: 'Execute Command',
              name: 'executeCommand',
              icon: 'fa:terminal',
              group: ['transform'],
              version: 1,
              description: 'Executes a command on the host',
              defaults: {
                  name: 'Execute Command',
                  color: '#886644',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Execute Once',
                      name: 'executeOnce',
                      type: 'boolean',
                      default: true,
                      description: 'Whether to execute only once instead of once for each entry',
                  },
                  {
                      displayName: 'Command',
                      name: 'command',
                      typeOptions: {
                          rows: 5,
                      },
                      type: 'string',
                      default: '',
                      placeholder: 'echo "test"',
                      description: 'The command to execute',
                      required: true,
                  },
              ],
          };
      }
      async execute() {
          let items = this.getInputData();
          let command;
          const executeOnce = this.getNodeParameter('executeOnce', 0);
          if (executeOnce) {
              items = [items[0]];
          }
          const returnItems = [];
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              try {
                  command = this.getNodeParameter('command', itemIndex);
                  const { error, exitCode, stdout, stderr } = await execPromise(command);
                  if (error !== undefined) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), error.message, { itemIndex });
                  }
                  returnItems.push({
                      json: {
                          exitCode,
                          stderr,
                          stdout,
                      },
                      pairedItem: {
                          item: itemIndex,
                      },
                  });
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnItems.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnItems];
      }
  }
  exports.ExecuteCommand = ExecuteCommand;
  //# sourceMappingURL=ExecuteCommand.node.js.map

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

  # Execute Command

  The Execute Command node runs shell commands on the host machine that runs n8n.

  /// note | Which shell runs the command?
  This node executes the command in the default shell of the host machine. For example, `cmd` on Windows and `zsh` on macOS.

  If you run n8n with Docker, your command will run in the n8n container and not the Docker host.
  ///

  /// note | Not available on Cloud
  This node isn't available on n8n Cloud.
  ///

  ## Node parameters

  Configure the node using the following parameters.

  ### Execute Once

  Choose whether you want the node to execute only once (turned on) or once for every item it receives as input (turned off).

  ### Command

  Enter the command to execute on the host machine. Refer to sections below for examples of running [multiple commands](#run-multiple-commands) and [cURL commands](#run-curl-command).

  #### Run multiple commands

  Use one of two methods to run multiple commands in one Execute Command node:

  * Enter each command on one line separated by `&&`. For example, you can combine the change directory (cd) command with the list (ls) command using `&&`.

      ```bash
      cd bin && ls
      ```

  * Enter each command on a separate line. For example, you can write the list (ls) command on a new line after the change directory (cd) command.

      ```bash
      cd bin
      ls
      ```

  #### Run cURL command

  You can also use the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/index.md) node to make a cURL request.

  If you want to run the curl command in the Execute Command node, you will have to build a Docker image based on the existing n8n image. The default n8n Docker image uses Alpine Linux. You will have to install the curl package.

  1. Create a file named `Dockerfile`.
  2. Add the below code snippet to the Dockerfile.

      ```shell
      FROM docker.n8n.io/n8nio/n8n
      USER root
      RUN apk --update add curl
      USER node
      ```

  3. In the same folder, execute the command below to build the Docker image.

      ```shell
      docker build -t n8n-curl
      ```

  4. Replace the Docker image you used before. For example, replace `docker.n8n.io/n8nio/n8n` with `n8n-curl`.
  5. Run the newly created Docker image. You'll now be able to execute ssh using the Execute Command Node.

  ## Templates and examples

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

  ## Common issues

  For common questions or issues and suggested solutions, refer to [Common Issues](/integrations/builtin/core-nodes/n8n-nodes-base.executecommand/common-issues.md).

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"f276244e-28e2-4271-976e-b72addef33ea","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"8deff3e79be59eefeec67601d7436d4175aa8a92a91f74533b67674217433218"}}


node_type: n8n-nodes-base.ExecuteWorkflow
name: ExecuteWorkflow
display_name: Execute Workflow
description: Execute another workflow
category: Other
code_hash: f1565eb6ca9041c9444299bdf264ba10953d71afc7913c5e2ac7c14beead0c9e
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:21
updated_at: 2025-06-08 08:05:21
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ExecuteWorkflow = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utilities_1 = require("../../utils/utilities");
  class ExecuteWorkflow {
      constructor() {
          this.description = {
              displayName: 'Execute Workflow',
              name: 'executeWorkflow',
              icon: 'fa:sign-in-alt',
              group: ['transform'],
              version: 1,
              subtitle: '={{"Workflow: " + $parameter["workflowId"]}}',
              description: 'Execute another workflow',
              defaults: {
                  name: 'Execute Workflow',
                  color: '#ff6d5a',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'hidden',
                      noDataExpression: true,
                      default: 'call_workflow',
                      options: [
                          {
                              name: 'Call Another Workflow',
                              value: 'call_workflow',
                          },
                      ],
                  },
                  {
                      displayName: 'Source',
                      name: 'source',
                      type: 'options',
                      options: [
                          {
                              name: 'Database',
                              value: 'database',
                              description: 'Load the workflow from the database by ID',
                          },
                          {
                              name: 'Local File',
                              value: 'localFile',
                              description: 'Load the workflow from a locally saved file',
                          },
                          {
                              name: 'Parameter',
                              value: 'parameter',
                              description: 'Load the workflow from a parameter',
                          },
                          {
                              name: 'URL',
                              value: 'url',
                              description: 'Load the workflow from an URL',
                          },
                      ],
                      default: 'database',
                      description: 'Where to get the workflow to execute from',
                  },
                  {
                      displayName: 'Workflow ID',
                      name: 'workflowId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              source: ['database'],
                          },
                      },
                      default: '',
                      required: true,
                      hint: 'Can be found in the URL of the workflow',
                      description: "Note on using an expression here: if this node is set to run once with all items, they will all be sent to the <em>same</em> workflow. That workflow's ID will be calculated by evaluating the expression for the <strong>first input item</strong>.",
                  },
                  {
                      displayName: 'Workflow Path',
                      name: 'workflowPath',
                      type: 'string',
                      displayOptions: {
                          show: {
                              source: ['localFile'],
                          },
                      },
                      default: '',
                      placeholder: '/data/workflow.json',
                      required: true,
                      description: 'The path to local JSON workflow file to execute',
                  },
                  {
                      displayName: 'Workflow JSON',
                      name: 'workflowJson',
                      type: 'string',
                      typeOptions: {
                          editor: 'json',
                          rows: 10,
                      },
                      displayOptions: {
                          show: {
                              source: ['parameter'],
                          },
                      },
                      default: '\n\n\n',
                      required: true,
                      description: 'The workflow JSON code to execute',
                  },
                  {
                      displayName: 'Workflow URL',
                      name: 'workflowUrl',
                      type: 'string',
                      displayOptions: {
                          show: {
                              source: ['url'],
                          },
                      },
                      default: '',
                      placeholder: 'https://example.com/workflow.json',
                      required: true,
                      description: 'The URL from which to load the workflow from',
                  },
                  {
                      displayName: 'Any data you pass into this node will be output by the Execute Workflow Trigger. <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/" target="_blank">More info</a>',
                      name: 'executeWorkflowNotice',
                      type: 'notice',
                      default: '',
                  },
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Run once with all items',
                              value: 'once',
                              description: 'Pass all items into a single execution of the sub-workflow',
                          },
                          {
                              name: 'Run once for each item',
                              value: 'each',
                              description: 'Call the sub-workflow individually for each item',
                          },
                      ],
                      default: 'once',
                  },
              ],
          };
      }
      async execute() {
          const source = this.getNodeParameter('source', 0);
          const mode = this.getNodeParameter('mode', 0, false);
          const items = this.getInputData();
          if (mode === 'each') {
              const returnData = [];
              for (let i = 0; i < items.length; i++) {
                  try {
                      const workflowInfo = await GenericFunctions_1.getWorkflowInfo.call(this, source, i);
                      const workflowResult = await this.executeWorkflow(workflowInfo, [
                          items[i],
                      ]);
                      for (const [outputIndex, outputData] of workflowResult.entries()) {
                          for (const item of outputData) {
                              item.pairedItem = { item: i };
                          }
                          if (returnData[outputIndex] === undefined) {
                              returnData[outputIndex] = [];
                          }
                          returnData[outputIndex].push(...outputData);
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          return [[{ json: { error: error.message }, pairedItem: { item: i } }]];
                      }
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
                          message: `Error executing workflow with item at index ${i}`,
                          description: error.message,
                          itemIndex: i,
                      });
                  }
              }
              return returnData;
          }
          else {
              try {
                  const workflowInfo = await GenericFunctions_1.getWorkflowInfo.call(this, source);
                  const workflowResult = await this.executeWorkflow(workflowInfo, items);
                  const pairedItem = (0, utilities_1.generatePairedItemData)(items.length);
                  for (const output of workflowResult) {
                      for (const item of output) {
                          item.pairedItem = pairedItem;
                      }
                  }
                  return workflowResult;
              }
              catch (error) {
                  const pairedItem = (0, utilities_1.generatePairedItemData)(items.length);
                  if (this.continueOnFail()) {
                      return [[{ json: { error: error.message }, pairedItem }]];
                  }
                  throw error;
              }
          }
      }
  }
  exports.ExecuteWorkflow = ExecuteWorkflow;
  //# sourceMappingURL=ExecuteWorkflow.node.js.map

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

  # Execute Sub-workflow Trigger node

  Use this node to start a workflow in response to another workflow. It should be the first node in the workflow.

  n8n allows you to call workflows from other workflows. This is useful if you want to:

  * Reuse a workflow: for example, you could have multiple workflows pulling and processing data from different sources, then have all those workflows call a single workflow that generates a report.
  * Break large workflows into smaller components.

  ## Usage

  This node runs in response to a call from the [Execute Sub-workflow](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow.md) or [Call n8n Workflow Tool](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md) nodes.

  --8<-- "_snippets/flow-logic/subworkflow-usage.md"

  ## Templates and examples

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

  ## How data passes between workflows

  --8<-- "_snippets/flow-logic/subworkflow-data-flow.md"

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b31119ef-6d52-482e-b82a-60eaa5c13913","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"13cf50f321c89f3f52b3dd0e46f3d34c3fbed24ad63f4eb518f65f42c6f49189"}}


node_type: n8n-nodes-base.ErrorTrigger
name: ErrorTrigger
display_name: Error Trigger
description: Triggers the workflow when another workflow has an error
category: Other
code_hash: 433bf91938992037c402b9331a9acbac3ece630c83526bdf8b1b33bde151d98c
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.errortrigger
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:21
updated_at: 2025-06-08 08:05:21
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ErrorTrigger = void 0;
  class ErrorTrigger {
      constructor() {
          this.description = {
              displayName: 'Error Trigger',
              name: 'errorTrigger',
              icon: 'fa:bug',
              group: ['trigger'],
              version: 1,
              description: 'Triggers the workflow when another workflow has an error',
              eventTriggerDescription: '',
              mockManualExecution: true,
              maxNodes: 1,
              defaults: {
                  name: 'Error Trigger',
                  color: '#0000FF',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'This node will trigger when there is an error in another workflow, as long as that workflow is set up to do so. <a href="https://docs.n8n.io/integrations/core-nodes/n8n-nodes-base.errortrigger" target="_blank">More info<a>',
                      name: 'notice',
                      type: 'notice',
                      default: '',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const mode = this.getMode();
          if (mode === 'manual' &&
              items.length === 1 &&
              Object.keys(items[0].json).length === 0 &&
              items[0].binary === undefined) {
              const restApiUrl = this.getRestApiUrl();
              const urlParts = restApiUrl.split('/');
              urlParts.pop();
              urlParts.push('execution');
              const id = 231;
              items[0].json = {
                  execution: {
                      id,
                      url: `${urlParts.join('/')}/workflow/1/${id}`,
                      retryOf: '34',
                      error: {
                          message: 'Example Error Message',
                          stack: 'Stacktrace',
                      },
                      lastNodeExecuted: 'Node With Error',
                      mode: 'manual',
                  },
                  workflow: {
                      id: '1',
                      name: 'Example Workflow',
                  },
              };
          }
          return [items];
      }
  }
  exports.ErrorTrigger = ErrorTrigger;
  //# sourceMappingURL=ErrorTrigger.node.js.map

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

  # Error Trigger node

  You can use the Error Trigger node to create error workflows. When another linked workflow fails, this node gets details about the failed workflow and the errors, and runs the error workflow.

  ## Usage

  --8<-- "_snippets/flow-logic/create-set-error-workflow.md"


  Note the following:

  * If a workflow uses the Error Trigger node, you don't have to activate the workflow.
  * If a workflow contains the Error Trigger node, by default, the workflow uses itself as the error workflow.
  * You can't test error workflows when running workflows manually. The Error Trigger only runs when an automatic workflow errors.

  ## Templates and examples

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

  ## Related resources

  You can use the [Stop And Error](/integrations/builtin/core-nodes/n8n-nodes-base.stopanderror.md) node to send custom messages to the Error Trigger.

  Read more about [Error workflows](/flow-logic/error-handling.md) in n8n workflows. 

  ## Error data

  --8<-- "_snippets/integrations/builtin/core-nodes/error-trigger/error-data.md"

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"fa5f827b-7c55-4bcf-aac7-e697a92f1b23","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"76d19f59720531ade2aba54a6819f14825d81e74f1f971b846ca8555c092b734"}}


