# nodes

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

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

  # Linear credentials

  You can use these credentials to authenticate the following nodes:

  * [Linear Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.lineartrigger.md)
  * [Linear](/integrations/builtin/app-nodes/n8n-nodes-base.linear.md)

  ## Prerequisites

  Create a [Linear](https://linear.app/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API key
  - OAuth2

  ## Related resources

  Refer to [Linear's API documentation](https://developers.linear.app/docs/graphql/working-with-the-graphql-api){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - A personal **API Key**: Create an API key in your [**Settings > API**](https://linear.app/n8n/settings/api){:target=_blank .external-link}. Refer to the [Linear Personal API keys documentation](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#personal-api-keys){:target=_blank .external-link} for more information.

  ## Using OAuth2

  To configure this credential, you'll need:

  - A **Client ID**: Generated when you create a new OAuth2 application.
  - A **Client Secret**: Generated when you create a new OAuth2 application.
  - Select the **Actor**: The actor defines how the OAuth2 application should create issues, comments and other changes. Options include:
      - **User** (Linear's default): The application creates resources as the authorizing user. Use this option if you want each user to do their own authentication.
      - **Application**: The application creates resources as itself. Use this option if you have only one user (like an admin) authorizing the application.
  - To use this credential with the [Linear Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.lineartrigger.md) node, you must enable the **Include Admin Scope** toggle.

  Refer to the [Linear OAuth2 Authentication documentation](https://developers.linear.app/docs/oauth/authentication){:target=_blank .external-link} for more detailed instructions and explanations. Use the n8n **OAuth Redirect URL** as the **Redirect callback URL** in your Linear OAuth2 application.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"c4ee69aa-66c0-4a2f-9a2d-b3993ac8e910","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"4075704a8b3ea98067ea68faf5efd7f615921a86789aebe28c6f7c1216d2bfa5"}}


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

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

  # LingvaNex credentials

  You can use these credentials to authenticate the following nodes:

  - [LingvaNex](/integrations/builtin/app-nodes/n8n-nodes-base.lingvanex.md)

  ## Prerequisites

  Create a [LingvaNex](https://lingvanex.com){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Lingvanex's Cloud API documentation](https://docs.lingvanex.com/reference/overview){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Generate an API key from your **Account** page. Refer to [Where can I get the authorization key?](https://docs.lingvanex.com/reference/translator-service-faq#where-can-i-get-the-authorization-key){:target=_blank .external-link} for more detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"773aad31-5ed1-4f07-9860-1eb11cfca77a","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"4764be600e4c2a37e8f1f940c495153c102f60de1d3152238296781d1e9d25b1"}}


node_type: n8n-nodes-base.Line
name: Line
display_name: Line
description: Consume Line API
category: Other
code_hash: c8d8b4834af3201e0b176fa5da6263bbb5882a92e7a82b42f8d86470310e9fda
documentation_url: https://docs.n8n.io/integrations/creating-nodes/build/reference/verification-guidelines
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Line = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const NotificationDescription_1 = require("./NotificationDescription");
  class Line {
      constructor() {
          this.description = {
              displayName: 'Line',
              name: 'line',
              icon: 'file:line.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Line API',
              defaults: {
                  name: 'Line',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'lineNotifyOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['notification'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Notification',
                              value: 'notification',
                          },
                      ],
                      default: 'notification',
                  },
                  ...NotificationDescription_1.notificationOperations,
                  ...NotificationDescription_1.notificationFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'notification') {
                      if (operation === 'send') {
                          const message = this.getNodeParameter('message', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              message,
                          };
                          Object.assign(body, additionalFields);
                          if (body.hasOwnProperty('notificationDisabled')) {
                              body.notificationDisabled = body.notificationDisabled ? 'true' : 'false';
                          }
                          if (body.stickerUi) {
                              const sticker = body.stickerUi.stickerValue;
                              if (sticker) {
                                  body.stickerId = sticker.stickerId;
                                  body.stickerPackageId = sticker.stickerPackageId;
                              }
                              delete body.stickerUi;
                          }
                          if (body.imageUi) {
                              const image = body.imageUi.imageValue;
                              if (image && image.binaryData === true) {
                                  const binaryProperty = image.binaryProperty;
                                  const binaryData = this.helpers.assertBinaryData(i, binaryProperty);
                                  const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty);
                                  body.imageFile = {
                                      value: binaryDataBuffer,
                                      options: {
                                          filename: binaryData.fileName,
                                      },
                                  };
                              }
                              else {
                                  body.imageFullsize = image.imageFullsize;
                                  body.imageThumbnail = image.imageThumbnail;
                              }
                              delete body.imageUi;
                          }
                          responseData = await GenericFunctions_1.lineApiRequest.call(this, 'POST', '', {}, {}, 'https://notify-api.line.me/api/notify', { formData: body });
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Line = Line;
  //# sourceMappingURL=Line.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  contentType: reference
  ---

  # Community node verification guidelines

  /// note | Do you want n8n to verify your node?
  Consider following these guidelines while building your node if you want to submit it for verification by n8n. Any user with verified community nodes enabled can discover and install verified nodes from n8n's nodes panel.
  ///

  ## Package source verification

  * Verify that your npm package repository URL matches the expected GitHub (or other platform) repository.
  * Confirm that the package author / maintainer matches between npm and the repository.
  * Confirm that the git link in npm works and that the repository is public.
  * Make sure your package has proper documentation (README, usage examples, etc.).
  * Make sure your package license is MIT.

  ## No external dependencies

  * Ensure that your package does **not** include any external dependencies to keep it lightweight and easy to maintain.

  ## Proper documentation

  * Provide clear documentation, whether it’s a **README** on GitHub or links to relevant **API documentation**.
  * Include usage instructions, example workflows, and any necessary authentication details.

  ## No access to environment variables or file system

  * The code **must not** interact with environment variables or attempt to read/write files.
  * Pass all necessary data through node parameters.

  ## Follow n8n best practices

  * Maintain a clear and consistent coding style.
  * Use **TypeScript** and follow n8n's [**node development guidelines**](/integrations/creating-nodes/overview.md).
  * Ensure proper error handling and validation.
  * Make sure the linter passes (in other words, make sure running `npx @n8n/scan-community-package n8n-nodes-PACKAGE` passes).

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"194f8730-9a2c-46f3-9cbc-bd7bfba44e5a","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"95e45ecd7916e7ed085122bd618177be8950d0e6ac31f7cad930b04422a6c846"}}


node_type: n8n-nodes-base.LinkedIn
name: LinkedIn
display_name: LinkedIn
description: Consume LinkedIn API
category: Other
code_hash: 1148fe37efdd5c3bbaee912c4f44399c3e83f8a16501e9aaa0ad2ba84214b8ef
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/linkedin
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LinkedIn = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const PostDescription_1 = require("./PostDescription");
  class LinkedIn {
      constructor() {
          this.description = {
              displayName: 'LinkedIn',
              name: 'linkedIn',
              icon: 'file:linkedin.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume LinkedIn API',
              defaults: {
                  name: 'LinkedIn',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'linkedInOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Post',
                              value: 'post',
                          },
                      ],
                      default: 'post',
                  },
                  ...PostDescription_1.postOperations,
                  ...PostDescription_1.postFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getPersonUrn() {
                      const returnData = [];
                      const person = await GenericFunctions_1.linkedInApiRequest.call(this, 'GET', '/me', {});
                      returnData.push({
                          name: `${person.localizedFirstName} ${person.localizedLastName}`,
                          value: person.id,
                      });
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let body = {};
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'post') {
                      if (operation === 'create') {
                          const text = this.getNodeParameter('text', i);
                          const shareMediaCategory = this.getNodeParameter('shareMediaCategory', i);
                          const postAs = this.getNodeParameter('postAs', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          let authorUrn = '';
                          let visibility = 'PUBLIC';
                          if (postAs === 'person') {
                              const personUrn = this.getNodeParameter('person', i);
                              visibility = additionalFields.visibility || 'PUBLIC';
                              authorUrn = `urn:li:person:${personUrn}`;
                          }
                          else {
                              const organizationUrn = this.getNodeParameter('organization', i);
                              authorUrn = `urn:li:organization:${organizationUrn}`;
                          }
                          let description = '';
                          let title = '';
                          let originalUrl = '';
                          body = {
                              author: authorUrn,
                              lifecycleState: 'PUBLISHED',
                              distribution: {
                                  feedDistribution: 'MAIN_FEED',
                                  thirdPartyDistributionChannels: [],
                              },
                              visibility,
                          };
                          if (shareMediaCategory === 'IMAGE') {
                              if (additionalFields.title) {
                                  title = additionalFields.title;
                              }
                              const registerRequest = {
                                  initializeUploadRequest: {
                                      owner: authorUrn,
                                  },
                              };
                              const registerObject = await GenericFunctions_1.linkedInApiRequest.call(this, 'POST', '/images?action=initializeUpload', registerRequest);
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              this.helpers.assertBinaryData(i, binaryPropertyName);
                              const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              const { uploadUrl, image } = registerObject.value;
                              await GenericFunctions_1.linkedInApiRequest.call(this, 'POST', uploadUrl, buffer, true);
                              const imageBody = {
                                  content: {
                                      media: {
                                          title,
                                          id: image,
                                      },
                                  },
                                  commentary: text,
                              };
                              Object.assign(body, imageBody);
                          }
                          else if (shareMediaCategory === 'ARTICLE') {
                              if (additionalFields.description) {
                                  description = additionalFields.description;
                              }
                              if (additionalFields.title) {
                                  title = additionalFields.title;
                              }
                              if (additionalFields.originalUrl) {
                                  originalUrl = additionalFields.originalUrl;
                              }
                              const articleBody = {
                                  content: {
                                      article: {
                                          title,
                                          description,
                                          source: originalUrl,
                                      },
                                  },
                                  commentary: text,
                              };
                              Object.assign(body, articleBody);
                              if (description === '') {
                                  delete body.description;
                              }
                              if (title === '') {
                                  delete body.title;
                              }
                          }
                          else {
                              Object.assign(body, { commentary: text });
                          }
                          const endpoint = '/posts';
                          responseData = await GenericFunctions_1.linkedInApiRequest.call(this, 'POST', endpoint, body);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.LinkedIn = LinkedIn;
  //# sourceMappingURL=LinkedIn.node.js.map

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

  # LinkedIn credentials

  You can use these credentials to authenticate the following nodes:

  - [LinkedIn](/integrations/builtin/app-nodes/n8n-nodes-base.linkedin.md)


  ## Prerequisites

  * Create a [LinkedIn](https://www.linkedin.com/){:target=_blank .external-link} account.
  * Create a LinkedIn [Company Page](https://www.linkedin.com/help/linkedin/answer/a543852){:target=_blank .external-link}.

  ## Supported authentication methods

  - **Community Management OAuth2**: Use this method if you're a new LinkedIn user or creating a new LinkedIn app.
  - **OAuth2**: Use this method for older LinkedIn apps and user accounts.

  ## Related Resources

  Refer to [LinkedIn's Community Management API documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/community-management-overview?view=li-lms-2024-04){:target=_blank .external-link} for more information about the service.

  This credential works with API version `202404`.

  ## Using Community Management OAuth2

  Use this method if you're a new LinkedIn user or creating a new LinkedIn app.

  To configure this credential, you'll need a [LinkedIn](https://www.linkedin.com/){:target=_blank .external-link} account, a LinkedIn [Company Page](https://www.linkedin.com/help/linkedin/answer/a543852){:target=_blank .external-link}, and:

  - A **Client ID**: Generated after you create a new developer app.
  - A **Client Secret**: Generated after you create a new developer app.

  To create a new developer app and set up the credential:

  1. Log into LinkedIn and select this link to [create a new developer app](https://www.linkedin.com/developers/apps/new){:target=_blank .external-link}.
  2. Enter an **App name** for your app, like `n8n integration`.
  3. For the **LinkedIn Page**, enter a LinkedIn [Company Page](https://www.linkedin.com/help/linkedin/answer/a543852){:target=_blank .external-link} or use the **Create a new LinkedIn Page** link to create one on-the-fly. Refer to [Associate an App with a LinkedIn Page](https://www.linkedin.com/help/linkedin/answer/a548360){:target=_blank .external-link} for more information. 
  4. Add an **App logo**.
  5. Check the box to agree to the **Legal agreement**.
  6. Select **Create app**.
  7. This should open the **Products** tab. Select the products/APIs you want to enable for your app. For the LinkedIn node to work properly, you must include:
  	- **Share on LinkedIn**
  	- **Sign In with LinkedIn using OpenID Connect**
  8. Once you've requested access to the products you need, open the **Auth** tab.
  9. Copy the **Client ID** and enter it in your n8n credential.
  10. Select the icon to **Copy** the **Primary Client Secret**. Enter this in your n8n credential as the **Client Secret**.

  /// note | Posting from organization accounts
  To post as an organization, you need to put your app through LinkedIn's [Community Management App Review](https://learn.microsoft.com/en-us/linkedin/marketing/community-management-app-review){:target=_blank .external-link} process.
  ///

  Refer to [Getting Access to LinkedIn APIs](https://learn.microsoft.com/en-us/linkedin/shared/authentication/getting-access){:target=_blank .external-link} for more information on scopes and permissions.

  ## Using OAuth2

  Only use this method for older LinkedIn apps and user accounts.

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

  All users must select:

  - **Organization Support**: If turned on, the credential requests permission to post as an organization using the `w_organization_social` scope.
  	- To use this option, you must put your app through LinkedIn's [Community Management App Review](https://learn.microsoft.com/en-us/linkedin/marketing/community-management-app-review){:target=_blank .external-link} process.
  - **Legacy**: If turned on, the credential uses legacy scopes for `r_liteprofile` and `r_emailaddress` instead of the newer `profile` and `email` scopes.

  If you're [self-hosting](/hosting/index.md) n8n, you'll need to configure OAuth2 from scratch by creating a new developer app:

  1. Log into LinkedIn and select this link to [create a new developer app](https://www.linkedin.com/developers/apps/new){:target=_blank .external-link}.
  2. Enter an **App name** for your app, like `n8n integration`.
  3. For the **LinkedIn Page**, enter a LinkedIn [Company Page](https://www.linkedin.com/help/linkedin/answer/a543852){:target=_blank .external-link} or use the **Create a new LinkedIn Page** link to create one on-the-fly. Refer to [Associate an App with a LinkedIn Page](https://www.linkedin.com/help/linkedin/answer/a548360){:target=_blank .external-link} for more information. 
  4. Add an **App logo**.
  5. Check the box to agree to the **Legal agreement**.
  6. Select **Create app**.
  7. This should open the **Products** tab. Select the products/APIs you want to enable for your app. For the LinkedIn node to work properly, you must include:
  	- **Share on LinkedIn**
  	- **Sign In with LinkedIn using OpenID Connect**
  8. Once you've requested access to the products you need, open the **Auth** tab.
  9. Copy the **Client ID** and enter it in your n8n credential.
  10. Select the icon to **Copy** the **Primary Client Secret**. Enter this in your n8n credential as the **Client Secret**.

  /// note | Posting from organization accounts
  To post as an organization, you need to put your app through LinkedIn's [Community Management App Review](https://learn.microsoft.com/en-us/linkedin/marketing/community-management-app-review){:target=_blank .external-link} process.
  ///

  Refer to [Getting Access to LinkedIn APIs](https://learn.microsoft.com/en-us/linkedin/shared/authentication/getting-access){:target=_blank .external-link} for more information on scopes and permissions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"4ebd4d2a-f830-4fe9-ba93-1c12fd31c52a","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"60926e5a6251188190ec6848171fc6f870a9078cf3a63219dd6eb0ab906aaa68"}}


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

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

  # Local File Trigger node

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

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

  ## Node parameters

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

  ## Changes to a Specific File

  The node triggers when the specified file changes.

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

  ## Changes Involving a Specific Folder

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

  Configure these parameters:

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


  ## Node options

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

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

  ### Examples for Ignore

  Ignore a single file:

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

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

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

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"585975e4-4887-45f2-9804-4f662a2f1fdf","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"9ca47a776d6c231830f1213ea31044d4fff908945562eedef022d57e1163c4ea"}}


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

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

  # LoneScale credentials

  You can use these credentials to authenticate the following nodes:

  - [LoneScale](/integrations/builtin/app-nodes/n8n-nodes-base.lonescale.md)
  - [LoneScale Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.lonescaletrigger.md)

  ## Prerequisites

  Create a [LoneScale](https://www.lonescale.com/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [LoneScale's API documentation](https://public-api.lonescale.com/api){: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 [LoneScale's Generate an API key documentation](https://help-center.lonescale.com/en/articles/6454360-lonescale-public-api){:target=_blank .external-link} to generate your key.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"9a9acdfe-3801-4aab-8dba-b4368f43235d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"35c04df123f3909c5c2c9078edca3e19320328ee68d5667da44194e9cdd2de29"}}


node_type: n8n-nodes-base.Mailcheck
name: Mailcheck
display_name: Mailcheck
description: Consume Mailcheck API
category: Other
code_hash: fafaa5f9e5c5d8581945d83f9a43dc10f497291843cc011649f4f65d84a2fcdc
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mailcheck
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mailcheck = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Mailcheck {
      constructor() {
          this.description = {
              displayName: 'Mailcheck',
              name: 'mailcheck',
              icon: 'file:mailcheck.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Mailcheck API',
              defaults: {
                  name: 'Mailcheck',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mailcheckApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Email',
                              value: 'email',
                          },
                      ],
                      default: 'email',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['email'],
                          },
                      },
                      options: [
                          {
                              name: 'Check',
                              value: 'check',
                              action: 'Check an email',
                          },
                      ],
                      default: 'check',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              resource: ['email'],
                              operation: ['check'],
                          },
                      },
                      default: '',
                      description: 'Email address to check',
                  },
              ],
          };
      }
      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 === 'email') {
                      if (operation === 'check') {
                          const email = this.getNodeParameter('email', i);
                          responseData = await GenericFunctions_1.mailCheckApiRequest.call(this, 'POST', '/singleEmail:check', {
                              email,
                          });
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
              if (Array.isArray(responseData)) {
                  returnData.push.apply(returnData, responseData);
              }
              else {
                  returnData.push(responseData);
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Mailcheck = Mailcheck;
  //# sourceMappingURL=Mailcheck.node.js.map

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

  # Mailcheck credentials

  You can use these credentials to authenticate the following nodes:

  - [Mailcheck](/integrations/builtin/app-nodes/n8n-nodes-base.mailcheck.md)

  ## Prerequisites

  Create a [Mailcheck](https://mailcheck.co/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Mailcheck's API documentation](https://app.mailcheck.co/docs?from=docs){:target=_blank .external-link} for more information about the service.

  ## Using API Key

  To configure this credential, you'll need:

  - An **API Key**: Generate an API Key in the API section of your dashboard. Refer to [Mailcheck's How to create an API key documentation](https://mailcheck.co/create-api-key){:target=_blank .external-link} for detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"08d1a78a-7a85-4e96-a4c5-1014a5ca3f0b","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"38d53ae28290846d2e804e589cbc5a8fbce0eeb69125cc0780c0045933c5c6a6"}}


node_type: n8n-nodes-base.Mailchimp
name: Mailchimp
display_name: Mailchimp
description: Consume Mailchimp API
category: Other
code_hash: f2caad087950dacb0627fb1424523c92a542b7bedb79535d47eb21809f69f722
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mailchimp
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
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.Mailchimp = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_1 = __importDefault(require("moment"));
  var Status;
  (function (Status) {
      Status["subscribe"] = "subscribe";
      Status["unsubscribed"] = "unsubscribe";
      Status["cleaned"] = "cleaned";
      Status["pending"] = "pending";
      Status["transactional"] = "transactional";
  })(Status || (Status = {}));
  class Mailchimp {
      constructor() {
          this.description = {
              displayName: 'Mailchimp',
              name: 'mailchimp',
              icon: 'file:mailchimp.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Mailchimp API',
              defaults: {
                  name: 'Mailchimp',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mailchimpApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['apiKey'],
                          },
                      },
                  },
                  {
                      name: 'mailchimpOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'API Key',
                              value: 'apiKey',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'apiKey',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Campaign',
                              value: 'campaign',
                          },
                          {
                              name: 'List Group',
                              value: 'listGroup',
                          },
                          {
                              name: 'Member',
                              value: 'member',
                          },
                          {
                              name: 'Member Tag',
                              value: 'memberTag',
                          },
                      ],
                      default: 'member',
                      required: true,
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['member'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a new member on list',
                              action: 'Create a member',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a member on list',
                              action: 'Delete a member',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a member on list',
                              action: 'Get a member',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many members on a list',
                              action: 'Get many members',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a new member on list',
                              action: 'Update a member',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['memberTag'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Add tags from a list member',
                              action: 'Create a member tag',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Remove tags from a list member',
                              action: 'Delete a member tag',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['listGroup'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many groups',
                              action: 'Get many list groups',
                          },
                      ],
                      default: 'getAll',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['campaign'],
                          },
                      },
                      options: [
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a campaign',
                              action: 'Delete a campaign',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a campaign',
                              action: 'Get a campaign',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many campaigns',
                              action: 'Get many campaigns',
                          },
                          {
                              name: 'Replicate',
                              value: 'replicate',
                              description: 'Replicate a campaign',
                              action: 'Replicate a campaign',
                          },
                          {
                              name: 'Resend',
                              value: 'resend',
                              description: 'Creates a Resend to Non-Openers version of this campaign',
                              action: 'Resend a campaign',
                          },
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send a campaign',
                              action: 'Send a campaign',
                          },
                      ],
                      default: 'getAll',
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                      },
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                          },
                      },
                      default: '',
                      options: [],
                      required: true,
                      description: 'List of lists. 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',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                          },
                      },
                      default: '',
                      description: 'Email address for a subscriber',
                  },
                  {
                      displayName: 'Status',
                      name: 'status',
                      type: 'options',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                          },
                      },
                      options: [
                          {
                              name: 'Cleaned',
                              value: 'cleaned',
                          },
                          {
                              name: 'Pending',
                              value: 'pending',
                          },
                          {
                              name: 'Subscribed',
                              value: 'subscribed',
                          },
                          {
                              name: 'Transactional',
                              value: 'transactional',
                          },
                          {
                              name: 'Unsubscribed',
                              value: 'unsubscribed',
                          },
                      ],
                      default: '',
                      description: "Subscriber's current status",
                  },
                  {
                      displayName: 'JSON Parameters',
                      name: 'jsonParameters',
                      type: 'boolean',
                      default: false,
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                          },
                      },
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Email Type',
                              name: 'emailType',
                              type: 'options',
                              options: [
                                  {
                                      name: 'HTML',
                                      value: 'html',
                                  },
                                  {
                                      name: 'Text',
                                      value: 'text',
                                  },
                              ],
                              default: '',
                              description: 'Type of email this member asked to get',
                          },
                          {
                              displayName: 'Language',
                              name: 'language',
                              type: 'string',
                              default: '',
                              description: "If set/detected, the subscriber's language",
                          },
                          {
                              displayName: 'Opt-in IP',
                              name: 'ipOptIn',
                              type: 'string',
                              default: '',
                              description: 'The IP address the subscriber used to confirm their opt-in status',
                          },
                          {
                              displayName: 'Signup IP',
                              name: 'ipSignup',
                              type: 'string',
                              default: '',
                              description: 'IP address the subscriber signed up from',
                          },
                          {
                              displayName: 'Signup Timestamp',
                              name: 'timestampSignup',
                              type: 'dateTime',
                              default: '',
                              description: 'The date and time the subscriber signed up for the list in ISO 8601 format',
                          },
                          {
                              displayName: 'Tags',
                              name: 'tags',
                              type: 'string',
                              default: '',
                              description: 'The tags that are associated with a member separeted by ,',
                          },
                          {
                              displayName: 'Vip',
                              name: 'vip',
                              type: 'boolean',
                              default: false,
                              description: 'Vip status for subscribers',
                          },
                          {
                              displayName: 'Opt-in Timestamp',
                              name: 'timestampOpt',
                              type: 'dateTime',
                              default: '',
                              description: 'The date and time the subscribe confirmed their opt-in status in ISO 8601 format',
                          },
                      ],
                  },
                  {
                      displayName: 'Location',
                      name: 'locationFieldsUi',
                      type: 'fixedCollection',
                      placeholder: 'Add Location',
                      default: {},
                      description: 'Subscriber location information.n',
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                              jsonParameters: [false],
                          },
                      },
                      options: [
                          {
                              name: 'locationFieldsValues',
                              displayName: 'Location',
                              values: [
                                  {
                                      displayName: 'Latitude',
                                      name: 'latitude',
                                      type: 'string',
                                      required: true,
                                      description: 'The location latitude',
                                      default: '',
                                  },
                                  {
                                      displayName: 'Longitude',
                                      name: 'longitude',
                                      type: 'string',
                                      required: true,
                                      description: 'The location longitude',
                                      default: '',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Merge Fields',
                      name: 'mergeFieldsUi',
                      placeholder: 'Add Merge Fields',
                      type: 'fixedCollection',
                      default: {},
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                              jsonParameters: [false],
                          },
                      },
                      description: 'An individual merge var and value for a member',
                      options: [
                          {
                              name: 'mergeFieldsValues',
                              displayName: 'Field',
                              typeOptions: {
                                  multipleValueButtonText: 'Add Field',
                              },
                              values: [
                                  {
                                      displayName: 'Field Name or ID',
                                      name: 'name',
                                      type: 'options',
                                      typeOptions: {
                                          loadOptionsMethod: 'getMergeFields',
                                          loadOptionsDependsOn: ['list'],
                                      },
                                      required: true,
                                      description: 'Merge Field name. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                      default: '',
                                  },
                                  {
                                      displayName: 'Field Value',
                                      name: 'value',
                                      required: true,
                                      type: 'string',
                                      default: '',
                                      description: 'Merge field value',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Merge Fields',
                      name: 'mergeFieldsJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                              jsonParameters: [true],
                          },
                      },
                  },
                  {
                      displayName: 'Location',
                      name: 'locationJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                              jsonParameters: [true],
                          },
                      },
                  },
                  {
                      displayName: 'Interest Groups',
                      name: 'groupsUi',
                      placeholder: 'Add Interest Group',
                      type: 'fixedCollection',
                      default: {},
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                              jsonParameters: [false],
                          },
                      },
                      options: [
                          {
                              name: 'groupsValues',
                              displayName: 'Group',
                              typeOptions: {
                                  multipleValueButtonText: 'Add Interest Group',
                              },
                              values: [
                                  {
                                      displayName: 'Category Name or ID',
                                      name: 'categoryId',
                                      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: 'getGroupCategories',
                                          loadOptionsDependsOn: ['list'],
                                      },
                                      default: '',
                                  },
                                  {
                                      displayName: 'Category Field ID',
                                      name: 'categoryFieldId',
                                      type: 'string',
                                      default: '',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'boolean',
                                      default: false,
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Interest Groups',
                      name: 'groupJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['create'],
                              jsonParameters: [true],
                          },
                      },
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                      },
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['delete'],
                          },
                      },
                      default: '',
                      options: [],
                      required: true,
                      description: 'List of lists. 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: {
                              resource: ['member'],
                              operation: ['delete'],
                          },
                      },
                      default: '',
                      required: true,
                      description: "Member's email",
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                      },
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['get'],
                          },
                      },
                      default: '',
                      options: [],
                      required: true,
                      description: 'List of lists. 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: {
                              resource: ['member'],
                              operation: ['get'],
                          },
                      },
                      default: '',
                      required: true,
                      description: "Member's email",
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Fields',
                              name: 'fields',
                              type: 'string',
                              default: '',
                              description: 'A comma-separated list of fields to return',
                          },
                          {
                              displayName: 'Exclude Fields',
                              name: 'excludeFields',
                              type: 'string',
                              default: '',
                              description: 'A comma-separated list of fields to exclude',
                          },
                      ],
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                      },
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['getAll'],
                          },
                      },
                      default: '',
                      options: [],
                      required: true,
                      description: 'List of lists. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 1000,
                      },
                      default: 500,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['getAll'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Before Last Changed',
                              name: 'beforeLastChanged',
                              type: 'dateTime',
                              default: '',
                              description: 'Restrict results to subscribers whose information changed before the set timeframe',
                          },
                          {
                              displayName: 'Before Timestamp Opt',
                              name: 'beforeTimestampOpt',
                              type: 'dateTime',
                              default: '',
                              description: 'Restrict results to subscribers who opted-in before the set timeframe',
                          },
                          {
                              displayName: 'Email Type',
                              name: 'emailType',
                              type: 'options',
                              options: [
                                  {
                                      name: 'HTML',
                                      value: 'html',
                                  },
                                  {
                                      name: 'Text',
                                      value: 'text',
                                  },
                              ],
                              default: '',
                              description: 'Type of email this member asked to get',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Cleaned',
                                      value: 'cleaned',
                                  },
                                  {
                                      name: 'Pending',
                                      value: 'pending',
                                  },
                                  {
                                      name: 'Subscribed',
                                      value: 'subscribed',
                                  },
                                  {
                                      name: 'Transactional',
                                      value: 'transactional',
                                  },
                                  {
                                      name: 'Unsubscribed',
                                      value: 'unsubscribed',
                                  },
                              ],
                              default: '',
                              description: "Subscriber's current status",
                          },
                          {
                              displayName: 'Since Last Changed',
                              name: 'sinceLastChanged',
                              type: 'dateTime',
                              default: '',
                              description: 'Restrict results to subscribers whose information changed after the set timeframe',
                          },
                      ],
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                      },
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['update'],
                          },
                      },
                      default: '',
                      options: [],
                      required: true,
                      description: 'List of lists. 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',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['update'],
                          },
                      },
                      default: '',
                      description: 'Email address of the subscriber',
                  },
                  {
                      displayName: 'JSON Parameters',
                      name: 'jsonParameters',
                      type: 'boolean',
                      default: false,
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['update'],
                          },
                      },
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['update'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Email Type',
                              name: 'emailType',
                              type: 'options',
                              options: [
                                  {
                                      name: 'HTML',
                                      value: 'html',
                                  },
                                  {
                                      name: 'Text',
                                      value: 'text',
                                  },
                              ],
                              default: '',
                              description: 'Type of email this member asked to get',
                          },
                          {
                              displayName: 'Interest Groups',
                              name: 'groupsUi',
                              placeholder: 'Add Interest Group',
                              type: 'fixedCollection',
                              default: {},
                              typeOptions: {
                                  multipleValues: true,
                              },
                              displayOptions: {
                                  show: {
                                      '/resource': ['member'],
                                      '/operation': ['update'],
                                      '/jsonParameters': [false],
                                  },
                              },
                              options: [
                                  {
                                      name: 'groupsValues',
                                      displayName: 'Group',
                                      typeOptions: {
                                          multipleValueButtonText: 'Add Interest Group',
                                      },
                                      values: [
                                          {
                                              displayName: 'Category Name or ID',
                                              name: 'categoryId',
                                              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: 'getGroupCategories',
                                                  loadOptionsDependsOn: ['list'],
                                              },
                                              default: '',
                                          },
                                          {
                                              displayName: 'Category Field ID',
                                              name: 'categoryFieldId',
                                              type: 'string',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Value',
                                              name: 'value',
                                              type: 'boolean',
                                              default: false,
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Language',
                              name: 'language',
                              type: 'string',
                              default: '',
                              description: "If set/detected, the subscriber's language",
                          },
                          {
                              displayName: 'Merge Fields',
                              name: 'mergeFieldsUi',
                              placeholder: 'Add Merge Fields',
                              type: 'fixedCollection',
                              default: {},
                              typeOptions: {
                                  multipleValues: true,
                              },
                              displayOptions: {
                                  show: {
                                      '/resource': ['member'],
                                      '/operation': ['update'],
                                      '/jsonParameters': [false],
                                  },
                              },
                              description: 'An individual merge var and value for a member',
                              options: [
                                  {
                                      name: 'mergeFieldsValues',
                                      displayName: 'Field',
                                      typeOptions: {
                                          multipleValueButtonText: 'Add Field',
                                      },
                                      values: [
                                          {
                                              displayName: 'Field Name or ID',
                                              name: 'name',
                                              type: 'options',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getMergeFields',
                                                  loadOptionsDependsOn: ['list'],
                                              },
                                              required: true,
                                              description: 'Merge Field name. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Field Value',
                                              name: 'value',
                                              required: true,
                                              type: 'string',
                                              default: '',
                                              description: 'Merge field value',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Opt-in IP',
                              name: 'ipOptIn',
                              type: 'string',
                              default: '',
                              description: 'The IP address the subscriber used to confirm their opt-in status',
                          },
                          {
                              displayName: 'Signup IP',
                              name: 'ipSignup',
                              type: 'string',
                              default: '',
                              description: 'IP address the subscriber signed up from',
                          },
                          {
                              displayName: 'Signup Timestamp',
                              name: 'timestampSignup',
                              type: 'dateTime',
                              default: '',
                              description: 'The date and time the subscriber signed up for the list in ISO 8601 format',
                          },
                          {
                              displayName: 'Skip Merge Validation',
                              name: 'skipMergeValidation',
                              type: 'boolean',
                              default: false,
                              description: 'Whether member data will be accepted without merge field values, even if the merge field is usually required',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Cleaned',
                                      value: 'cleaned',
                                  },
                                  {
                                      name: 'Pending',
                                      value: 'pending',
                                  },
                                  {
                                      name: 'Subscribed',
                                      value: 'subscribed',
                                  },
                                  {
                                      name: 'Transactional',
                                      value: 'transactional',
                                  },
                                  {
                                      name: 'Unsubscribed',
                                      value: 'unsubscribed',
                                  },
                              ],
                              default: '',
                              description: "Subscriber's current status",
                          },
                          {
                              displayName: 'Vip',
                              name: 'vip',
                              type: 'boolean',
                              default: false,
                              description: 'Vip status for subscribers',
                          },
                          {
                              displayName: 'Location',
                              name: 'locationFieldsUi',
                              type: 'fixedCollection',
                              placeholder: 'Add Location',
                              default: {},
                              description: 'Subscriber location information.n',
                              displayOptions: {
                                  show: {
                                      '/resource': ['member'],
                                      '/operation': ['update'],
                                      '/jsonParameters': [false],
                                  },
                              },
                              options: [
                                  {
                                      name: 'locationFieldsValues',
                                      displayName: 'Location',
                                      values: [
                                          {
                                              displayName: 'Latitude',
                                              name: 'latitude',
                                              type: 'string',
                                              required: true,
                                              description: 'The location latitude',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Longitude',
                                              name: 'longitude',
                                              type: 'string',
                                              required: true,
                                              description: 'The location longitude',
                                              default: '',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Opt-in Timestamp',
                              name: 'timestampOpt',
                              type: 'dateTime',
                              default: '',
                              description: 'The date and time the subscribe confirmed their opt-in status in ISO 8601 format',
                          },
                      ],
                  },
                  {
                      displayName: 'Merge Fields',
                      name: 'mergeFieldsJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['update'],
                              jsonParameters: [true],
                          },
                      },
                  },
                  {
                      displayName: 'Location',
                      name: 'locationJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['update'],
                              jsonParameters: [true],
                          },
                      },
                  },
                  {
                      displayName: 'Interest Groups',
                      name: 'groupJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['member'],
                              operation: ['update'],
                              jsonParameters: [true],
                          },
                      },
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                      },
                      displayOptions: {
                          show: {
                              resource: ['memberTag'],
                              operation: ['create', 'delete'],
                          },
                      },
                      default: '',
                      options: [],
                      required: true,
                      description: 'List of lists. 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',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['memberTag'],
                              operation: ['create', 'delete'],
                          },
                      },
                      default: '',
                      description: 'Email address of the subscriber',
                  },
                  {
                      displayName: 'Tags',
                      name: 'tags',
                      type: 'string',
                      typeOptions: {
                          multipleValues: true,
                          multipleValueButtonText: 'Add Tag',
                      },
                      displayOptions: {
                          show: {
                              resource: ['memberTag'],
                              operation: ['create', 'delete'],
                          },
                      },
                      default: [],
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['memberTag'],
                              operation: ['create', 'delete'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Is Syncing',
                              name: 'isSyncing',
                              type: 'boolean',
                              default: false,
                              description: 'Whether automations based on the tags in the request will not fire',
                          },
                      ],
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                      },
                      displayOptions: {
                          show: {
                              resource: ['listGroup'],
                              operation: ['getAll'],
                          },
                      },
                      default: '',
                      options: [],
                      required: true,
                      description: 'List of lists. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Group Category Name or ID',
                      name: 'groupCategory',
                      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: 'getGroupCategories',
                          loadOptionsDependsOn: ['list'],
                      },
                      displayOptions: {
                          show: {
                              resource: ['listGroup'],
                              operation: ['getAll'],
                          },
                      },
                      default: '',
                      options: [],
                      required: true,
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['listGroup'],
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['listGroup'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 1000,
                      },
                      default: 500,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['campaign'],
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['campaign'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 1000,
                      },
                      default: 10,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['campaign'],
                              operation: ['getAll'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Before Create Time',
                              name: 'beforeCreateTime',
                              type: 'dateTime',
                              default: '',
                              description: 'Restrict the response to campaigns created before the set time',
                          },
                          {
                              displayName: 'Before Send Time',
                              name: 'beforeSendTime',
                              type: 'dateTime',
                              default: '',
                              description: 'Restrict the response to campaigns sent before the set time',
                          },
                          {
                              displayName: 'Exclude Field Names or IDs',
                              name: 'excludeFields',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getCampaignsFields',
                              },
                              default: [],
                              description: 'A comma-separated list of fields to exclude. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Field Names or IDs',
                              name: 'fields',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getCampaignsFields',
                              },
                              default: [
                                  'campaigns.id',
                                  'campaigns.status',
                                  'campaigns.tracking',
                                  'campaigns.settings.from_name',
                                  'campaigns.settings.reply_to',
                                  'campaigns.settings.title',
                              ],
                              description: 'A comma-separated list of fields to return. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'List Name or ID',
                              name: 'listId',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getLists',
                              },
                              default: '',
                              description: 'List of lists. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Since Create Time',
                              name: 'sinceCreateTime',
                              type: 'dateTime',
                              default: '',
                              description: 'Restrict the response to campaigns created after the set time',
                          },
                          {
                              displayName: 'Since Send Time',
                              name: 'sinceSendTime',
                              type: 'dateTime',
                              default: '',
                              description: 'Restrict the response to campaigns sent after the set time',
                          },
                          {
                              displayName: 'Sort Direction',
                              name: 'sortDirection',
                              type: 'options',
                              options: [
                                  {
                                      name: 'ASC',
                                      value: 'ASC',
                                  },
                                  {
                                      name: 'DESC',
                                      value: 'DESC',
                                  },
                              ],
                              default: '',
                              description: 'Determines the order direction for sorted results',
                          },
                          {
                              displayName: 'Sort Field',
                              name: 'sortField',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Create Time',
                                      value: 'create_time',
                                  },
                                  {
                                      name: 'Send Time',
                                      value: 'send_time',
                                  },
                              ],
                              default: '',
                              description: 'Returns files sorted by the specified field',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Save',
                                      value: 'save',
                                  },
                                  {
                                      name: 'Sending',
                                      value: 'sending',
                                  },
                                  {
                                      name: 'Sent',
                                      value: 'sent',
                                  },
                                  {
                                      name: 'Schedule',
                                      value: 'schedule',
                                  },
                              ],
                              default: '',
                              description: 'The status of the campaign',
                          },
                      ],
                  },
                  {
                      displayName: 'Campaign ID',
                      name: 'campaignId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['campaign'],
                              operation: ['send', 'get', 'delete', 'replicate', 'resend'],
                          },
                      },
                      required: true,
                      default: '',
                      description: 'List of Campaigns',
                      options: [],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLists() {
                      const returnData = [];
                      const lists = await GenericFunctions_1.mailchimpApiRequestAllItems.call(this, '/lists', 'GET', 'lists');
                      for (const list of lists) {
                          const listName = list.name;
                          const listId = list.id;
                          returnData.push({
                              name: listName,
                              value: listId,
                          });
                      }
                      return returnData;
                  },
                  async getMergeFields() {
                      const returnData = [];
                      const listId = this.getCurrentNodeParameter('list');
                      const { merge_fields } = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/merge-fields`, 'GET');
                      for (const mergeField of merge_fields) {
                          const mergeFieldName = mergeField.name;
                          const mergeFieldId = mergeField.tag;
                          returnData.push({
                              name: mergeFieldName,
                              value: mergeFieldId,
                          });
                      }
                      return returnData;
                  },
                  async getGroupCategories() {
                      const returnData = [];
                      const listId = this.getCurrentNodeParameter('list');
                      const { categories } = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/interest-categories`, 'GET');
                      for (const category of categories) {
                          const categoryName = category.title;
                          const categoryId = category.id;
                          returnData.push({
                              name: categoryName,
                              value: categoryId,
                          });
                      }
                      return returnData;
                  },
                  async getCampaigns() {
                      const returnData = [];
                      const campaigns = await GenericFunctions_1.mailchimpApiRequestAllItems.call(this, '/campaigns', 'GET', 'campaigns');
                      for (const campaign of campaigns) {
                          const campaignName = campaign.settings.title;
                          const campaignId = campaign.id;
                          returnData.push({
                              name: campaignName,
                              value: campaignId,
                          });
                      }
                      return returnData;
                  },
                  async getCampaignsFields() {
                      const returnData = [];
                      for (const campaignFields of GenericFunctions_1.campaignFieldsMetadata) {
                          returnData.push({
                              name: campaignFields,
                              value: campaignFields,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'listGroup') {
                      if (operation === 'getAll') {
                          const listId = this.getNodeParameter('list', i);
                          const categoryId = this.getNodeParameter('groupCategory', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mailchimpApiRequestAllItems.call(this, `/lists/${listId}/interest-categories/${categoryId}/interests`, 'GET', 'interests', {}, qs);
                          }
                          else {
                              qs.count = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/interest-categories/${categoryId}/interests`, 'GET', {}, qs);
                              responseData = responseData.interests;
                          }
                      }
                  }
                  if (resource === 'member') {
                      if (operation === 'create') {
                          const listId = this.getNodeParameter('list', i);
                          const email = this.getNodeParameter('email', i);
                          const status = this.getNodeParameter('status', i);
                          const options = this.getNodeParameter('options', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const body = {
                              listId,
                              email_address: email,
                              status,
                          };
                          if (options.emailType) {
                              body.email_type = options.emailType;
                          }
                          if (options.language) {
                              body.language = options.language;
                          }
                          if (options.vip) {
                              body.vip = options.vip;
                          }
                          if (options.ipSignup) {
                              body.ip_signup = options.ipSignup;
                          }
                          if (options.ipOptIn) {
                              body.ip_opt = options.ipOptIn;
                          }
                          if (options.timestampOpt) {
                              body.timestamp_opt = (0, moment_1.default)(options.timestampOpt).format('YYYY-MM-DD HH:MM:SS');
                          }
                          if (options.timestampSignup) {
                              body.timestamp_signup = (0, moment_1.default)(options.timestampSignup).format('YYYY-MM-DD HH:MM:SS');
                          }
                          if (options.tags) {
                              body.tags = options.tags.split(',');
                          }
                          if (!jsonActive) {
                              const locationValues = this.getNodeParameter('locationFieldsUi', i)
                                  .locationFieldsValues;
                              if (locationValues) {
                                  const location = {};
                                  for (const key of Object.keys(locationValues)) {
                                      if (key === 'latitude') {
                                          location.latitude = parseFloat(locationValues[key]);
                                      }
                                      else if (key === 'longitude') {
                                          location.longitude = parseFloat(locationValues[key]);
                                      }
                                  }
                                  body.location = location;
                              }
                              const mergeFieldsValues = this.getNodeParameter('mergeFieldsUi', i)
                                  .mergeFieldsValues;
                              if (mergeFieldsValues) {
                                  const mergeFields = {};
                                  for (let index = 0; index < mergeFieldsValues.length; index++) {
                                      mergeFields[mergeFieldsValues[index].name] = mergeFieldsValues[index].value;
                                  }
                                  body.merge_fields = mergeFields;
                              }
                              const groupsValues = this.getNodeParameter('groupsUi', i)
                                  .groupsValues;
                              if (groupsValues) {
                                  const groups = {};
                                  for (let index = 0; index < groupsValues.length; index++) {
                                      groups[groupsValues[index].categoryFieldId] = groupsValues[index].value;
                                  }
                                  body.interests = groups;
                              }
                          }
                          else {
                              const locationJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('locationJson', i));
                              const mergeFieldsJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('mergeFieldsJson', i));
                              const groupJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('groupJson', i));
                              if (locationJson) {
                                  body.location = locationJson;
                              }
                              if (mergeFieldsJson) {
                                  body.merge_fields = mergeFieldsJson;
                              }
                              if (groupJson) {
                                  body.interests = groupJson;
                              }
                          }
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/members`, 'POST', body);
                      }
                      if (operation === 'delete') {
                          const listId = this.getNodeParameter('list', i);
                          const email = this.getNodeParameter('email', i);
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/members/${email}/actions/delete-permanent`, 'POST');
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const listId = this.getNodeParameter('list', i);
                          const email = this.getNodeParameter('email', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.fields) {
                              qs.fields = options.fields;
                          }
                          if (options.excludeFields) {
                              qs.exclude_fields = options.excludeFields;
                          }
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/members/${email}`, 'GET', {}, qs);
                      }
                      if (operation === 'getAll') {
                          const listId = this.getNodeParameter('list', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.beforeLastChanged) {
                              qs.before_last_changed = options.beforeLastChanged;
                          }
                          if (options.beforeTimestampOpt) {
                              qs.before_timestamp_opt = options.beforeTimestampOpt;
                          }
                          if (options.emailType) {
                              qs.email_type = options.emailType;
                          }
                          if (options.status) {
                              qs.status = options.status;
                          }
                          if (options.sinceLastChanged) {
                              qs.since_last_changed = options.sinceLastChanged;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mailchimpApiRequestAllItems.call(this, `/lists/${listId}/members`, 'GET', 'members', {}, qs);
                          }
                          else {
                              qs.count = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/members`, 'GET', {}, qs);
                              responseData = responseData.members;
                          }
                      }
                      if (operation === 'update') {
                          const listId = this.getNodeParameter('list', i);
                          const email = this.getNodeParameter('email', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const body = {
                              listId,
                              email_address: email,
                          };
                          if (updateFields.skipMergeValidation) {
                              qs.skip_merge_validation = updateFields.skipMergeValidation;
                          }
                          if (updateFields.status) {
                              body.status = updateFields.status;
                          }
                          if (updateFields.emailType) {
                              body.email_type = updateFields.emailType;
                          }
                          if (updateFields.language) {
                              body.language = updateFields.language;
                          }
                          if (updateFields.vip) {
                              body.vip = updateFields.vip;
                          }
                          if (updateFields.ipSignup) {
                              body.ip_signup = updateFields.ipSignup;
                          }
                          if (updateFields.ipOptIn) {
                              body.ip_opt = updateFields.ipOptIn;
                          }
                          if (updateFields.timestampOpt) {
                              body.timestamp_opt = (0, moment_1.default)(updateFields.timestampOpt).format('YYYY-MM-DD HH:MM:SS');
                          }
                          if (updateFields.timestampSignup) {
                              body.timestamp_signup = (0, moment_1.default)(updateFields.timestampSignup).format('YYYY-MM-DD HH:MM:SS');
                          }
                          if (!jsonActive) {
                              if (updateFields.locationFieldsUi) {
                                  const locationValues = updateFields.locationFieldsUi
                                      .locationFieldsValues;
                                  if (locationValues) {
                                      const location = {};
                                      for (const key of Object.keys(locationValues)) {
                                          if (key === 'latitude') {
                                              location.latitude = parseFloat(locationValues[key]);
                                          }
                                          else if (key === 'longitude') {
                                              location.longitude = parseFloat(locationValues[key]);
                                          }
                                      }
                                      body.location = location;
                                  }
                              }
                              if (updateFields.mergeFieldsUi) {
                                  const mergeFieldsValues = updateFields.mergeFieldsUi
                                      .mergeFieldsValues;
                                  if (mergeFieldsValues) {
                                      const mergeFields = {};
                                      for (let index = 0; index < mergeFieldsValues.length; index++) {
                                          mergeFields[mergeFieldsValues[index].name] = mergeFieldsValues[index].value;
                                      }
                                      body.merge_fields = mergeFields;
                                  }
                              }
                              if (updateFields.groupsUi) {
                                  const groupsValues = updateFields.groupsUi
                                      .groupsValues;
                                  if (groupsValues) {
                                      const groups = {};
                                      for (let index = 0; index < groupsValues.length; index++) {
                                          groups[groupsValues[index].categoryFieldId] = groupsValues[index].value;
                                      }
                                      body.interests = groups;
                                  }
                              }
                          }
                          else {
                              const locationJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('locationJson', i));
                              const mergeFieldsJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('mergeFieldsJson', i));
                              const groupJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('groupJson', i));
                              if (locationJson) {
                                  body.location = locationJson;
                              }
                              if (mergeFieldsJson) {
                                  body.merge_fields = mergeFieldsJson;
                              }
                              if (groupJson) {
                                  body.interests = groupJson;
                              }
                          }
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/members/${email}`, 'PUT', body);
                      }
                  }
                  if (resource === 'memberTag') {
                      if (operation === 'create') {
                          const listId = this.getNodeParameter('list', i);
                          const email = this.getNodeParameter('email', i);
                          const tags = this.getNodeParameter('tags', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              tags: [],
                          };
                          if (options.isSyncing) {
                              body.is_syncing = options.isSyncing;
                          }
                          for (const tag of tags) {
                              body.tags.push({
                                  name: tag,
                                  status: 'active',
                              });
                          }
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/members/${email}/tags`, 'POST', body);
                          responseData = { success: true };
                      }
                      if (operation === 'delete') {
                          const listId = this.getNodeParameter('list', i);
                          const email = this.getNodeParameter('email', i);
                          const tags = this.getNodeParameter('tags', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              tags: [],
                          };
                          if (options.isSyncing) {
                              body.is_syncing = options.isSyncing;
                          }
                          for (const tag of tags) {
                              body.tags.push({
                                  name: tag,
                                  status: 'inactive',
                              });
                          }
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/lists/${listId}/members/${email}/tags`, 'POST', body);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'campaign') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.status) {
                              qs.status = options.status;
                          }
                          if (options.beforeCreateTime) {
                              qs.before_create_time = options.beforeCreateTime;
                          }
                          if (options.beforeSendTime) {
                              qs.before_send_time = options.beforeSendTime;
                          }
                          if (options.excludeFields) {
                              qs.exclude_fields = options.exclude_fields.join(',');
                          }
                          if (options.fields) {
                              qs.fields = options.fields.join(',');
                              if (options.fields.includes('*')) {
                                  qs.fields = GenericFunctions_1.campaignFieldsMetadata.join(',');
                              }
                          }
                          else {
                              qs.fields = [
                                  'campaigns.id',
                                  'campaigns.status',
                                  'campaigns.tracking',
                                  'campaigns.settings.from_name',
                                  'campaigns.settings.title',
                                  'campaigns.settings.reply_to',
                              ].join(',');
                          }
                          if (options.listId) {
                              qs.list_id = options.listId;
                          }
                          if (options.sinceCreateTime) {
                              qs.since_create_time = options.sinceCreateTime;
                          }
                          if (options.sinceSendTime) {
                              qs.since_send_time = options.sinceSendTime;
                          }
                          if (options.sortDirection) {
                              qs.sort_dir = options.sortDirection;
                          }
                          if (options.sortField) {
                              qs.sort_field = options.sortField;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mailchimpApiRequestAllItems.call(this, '/campaigns', 'GET', 'campaigns', {}, qs);
                          }
                          else {
                              qs.count = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, '/campaigns', 'GET', {}, qs);
                              responseData = responseData.campaigns;
                          }
                      }
                      if (operation === 'send') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/campaigns/${campaignId}/actions/send`, 'POST', {});
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/campaigns/${campaignId}`, 'GET', {});
                      }
                      if (operation === 'delete') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/campaigns/${campaignId}`, 'DELETE', {});
                          responseData = { success: true };
                      }
                      if (operation === 'replicate') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/campaigns/${campaignId}/actions/replicate`, 'POST', {});
                      }
                      if (operation === 'resend') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          responseData = await GenericFunctions_1.mailchimpApiRequest.call(this, `/campaigns/${campaignId}/actions/create-resend`, 'POST', {});
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Mailchimp = Mailchimp;
  //# sourceMappingURL=Mailchimp.node.js.map

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

  # Mailchimp credentials

  You can use these credentials to authenticate the following nodes:

  - [Mailchimp](/integrations/builtin/app-nodes/n8n-nodes-base.mailchimp.md)
  - [Mailchimp Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.mailchimptrigger.md)

  ## Prerequisites

  Create a [Mailchimp](https://www.mailchimp.com/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API key
  - OAuth2

  Refer to [Selecting an authentication method](#selecting-an-authentication-method) for guidance on which method to use.

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Generate an API key in the [API keys section](https://us1.admin.mailchimp.com/account/api/){:target=_blank .external-link} of your Mailchimp account. Refer to [Mailchimp's Generate your API key documentation](https://mailchimp.com/developer/marketing/guides/quick-start/#generate-your-api-key){:target=_blank .external-link} for more detailed instructions.

  ## Using OAuth2

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

  If you need to configure OAuth2 from scratch, [register an application](https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/#register-your-application){:target=_blank .external-link}. Refer to the [Mailchimp OAuth2 documentation](https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/){:target=_blank .external-link} for more information.

  ## Selecting an authentication method

  Mailchimp suggests using an API key if you're only accessing your own Mailchimp account's data:

  > Use an API key if you're writing code that tightly couples _your_ application's data to _your_ Mailchimp account's data. If you ever need to access _someone else's_ Mailchimp account's data, you should be using OAuth 2 ([source](https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/#when-not-to-use-oauth-2){:target=_blank .external-link})

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"bb677ff0-b3b9-46cf-a125-35efc5cac491","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"196c40debd542da4d47f1889c1f911b7dca0c0e22acd90a63a3916aee5c872d3"}}


node_type: n8n-nodes-base.ManualTrigger
name: ManualTrigger
display_name: Manual Trigger
description: Runs the flow on clicking a button in n8n
category: Other
code_hash: 3f35cd3f09861e28f965057221a8ecbf622153067834b57309d254a96f85c787
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ManualTrigger = void 0;
  class ManualTrigger {
      constructor() {
          this.description = {
              displayName: 'Manual Trigger',
              name: 'manualTrigger',
              icon: 'fa:mouse-pointer',
              group: ['trigger'],
              version: 1,
              description: 'Runs the flow on clicking a button in n8n',
              eventTriggerDescription: '',
              maxNodes: 1,
              defaults: {
                  name: 'When clicking "Execute Workflow"',
                  color: '#909298',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'This node is where a manual workflow execution starts. To make one, go back to the canvas and click ‘execute workflow’',
                      name: 'notice',
                      type: 'notice',
                      default: '',
                  },
              ],
          };
      }
      async trigger() {
          const manualTriggerFunction = async () => {
              this.emit([this.helpers.returnJsonArray([{}])]);
          };
          return {
              manualTriggerFunction,
          };
      }
  }
  exports.ManualTrigger = ManualTrigger;
  //# sourceMappingURL=ManualTrigger.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"870e068e-1e5d-4844-a856-2aac2136950e","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"bbb85621b16a0e3285d33730ac99819a08a5998387b612c112c40b647858b24e"}}


node_type: n8n-nodes-base.MailerLite
name: MailerLite
display_name: MailerLite
description: Consume Mailer Lite API
category: Other
code_hash: 0af5a52cc8e0d27ceca5f43ceaaa2ad33788a2b44bba34875a96dc54014452fb
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mailerlite
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MailerLite = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const SubscriberDescription_1 = require("./SubscriberDescription");
  class MailerLite {
      constructor() {
          this.description = {
              displayName: 'MailerLite',
              name: 'mailerLite',
              icon: 'file:mailerLite.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Mailer Lite API',
              defaults: {
                  name: 'MailerLite',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mailerLiteApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Subscriber',
                              value: 'subscriber',
                          },
                      ],
                      default: 'subscriber',
                  },
                  ...SubscriberDescription_1.subscriberOperations,
                  ...SubscriberDescription_1.subscriberFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCustomFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.mailerliteApiRequest.call(this, 'GET', '/fields');
                      for (const field of fields) {
                          returnData.push({
                              name: field.key,
                              value: field.key,
                          });
                      }
                      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 === 'subscriber') {
                      if (operation === 'create') {
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                              fields: [],
                          };
                          Object.assign(body, additionalFields);
                          if (additionalFields.customFieldsUi) {
                              const customFieldsValues = additionalFields.customFieldsUi
                                  .customFieldsValues;
                              if (customFieldsValues) {
                                  const fields = {};
                                  for (const customFieldValue of customFieldsValues) {
                                      fields[customFieldValue.fieldId] = customFieldValue.value;
                                  }
                                  body.fields = fields;
                                  delete body.customFieldsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.mailerliteApiRequest.call(this, 'POST', '/subscribers', body);
                      }
                      if (operation === 'get') {
                          const subscriberId = this.getNodeParameter('subscriberId', i);
                          responseData = await GenericFunctions_1.mailerliteApiRequest.call(this, 'GET', `/subscribers/${subscriberId}`);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mailerliteApiRequestAllItems.call(this, 'GET', '/subscribers', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mailerliteApiRequest.call(this, 'GET', '/subscribers', {}, qs);
                          }
                      }
                      if (operation === 'update') {
                          const subscriberId = this.getNodeParameter('subscriberId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          if (updateFields.customFieldsUi) {
                              const customFieldsValues = updateFields.customFieldsUi
                                  .customFieldsValues;
                              if (customFieldsValues) {
                                  const fields = {};
                                  for (const customFieldValue of customFieldsValues) {
                                      fields[customFieldValue.fieldId] = customFieldValue.value;
                                  }
                                  body.fields = fields;
                                  delete body.customFieldsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.mailerliteApiRequest.call(this, 'PUT', `/subscribers/${subscriberId}`, body);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.MailerLite = MailerLite;
  //# sourceMappingURL=MailerLite.node.js.map

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

  # MailerLite credentials

  You can use these credentials to authenticate the following nodes:

  - [MailerLite](/integrations/builtin/app-nodes/n8n-nodes-base.mailerlite.md)
  - [MailerLite Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.mailerlitetrigger.md)

  ## Prerequisites

  Create a [MailerLite](https://www.mailerlite.com/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [MailerLite's API documentation](https://developers.mailerlite.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**: Generate an API key from the **Integrations** menu. Refer to the [API Authentication documentation](https://developers.mailerlite.com/docs/#authentication){:target=_blank .external-link} for more detailed instructions.

  Enable the **Classic API** toggle if the API key is for a MailerLite Classic account instead of the newer MailerLite experience.

  /// note
  Most new MailerLite accounts and all free accounts should disable the **Classic API** toggle. You can find out [which version of MailerLite you are using](https://www.mailerlite.com/help/which-version-of-mailerlite-am-i-using) and learn more about the differences between the two in the [MailerLite FAQ](https://www.mailerlite.com/help/new-mailerlite-faq).
  ///

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"568faf5c-aba0-4c2e-8121-68170550da53","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"56b3f49e206547698a708ddc0feefffb4b762650b978628808666f17441aeba0"}}


node_type: n8n-nodes-base.Mailgun
name: Mailgun
display_name: Mailgun
description: Sends an email via Mailgun
category: Other
code_hash: c3138d05def2613a2fc1ee670a81307bc48fc7a70ed95b0077f03a6ebd69f044
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mailgun
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mailgun = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class Mailgun {
      constructor() {
          this.description = {
              displayName: 'Mailgun',
              name: 'mailgun',
              icon: 'file:mailgun.svg',
              group: ['output'],
              version: 1,
              description: 'Sends an email via Mailgun',
              defaults: {
                  name: 'Mailgun',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mailgunApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'From Email',
                      name: 'fromEmail',
                      type: 'string',
                      default: '',
                      required: true,
                      placeholder: 'Admin <admin@example.com>',
                      description: 'Email address of the sender optional with name',
                  },
                  {
                      displayName: 'To Email',
                      name: 'toEmail',
                      type: 'string',
                      default: '',
                      required: true,
                      placeholder: 'info@example.com',
                      description: 'Email address of the recipient. Multiple ones can be separated by comma.',
                  },
                  {
                      displayName: 'Cc Email',
                      name: 'ccEmail',
                      type: 'string',
                      default: '',
                      placeholder: '',
                      description: 'Cc Email address of the recipient. Multiple ones can be separated by comma.',
                  },
                  {
                      displayName: 'Bcc Email',
                      name: 'bccEmail',
                      type: 'string',
                      default: '',
                      placeholder: '',
                      description: 'Bcc Email address of the recipient. Multiple ones can be separated by comma.',
                  },
                  {
                      displayName: 'Subject',
                      name: 'subject',
                      type: 'string',
                      default: '',
                      placeholder: 'My subject line',
                      description: 'Subject line of the email',
                  },
                  {
                      displayName: 'Text',
                      name: 'text',
                      type: 'string',
                      typeOptions: {
                          rows: 5,
                      },
                      default: '',
                      description: 'Plain text message of email',
                  },
                  {
                      displayName: 'HTML',
                      name: 'html',
                      type: 'string',
                      typeOptions: {
                          rows: 5,
                          editor: 'htmlEditor',
                      },
                      default: '',
                      description: 'HTML text message of email',
                  },
                  {
                      displayName: 'Attachments',
                      name: 'attachments',
                      type: 'string',
                      default: '',
                      description: 'Name of the binary properties which contain data which should be added to email as attachment. Multiple ones can be comma-separated.',
                  },
              ],
          };
      }
      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 fromEmail = this.getNodeParameter('fromEmail', itemIndex);
                  const toEmail = this.getNodeParameter('toEmail', itemIndex);
                  const ccEmail = this.getNodeParameter('ccEmail', itemIndex);
                  const bccEmail = this.getNodeParameter('bccEmail', itemIndex);
                  const subject = this.getNodeParameter('subject', itemIndex);
                  const text = this.getNodeParameter('text', itemIndex);
                  const html = this.getNodeParameter('html', itemIndex);
                  const attachmentPropertyString = this.getNodeParameter('attachments', itemIndex);
                  const credentials = await this.getCredentials('mailgunApi');
                  const formData = {
                      from: fromEmail,
                      to: toEmail,
                      subject,
                      text,
                      html,
                  };
                  if (ccEmail.length !== 0) {
                      formData.cc = ccEmail;
                  }
                  if (bccEmail.length !== 0) {
                      formData.bcc = bccEmail;
                  }
                  if (attachmentPropertyString && item.binary) {
                      const attachments = [];
                      const attachmentProperties = attachmentPropertyString
                          .split(',')
                          .map((propertyName) => {
                          return propertyName.trim();
                      });
                      for (const propertyName of attachmentProperties) {
                          const binaryData = this.helpers.assertBinaryData(itemIndex, propertyName);
                          const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(itemIndex, propertyName);
                          attachments.push({
                              value: binaryDataBuffer,
                              options: {
                                  filename: binaryData.fileName || 'unknown',
                              },
                          });
                      }
                      if (attachments.length) {
                          formData.attachment = attachments;
                      }
                  }
                  const options = {
                      method: 'POST',
                      formData,
                      uri: `https://${credentials.apiDomain}/v3/${credentials.emailDomain}/messages`,
                      json: true,
                  };
                  let responseData;
                  try {
                      responseData = await this.helpers.requestWithAuthentication.call(this, 'mailgunApi', options);
                  }
                  catch (error) {
                      throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: itemIndex } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: itemIndex } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Mailgun = Mailgun;
  //# sourceMappingURL=Mailgun.node.js.map

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

  # Mailgun credentials

  You can use these credentials to authenticate the following nodes:

  - [Mailgun](/integrations/builtin/app-nodes/n8n-nodes-base.mailgun.md)

  ## Prerequisites

  - Create a [Mailgun](https://www.mailgun.com/){:target=_blank .external-link} account.
  - [Add and verify a domain](https://help.mailgun.com/hc/en-us/articles/360026833053-Domain-Verification-Setup-Guide){:target=_blank .external-link} in Mailgun or use the provided sandbox domain for testing.

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Domain**: If your Mailgun account is based in Europe, select **api.eu.mailgun.net**; otherwise, select **api.mailgun.net**. Refer to [Mailgun Base URLs](https://documentation.mailgun.com/docs/mailgun/api-reference/intro/#base-url){:target=_blank .external-link} for more information.
  - An **Email Domain**: Enter the email sending domain you're working with. If you have multiple sending domains, refer to [Working with multiple email domains](#working-with-multiple-email-domains) for more information.
  - An **API Key**: View your API key in **Settings > API Keys**. Refer to [Mailgun's API Authentication documentation](https://documentation.mailgun.com/docs/mailgun/api-reference/authentication/){:target=_blank .external-link} for more detailed instructions.

  ## Working with multiple email domains

  If your Mailgun account includes multiple sending domains, create a separate credential for each email domain you're working with.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"38a26696-a103-4a46-a5ff-03b713a0e171","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"e11b23595bbae11818eb61a21c999c94ba3e56ba39c6b795b1da8ed6b97a9d10"}}


node_type: n8n-nodes-base.Mailjet
name: Mailjet
display_name: Mailjet
description: Consume Mailjet API
category: Other
code_hash: 9a100847b669fd304f2adac69dade7b637bd6b0910312a076e1061b42b66f35c
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mailjet
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mailjet = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const EmailDescription_1 = require("./EmailDescription");
  const SmsDescription_1 = require("./SmsDescription");
  class Mailjet {
      constructor() {
          this.description = {
              displayName: 'Mailjet',
              name: 'mailjet',
              icon: 'file:mailjet.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Mailjet API',
              defaults: {
                  name: 'Mailjet',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mailjetEmailApi',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['email'],
                          },
                      },
                  },
                  {
                      name: 'mailjetSmsApi',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Email',
                              value: 'email',
                          },
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                      ],
                      default: 'email',
                  },
                  ...EmailDescription_1.emailOperations,
                  ...EmailDescription_1.emailFields,
                  ...SmsDescription_1.smsOperations,
                  ...SmsDescription_1.smsFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTemplates() {
                      const returnData = [];
                      const { Data: templates } = await GenericFunctions_1.mailjetApiRequest.call(this, 'GET', '/v3/REST/template');
                      for (const template of templates) {
                          returnData.push({
                              name: template.Name,
                              value: template.ID,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a;
          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 === 'email') {
                      if (operation === 'send') {
                          const fromEmail = this.getNodeParameter('fromEmail', i);
                          const htmlBody = this.getNodeParameter('html', i);
                          const textBody = this.getNodeParameter('text', i);
                          const subject = this.getNodeParameter('subject', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const toEmail = this.getNodeParameter('toEmail', i).split(',');
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const body = {
                              From: {
                                  Email: fromEmail,
                              },
                              Subject: subject,
                              To: [],
                              Cc: [],
                              Bcc: [],
                              Variables: {},
                          };
                          for (const email of toEmail) {
                              (_a = body.To) === null || _a === void 0 ? void 0 : _a.push({
                                  Email: email,
                              });
                          }
                          if (jsonParameters) {
                              const variablesJson = this.getNodeParameter('variablesJson', i);
                              const parsedJson = (0, GenericFunctions_1.validateJSON)(variablesJson);
                              if (parsedJson === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Parameter 'Variables (JSON)' has a invalid JSON", { itemIndex: i });
                              }
                              body.Variables = parsedJson;
                          }
                          else {
                              const variables = this.getNodeParameter('variablesUi', i)
                                  .variablesValues || [];
                              for (const variable of variables) {
                                  body.Variables[variable.name] = variable.value;
                              }
                          }
                          if (htmlBody) {
                              body.HTMLPart = htmlBody;
                          }
                          if (textBody) {
                              body.TextPart = textBody;
                          }
                          if (additionalFields.bccEmail) {
                              const bccEmail = additionalFields.bccEmail.split(',');
                              for (const email of bccEmail) {
                                  body.Bcc.push({
                                      Email: email,
                                  });
                              }
                          }
                          if (additionalFields.ccAddresses) {
                              const ccEmail = additionalFields.ccAddresses.split(',');
                              for (const email of ccEmail) {
                                  body.Cc.push({
                                      Email: email,
                                  });
                              }
                          }
                          if (additionalFields.trackOpens) {
                              body.TrackOpens = additionalFields.trackOpens;
                          }
                          if (additionalFields.replyTo) {
                              const replyTo = additionalFields.replyTo;
                              body.ReplyTo = {
                                  Email: replyTo,
                              };
                          }
                          if (additionalFields.trackClicks) {
                              body.TrackClicks = additionalFields.trackClicks;
                          }
                          if (additionalFields.fromName) {
                              body.From.Name = additionalFields.fromName;
                          }
                          if (additionalFields.templateLanguage) {
                              body.TemplateLanguage = additionalFields.templateLanguage;
                          }
                          if (additionalFields.priority) {
                              body.Priority = additionalFields.priority;
                          }
                          responseData = await GenericFunctions_1.mailjetApiRequest.call(this, 'POST', '/v3.1/send', {
                              Messages: [body],
                          });
                          responseData = responseData.Messages;
                      }
                      if (operation === 'sendTemplate') {
                          const fromEmail = this.getNodeParameter('fromEmail', i);
                          const templateId = parseInt(this.getNodeParameter('templateId', i), 10);
                          const subject = this.getNodeParameter('subject', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const toEmail = this.getNodeParameter('toEmail', i).split(',');
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const body = {
                              From: {
                                  Email: fromEmail,
                              },
                              Subject: subject,
                              To: [],
                              Cc: [],
                              Bcc: [],
                              Variables: {},
                              TemplateID: templateId,
                          };
                          for (const email of toEmail) {
                              body.To.push({
                                  Email: email,
                              });
                          }
                          if (jsonParameters) {
                              const variablesJson = this.getNodeParameter('variablesJson', i);
                              const parsedJson = (0, GenericFunctions_1.validateJSON)(variablesJson);
                              if (parsedJson === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Parameter 'Variables (JSON)' has a invalid JSON", { itemIndex: i });
                              }
                              body.Variables = parsedJson;
                          }
                          else {
                              const variables = this.getNodeParameter('variablesUi', i)
                                  .variablesValues || [];
                              for (const variable of variables) {
                                  body.Variables[variable.name] = variable.value;
                              }
                          }
                          if (additionalFields.bccEmail) {
                              const bccEmail = additionalFields.bccEmail.split(',');
                              for (const email of bccEmail) {
                                  body.Bcc.push({
                                      Email: email,
                                  });
                              }
                          }
                          if (additionalFields.ccEmail) {
                              const ccEmail = additionalFields.ccEmail.split(',');
                              for (const email of ccEmail) {
                                  body.Cc.push({
                                      Email: email,
                                  });
                              }
                          }
                          if (additionalFields.replyTo) {
                              const replyTo = additionalFields.replyTo;
                              body.ReplyTo = {
                                  Email: replyTo,
                              };
                          }
                          if (additionalFields.trackOpens) {
                              body.TrackOpens = additionalFields.trackOpens;
                          }
                          if (additionalFields.trackClicks) {
                              body.TrackClicks = additionalFields.trackClicks;
                          }
                          if (additionalFields.fromName) {
                              body.From.Name = additionalFields.fromName;
                          }
                          if (additionalFields.templateLanguage) {
                              body.TemplateLanguage = additionalFields.templateLanguage;
                          }
                          if (additionalFields.priority) {
                              body.Priority = additionalFields.priority;
                          }
                          responseData = await GenericFunctions_1.mailjetApiRequest.call(this, 'POST', '/v3.1/send', {
                              Messages: [body],
                          });
                          responseData = responseData.Messages;
                      }
                  }
                  if (resource === 'sms') {
                      if (operation === 'send') {
                          const from = this.getNodeParameter('from', i);
                          const to = this.getNodeParameter('to', i);
                          const text = this.getNodeParameter('text', i);
                          const body = {
                              From: from,
                              To: to,
                              Text: text,
                          };
                          responseData = await GenericFunctions_1.mailjetApiRequest.call(this, 'POST', '/v4/sms-send', 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.Mailjet = Mailjet;
  //# sourceMappingURL=Mailjet.node.js.map

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

  # Mailjet credentials

  You can use these credentials to authenticate the following nodes:

  - [Mailjet](/integrations/builtin/app-nodes/n8n-nodes-base.mailjet.md)
  - [Mailjet Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.mailjettrigger.md)

  ## Prerequisites

  Create a [Mailjet](https://www.mailjet.com/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - Email API key: For use with Mailjet's Email API
  - SMS token: For use with Mailjet's SMS API

  ## Related resources

  Refer to [Mailjet's Email API documentation](https://dev.mailjet.com/email/guides/){:target=_blank .external-link} and [Mailjet's SMS API documentation](https://dev.mailjet.com/sms/guides/){:target=_blank .external-link} for more information about each service.

  ## Using Email API key

  To configure this credential, you'll need:

  - An **API Key**: View and generate API keys in your Mailjet [API Key Management](https://app.mailjet.com/account/api_keys){:target=_blank .external-link} page.
  - A **Secret Key**: View your API Secret Keys in your Mailjet [API Key Management](https://app.mailjet.com/account/api_keys){:target=_blank .external-link} page.
  - _Optional:_ Select whether to use **Sandbox Mode** for calls made using this credential. When turned on, all API calls use Sandbox mode: the API will still validate the payloads but won't deliver the actual messages. This can be useful to troubleshoot any payload error messages without actually sending messages. Refer to Mailjet's [Sandbox Mode documentation](https://dev.mailjet.com/email/guides/send-api-v31/#sandbox-mode){:target=_blank .external-link} for more information.

  For this credential, you can use either:

  - Mailjet's primary API key and secret key
  - A subaccount API key and secret key

  Refer to Mailjet's [How to create a subaccount (or additional API key) documentation](https://documentation.mailjet.com/hc/en-us/articles/360042561974-How-to-create-a-subaccount-or-additional-API-Key){:target=_blank .external-link} for detailed instructions on creating more API keys. Refer to [What are subaccounts and how does it help me?](https://documentation.mailjet.com/hc/en-us/articles/360042561854-What-are-subaccounts-and-how-does-it-help-me){:target=_blank .external-link} page for more information on Mailjet subaccounts and when you might want to use one.

  ## Using SMS Token

  To configure this credential, you'll need:

  - An access **Token**: Generate a new token from Mailjet's [SMS Dashboard](https://app.mailjet.com/sms){:target=_blank .external-link}. Refer to the [SMS API Getting Started guide](https://dev.mailjet.com/sms/guides/getting-started/){:target=_blank .external-link} for more detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"6ab01493-1adf-499d-abd7-c1e3e3b417b6","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"212f6341fe5a2231d03d3da296c839590256d6f88cdc6bc7edaf2c37fe112447"}}


node_type: n8n-nodes-base.Mandrill
name: Mandrill
display_name: Mandrill
description: Consume Mandrill API
category: Other
code_hash: 657483f4909d3e32f7e699bcb912c62b28ebb22b51a309fd9b7b73c498f6680b
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mandrill
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
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.Mandrill = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_1 = __importDefault(require("moment"));
  const map_1 = __importDefault(require("lodash/map"));
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  class Mandrill {
      constructor() {
          this.description = {
              displayName: 'Mandrill',
              name: 'mandrill',
              icon: 'file:mandrill.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Mandrill API',
              defaults: {
                  name: 'Mandrill',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mandrillApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Message',
                              value: 'message',
                              description: 'Send a message',
                          },
                      ],
                      default: 'message',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Send Template',
                              value: 'sendTemplate',
                              description: 'Send message based on template',
                              action: 'Send a message based on a template',
                          },
                          {
                              name: 'Send HTML',
                              value: 'sendHtml',
                              description: 'Send message based on HTML',
                              action: 'Send a message based on HTML',
                          },
                      ],
                      default: 'sendTemplate',
                  },
                  {
                      displayName: 'Template Name or ID',
                      name: 'template',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getTemplates',
                      },
                      displayOptions: {
                          show: {
                              operation: ['sendTemplate'],
                          },
                      },
                      default: '',
                      options: [],
                      required: true,
                      description: 'The template you want to send. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'From Email',
                      name: 'fromEmail',
                      type: 'string',
                      default: '',
                      required: true,
                      placeholder: 'Admin <example@yourdomain.com>',
                      description: 'Email address of the sender optional with name',
                      displayOptions: {
                          show: {
                              operation: ['sendHtml', 'sendTemplate'],
                          },
                      },
                  },
                  {
                      displayName: 'To Email',
                      name: 'toEmail',
                      type: 'string',
                      default: '',
                      required: true,
                      placeholder: 'info@example.com',
                      description: 'Email address of the recipient. Multiple ones can be separated by comma.',
                      displayOptions: {
                          show: {
                              operation: ['sendHtml', 'sendTemplate'],
                          },
                      },
                  },
                  {
                      displayName: 'JSON Parameters',
                      name: 'jsonParameters',
                      type: 'boolean',
                      default: false,
                      displayOptions: {
                          show: {
                              operation: ['sendHtml', 'sendTemplate'],
                          },
                      },
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['sendHtml', 'sendTemplate'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Async',
                              name: 'async',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable a background sending mode that is optimized for bulk sending. In async mode, messages/send will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the \'reject\' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.',
                          },
                          {
                              displayName: 'Auto Text',
                              name: 'autoText',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not to automatically generate a text part for messages that are not given text',
                          },
                          {
                              displayName: 'Auto HTML',
                              name: 'autoHtml',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not to automatically generate an HTML part for messages that are not given HTML',
                          },
                          {
                              displayName: 'BCC Address',
                              name: 'bccAddress',
                              type: 'string',
                              default: '',
                              placeholder: 'message.bcc_address@example.com',
                              description: "An optional address to receive an exact copy of each recipient's email",
                          },
                          {
                              displayName: 'From Name',
                              name: 'fromName',
                              type: 'string',
                              default: '',
                              placeholder: 'John Doe',
                              description: 'Optional from name to be used',
                          },
                          {
                              displayName: 'Google Analytics Campaign',
                              name: 'googleAnalyticsCampaign',
                              type: 'string',
                              default: '',
                              placeholder: '',
                              description: "Optional string indicating the value to set for the utm_campaign tracking parameter. If this isn't provided the email's from address will be used instead.",
                          },
                          {
                              displayName: 'Google Analytics Domains',
                              name: 'googleAnalyticsDomains',
                              type: 'string',
                              default: '',
                              placeholder: '',
                              description: 'An array of strings separated by a comma (,) indicating for which any matching URLs will automatically have Google Analytics parameters appended to their query string automatically',
                          },
                          {
                              displayName: 'HTML',
                              name: 'html',
                              type: 'string',
                              default: '',
                              typeOptions: {
                                  rows: 5,
                              },
                              options: [],
                              description: 'The html you want to send',
                          },
                          {
                              displayName: 'Important',
                              name: 'important',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not this message is important, and should be delivered ahead of non-important messages',
                          },
                          {
                              displayName: 'Inline CSS',
                              name: 'inlineCss',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not to automatically inline all CSS styles provided in the message HTML - only for HTML documents less than 256KB in size',
                          },
                          {
                              displayName: 'Ip Pool',
                              name: 'ipPool',
                              type: 'string',
                              default: '',
                              placeholder: '',
                              description: 'The name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.',
                          },
                          {
                              displayName: 'Preserve Recipients',
                              name: 'preserveRecipients',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not to expose all recipients in to "To" header for each email',
                          },
                          {
                              displayName: 'Return Path Domain',
                              name: 'returnPathDomain',
                              type: 'string',
                              default: '',
                              placeholder: '',
                              description: "A custom domain to use for the messages's return-path",
                          },
                          {
                              displayName: 'Sent At',
                              name: 'sendAt',
                              type: 'dateTime',
                              default: '',
                              placeholder: '',
                              description: 'When this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately. An additional fee applies for scheduled email, and this feature is only available to accounts with a positive balance.',
                          },
                          {
                              displayName: 'Signing Domain',
                              name: 'signingDomain',
                              type: 'string',
                              default: '',
                              placeholder: '',
                              description: 'A custom domain to use for SPF/DKIM signing instead of mandrill(for "via" or "on behalf of" in email clients)',
                          },
                          {
                              displayName: 'Subaccount',
                              name: 'subAccount',
                              type: 'string',
                              default: '',
                              placeholder: '',
                              description: 'The unique ID of a subaccount for this message - must already exist or will fail with an error',
                          },
                          {
                              displayName: 'Subject',
                              name: 'subject',
                              type: 'string',
                              default: '',
                              placeholder: 'My subject line',
                              description: 'Subject line of the email',
                          },
                          {
                              displayName: 'Tags',
                              name: 'tags',
                              type: 'string',
                              default: '',
                              placeholder: '',
                              description: 'An array of string separated by a comma (,) to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and will cause errors.',
                          },
                          {
                              displayName: 'Text',
                              name: 'text',
                              type: 'string',
                              default: '',
                              typeOptions: {
                                  rows: 5,
                              },
                              options: [],
                              description: 'Example text content',
                          },
                          {
                              displayName: 'Track Clicks',
                              name: 'trackClicks',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not to turn on click tracking for the message',
                          },
                          {
                              displayName: 'Track Opens',
                              name: 'trackOpens',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not to turn on open tracking for the message',
                          },
                          {
                              displayName: 'Tracking Domain',
                              name: 'trackingDomain',
                              type: 'string',
                              default: '',
                              placeholder: '',
                              description: 'A custom domain to use for tracking opens and clicks instead of mandrillapp.com',
                          },
                          {
                              displayName: 'Url Strip Qs',
                              name: 'urlStripQs',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not to strip the query string from URLs when aggregating tracked URL data',
                          },
                          {
                              displayName: 'View Content Link',
                              name: 'viewContentLink',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to remove content logging for sensitive emails',
                          },
                      ],
                  },
                  {
                      displayName: 'Merge Vars',
                      name: 'mergeVarsJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      default: '',
                      placeholder: `[
  	{
  		{ "name": "name", "content": "content" }
  	}
  ]`,
                      displayOptions: {
                          show: {
                              jsonParameters: [true],
                          },
                      },
                      description: 'Global merge variables',
                  },
                  {
                      displayName: 'Merge Vars',
                      name: 'mergeVarsUi',
                      placeholder: 'Add Merge Vars',
                      type: 'fixedCollection',
                      default: {},
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              jsonParameters: [false],
                          },
                      },
                      description: 'Per-recipient merge variables',
                      options: [
                          {
                              name: 'mergeVarsValues',
                              displayName: 'Vars',
                              values: [
                                  {
                                      displayName: 'Name',
                                      name: 'name',
                                      type: 'string',
                                      default: '',
                                  },
                                  {
                                      displayName: 'Content',
                                      name: 'content',
                                      type: 'string',
                                      default: '',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Metadata',
                      name: 'metadataUi',
                      placeholder: 'Add Metadata',
                      type: 'fixedCollection',
                      default: {},
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              jsonParameters: [false],
                          },
                      },
                      description: 'Metadata an associative array of user metadata. Mandrill will store this metadata and make it available for retrieval. In addition, you can select up to 10 metadata fields to index and make searchable using the Mandrill search api.',
                      options: [
                          {
                              name: 'metadataValues',
                              displayName: 'Metadata',
                              values: [
                                  {
                                      displayName: 'Name',
                                      name: 'name',
                                      type: 'string',
                                      default: 'Name of the metadata key to add.',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                      description: 'Value to set for the metadata key',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Metadata',
                      name: 'metadataJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      displayOptions: {
                          show: {
                              jsonParameters: [true],
                          },
                      },
                      default: '',
                      placeholder: `{
  	"website": "www.example.com"
  }`,
                      description: 'Metadata an associative array of user metadata. Mandrill will store this metadata and make it available for retrieval. In addition, you can select up to 10 metadata fields to index and make searchable using the Mandrill search api.',
                  },
                  {
                      displayName: 'Attachments',
                      name: 'attachmentsJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      displayOptions: {
                          show: {
                              jsonParameters: [true],
                          },
                      },
                      default: '',
                      placeholder: `[
  	{
  		"type": "text/plain" (the MIME type of the attachment),
  		"name": "myfile.txt" (the file name of the attachment),
  		"content": "ZXhhbXBsZSBmaWxl" (the content of the attachment as a base64-encoded string)
  	}
  ]`,
                      description: 'An array of supported attachments to add to the message',
                  },
                  {
                      displayName: 'Attachments',
                      name: 'attachmentsUi',
                      placeholder: 'Add Attachments',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              jsonParameters: [false],
                          },
                      },
                      options: [
                          {
                              name: 'attachmentsValues',
                              displayName: 'Attachments Values',
                              values: [
                                  {
                                      displayName: 'Type',
                                      name: 'type',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'text/plain',
                                      description: 'The MIME type of the attachment',
                                  },
                                  {
                                      displayName: 'Name',
                                      name: 'name',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'myfile.txt',
                                      description: 'The file name of the attachment',
                                  },
                                  {
                                      displayName: 'Content',
                                      name: 'content',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'ZXhhbXBsZSBmaWxl',
                                      description: 'The content of the attachment as a base64-encoded string',
                                  },
                              ],
                          },
                          {
                              name: 'attachmentsBinary',
                              displayName: 'Attachments Binary',
                              values: [
                                  {
                                      displayName: 'Property',
                                      name: 'property',
                                      type: 'string',
                                      default: '',
                                      description: 'Name of the binary properties which contain data which should be added to email as attachment',
                                  },
                              ],
                          },
                      ],
                      default: {},
                      description: 'Array of supported attachments to add to the message',
                  },
                  {
                      displayName: 'Headers',
                      name: 'headersJson',
                      type: 'json',
                      default: '',
                      placeholder: `{
  	"Reply-To": "replies@example.com"
  }`,
                      displayOptions: {
                          show: {
                              jsonParameters: [true],
                          },
                      },
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      description: 'Optional extra headers to add to the message (most headers are allowed)',
                  },
                  {
                      displayName: 'Headers',
                      name: 'headersUi',
                      placeholder: 'Add Headers',
                      type: 'fixedCollection',
                      default: {},
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              jsonParameters: [false],
                          },
                      },
                      options: [
                          {
                              name: 'headersValues',
                              displayName: 'Values',
                              values: [
                                  {
                                      displayName: 'Name',
                                      name: 'name',
                                      type: 'string',
                                      default: '',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                  },
                              ],
                          },
                      ],
                      description: 'Optional extra headers to add to the message (most headers are allowed)',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTemplates() {
                      const returnData = [];
                      let templates;
                      try {
                          templates = await GenericFunctions_1.mandrillApiRequest.call(this, '/templates', 'POST', '/list');
                      }
                      catch (error) {
                          throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                      }
                      for (const template of templates) {
                          const templateName = template.name;
                          const templateSlug = template.slug;
                          returnData.push({
                              name: templateName,
                              value: templateSlug,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const returnData = [];
          const items = this.getInputData();
          let responseData;
          let emailSentResponse;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'message') {
                      const options = this.getNodeParameter('options', i);
                      const fromEmail = this.getNodeParameter('fromEmail', i);
                      const toEmail = this.getNodeParameter('toEmail', i);
                      const jsonActive = this.getNodeParameter('jsonParameters', i);
                      const toEmailArray = (0, GenericFunctions_1.getToEmailArray)(toEmail);
                      const message = {
                          html: options.html ? options.html : '',
                          text: options.text ? options.text : '',
                          subject: options.subject ? options.subject : '',
                          from_email: fromEmail,
                          to: toEmailArray,
                          important: options.important ? options.important : false,
                          track_opens: options.trackOpens ? options.trackOpens : false,
                          track_clicks: options.trackClicks ? options.trackClicks : false,
                          auto_text: options.autoText ? options.autoText : false,
                          auto_html: options.autoHtml ? options.autoHtml : false,
                          inline_css: options.inlineCss ? options.inlineCss : false,
                          url_strip_qs: options.urlStripQs ? options.urlStripQs : false,
                          preserve_recipients: options.preserveRecipients ? options.preserveRecipients : false,
                          view_content_link: options.viewContentLink ? options.viewContentLink : false,
                          async: options.async ? options.async : false,
                          google_analytics_campaign: options.googleAnalyticsCampaign
                              ? options.googleAnalyticsCampaign
                              : '',
                          ip_pool: options.ipPool ? options.ipPool : '',
                          bcc_address: options.bccAddress ? options.bccAddress : '',
                          tracking_domain: options.trackingDomain ? options.trackingDomain : '',
                          signing_domain: options.signingDomain ? options.signingDomain : '',
                          return_path_domain: options.returnPathDomain ? options.returnPathDomain : '',
                      };
                      if (options.googleAnalyticsDomains) {
                          message.google_analytics_domains = (0, GenericFunctions_1.getGoogleAnalyticsDomainsArray)(options.googleAnalyticsDomains);
                      }
                      if (options.tags) {
                          message.tags = (0, GenericFunctions_1.getTags)(options.tags);
                      }
                      if (options.fromName) {
                          message.from_name = options.fromName;
                      }
                      if (options.subaccount) {
                          message.subaccount = options.subaccount;
                      }
                      const body = {
                          template_content: [],
                          message,
                      };
                      if (options.sendAt) {
                          body.send_at = (0, moment_1.default)(options.sendAt).utc().format('YYYY-MM-DD HH:mm:ss');
                      }
                      if (jsonActive) {
                          body.message.headers = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('headersJson', i));
                          body.message.metadata = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('metadataJson', i));
                          body.message.global_merge_vars = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('mergeVarsJson', i));
                          body.message.attachments = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('attachmentsJson', i));
                      }
                      else {
                          const headersUi = this.getNodeParameter('headersUi', i);
                          if (!(0, isEmpty_1.default)(headersUi)) {
                              body.message.headers = (0, map_1.default)(headersUi.headersValues, (o) => {
                                  const aux = {};
                                  aux[o.name] = o.value;
                                  return aux;
                              });
                          }
                          const metadataUi = this.getNodeParameter('metadataUi', i);
                          if (!(0, isEmpty_1.default)(metadataUi)) {
                              body.message.metadata = (0, map_1.default)(metadataUi.metadataValues, (o) => {
                                  const aux = {};
                                  aux[o.name] = o.value;
                                  return aux;
                              });
                          }
                          const mergeVarsUi = this.getNodeParameter('mergeVarsUi', i);
                          if (!(0, isEmpty_1.default)(mergeVarsUi)) {
                              body.message.global_merge_vars = (0, map_1.default)(mergeVarsUi.mergeVarsValues, (o) => {
                                  const aux = {};
                                  aux.name = o.name;
                                  aux.content = o.content;
                                  return aux;
                              });
                          }
                          const attachmentsUi = this.getNodeParameter('attachmentsUi', i);
                          let attachmentsBinary = [], attachmentsValues = [];
                          if (!(0, isEmpty_1.default)(attachmentsUi)) {
                              if (attachmentsUi.hasOwnProperty('attachmentsValues') &&
                                  !(0, isEmpty_1.default)(attachmentsUi.attachmentsValues)) {
                                  attachmentsValues = (0, map_1.default)(attachmentsUi.attachmentsValues, (o) => {
                                      const aux = {};
                                      aux.name = o.name;
                                      aux.content = o.content;
                                      aux.type = o.type;
                                      return aux;
                                  });
                              }
                              if (attachmentsUi.hasOwnProperty('attachmentsBinary') &&
                                  !(0, isEmpty_1.default)(attachmentsUi.attachmentsBinary) &&
                                  items[i].binary) {
                                  attachmentsBinary = (0, map_1.default)(attachmentsUi.attachmentsBinary, (o) => {
                                      if (items[i].binary.hasOwnProperty(o.property)) {
                                          const aux = {};
                                          aux.name = items[i].binary[o.property].fileName || 'unknown';
                                          aux.content = items[i].binary[o.property].data;
                                          aux.type = items[i].binary[o.property].mimeType;
                                          return aux;
                                      }
                                  });
                              }
                          }
                          body.message.attachments = attachmentsBinary.concat(attachmentsValues);
                      }
                      if (operation === 'sendTemplate') {
                          const template = this.getNodeParameter('template', i);
                          body.template_name = template;
                          emailSentResponse = GenericFunctions_1.mandrillApiRequest.call(this, '/messages', 'POST', '/send-template', body);
                      }
                      else if (operation === 'sendHtml') {
                          emailSentResponse = GenericFunctions_1.mandrillApiRequest.call(this, '/messages', 'POST', '/send', body);
                      }
                      responseData = await emailSentResponse;
                  }
                  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.Mandrill = Mandrill;
  //# sourceMappingURL=Mandrill.node.js.map

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

  # Mandrill credentials

  You can use these credentials to authenticate the following nodes:

  - [Mandrill](/integrations/builtin/app-nodes/n8n-nodes-base.mandrill.md)

  ## Prerequisites

  - Create a Mailchimp [Transactional email account](https://mailchimp.com/features/transactional-email-infrastructure/){:target=_blank .external-link} 
  - Log in to [Mandrill](https://mandrillapp.com/login/){:target=_blank .external-link} with your Mailchimp account.

  If you already have a Mailchimp account with a Standard plan or higher, enable [Transactional Emails](https://mailchimp.com/help/add-or-remove-transactional-email){:target=_blank .external-link} within that account to use Mandrill.

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Generate an API key from the Mandrill [Settings](https://mandrillapp.com/settings){:target=_blank .external-link}. Refer to Mailchimp's [Generate your API key documentation](https://mailchimp.com/developer/transactional/guides/quick-start/#generate-your-api-key){:target=_blank .external-link} for more detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"adb6f3e1-4ab6-4286-ba3b-da47797a06b7","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"66f4d307e6881e2c91240029ad369c41b697624bf6c927432622c54a23f338d5"}}


node_type: n8n-nodes-base.Marketstack
name: Marketstack
display_name: Marketstack
description: Consume Marketstack API
category: Other
code_hash: 098ff7375610f64c4f10cdaa78dbfa45ab7c388f1349b0dec97e88a16ec18538
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/marketstack
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Marketstack = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Marketstack {
      constructor() {
          this.description = {
              displayName: 'Marketstack',
              name: 'marketstack',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              icon: 'file:marketstack.svg',
              group: ['transform'],
              version: 1,
              description: 'Consume Marketstack API',
              defaults: {
                  name: 'Marketstack',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'marketstackApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'End-of-Day Data',
                              value: 'endOfDayData',
                              description: 'Stock market closing data',
                          },
                          {
                              name: 'Exchange',
                              value: 'exchange',
                              description: 'Stock market exchange',
                          },
                          {
                              name: 'Ticker',
                              value: 'ticker',
                              description: 'Stock market symbol',
                          },
                      ],
                      default: 'endOfDayData',
                      required: true,
                  },
                  ...descriptions_1.endOfDayDataOperations,
                  ...descriptions_1.endOfDayDataFields,
                  ...descriptions_1.exchangeOperations,
                  ...descriptions_1.exchangeFields,
                  ...descriptions_1.tickerOperations,
                  ...descriptions_1.tickerFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'endOfDayData') {
                      if (operation === 'getAll') {
                          const qs = {
                              symbols: this.getNodeParameter('symbols', i),
                          };
                          const { latest, specificDate, dateFrom, dateTo, ...rest } = this.getNodeParameter('filters', i);
                          GenericFunctions_1.validateTimeOptions.call(this, [
                              latest !== undefined && latest,
                              specificDate !== undefined,
                              dateFrom !== undefined && dateTo !== undefined,
                          ]);
                          if (Object.keys(rest).length) {
                              Object.assign(qs, rest);
                          }
                          let endpoint;
                          if (latest) {
                              endpoint = '/eod/latest';
                          }
                          else if (specificDate) {
                              endpoint = `/eod/${(0, GenericFunctions_1.format)(specificDate)}`;
                          }
                          else {
                              if (!dateFrom || !dateTo) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter a start and end date to filter by timeframe.', { itemIndex: i });
                              }
                              endpoint = '/eod';
                              qs.date_from = (0, GenericFunctions_1.format)(dateFrom);
                              qs.date_to = (0, GenericFunctions_1.format)(dateTo);
                          }
                          responseData = await GenericFunctions_1.marketstackApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
                      }
                  }
                  else if (resource === 'exchange') {
                      if (operation === 'get') {
                          const exchange = this.getNodeParameter('exchange', i);
                          const endpoint = `/exchanges/${exchange}`;
                          responseData = await GenericFunctions_1.marketstackApiRequest.call(this, 'GET', endpoint);
                      }
                  }
                  else if (resource === 'ticker') {
                      if (operation === 'get') {
                          const symbol = this.getNodeParameter('symbol', i);
                          const endpoint = `/tickers/${symbol}`;
                          responseData = await GenericFunctions_1.marketstackApiRequest.call(this, 'GET', endpoint);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Marketstack = Marketstack;
  //# sourceMappingURL=Marketstack.node.js.map

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

  # Marketstack credentials

  You can use these credentials to authenticate the following nodes:

  - [Marketstack](/integrations/builtin/app-nodes/n8n-nodes-base.marketstack.md)

  ## Prerequisites

  Create a [Marketstack](https://marketstack.com/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: View and generate API keys in your Marketstack [account dashboard](https://marketstack.com/dashboard){:target=_blank .external-link}.
  - Select whether to **Use HTTPS**: Make this selection based on your Marketstack account plan level:
      - Free plan: Turn off **Use HTTPS**
      - All other plans: Turn on **Use HTTPS**

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"ce8399c8-adef-4734-b324-55ebb2c4c367","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"9b8ccfada90c5cbfb55d926c842a7cf0bee2584a9ef3416df7338f46ced0190a"}}


node_type: n8n-nodes-base.Markdown
name: Markdown
display_name: Markdown
description: Convert data between Markdown and HTML
category: Other
code_hash: 32b117c3ea879ef7772b83158e47c9db429370a9fd5b3a30dcb41fba78d4fd06
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.markdown
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
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.Markdown = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const showdown_1 = require("showdown");
  const node_html_markdown_1 = require("node-html-markdown");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  const set_1 = __importDefault(require("lodash/set"));
  class Markdown {
      constructor() {
          this.description = {
              displayName: 'Markdown',
              name: 'markdown',
              icon: 'file:markdown.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["mode"]==="markdownToHtml" ? "Markdown to HTML" : "HTML to Markdown"}}',
              description: 'Convert data between Markdown and HTML',
              defaults: {
                  name: 'Markdown',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [],
              properties: [
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      options: [
                          {
                              name: 'Markdown to HTML',
                              value: 'markdownToHtml',
                              description: 'Convert data from Markdown to HTML',
                          },
                          {
                              name: 'HTML to Markdown',
                              value: 'htmlToMarkdown',
                              description: 'Convert data from HTML to Markdown',
                          },
                      ],
                      default: 'htmlToMarkdown',
                  },
                  {
                      displayName: 'HTML',
                      name: 'html',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['htmlToMarkdown'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'The HTML to be converted to markdown',
                  },
                  {
                      displayName: 'Markdown',
                      name: 'markdown',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['markdownToHtml'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'The Markdown to be converted to html',
                  },
                  {
                      displayName: 'Destination Key',
                      name: 'destinationKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['markdownToHtml', 'htmlToMarkdown'],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: '',
                      description: 'The field to put the output in. Specify nested fields using dots, e.g."level1.level2.newKey".',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              mode: ['htmlToMarkdown'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Bullet Marker',
                              name: 'bulletMarker',
                              type: 'string',
                              default: '*',
                              description: 'Specify bullet marker, default *',
                          },
                          {
                              displayName: 'Code Block Fence',
                              name: 'codeFence',
                              type: 'string',
                              default: '```',
                              description: 'Specify code block fence, default ```',
                          },
                          {
                              displayName: 'Emphasis Delimiter',
                              name: 'emDelimiter',
                              type: 'string',
                              default: '_',
                              description: 'Specify emphasis delimiter, default _',
                          },
                          {
                              displayName: 'Global Escape Pattern',
                              name: 'globalEscape',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: false,
                              },
                              default: {},
                              description: 'Setting this will override the default escape settings, you might want to use textReplace option instead',
                              options: [
                                  {
                                      name: 'value',
                                      displayName: 'Value',
                                      values: [
                                          {
                                              displayName: 'Pattern',
                                              name: 'pattern',
                                              type: 'string',
                                              default: '',
                                              description: 'RegEx for pattern',
                                          },
                                          {
                                              displayName: 'Replacement',
                                              name: 'replacement',
                                              type: 'string',
                                              default: '',
                                              description: 'String replacement',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Ignored Elements',
                              name: 'ignore',
                              type: 'string',
                              default: '',
                              description: 'Supplied elements will be ignored (ignores inner text does not parse children)',
                              placeholder: 'e.g. h1, p ...',
                              hint: 'Comma separated elements',
                          },
                          {
                              displayName: 'Keep Images With Data',
                              name: 'keepDataImages',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to keep images with data: URI (Note: These can be up to 1MB each), e.g. &lt;img src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSK......0o/"&gt;',
                          },
                          {
                              displayName: 'Line Start Escape Pattern',
                              name: 'lineStartEscape',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: false,
                              },
                              default: {},
                              description: 'Setting this will override the default escape settings, you might want to use textReplace option instead',
                              options: [
                                  {
                                      name: 'value',
                                      displayName: 'Value',
                                      values: [
                                          {
                                              displayName: 'Pattern',
                                              name: 'pattern',
                                              type: 'string',
                                              default: '',
                                              description: 'RegEx for pattern',
                                          },
                                          {
                                              displayName: 'Replacement',
                                              name: 'replacement',
                                              type: 'string',
                                              default: '',
                                              description: 'String replacement',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Max Consecutive New Lines',
                              name: 'maxConsecutiveNewlines',
                              type: 'number',
                              default: 3,
                              description: 'Specify max consecutive new lines allowed',
                          },
                          {
                              displayName: 'Place URLs At The Bottom',
                              name: 'useLinkReferenceDefinitions',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to Place URLS at the bottom and format links using link reference definitions',
                          },
                          {
                              displayName: 'Strong Delimiter',
                              name: 'strongDelimiter',
                              type: 'string',
                              default: '**',
                              description: 'Specify strong delimiter, default **',
                          },
                          {
                              displayName: 'Style For Code Block',
                              name: 'codeBlockStyle',
                              type: 'options',
                              default: 'fence',
                              description: 'Specify style for code block, default "fence"',
                              options: [
                                  {
                                      name: 'Fence',
                                      value: 'fence',
                                  },
                                  {
                                      name: 'Indented',
                                      value: 'indented',
                                  },
                              ],
                          },
                          {
                              displayName: 'Text Replacement Pattern',
                              name: 'textReplace',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: [],
                              description: 'User-defined text replacement pattern (Replaces matching text retrieved from nodes)',
                              options: [
                                  {
                                      name: 'values',
                                      displayName: 'Values',
                                      values: [
                                          {
                                              displayName: 'Pattern',
                                              name: 'pattern',
                                              type: 'string',
                                              default: '',
                                              description: 'RegEx for pattern',
                                          },
                                          {
                                              displayName: 'Replacement',
                                              name: 'replacement',
                                              type: 'string',
                                              default: '',
                                              description: 'String replacement',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Treat As Blocks',
                              name: 'blockElements',
                              type: 'string',
                              default: '',
                              description: 'Supplied elements will be treated as blocks (surrounded with blank lines)',
                              placeholder: 'e.g. p, div, ...',
                              hint: 'Comma separated elements',
                          },
                      ],
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              mode: ['markdownToHtml'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Add Blank To Links',
                              name: 'openLinksInNewWindow',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to open all links in new windows (by adding the attribute target="_blank" to <a> tags)',
                          },
                          {
                              displayName: 'Automatic Linking to URLs',
                              name: 'simplifiedAutoLink',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable automatic linking to URLs',
                          },
                          {
                              displayName: 'Backslash Escapes HTML Tags',
                              name: 'backslashEscapesHTMLTags',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to support for HTML Tag escaping ex: &lt;div&gt;foo&lt;/div&gt;',
                          },
                          {
                              displayName: 'Complete HTML Document',
                              name: 'completeHTMLDocument',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to output a complete html document, including &lt;html&gt;, &lt;head&gt; and &lt;body&gt; tags instead of an HTML fragment',
                          },
                          {
                              displayName: 'Customized Header ID',
                              name: 'customizedHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to use text in curly braces as header ID',
                          },
                          {
                              displayName: 'Emoji Support',
                              name: 'emoji',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable emoji support. Ex: this is a :smile: emoji For more info on available emojis, see https://github.com/showdownjs/showdown/wiki/Emojis.',
                          },
                          {
                              displayName: 'Encode Emails',
                              name: 'encodeEmails',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to enable e-mail addresses encoding through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
                          },
                          {
                              displayName: 'Exclude Trailing Punctuation From URLs',
                              name: 'excludeTrailingPunctuationFromURLs',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to exclude trailing punctuation from autolinking URLs. Punctuation excluded: . ! ? ( ). Only applies if simplifiedAutoLink option is set to true.',
                          },
                          {
                              displayName: 'GitHub Code Blocks',
                              name: 'ghCodeBlocks',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to enable support for GFM code block style',
                          },
                          {
                              displayName: 'GitHub Compatible Header IDs',
                              name: 'ghCompatibleHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to generate header IDs compatible with github style (spaces are replaced with dashes and a bunch of non alphanumeric chars are removed)',
                          },
                          {
                              displayName: 'GitHub Mention Link',
                              name: 'ghMentionsLink',
                              type: 'string',
                              default: 'https://github.com/{u}',
                              description: 'Whether to change the link generated by @mentions. Showdown will replace {u} with the username. Only applies if ghMentions option is enabled.',
                          },
                          {
                              displayName: 'GitHub Mentions',
                              name: 'ghMentions',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable github @mentions, which link to the username mentioned',
                          },
                          {
                              displayName: 'GitHub Task Lists',
                              name: 'tasklists',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable support for GFM tasklists',
                          },
                          {
                              displayName: 'Header Level Start',
                              name: 'headerLevelStart',
                              type: 'number',
                              default: 1,
                              description: 'Whether to set the header starting level',
                          },
                          {
                              displayName: 'Mandatory Space Before Header',
                              name: 'requireSpaceBeforeHeadingText',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to make adding a space between # and the header text mandatory',
                          },
                          {
                              displayName: 'Middle Word Asterisks',
                              name: 'literalMidWordAsterisks',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to stop showdown from interpreting asterisks in the middle of words as <em> and <strong> and instead treat them as literal asterisks',
                          },
                          {
                              displayName: 'Middle Word Underscores',
                              name: 'literalMidWordUnderscores',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to stop showdown from interpreting underscores in the middle of words as <em> and <strong> and instead treat them as literal underscores',
                          },
                          {
                              displayName: 'No Header ID',
                              name: 'noHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to disable the automatic generation of header IDs',
                          },
                          {
                              displayName: 'Parse Image Dimensions',
                              name: 'parseImgDimensions',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable support for setting image dimensions from within markdown syntax',
                          },
                          {
                              displayName: 'Prefix Header ID',
                              name: 'prefixHeaderId',
                              type: 'string',
                              default: 'section',
                              description: 'Add a prefix to the generated header IDs',
                          },
                          {
                              displayName: 'Raw Header ID',
                              name: 'rawHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to remove only spaces, \' and " from generated header IDs (including prefixes), replacing them with dashes (-)',
                          },
                          {
                              displayName: 'Raw Prefix Header ID',
                              name: 'rawPrefixHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to prevent showdown from modifying the prefix',
                          },
                          {
                              displayName: 'Simple Line Breaks',
                              name: 'simpleLineBreaks',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to parse line breaks as &lt;br&gt;, like GitHub does, without needing 2 spaces at the end of the line',
                          },
                          {
                              displayName: 'Smart Indentation Fix',
                              name: 'smartIndentationFix',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to try to smartly fix indentation problems related to es6 template strings in the midst of indented code',
                          },
                          {
                              displayName: 'Spaces Indented Sublists',
                              name: 'disableForced4SpacesIndentedSublists',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to disable the requirement of indenting sublists by 4 spaces for them to be nested, effectively reverting to the old behavior where 2 or 3 spaces were enough',
                          },
                          {
                              displayName: 'Split Adjacent Blockquotes',
                              name: 'splitAdjacentBlockquotes',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to split adjacent blockquote blocks',
                          },
                          {
                              displayName: 'Strikethrough',
                              name: 'strikethrough',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable support for strikethrough syntax',
                          },
                          {
                              displayName: 'Tables Header ID',
                              name: 'tablesHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to add an ID property to table headers tags',
                          },
                          {
                              displayName: 'Tables Support',
                              name: 'tables',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable support for tables syntax',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const mode = this.getNodeParameter('mode', 0);
          const { length } = items;
          for (let i = 0; i < length; i++) {
              try {
                  if (mode === 'htmlToMarkdown') {
                      const options = this.getNodeParameter('options', i);
                      const destinationKey = this.getNodeParameter('destinationKey', i);
                      const textReplaceOption = this.getNodeParameter('options.textReplace.values', i, []);
                      options.textReplace = !(0, isEmpty_1.default)(textReplaceOption)
                          ? textReplaceOption.map((entry) => [entry.pattern, entry.replacement])
                          : undefined;
                      const lineStartEscapeOption = this.getNodeParameter('options.lineStartEscape.value', i, {});
                      options.lineStartEscape = !(0, isEmpty_1.default)(lineStartEscapeOption)
                          ? [lineStartEscapeOption.pattern, lineStartEscapeOption.replacement]
                          : undefined;
                      const globalEscapeOption = this.getNodeParameter('options.globalEscape.value', i, {});
                      options.globalEscape = !(0, isEmpty_1.default)(globalEscapeOption)
                          ? [globalEscapeOption.pattern, globalEscapeOption.replacement]
                          : undefined;
                      options.ignore = options.ignore
                          ? options.ignore.split(',').map((element) => element.trim())
                          : undefined;
                      options.blockElements = options.blockElements
                          ? options.blockElements.split(',').map((element) => element.trim())
                          : undefined;
                      const markdownOptions = {};
                      Object.keys(options).forEach((option) => {
                          if (options[option]) {
                              markdownOptions[option] = options[option];
                          }
                      });
                      const html = this.getNodeParameter('html', i);
                      const markdownFromHTML = node_html_markdown_1.NodeHtmlMarkdown.translate(html, markdownOptions);
                      const newItem = (0, n8n_workflow_1.deepCopy)(items[i].json);
                      (0, set_1.default)(newItem, destinationKey, markdownFromHTML);
                      returnData.push(newItem);
                  }
                  if (mode === 'markdownToHtml') {
                      const markdown = this.getNodeParameter('markdown', i);
                      const destinationKey = this.getNodeParameter('destinationKey', i);
                      const options = this.getNodeParameter('options', i);
                      const converter = new showdown_1.Converter();
                      Object.keys(options).forEach((key) => converter.setOption(key, options[key]));
                      const htmlFromMarkdown = converter.makeHtml(markdown);
                      const newItem = (0, n8n_workflow_1.deepCopy)(items[i].json);
                      (0, set_1.default)(newItem, destinationKey, htmlFromMarkdown);
                      returnData.push(newItem);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Markdown = Markdown;
  //# sourceMappingURL=Markdown.node.js.map

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

  # Markdown

  The Markdown node converts between Markdown and HTML formats.

  ## Operations

  This node's operations are **Modes**:

  * **Markdown to HTML**: Use this mode to convert from Markdown to HTML.
  * **HTML to Markdown**: Use this mode to convert from HTML to Markdown.

  ## Node parameters

  * **HTML** or **Markdown**: Enter the data you want to convert. The field name changes based on which **Mode** you select.
  * **Destination Key**: Enter the field you want to put the output in. Specify nested fields using dots, for example `level1.level2.newKey`.

  ## Node options

  The node's **Options** depend on the **Mode** selected.

  /// note | Test out the options
  Some of the options depend on each other or can interact. We recommend testing out options to confirm the effects are what you want.
  ///

  ### Markdown to HTML options

  | Option | Description | Default |
  | ------ | ----------- | ------- |
  | **Add Blank To Links** | Whether to open links a new window (enabled) or not (disabled). | Disabled |
  | **Automatic Linking To URLs** | Whether to automatically link to URLs (enabled) or not (disabled). If enabled, n8n converts any string that it identifies as a URL to a link. | Disabled |
  | **Backslash Escapes HTML Tags** | Whether to allow backslash escaping of HTML tags (enabled) or not (disabled). When enabled, n8n escapes any `<` or `>` prefaced with `\`. For example, `\<div\>` renders as `&lt;div&gt;`.  | Disabled |
  | **Complete HTML Document** | Whether to output a complete HTML document (enabled) or an HTML fragment (disabled). A complete HTML document includes the `<DOCTYPE HTML>` declaration, `<html>` and `<body>` tags, and the `<head>` element.  | Disabled |
  | **Customized Header ID** | Whether to support custom heading IDs (enabled) or not (disabled). When enabled, you can add custom heading IDs using `{header ID here}` after the heading text. | Disabled |
  | **Emoji Support** | Whether to support emojis (enabled) or not (disabled). | Disabled. |
  | **Encode Emails** | Whether to transform ASCII character emails into their equivalent decimal entities (enabled) or not (disabled). | Enabled | 
  | **Exclude Trailing Punctuation From URLs** | Whether to exclude trailing punctuation from automatically linked URLs (enabled) or not (disabled). For use with **Automatic Linking To URLs**. | Disabled |
  | **GitHub Code Blocks** | Whether to enable GitHub Flavored Markdown code blocks (enabled) or not (disabled). | Enabled |
  | **GitHub Compatible Header IDs** | Whether to generate GitHub Flavored Markdown heading IDs (enabled) or not (disabled). GitHub Flavored Markdown generates heading IDs with `-` in place of spaces and removes non-alphanumeric characters. | Disabled |
  | **GitHub Mention Link** | Change the link used with **GitHub Mentions**.  | Disabled |
  | **GitHub Mentions** | Whether to support tagging GitHub users with `@` (enabled) or not (disabled). When enabled, n8n replaces `@name` with `https://github.com/name`. | Disabled |
  | **GitHub Task Lists** | Whether to support GitHub Flavored Markdown task lists (enabled) or not (disabled). | Disabled |
  | **Header Level Start** | Number. Set the start level for headers. For example, changing this field to `2` causes n8n to treat `#` as `<h2>`, `##` as `<h3>`, and so on. | 1 |
  | **Mandatory Space Before Header** | Whether to make a space between `#` and heading text required (enabled) or not (disabled). When enabled, n8n renders a heading written as `##Some header text` literally (it doesn't turn it into a heading element) | Disabled |
  | **Middle Word Asterisks** | Whether n8n should treat asterisks in words as Markdown (disabled) or render them as literal asterisks (enabled). | Disabled |
  | **Middle Word Underscores** | Whether n8n should treat underscores in words as Markdown (disabled) or render them as literal underscores (enabled). | Disabled |
  | **No Header ID** | Disable automatic generation of header IDs (enabled). | Disabled |
  | **Parse Image Dimensions** | Support setting maximum image dimensions in Markdown syntax (enabled). | Disabled |
  | **Prefix Header ID** | Define a prefix to add to header IDs. | None |
  | **Raw Header ID** | Whether to remove spaces, `'`, and `"` from header IDs, including prefixes, replacing them with `-` (enabled) or not (disabled). | Disabled |
  | **Raw Prefix Header ID** | Whether to prevent n8n from modifying header prefixes (enabled) or not (disabled) | Disabled |
  | **Simple Line Breaks** | Whether to create line breaks without a double space at the end of a line (enabled) or not (disabled). | Disabled |
  | **Smart Indentation Fix** | Whether to try to smartly fix indentation problems related to ES6 template strings in indented code blocks (enabled) or not (disabled). | Disabled |
  | **Spaces Indented Sublists** | Whether to remove the requirement to indent sublists four spaces (enabled) or not (disabled). | Disabled |
  | **Split Adjacent Blockquotes** | Whether to split adjacent blockquote blocks (enabled) or not (disabled). If you don't enable this, n8n treats quotes (indicated by `>` at the start of the line) on separate lines as a single blockquote, even when separated by an empty line.  | Disabled |
  | **Strikethrough** | Whether to support strikethrough syntax (enabled) or not (disabled). When enabled, you can add a ~~strikethrough~~ effect using `~~` around the word or phrase. | Disabled |
  | **Tables Header ID** | Whether to add an ID to table header tags (enabled) or not (disabled). | Disabled |
  | **Tables Support** | Whether to support tables (enabled) or not (disabled). | Disabled |

  ### HTML to Markdown options

  | Option | Description | Default |
  | ------ | ----------- | ------- |
  | **Bullet Marker** | Specify the character to use for unordered lists. | * |
  | **Code Block Fence** | Specify the characters to use for code blocks. | ``` |
  | **Emphasis Delimiter** | Specify the character `<em>`. | _ |
  | **Global Escape Pattern** | Overrides the default character escape settings. You may want to use Text Replacement Pattern instead. | None |
  | **Ignored Elements** | Ignore given HTML elements, and their children. | None |
  | **Keep Images With Data** | Whether to keep images with data (enabled) or not (disabled). Support files up to 1MB. | Disabled |
  | **Line Start Escape Pattern** | Overrides the default character escape settings. You may want to use Text Replacement Pattern instead. | None |
  | **Max Consecutive New Lines** | Number. Specify the maximum number of consecutive new lines allowed. | 3 |
  | **Place URLs At The Bottom** | Whether to place URLs at the bottom of the page and format using link reference definitions (enabled) or not (disabled). | Disabled |
  | **Strong Delimiter** | Specify the characters for `<strong>`. | ** |
  | **Style For Code Block** | Specify the styling for code blocks. Options are **Fence** and **Indented**. | Fence |
  | **Text Replacement Pattern** | Define a text replacement pattern using regex. | None |
  | **Treat As Blocks** | Specify HTML elements to treat as blocks (surround with blank lines) | None |

  ## Templates and examples

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

  ## Parsers

  n8n uses the following parsers:

  * To convert from HTML to Markdown: [node-html-markdown](https://www.npmjs.com/package/node-html-markdown){:target=_blank .external-link}.
  * To convert from Markdown to HTML: [Showdown](https://www.npmjs.com/package/showdown){:target=_blank .external-link}. Some options allow you to extend your Markdown with [GitHub Flavored Markdown](https://github.github.com/gfm/){:target=_blank .external-link}.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"785a310f-69ed-4201-a88e-c47d343aa13c","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"947bebc61f537f860c300ddb465fdff53185540a51f9f14ddccaf2adf43449a6"}}


node_type: n8n-nodes-base.Matrix
name: Matrix
display_name: Matrix
description: Consume Matrix API
category: Other
code_hash: 91e527aaf38b57561fef448ed86f0079de7a086d1320bda1df4c98a5c3c6a43c
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/matrix
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:25
updated_at: 2025-06-08 08:05:25
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Matrix = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const AccountDescription_1 = require("./AccountDescription");
  const EventDescription_1 = require("./EventDescription");
  const MediaDescription_1 = require("./MediaDescription");
  const MessageDescription_1 = require("./MessageDescription");
  const RoomDescription_1 = require("./RoomDescription");
  const RoomMemberDescription_1 = require("./RoomMemberDescription");
  class Matrix {
      constructor() {
          this.description = {
              displayName: 'Matrix',
              name: 'matrix',
              icon: 'file:matrix.png',
              group: ['output'],
              version: 1,
              description: 'Consume Matrix API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Matrix',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'matrixApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Account',
                              value: 'account',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Media',
                              value: 'media',
                          },
                          {
                              name: 'Message',
                              value: 'message',
                          },
                          {
                              name: 'Room',
                              value: 'room',
                          },
                          {
                              name: 'Room Member',
                              value: 'roomMember',
                          },
                      ],
                      default: 'message',
                  },
                  ...AccountDescription_1.accountOperations,
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...MediaDescription_1.mediaOperations,
                  ...MediaDescription_1.mediaFields,
                  ...MessageDescription_1.messageOperations,
                  ...MessageDescription_1.messageFields,
                  ...RoomDescription_1.roomOperations,
                  ...RoomDescription_1.roomFields,
                  ...RoomMemberDescription_1.roomMemberOperations,
                  ...RoomMemberDescription_1.roomMemberFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getChannels() {
                      const returnData = [];
                      const joinedRoomsResponse = await GenericFunctions_1.matrixApiRequest.call(this, 'GET', '/joined_rooms');
                      await Promise.all(joinedRoomsResponse.joined_rooms.map(async (roomId) => {
                          try {
                              const roomNameResponse = await GenericFunctions_1.matrixApiRequest.call(this, 'GET', `/rooms/${roomId}/state/m.room.name`);
                              returnData.push({
                                  name: roomNameResponse.name,
                                  value: roomId,
                              });
                          }
                          catch (error) {
                              returnData.push({
                                  name: `Unknown: ${roomId}`,
                                  value: roomId,
                              });
                          }
                      }));
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  const responseData = await GenericFunctions_1.handleMatrixCall.call(this, items[i], i, resource, operation);
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Matrix = Matrix;
  //# sourceMappingURL=Matrix.node.js.map

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

  # Matrix credentials

  You can use these credentials to authenticate the following nodes:

  - [Matrix](/integrations/builtin/app-nodes/n8n-nodes-base.matrix.md)

  ## Prerequisites

  Create an account on a [Matrix](https://matrix.org/){:target=_blank .external-link} server. Refer to [Creating an account](https://matrix.org/docs/chat_basics/matrix-for-im/#creating-a-matrix-account){:target=_blank .external-link} for more information.

  ## Supported authentication methods

  - API access token

  ## Related resources

  Refer to the [Matrix Specification](https://spec.matrix.org/latest/){:target=_blank .external-link} for more information about the service.

  Refer to the documentation for the specific client you're using to access the Matrix server.

  ## Using API access token

  To configure this credential, you'll need:

  - An **Access Token**: This token is tied to the account you use to log into Matrix with.
  - A **Homeserver URL**: This is the URL of the [homeserver](https://matrix.org/docs/matrix-concepts/elements-of-matrix/#homeserver){:target=_blank .external-link} you entered when you created your account. n8n prepopulates this with matrix.org's own server; adjust this if you're using a server hosted elsewhere.

  Instructions for getting these details vary depending on the client you're using to access the server. Both the **Access Token** and the **Homeserver URL** can most commonly be found in **Settings > Help & About > Advanced**, but refer to your client's documentation for more details. 

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b0b904fa-1430-4bd3-b2f2-dec200edb311","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"50883de69b7aa0e070c5a32c8d8d4f66d5ef30a7e46922a263ae0910fa191944"}}


node_type: n8n-nodes-base.Mautic
name: Mautic
display_name: Mautic
description: Consume Mautic API
category: Other
code_hash: 9fd6ac004d6538dd3a615d81114369f98b52d90f5404a73e452c9f6321c81771
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mautic
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mautic = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const ContactDescription_1 = require("./ContactDescription");
  const SegmentEmailDescription_1 = require("./SegmentEmailDescription");
  const CompanyDescription_1 = require("./CompanyDescription");
  const CompanyContactDescription_1 = require("./CompanyContactDescription");
  const ContactSegmentDescription_1 = require("./ContactSegmentDescription");
  const CampaignContactDescription_1 = require("./CampaignContactDescription");
  const change_case_1 = require("change-case");
  class Mautic {
      constructor() {
          this.description = {
              displayName: 'Mautic',
              name: 'mautic',
              icon: 'file:mautic.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Mautic API',
              defaults: {
                  name: 'Mautic',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mauticApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['credentials'],
                          },
                      },
                  },
                  {
                      name: 'mauticOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Credentials',
                              value: 'credentials',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'credentials',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Campaign Contact',
                              value: 'campaignContact',
                              description: 'Add/remove contacts to/from a campaign',
                          },
                          {
                              name: 'Company',
                              value: 'company',
                              description: 'Create or modify a company',
                          },
                          {
                              name: 'Company Contact',
                              value: 'companyContact',
                              description: 'Add/remove contacts to/from a company',
                          },
                          {
                              name: 'Contact',
                              value: 'contact',
                              description: 'Create & modify contacts',
                          },
                          {
                              name: 'Contact Segment',
                              value: 'contactSegment',
                              description: 'Add/remove contacts to/from a segment',
                          },
                          {
                              name: 'Segment Email',
                              value: 'segmentEmail',
                              description: 'Send an email',
                          },
                      ],
                      default: 'contact',
                  },
                  ...CompanyDescription_1.companyOperations,
                  ...CompanyDescription_1.companyFields,
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
                  ...ContactSegmentDescription_1.contactSegmentOperations,
                  ...ContactSegmentDescription_1.contactSegmentFields,
                  ...CampaignContactDescription_1.campaignContactOperations,
                  ...CampaignContactDescription_1.campaignContactFields,
                  ...CompanyContactDescription_1.companyContactOperations,
                  ...CompanyContactDescription_1.companyContactFields,
                  ...SegmentEmailDescription_1.segmentEmailOperations,
                  ...SegmentEmailDescription_1.segmentEmailFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCompanies() {
                      const returnData = [];
                      const companies = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'companies', 'GET', '/companies');
                      for (const company of companies) {
                          returnData.push({
                              name: company.fields.all.companyname,
                              value: company.fields.all.companyname,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const returnData = [];
                      const tags = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'tags', 'GET', '/tags');
                      for (const tag of tags) {
                          returnData.push({
                              name: tag.tag,
                              value: tag.tag,
                          });
                      }
                      return returnData;
                  },
                  async getStages() {
                      const returnData = [];
                      const stages = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'stages', 'GET', '/stages');
                      for (const stage of stages) {
                          returnData.push({
                              name: stage.name,
                              value: stage.id,
                          });
                      }
                      return returnData;
                  },
                  async getCompanyFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'fields', 'GET', '/fields/company');
                      for (const field of fields) {
                          returnData.push({
                              name: field.label,
                              value: field.alias,
                          });
                      }
                      return returnData;
                  },
                  async getIndustries() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'fields', 'GET', '/fields/company');
                      for (const field of fields) {
                          if (field.alias === 'companyindustry') {
                              for (const { label, value } of field.properties.list) {
                                  returnData.push({
                                      name: label,
                                      value,
                                  });
                              }
                          }
                      }
                      return returnData;
                  },
                  async getContactFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'fields', 'GET', '/fields/contact');
                      for (const field of fields) {
                          returnData.push({
                              name: field.label,
                              value: field.alias,
                          });
                      }
                      return returnData;
                  },
                  async getSegments() {
                      const returnData = [];
                      const segments = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'lists', 'GET', '/segments');
                      for (const segment of segments) {
                          returnData.push({
                              name: segment.name,
                              value: segment.id,
                          });
                      }
                      return returnData;
                  },
                  async getCampaigns() {
                      const returnData = [];
                      const campaings = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'campaigns', 'GET', '/campaigns');
                      for (const campaign of campaings) {
                          returnData.push({
                              name: campaign.name,
                              value: campaign.id,
                          });
                      }
                      return returnData;
                  },
                  async getEmails() {
                      const returnData = [];
                      const emails = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'emails', 'GET', '/emails');
                      for (const email of emails) {
                          returnData.push({
                              name: email.name,
                              value: email.id,
                          });
                      }
                      return returnData;
                  },
                  async getSegmentEmails() {
                      const returnData = [];
                      const emails = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'emails', 'GET', '/emails');
                      for (const email of emails) {
                          if (email.emailType === 'list') {
                              returnData.push({
                                  name: email.name,
                                  value: email.id,
                              });
                          }
                      }
                      return returnData;
                  },
                  async getCampaignEmails() {
                      const returnData = [];
                      const emails = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'emails', 'GET', '/emails');
                      for (const email of emails) {
                          if (email.emailType === 'template') {
                              returnData.push({
                                  name: email.name,
                                  value: email.id,
                              });
                          }
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let qs;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              qs = {};
              try {
                  if (resource === 'company') {
                      if (operation === 'create') {
                          const simple = this.getNodeParameter('simple', i);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              companyname: name,
                          };
                          const { addressUi, customFieldsUi, companyEmail, fax, industry, numberOfEmpoyees, phone, website, annualRevenue, description, ...rest } = this.getNodeParameter('additionalFields', i);
                          if (addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressValues) {
                              const { addressValues } = addressUi;
                              body.companyaddress1 = addressValues.address1;
                              body.companyaddress2 = addressValues.address2;
                              body.companycity = addressValues.city;
                              body.companystate = addressValues.state;
                              body.companycountry = addressValues.country;
                              body.companyzipcode = addressValues.zipCode;
                          }
                          if (companyEmail) {
                              body.companyemail = companyEmail;
                          }
                          if (fax) {
                              body.companyfax = fax;
                          }
                          if (industry) {
                              body.companyindustry = industry;
                          }
                          if (industry) {
                              body.companyindustry = industry;
                          }
                          if (numberOfEmpoyees) {
                              body.companynumber_of_employees = numberOfEmpoyees;
                          }
                          if (phone) {
                              body.companyphone = phone;
                          }
                          if (website) {
                              body.companywebsite = website;
                          }
                          if (annualRevenue) {
                              body.companyannual_revenue = annualRevenue;
                          }
                          if (description) {
                              body.companydescription = description;
                          }
                          if (customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldValues) {
                              const { customFieldValues } = customFieldsUi;
                              const data = customFieldValues.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                              Object.assign(body, data);
                          }
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', '/companies/new', body);
                          responseData = responseData.company;
                          if (simple) {
                              responseData = responseData.fields.all;
                          }
                      }
                      if (operation === 'update') {
                          const companyId = this.getNodeParameter('companyId', i);
                          const simple = this.getNodeParameter('simple', i);
                          const body = {};
                          const { addressUi, customFieldsUi, companyEmail, name, fax, industry, numberOfEmpoyees, phone, website, annualRevenue, description, ...rest } = this.getNodeParameter('updateFields', i);
                          if (addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressValues) {
                              const { addressValues } = addressUi;
                              body.companyaddress1 = addressValues.address1;
                              body.companyaddress2 = addressValues.address2;
                              body.companycity = addressValues.city;
                              body.companystate = addressValues.state;
                              body.companycountry = addressValues.country;
                              body.companyzipcode = addressValues.zipCode;
                          }
                          if (companyEmail) {
                              body.companyemail = companyEmail;
                          }
                          if (name) {
                              body.companyname = name;
                          }
                          if (fax) {
                              body.companyfax = fax;
                          }
                          if (industry) {
                              body.companyindustry = industry;
                          }
                          if (industry) {
                              body.companyindustry = industry;
                          }
                          if (numberOfEmpoyees) {
                              body.companynumber_of_employees = numberOfEmpoyees;
                          }
                          if (phone) {
                              body.companyphone = phone;
                          }
                          if (website) {
                              body.companywebsite = website;
                          }
                          if (annualRevenue) {
                              body.companyannual_revenue = annualRevenue;
                          }
                          if (description) {
                              body.companydescription = description;
                          }
                          if (customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldValues) {
                              const { customFieldValues } = customFieldsUi;
                              const data = customFieldValues.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                              Object.assign(body, data);
                          }
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'PATCH', `/companies/${companyId}/edit`, body);
                          responseData = responseData.company;
                          if (simple) {
                              responseData = responseData.fields.all;
                          }
                      }
                      if (operation === 'get') {
                          const companyId = this.getNodeParameter('companyId', i);
                          const simple = this.getNodeParameter('simple', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'GET', `/companies/${companyId}`);
                          responseData = responseData.company;
                          if (simple) {
                              responseData = responseData.fields.all;
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const simple = this.getNodeParameter('simple', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          qs = Object.assign(qs, additionalFields);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'companies', 'GET', '/companies', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              qs.start = 0;
                              responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'GET', '/companies', {}, qs);
                              if (responseData.errors) {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData);
                              }
                              responseData = responseData.companies;
                              responseData = Object.values(responseData);
                          }
                          if (simple) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'delete') {
                          const simple = this.getNodeParameter('simple', i);
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'DELETE', `/companies/${companyId}/delete`);
                          responseData = responseData.company;
                          if (simple) {
                              responseData = responseData.fields.all;
                          }
                      }
                  }
                  if (resource === 'contact') {
                      if (operation === 'create') {
                          const options = this.getNodeParameter('options', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          let body = {};
                          if (!jsonActive) {
                              body.email = this.getNodeParameter('email', i);
                              body.firstname = this.getNodeParameter('firstName', i);
                              body.lastname = this.getNodeParameter('lastName', i);
                              body.company = this.getNodeParameter('company', i);
                              body.position = this.getNodeParameter('position', i);
                              body.title = this.getNodeParameter('title', i);
                          }
                          else {
                              const json = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('bodyJson', i));
                              if (json !== undefined) {
                                  body = { ...json };
                              }
                              else {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid JSON', { itemIndex: i });
                              }
                          }
                          if (additionalFields.ipAddress) {
                              body.ipAddress = additionalFields.ipAddress;
                          }
                          if (additionalFields.lastActive) {
                              body.lastActive = additionalFields.lastActive;
                          }
                          if (additionalFields.ownerId) {
                              body.owner = additionalFields.ownerId;
                          }
                          if (additionalFields.addressUi) {
                              const addressValues = additionalFields.addressUi
                                  .addressValues;
                              if (addressValues) {
                                  body.address1 = addressValues.address1;
                                  body.address2 = addressValues.address2;
                                  body.city = addressValues.city;
                                  body.state = addressValues.state;
                                  body.country = addressValues.country;
                                  body.zipcode = addressValues.zipCode;
                              }
                          }
                          if (additionalFields.socialMediaUi) {
                              const socialMediaValues = additionalFields.socialMediaUi
                                  .socialMediaValues;
                              if (socialMediaValues) {
                                  body.facebook = socialMediaValues.facebook;
                                  body.foursquare = socialMediaValues.foursquare;
                                  body.instagram = socialMediaValues.instagram;
                                  body.linkedin = socialMediaValues.linkedIn;
                                  body.skype = socialMediaValues.skype;
                                  body.twitter = socialMediaValues.twitter;
                              }
                          }
                          if (additionalFields.customFieldsUi) {
                              const customFields = additionalFields.customFieldsUi
                                  .customFieldValues;
                              if (customFields) {
                                  const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                                  Object.assign(body, data);
                              }
                          }
                          if (additionalFields.b2bOrb2c) {
                              body.b2b_or_b2c = additionalFields.b2bOrb2c;
                          }
                          if (additionalFields.crmId) {
                              body.crm_id = additionalFields.crmId;
                          }
                          if (additionalFields.fax) {
                              body.fax = additionalFields.fax;
                          }
                          if (additionalFields.hasPurchased) {
                              body.haspurchased = additionalFields.hasPurchased;
                          }
                          if (additionalFields.mobile) {
                              body.mobile = additionalFields.mobile;
                          }
                          if (additionalFields.phone) {
                              body.phone = additionalFields.phone;
                          }
                          if (additionalFields.prospectOrCustomer) {
                              body.prospect_or_customer = additionalFields.prospectOrCustomer;
                          }
                          if (additionalFields.sandbox) {
                              body.sandbox = additionalFields.sandbox;
                          }
                          if (additionalFields.stage) {
                              body.stage = additionalFields.stage;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.website) {
                              body.website = additionalFields.website;
                          }
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', '/contacts/new', body);
                          responseData = [responseData.contact];
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'update') {
                          const options = this.getNodeParameter('options', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          let body = {};
                          if (updateFields.email) {
                              body.email = updateFields.email;
                          }
                          if (updateFields.firstName) {
                              body.firstname = updateFields.firstName;
                          }
                          if (updateFields.lastName) {
                              body.lastname = updateFields.lastName;
                          }
                          if (updateFields.company) {
                              body.company = updateFields.company;
                          }
                          if (updateFields.position) {
                              body.position = updateFields.position;
                          }
                          if (updateFields.title) {
                              body.title = updateFields.title;
                          }
                          if (updateFields.bodyJson) {
                              const json = (0, GenericFunctions_1.validateJSON)(updateFields.bodyJson);
                              if (json !== undefined) {
                                  body = { ...json };
                              }
                              else {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid JSON', { itemIndex: i });
                              }
                          }
                          if (updateFields.ipAddress) {
                              body.ipAddress = updateFields.ipAddress;
                          }
                          if (updateFields.lastActive) {
                              body.lastActive = updateFields.lastActive;
                          }
                          if (updateFields.ownerId) {
                              body.owner = updateFields.ownerId;
                          }
                          if (updateFields.addressUi) {
                              const addressValues = updateFields.addressUi
                                  .addressValues;
                              if (addressValues) {
                                  body.address1 = addressValues.address1;
                                  body.address2 = addressValues.address2;
                                  body.city = addressValues.city;
                                  body.state = addressValues.state;
                                  body.country = addressValues.country;
                                  body.zipcode = addressValues.zipCode;
                              }
                          }
                          if (updateFields.socialMediaUi) {
                              const socialMediaValues = updateFields.socialMediaUi
                                  .socialMediaValues;
                              if (socialMediaValues) {
                                  body.facebook = socialMediaValues.facebook;
                                  body.foursquare = socialMediaValues.foursquare;
                                  body.instagram = socialMediaValues.instagram;
                                  body.linkedin = socialMediaValues.linkedIn;
                                  body.skype = socialMediaValues.skype;
                                  body.twitter = socialMediaValues.twitter;
                              }
                          }
                          if (updateFields.customFieldsUi) {
                              const customFields = updateFields.customFieldsUi
                                  .customFieldValues;
                              if (customFields) {
                                  const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                                  Object.assign(body, data);
                              }
                          }
                          if (updateFields.b2bOrb2c) {
                              body.b2b_or_b2c = updateFields.b2bOrb2c;
                          }
                          if (updateFields.crmId) {
                              body.crm_id = updateFields.crmId;
                          }
                          if (updateFields.fax) {
                              body.fax = updateFields.fax;
                          }
                          if (updateFields.hasPurchased) {
                              body.haspurchased = updateFields.hasPurchased;
                          }
                          if (updateFields.mobile) {
                              body.mobile = updateFields.mobile;
                          }
                          if (updateFields.phone) {
                              body.phone = updateFields.phone;
                          }
                          if (updateFields.prospectOrCustomer) {
                              body.prospect_or_customer = updateFields.prospectOrCustomer;
                          }
                          if (updateFields.sandbox) {
                              body.sandbox = updateFields.sandbox;
                          }
                          if (updateFields.stage) {
                              body.stage = updateFields.stage;
                          }
                          if (updateFields.tags) {
                              body.tags = updateFields.tags;
                          }
                          if (updateFields.website) {
                              body.website = updateFields.website;
                          }
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'PATCH', `/contacts/${contactId}/edit`, body);
                          responseData = [responseData.contact];
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'get') {
                          const options = this.getNodeParameter('options', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'GET', `/contacts/${contactId}`);
                          responseData = [responseData.contact];
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          qs = Object.assign(qs, options);
                          if (qs.orderBy) {
                              qs.orderBy = (0, change_case_1.snakeCase)(qs.orderBy);
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'contacts', 'GET', '/contacts', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              qs.start = 0;
                              responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'GET', '/contacts', {}, qs);
                              if (responseData.errors) {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData);
                              }
                              responseData = responseData.contacts;
                              responseData = Object.values(responseData);
                          }
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'delete') {
                          const options = this.getNodeParameter('options', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'DELETE', `/contacts/${contactId}/delete`);
                          responseData = [responseData.contact];
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'sendEmail') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const campaignEmailId = this.getNodeParameter('campaignEmailId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/emails/${campaignEmailId}/contact/${contactId}/send`);
                      }
                      if (operation === 'editDoNotContactList') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const action = this.getNodeParameter('action', i);
                          const channel = this.getNodeParameter('channel', i);
                          const body = {};
                          if (action === 'add') {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/contacts/${contactId}/dnc/${channel}/${action}`, body);
                          responseData = responseData.contact;
                      }
                      if (operation === 'editContactPoint') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const action = this.getNodeParameter('action', i);
                          const points = this.getNodeParameter('points', i);
                          const path = action === 'add' ? 'plus' : 'minus';
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/contacts/${contactId}/points/${path}/${points}`);
                      }
                  }
                  if (resource === 'contactSegment') {
                      if (operation === 'add') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const segmentId = this.getNodeParameter('segmentId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/segments/${segmentId}/contact/${contactId}/add`);
                      }
                      if (operation === 'remove') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const segmentId = this.getNodeParameter('segmentId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/segments/${segmentId}/contact/${contactId}/remove`);
                      }
                  }
                  if (resource === 'campaignContact') {
                      if (operation === 'add') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const campaignId = this.getNodeParameter('campaignId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/campaigns/${campaignId}/contact/${contactId}/add`);
                      }
                      if (operation === 'remove') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const campaignId = this.getNodeParameter('campaignId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/campaigns/${campaignId}/contact/${contactId}/remove`);
                      }
                  }
                  if (resource === 'segmentEmail') {
                      if (operation === 'send') {
                          const segmentEmailId = this.getNodeParameter('segmentEmailId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/emails/${segmentEmailId}/send`);
                      }
                  }
                  if (resource === 'companyContact') {
                      if (operation === 'add') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/companies/${companyId}/contact/${contactId}/add`, {});
                      }
                      if (operation === 'remove') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/companies/${companyId}/contact/${contactId}/remove`, {});
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Mautic = Mautic;
  //# sourceMappingURL=Mautic.node.js.map

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

  # Mautic credentials

  You can use these credentials to authenticate the following nodes:

  - [Mautic](/integrations/builtin/app-nodes/n8n-nodes-base.mautic.md)
  - [Mautic Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.mautictrigger.md)

  ## Supported authentication methods

  - Basic auth
  - OAuth2

  ## Related resources

  Refer to [Mautic's API documentation](https://developer.mautic.org/#rest-api){:target=_blank .external-link} for more information about the service.

  ## Using basic auth

  /// note | API enabled
  To set up this credential, your Mautic instance must have the API enabled. Refer to [Enable the API](#enable-the-api) for instructions.
  ///

  To configure this credential, you'll need an account on a [Mautic](https://www.mautic.org/){:target=_blank .external-link} instance and:

  - Your **URL**
  - A **Username**
  - A **Password**

  To set it up:

  1. In Mautic, go to **Configuration > API Settings**.
  2. If **Enable HTTP basic auth?** is set to **No**, change it to **Yes** and save. Refer to the [API Settings documentation](https://docs.mautic.org/en/5.x/configuration/settings.html#api-settings){:target=_blank .external-link} for more information.
  1. In n8n, enter the Base **URL** of your Mautic instance.
  2. Enter your Mautic **Username**.
  3. Enter your Mautic **Password**.

  ## Using OAuth2

  /// note | API enabled
  To set up this credential, your Mautic instance must have the API enabled. Refer to [Enable the API](#enable-the-api) for instructions.
  ///

  To configure this credential, you'll need an account on a [Mautic](https://www.mautic.org/){:target=_blank .external-link} instance and:

  - A **Client ID**: Generated when you create new API credentials.
  - A **Client Secret**: Generated when you create new API credentials.
  - Your **URL**

  To set it up:

  1. In Mautic, go to **Configuration > Settings**.
  2. Select **API Credentials**.

      /// note | No API Credentials menu
      If you don't see the **API Credentials** option under **Configuration > Settings**, be sure to [Enable the API](#enable-the-api). If you've enabled the API and you still don't see the option, try [manually clearing the cache](https://forum.mautic.org/t/cant-find-api-credentials-menu/10689){:target=_blank .external-link}.
      ///

  2. Select the option to **Create new client**.
  3. Select **OAuth 2** as the **Authorization Protocol**.
  4. Enter a **Name** for your credential, like `n8n integration`.
  5. In n8n, copy the **OAuth Callback URL** and enter it as the **Redirect URI** in Mautic.
  6. Select **Apply**.
  7. Copy the **Client ID** from Mautic and enter it in your n8n credential.
  8. Copy the **Client Secret** from Mautic and enter it in your n8n credential.
  9. Enter the Base **URL** of your Mautic instance.

  Refer to [What is Mautic's API?](https://kb.mautic.org/article/what-is-mautic-039%3bs-api.html#mcetoc_1g7n1bgoo0){:target=_blank .external-link} for more information.

  ## Enable the API

  To enable the API in your Mautic instance:

  1. Go to **Settings > Configuration**.
  2. Select **API Settings**.
  3. Set **API enabled?** to **Yes**.
  4. **Save** your changes.

  Refer to [How to use the Mautic API](https://kb.mautic.org/article/what-is-mautic-039;s-api.html){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"891aff9e-3f8e-48de-a3a7-7e7e486a7dae","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"f0bec41ff94e02c5fad7e8860275360375d389f482189c4c6c39d930d7773488"}}


node_type: n8n-nodes-base.Mattermost
name: Mattermost
display_name: Mattermost
description: Sends data to Mattermost
category: Other
code_hash: 9a4b0669740615e90e6eefc2f30d8de6a43dac3305dd908b29e49c48787130fb
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mattermost
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mattermost = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const MattermostV1_node_1 = require("./v1/MattermostV1.node");
  class Mattermost extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Mattermost',
              name: 'mattermost',
              icon: 'file:mattermost.svg',
              group: ['output'],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends data to Mattermost',
              defaultVersion: 1,
          };
          const nodeVersions = {
              1: new MattermostV1_node_1.MattermostV1(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Mattermost = Mattermost;
  //# sourceMappingURL=Mattermost.node.js.map

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

  # Mattermost credentials

  You can use these credentials to authenticate the following nodes:

  - [Mattermost](/integrations/builtin/app-nodes/n8n-nodes-base.mattermost.md)

  ## Supported authentication methods

  - API access token

  ## Related resources

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

  ## Using API access token

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

  - A personal **Access Token**
  - Your Mattermost **Base URL**.

  To set it up:

  1. In Mattermost, go to **Profile > Security > Personal Access Tokens**.

      /// warning | No Personal Access Tokens option
      If you don't see the Personal Access Tokens option, refer to the troubleshooting steps in [Enable personal access tokens](#enable-personal-access-tokens) below.
      ///

  2. Select **Create Token**.
  3. Enter a **Token description**, like `n8n integration`.
  4. Select **Save**.
  5. Copy the **Token ID** and enter it as the **Access Token** in your n8n credential.
  6. Enter your Mattermost URL as the **Base URL**.
  7. By default, n8n connects only if SSL certificate validation succeeds. To connect even if SSL certificate validation fails, turn on **Ignore SSL Issues**.

  Refer to the Mattermost [Personal access tokens documentation](https://developers.mattermost.com/integrate/reference/personal-access-token/){:target=_blank .external-link} for more information.

  ## Enable personal access tokens

  Not seeing the **Personal Access Tokens** option has two possible causes:

  - Mattermost doesn't have the personal access tokens integration enabled.
  - You're trying to generate a personal access token as a non-admin user who doesn't have permission to generate personal access tokens.

  To identify the root cause and resolve it:

  1. Log in to Mattermost as an admin.
  2. Go to **System Console > Integrations > Integration Management**.
  3. Confirm that **Enable personal access tokens** is set to **true**. If it's not, change.
  4. Go to **System Console > User Management > Users**.
  5. Search for the user account you want to allow to generate personal access tokens.
  6. Select the **Actions** dropdown for the user and select **Manage roles**.
  7. Check the box for **Allow this account to generate personal access tokens** and **Save**.

  Refer to the Mattermost [Personal access tokens documentation](https://developers.mattermost.com/integrate/reference/personal-access-token/){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"d9b8799a-47bd-41e7-8ace-11ba32d8b00c","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"199c19cf57682ed6722837ab4968403c9f1545026dd08cc0f333d40c905f702d"}}


node_type: n8n-nodes-base.Medium
name: Medium
display_name: Medium
description: Consume Medium API
category: Other
code_hash: bdfe9b89bafe735fe0197d624433da4cc151dac20cf5436856ca2885380539f9
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/medium
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Medium = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Medium {
      constructor() {
          this.description = {
              displayName: 'Medium',
              name: 'medium',
              group: ['output'],
              icon: 'file:medium.png',
              version: 1,
              description: 'Consume Medium API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Medium',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mediumApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'mediumOAuth2Api',
                      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: 'Post',
                              value: 'post',
                          },
                          {
                              name: 'Publication',
                              value: 'publication',
                          },
                      ],
                      default: 'post',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['post'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a post',
                              action: 'Create a post',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Publication',
                      name: 'publication',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['post'],
                              operation: ['create'],
                          },
                      },
                      default: false,
                      description: 'Whether you are posting for a publication',
                  },
                  {
                      displayName: 'Publication Name or ID',
                      name: 'publicationId',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['post'],
                              operation: ['create'],
                              publication: [true],
                          },
                      },
                      typeOptions: {
                          loadOptionsMethod: 'getPublications',
                      },
                      default: '',
                      description: 'Publication IDs. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      type: 'string',
                      default: '',
                      placeholder: 'My Open Source Contribution',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['post'],
                          },
                      },
                      description: 'Title of the post. Max Length : 100 characters.',
                  },
                  {
                      displayName: 'Content Format',
                      name: 'contentFormat',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['post'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'HTML',
                              value: 'html',
                          },
                          {
                              name: 'Markdown',
                              value: 'markdown',
                          },
                      ],
                      description: 'The format of the content to be posted',
                  },
                  {
                      displayName: 'Content',
                      name: 'content',
                      type: 'string',
                      default: '',
                      placeholder: 'My open source contribution',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['post'],
                          },
                      },
                      description: 'The body of the post, in a valid semantic HTML fragment, or Markdown',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['post'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Canonical Url',
                              name: 'canonicalUrl',
                              type: 'string',
                              default: '',
                              description: 'The original home of this content, if it was originally published elsewhere',
                          },
                          {
                              displayName: 'License',
                              name: 'license',
                              type: 'options',
                              default: 'all-rights-reserved',
                              options: [
                                  {
                                      name: 'all-rights-reserved',
                                      value: 'all-rights-reserved',
                                  },
                                  {
                                      name: 'cc-40-by',
                                      value: 'cc-40-by',
                                  },
                                  {
                                      name: 'cc-40-by-nc',
                                      value: 'cc-40-by-nc',
                                  },
                                  {
                                      name: 'cc-40-by-nc-nd',
                                      value: 'cc-40-by-nc-nd',
                                  },
                                  {
                                      name: 'cc-40-by-nc-sa',
                                      value: 'cc-40-by-nc-sa',
                                  },
                                  {
                                      name: 'cc-40-by-nd',
                                      value: 'cc-40-by-nd',
                                  },
                                  {
                                      name: 'cc-40-by-sa',
                                      value: 'cc-40-by-sa',
                                  },
                                  {
                                      name: 'cc-40-zero',
                                      value: 'cc-40-zero',
                                  },
                                  {
                                      name: 'public-domain',
                                      value: 'public-domain',
                                  },
                              ],
                              description: 'License of the post',
                          },
                          {
                              displayName: 'Notify Followers',
                              name: 'notifyFollowers',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to notify followers that the user has published',
                          },
                          {
                              displayName: 'Publish Status',
                              name: 'publishStatus',
                              default: 'public',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Public',
                                      value: 'public',
                                  },
                                  {
                                      name: 'Draft',
                                      value: 'draft',
                                  },
                                  {
                                      name: 'Unlisted',
                                      value: 'unlisted',
                                  },
                              ],
                              description: 'The status of the post',
                          },
                          {
                              displayName: 'Tags',
                              name: 'tags',
                              type: 'string',
                              default: '',
                              placeholder: 'open-source,mlh,fellowship',
                              description: 'Comma-separated strings to be used as tags for post classification. Max allowed tags: 5. Max tag length: 25 characters.',
                          },
                      ],
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['publication'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many publications',
                              action: 'Get many publications',
                          },
                      ],
                      default: 'publication',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['publication'],
                          },
                      },
                      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: ['publication'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 200,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getPublications() {
                      const returnData = [];
                      const user = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', '/me');
                      const userId = user.data.id;
                      const publications = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', `/users/${userId}/publications`);
                      const publicationsList = publications.data;
                      for (const publication of publicationsList) {
                          const publicationName = publication.name;
                          const publicationId = publication.id;
                          returnData.push({
                              name: publicationName,
                              value: publicationId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let operation;
          let resource;
          let bodyRequest;
          let qs;
          let responseData;
          for (let i = 0; i < items.length; i++) {
              qs = {};
              try {
                  resource = this.getNodeParameter('resource', i);
                  operation = this.getNodeParameter('operation', i);
                  if (resource === 'post') {
                      if (operation === 'create') {
                          const title = this.getNodeParameter('title', i);
                          const contentFormat = this.getNodeParameter('contentFormat', i);
                          const content = this.getNodeParameter('content', i);
                          bodyRequest = {
                              tags: [],
                              title,
                              contentFormat,
                              content,
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.tags) {
                              const tags = additionalFields.tags;
                              bodyRequest.tags = tags.split(',').map((name) => {
                                  const returnValue = name.trim();
                                  if (returnValue.length > 25) {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The tag "${returnValue}" is to long. Maximum lenght of a tag is 25 characters.`, { itemIndex: i });
                                  }
                                  return returnValue;
                              });
                              if (bodyRequest.tags.length > 5) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'To many tags got used. Maximum 5 can be set.', { itemIndex: i });
                              }
                          }
                          if (additionalFields.canonicalUrl) {
                              bodyRequest.canonicalUrl = additionalFields.canonicalUrl;
                          }
                          if (additionalFields.publishStatus) {
                              bodyRequest.publishStatus = additionalFields.publishStatus;
                          }
                          if (additionalFields.license) {
                              bodyRequest.license = additionalFields.license;
                          }
                          if (additionalFields.notifyFollowers) {
                              bodyRequest.notifyFollowers = additionalFields.notifyFollowers;
                          }
                          const underPublication = this.getNodeParameter('publication', i);
                          if (underPublication) {
                              const publicationId = this.getNodeParameter('publicationId', i);
                              responseData = await GenericFunctions_1.mediumApiRequest.call(this, 'POST', `/publications/${publicationId}/posts`, bodyRequest, qs);
                          }
                          else {
                              const responseAuthorId = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', '/me', {}, qs);
                              const authorId = responseAuthorId.data.id;
                              responseData = await GenericFunctions_1.mediumApiRequest.call(this, 'POST', `/users/${authorId}/posts`, bodyRequest, qs);
                              responseData = responseData.data;
                          }
                      }
                  }
                  if (resource === 'publication') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const user = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', '/me');
                          const userId = user.data.id;
                          responseData = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', `/users/${userId}/publications`);
                          responseData = responseData.data;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  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.Medium = Medium;
  //# sourceMappingURL=Medium.node.js.map

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

  # Medium credentials

  You can use these credentials to authenticate the following nodes:

  - [Medium](/integrations/builtin/app-nodes/n8n-nodes-base.medium.md)

  /// warning | Medium API no longer supported
  Medium has stopped supporting the Medium API. These credentials still appear within n8n, but you can't configure new integrations using them.
  ///

  ## Prerequisites

  - Create an account on [Medium](https://www.medium.com/){:target=_blank .external-link}.
  - For OAuth2, request access to credentials by emailing [yourfriends@medium.com](mailto:yourfriends@medium.com).

  ## Supported authentication methods

  - API access token
  - OAuth2

  ## Related resources

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

  ## Using API access token

  To configure this credential, you'll need:

  - An API **Access Token**: Generate a token in **Settings >** [**Security and apps**](https://medium.com/me/settings/security){:target=_blank .external-link} **> Integration tokens**. Use the integration token this generates as your n8n **Access Token**.

  Refer to the Medium API [Self-issued access tokens documentation](https://github.com/Medium/medium-api-docs?tab=readme-ov-file#21-self-issued-access-tokens){:target=_blank .external-link} for more information.

  ## Using OAuth2

  To configure this credential, you'll need:

  - A **Client ID**
  - A **Client Secret**

  To generate a **Client ID** and **Client Secret**, you'll need access to the **Developers** menu. From there, create a new application to generate the Client ID and Secret.

  Use these settings for your new application:

  - Select **OAuth 2** as the **Authorization Protocol**
  - Copy the **OAuth Callback URL** from n8n and use this as the **Callback URL** in Medium.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"84e5f69f-399f-407e-9767-cb0cdffcbdc4","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"2f6108cd552b3314007adf35bb5bf26bdeebb200f565a3514566e39b03fe7962"}}


node_type: n8n-nodes-base.Merge
name: Merge
display_name: Merge
description: Merges data of multiple streams once data from both is available
category: Other
code_hash: 7ea8c21ecbdf79a2e935cdf1aa4e4c4c9f9c1139d9ffaaea0a767c41878b1ce8
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.merge
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Merge = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const MergeV1_node_1 = require("./v1/MergeV1.node");
  const MergeV2_node_1 = require("./v2/MergeV2.node");
  class Merge extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Merge',
              name: 'merge',
              icon: 'fa:code-branch',
              group: ['transform'],
              subtitle: '={{$parameter["mode"]}}',
              description: 'Merges data of multiple streams once data from both is available',
              defaultVersion: 2.1,
          };
          const nodeVersions = {
              1: new MergeV1_node_1.MergeV1(baseDescription),
              2: new MergeV2_node_1.MergeV2(baseDescription),
              2.1: new MergeV2_node_1.MergeV2(baseDescription),
              2.2: new MergeV2_node_1.MergeV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Merge = Merge;
  //# sourceMappingURL=Merge.node.js.map

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

  # Merge

  Use the Merge node to combine data from multiple streams, once data of all streams is available.

  /// note | Major changes in 0.194.0
  The n8n team overhauled this node in n8n 0.194.0. This document reflects the latest version of the node. If you're using an older version of n8n, you can find the previous version of this document [here](https://github.com/n8n-io/n8n-docs/blob/4ff688642cc9ee7ca7d00987847bf4e4515da59d/docs/integrations/builtin/core-nodes/n8n-nodes-base.merge.md){:target=_blank .external-link}.
  ///

  /// note | Minor changes in 1.49.0
  n8n version 1.49.0 introduced the option to add more than two inputs. Older versions only support up to two inputs. If you're running an older version and want to combine multiple inputs in these versions, use the [Code node](https://deploy-preview-2225--n8n-docs.netlify.app/code/code-node/).

  The **Mode > SQL Query** feature was also added in n8n version 1.49.0 and isn't available in older versions.
  ///

  ## Node parameters

  You can specify how the Merge node should combine data from different data streams by choosing a **Mode**: 

  ### Append

  Keep data from all inputs. Choose a **Number of Inputs** to output items of each input, one after another. The node waits for the execution of all connected inputs. 

  <figure markdown="span">
  ![Sample Append mode inputs and output. Two separate data sources are on the left, one with items A, B, C and one with items D, E, F. The final data source combines both and lists A, B, C, D, E, F.](/_images/integrations/builtin/core-nodes/merge/append-diagram.png)
  <figcaption>Append mode inputs and output</figcaption>
  </figure>

  ### Combine

  Combine data from two inputs. Select an option in **Combine By** to determine how you want to merge the input data.

  #### Matching Fields

  Compare items by field values. Enter the fields you want to compare in **Fields to Match**. 

  n8n's default behavior is to keep matching items. You can change this using the **Output Type** setting:

  * **Keep Matches**: Merge items that match. This is like an inner join.
  * **Keep Non-Matches**: Merge items that don't match.
  * **Keep Everything**: Merge items together that do match and include items that don't match. This is like an outer join.
  * **Enrich Input 1**: Keep all data from Input 1, and add matching data from Input 2. This is like a left join.
  * **Enrich Input 2**: Keep all data from Input 2, and add matching data from Input 1. This is like a right join.

  <figure markdown="span">
  ![Sample Combine mode inputs and output. Two separate data sources are on the left. The final data source combines these data sources by matching fields.](/_images/integrations/builtin/core-nodes/merge/merge-by-field-diagram.png)
  <figcaption>Combine by Matching Fields mode inputs and output</figcaption>
  </figure>


  #### Position

  Combine items based on their order. The item at index 0 in Input 1 merges with the item at index 0 in Input 2, and so on.

  <figure markdown="span">
  ![Sample Combine mode inputs and output. Two separate data sources are on the left. The final data source combines these data sources by index position.](/_images/integrations/builtin/core-nodes/merge/merge-by-position-diagram.png)
  <figcaption>Combine by Position mode inputs and output</figcaption>
  </figure>


  #### All Possible Combinations

  Output all possible item combinations, while merging fields with the same name.

  <figure markdown="span">
  ![Sample Combine mode inputs and output. Two separate data sources are on the left. The final data source combines these data sources by all possible combinations.](/_images/integrations/builtin/core-nodes/merge/multiplex-diagram.png)
  <figcaption>Combine by All Possible Combinations mode inputs and output</figcaption>
  </figure>

  #### Combine mode options

  When merging data by **Mode > Combine**, you can set these **Options**:

  * **Clash Handling**: Choose how to merge when data streams clash, or when there are sub-fields. Refer to [Clash handling](#clash-handling) for details.
  * **Fuzzy Compare**: Whether to tolerate type differences when comparing fields (enabled), or not (disabled, default). For example, when you enable this, n8n treats `"3"` and `3` as the same.
  * **Disable Dot Notation**: This prevents accessing child fields using `parent.child` in the field name.
  * **Multiple Matches**: Choose how n8n handles multiple matches when comparing data streams.
      * **Include All Matches**: Output multiple items if there are multiple matches, one for each match.
      * **Include First Match Only**: Keep the first item per match and discard the remaining multiple matches.
  * **Include Any Unpaired Items**: Choose whether to keep or discard unpaired items when merging by position. The default behavior is to leave out the items without a match. 

  ##### Clash Handling

  --8<-- "_snippets/integrations/builtin/core-nodes/merge/field-value-clash.md"

  ### SQL Query

  Write a custom SQL Query to merge the data. 

  Example: 
  ```sql
  SELECT * FROM input1 LEFT JOIN input2 ON input1.name = input2.id
  ```

  Data from previous nodes are available as tables and you can use them in the SQL query as input1, input2, input3, and so on, based on their order. Refer to [AlaSQL GitHub page](https://github.com/alasql/alasql/wiki/Supported-SQL-statements){:target=_blank .external-link} for a full list of supported SQL statements. 

  ### Choose Branch

  Choose which input to keep. This option always waits until the data from both inputs is available. You can choose to **Output**:

  * The **Input 1 Data**
  * The **Input 2 Data**
  * **A Single, Empty Item**

  The node outputs the data from the chosen input, without changing it.

  ## Templates and examples

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

  ## Merging data streams with uneven numbers of items

  The items passed into Input 1 of the Merge node will take precedence. For example, if the Merge node receives five items in Input 1 and 10 items in Input 2, it only processes five items. The remaining five items from Input 2 aren't processed.

  ## Branch execution with If and Merge nodes

  --8<-- "_snippets/integrations/builtin/core-nodes/merge/if-merge-branch-execution.md"


  ## Try it out: A step by step example

  Create a workflow with some example input data to try out the Merge node.

  ### Set up sample data using the Code nodes

  1. Add a Code node to the canvas and connect it to the Start node.
  2. Paste the following JavaScript code snippet in the **JavaScript Code** field:
  ```js
  return [
    {
      json: {
        name: 'Stefan',
        language: 'de',
      }
    },
    {
      json: {
        name: 'Jim',
        language: 'en',
      }
    },
    {
      json: {
        name: 'Hans',
        language: 'de',
      }
    }
  ];
  ```
  3. Add a second Code node, and connect it to the Start node.
  4. Paste the following JavaScript code snippet in the **JavaScript Code** field:
  ```js
  return [
  	  {
      json: {
        greeting: 'Hello',
        language: 'en',
      }
    },
    {
      json: {
        greeting: 'Hallo',
        language: 'de',
      }
    }
  ];
  ```

  ### Try out different merge modes

  Add the Merge node. Connect the first Code node to **Input 1**, and the second Code node to **Input 2**. Run the workflow to load data into the Merge node.

  The final workflow should look like this:

  [[ workflowDemo("https://api.n8n.io/workflows/templates/655") ]]

  Now try different options in **Mode** to see how it affects the output data.

  #### Append

  Select **Mode** > **Append**, then select **Execute step**.

  Your output in table view should look like this:
  <!-- vale off -->
  | **name** | **language** | **greeting** |
  | --- | --- | --- |
  | Stefan | de |  |
  | Jim | en |  |
  | Hans | de |  |
  |   | en | Hello |
  |   | de | Hallo |
  <!-- vale on -->

  #### Combine by Matching Fields

  You can merge these two data inputs so that each person gets the correct greeting for their language.

  1. Select **Mode** > **Combine**.
  2. Select **Combine by** > **Matching Fields**.
  3. In both **Input 1 Field** and **Input 2 Field**, enter `language`. This tells n8n to combine the data by matching the values in the `language` field in each data set.
  4. Select **Execute step**.

  Your output in table view should look like this:
  <!-- vale off -->

  | **name** | **language** | **greeting** |
  | --- | --- | --- |
  | Stefan | de | Hallo |
  | Jim | en | Hello  |
  | Hans | de | Hallo |
  <!-- vale on -->

  #### Combine by Position

  Select **Mode** > **Combine**, **Combine by** > **Position**, then select **Execute step**.

  Your output in table view should look like this:
  <!-- vale off -->
  | **name** | **language** | **greeting** |
  | --- | --- | --- |
  | Stefan | en | Hello |
  | Jim | de | Hallo  |
  <!-- vale on -->

  ##### Keep unpaired items

  If you want to keep all items, select **Add Option** > **Include Any Unpaired Items**, then turn on **Include Any Unpaired Items**.

  Your output in table view should look like this:
  <!-- vale off -->
  | **name** | **language** | **greeting** |
  | --- | --- | --- |
  | Stefan | en | Hello |
  | Jim | de | Hallo  |
  | Hans | de |  |
  <!-- vale on -->

  #### Combine by All Possible Combinations 

  Select **Mode** > **Combine**, **Combine by** > **All Possible Combinations**, then select **Execute step**.

  Your output in table view should look like this:
  <!-- vale off -->
  | **name** | **language** | **greeting** |
  | --- | --- | --- |
  | Stefan | en | Hello |
  | Stefan | de | Hallo |
  | Jim | en | Hello  |
  | Jim | de | Hallo |
  | Hans | en | Hello |
  | Hans | de | Hallo |
  <!-- vale on -->

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b2736b71-8350-4aa4-8fc6-ad7e1b770ddc","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"e55af24fa3883a52401b4979c3a3d059bea6e38bd529bc3ca3538ea14d6d5c07"}}


