# nodes

node_type: n8n-nodes-base.Mqtt
name: Mqtt
display_name: MQTT
description: Push messages to MQTT
category: input
icon: file:mqtt.svg
code_hash: c7e9512bc7eb28a8164578ac33ccffc5611b5e868085382db1767c98ad72f553
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Mqtt
documentation_title: MQTT node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"mqtt","description":"Templates for mqtt"}]
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"topic":"example-value","sendInputData":true,"message":"example-value","options":{}}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:51
updated_at: 2025-06-12 08:58:51
source_code:
  "use strict";
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
      }
      Object.defineProperty(o, k2, desc);
  }) : (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      o[k2] = m[k];
  }));
  var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
  }) : function(o, v) {
      o["default"] = v;
  });
  var __importStar = (this && this.__importStar) || function (mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      __setModuleDefault(result, mod);
      return result;
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mqtt = void 0;
  const mqtt = __importStar(require("mqtt"));
  const utilities_1 = require("../../utils/utilities");
  class Mqtt {
      constructor() {
          this.description = {
              displayName: 'MQTT',
              name: 'mqtt',
              icon: 'file:mqtt.svg',
              group: ['input'],
              version: 1,
              description: 'Push messages to MQTT',
              defaults: {
                  name: 'MQTT',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mqtt',
                      required: true,
                      testedBy: 'mqttConnectionTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Topic',
                      name: 'topic',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The topic to publish to',
                  },
                  {
                      displayName: 'Send Input Data',
                      name: 'sendInputData',
                      type: 'boolean',
                      default: true,
                      description: 'Whether to send the the data the node receives as JSON',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              sendInputData: [false],
                          },
                      },
                      default: '',
                      description: 'The message to publish',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'QoS',
                              name: 'qos',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Received at Most Once',
                                      value: 0,
                                  },
                                  {
                                      name: 'Received at Least Once',
                                      value: 1,
                                  },
                                  {
                                      name: 'Exactly Once',
                                      value: 2,
                                  },
                              ],
                              default: 0,
                              description: 'QoS subscription level',
                          },
                          {
                              displayName: 'Retain',
                              name: 'retain',
                              type: 'boolean',
                              default: false,
                              description: 'Normally if a publisher publishes a message to a topic, and no one is subscribed to that topic the message is simply discarded by the broker. However the publisher can tell the broker to keep the last message on that topic by setting the retain flag to true.',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async mqttConnectionTest(credential) {
                      const credentials = credential.data;
                      try {
                          const protocol = credentials.protocol || 'mqtt';
                          const host = credentials.host;
                          const brokerUrl = `${protocol}://${host}`;
                          const port = credentials.port || 1883;
                          const clientId = credentials.clientId || `mqttjs_${Math.random().toString(16).substr(2, 8)}`;
                          const clean = credentials.clean;
                          const ssl = credentials.ssl;
                          const ca = (0, utilities_1.formatPrivateKey)(credentials.ca);
                          const cert = (0, utilities_1.formatPrivateKey)(credentials.cert);
                          const key = (0, utilities_1.formatPrivateKey)(credentials.key);
                          const rejectUnauthorized = credentials.rejectUnauthorized;
                          let client;
                          if (!ssl) {
                              const clientOptions = {
                                  port,
                                  clean,
                                  clientId,
                              };
                              if (credentials.username && credentials.password) {
                                  clientOptions.username = credentials.username;
                                  clientOptions.password = credentials.password;
                              }
                              client = mqtt.connect(brokerUrl, clientOptions);
                          }
                          else {
                              const clientOptions = {
                                  port,
                                  clean,
                                  clientId,
                                  ca,
                                  cert,
                                  key,
                                  rejectUnauthorized,
                              };
                              if (credentials.username && credentials.password) {
                                  clientOptions.username = credentials.username;
                                  clientOptions.password = credentials.password;
                              }
                              client = mqtt.connect(brokerUrl, clientOptions);
                          }
                          await new Promise((resolve, reject) => {
                              client.on('connect', (test) => {
                                  resolve(test);
                                  client.end();
                              });
                              client.on('error', (error) => {
                                  client.end();
                                  reject(error);
                              });
                          });
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          const credentials = await this.getCredentials('mqtt');
          const protocol = credentials.protocol || 'mqtt';
          const host = credentials.host;
          const brokerUrl = `${protocol}://${host}`;
          const port = credentials.port || 1883;
          const clientId = credentials.clientId || `mqttjs_${Math.random().toString(16).substr(2, 8)}`;
          const clean = credentials.clean;
          const ssl = credentials.ssl;
          const ca = credentials.ca;
          const cert = credentials.cert;
          const key = credentials.key;
          const rejectUnauthorized = credentials.rejectUnauthorized;
          let client;
          if (!ssl) {
              const clientOptions = {
                  port,
                  clean,
                  clientId,
              };
              if (credentials.username && credentials.password) {
                  clientOptions.username = credentials.username;
                  clientOptions.password = credentials.password;
              }
              client = mqtt.connect(brokerUrl, clientOptions);
          }
          else {
              const clientOptions = {
                  port,
                  clean,
                  clientId,
                  ca,
                  cert,
                  key,
                  rejectUnauthorized,
              };
              if (credentials.username && credentials.password) {
                  clientOptions.username = credentials.username;
                  clientOptions.password = credentials.password;
              }
              client = mqtt.connect(brokerUrl, clientOptions);
          }
          const sendInputData = this.getNodeParameter('sendInputData', 0);
          const data = await new Promise((resolve, reject) => {
              client.on('connect', () => {
                  for (let i = 0; i < length; i++) {
                      let message;
                      const topic = this.getNodeParameter('topic', i);
                      const options = this.getNodeParameter('options', i);
                      try {
                          if (sendInputData) {
                              message = JSON.stringify(items[i].json);
                          }
                          else {
                              message = this.getNodeParameter('message', i);
                          }
                          client.publish(topic, message, options);
                      }
                      catch (e) {
                          reject(e);
                      }
                  }
                  client.end(false, {}, () => {
                      resolve([items]);
                  });
                  client.on('error', (e) => {
                      reject(e);
                  });
              });
          });
          return data;
      }
  }
  exports.Mqtt = Mqtt;
  //# sourceMappingURL=Mqtt.node.js.map

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

  # MQTT node

  Use the MQTT node to automate work in MQTT, and integrate MQTT with other applications. n8n supports transporting messages with MQTT.

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

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

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

  ## Operations

  Use the MQTT node to send a message. You can set the message topic, and choose whether to send the node input data as part of the message.

  ## Templates and examples

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

  ## Related resources

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

  Refer to [MQTT's documentation](https://mqtt.org/getting-started/){:target=_blank .external-link} for more information about the service.

related_resources:
  [{"title":"here","url":"/integrations/builtin/trigger-nodes/n8n-nodes-base.mqtttrigger.md","type":"documentation"},{"title":"MQTT's documentation","url":"https://mqtt.org/getting-started/","type":"external"}]

example_workflow:
  {"name":"MQTT Example Workflow","nodes":[{"parameters":{"topic":"example-value","sendInputData":true,"message":"example-value","options":{}},"id":"t26gf1bpatjfah89g3qzj","name":"MQTT","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Topic","name":"topic","type":"string","default":"","required":true,"description":"The topic to publish to"},{"displayName":"Send Input Data","name":"sendInputData","type":"boolean","default":true,"description":"Whether to send the the data the node receives as JSON"},{"displayName":"Message","name":"message","type":"string","default":"","required":true,"description":"The message to publish"},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"QoS subscription level","placeholder":"Add Option"}]


node_type: n8n-nodes-base.Mailcheck
name: Mailcheck
display_name: Mailcheck
description: Consume Mailcheck API
category: transform
icon: file:mailcheck.svg
code_hash: fafaa5f9e5c5d8581945d83f9a43dc10f497291843cc011649f4f65d84a2fcdc
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Mailcheck
documentation_title: Mailcheck node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"mailcheck","description":"Templates for mailcheck"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"email","operation":"check","email":"user@example.com"}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:51
updated_at: 2025-06-12 08:58:51
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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

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

  // --- Next Credential File ---

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

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

  # Mailcheck node

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

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

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

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

  ## Operations

  * Email
      * Check

  ## Templates and examples

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

example_workflow:
  {"name":"Mailcheck Example Workflow","nodes":[{"parameters":{"resource":"email","operation":"check","email":"user@example.com"},"id":"jzffyulzixitipdcp6q21l","name":"Mailcheck","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"email","options":[{"name":"Email","value":"email"}]},{"displayName":"Operation","name":"operation","type":"options","default":"check","options":[{"name":"Check","value":"check"}]},{"displayName":"Email","name":"email","type":"string","default":"","description":"Email address to check","placeholder":"name@email.com"}]


node_type: n8n-nodes-base.LinkedIn
name: LinkedIn
display_name: LinkedIn
description: Consume LinkedIn API
category: input
icon: file:linkedin.svg
code_hash: 1148fe37efdd5c3bbaee912c4f44399c3e83f8a16501e9aaa0ad2ba84214b8ef
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.LinkedIn
documentation_title: LinkedIn node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"linkedin","description":"Templates for linkedin"}]
required_scopes: []
example_parameters: {"resource":"post","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:51
updated_at: 2025-06-12 08:58:51
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LinkedInOAuth2Api = void 0;
  class LinkedInOAuth2Api {
      constructor() {
          this.name = 'linkedInOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'LinkedIn OAuth2 API';
          this.documentationUrl = 'linkedIn';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Organization Support',
                  name: 'organizationSupport',
                  type: 'boolean',
                  default: true,
                  description: 'Whether to request permissions to post as an organization',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://www.linkedin.com/oauth/v2/authorization',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://www.linkedin.com/oauth/v2/accessToken',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '=w_member_social{{$self["organizationSupport"] === true ? ",w_organization_social":",r_liteprofile,r_emailaddress"}}',
                  description: 'Standard scopes for posting on behalf of a user or organization. See <a href="https://docs.microsoft.com/en-us/linkedin/marketing/getting-started#available-permissions"> this resource </a>.',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.LinkedInOAuth2Api = LinkedInOAuth2Api;
  //# sourceMappingURL=LinkedInOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.LinkedInOAuth2Api = void 0;
  class LinkedInOAuth2Api {
      constructor() {
          this.name = 'linkedInOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'LinkedIn OAuth2 API';
          this.documentationUrl = 'linkedIn';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Organization Support',
                  name: 'organizationSupport',
                  type: 'boolean',
                  default: true,
                  description: 'Whether to request permissions to post as an organization',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://www.linkedin.com/oauth/v2/authorization',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://www.linkedin.com/oauth/v2/accessToken',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '=w_member_social{{$self["organizationSupport"] === true ? ",w_organization_social":",r_liteprofile,r_emailaddress"}}',
                  description: 'Standard scopes for posting on behalf of a user or organization. See <a href="https://docs.microsoft.com/en-us/linkedin/marketing/getting-started#available-permissions"> this resource </a>.',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.LinkedInOAuth2Api = LinkedInOAuth2Api;
  //# sourceMappingURL=LinkedInOAuth2Api.credentials.js.map

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

  # LinkedIn node

  Use the LinkedIn node to automate work in LinkedIn, and integrate LinkedIn with other applications. n8n supports creating posts.

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

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

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

  ## Operations

  * Post
      * Create

  ## Parameters

  * **Post As**: choose whether to post as a **Person** or **Organization**.
  * **Person Name or ID** and **Organization URN**: enter an identifier for the person or organization.

  	/// note | Posting as organization
  	If posting as an Organization enter the organization number in the URN field. For example, `03262013` not `urn:li:company:03262013`.
  	///
  	
  * **Text**: the post contents.
  * **Media Category**: use this when including images or article URLs in your post.

  ## Templates and examples

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

  ## Related resources

  Refer to [LinkedIn's API documentation](https://learn.microsoft.com/en-us/linkedin/){:target=_blank .external-link} for more information about the service.

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

related_resources:
  [{"title":"LinkedIn's API documentation","url":"https://learn.microsoft.com/en-us/linkedin/","type":"external"}]

parameter_schemas:
  [{"name":"post_as","displayName":"Post As","type":"string","required":false,"description":"choose whether to post as a **Person** or **Organization**."},{"name":"text","displayName":"Text","type":"string","required":false,"description":"the post contents."},{"name":"media_category","displayName":"Media Category","type":"string","required":false,"description":"use this when including images or article URLs in your post."}]

troubleshooting_info:
  [{"issue":"Parameters","solution":"* **Post As**: choose whether to post as a **Person** or **Organization**.\n* **Person Name or ID** and **Organization URN**: enter an identifier for the person or organization."}]

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"post","options":[{"name":"Post","value":"post"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PostDescription_1.postOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PostDescription_1.postFields"}]


node_type: n8n-nodes-base.Mailchimp
name: Mailchimp
display_name: Mailchimp
description: Consume Mailchimp API
category: output
icon: file:mailchimp.svg
code_hash: f2caad087950dacb0627fb1424523c92a542b7bedb79535d47eb21809f69f722
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Mailchimp
documentation_title: Mailchimp node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"mailchimp","description":"Templates for mailchimp"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:51
updated_at: 2025-06-12 08:58:51
source_code:
  "use strict";
  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

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MailchimpApi = void 0;
  class MailchimpApi {
      constructor() {
          this.name = 'mailchimpApi';
          this.displayName = 'Mailchimp API';
          this.documentationUrl = 'mailchimp';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=apikey {{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '=https://{{$credentials.apiKey.split("-").pop()}}.api.mailchimp.com/3.0',
                  url: '/lists',
              },
          };
      }
  }
  exports.MailchimpApi = MailchimpApi;
  //# sourceMappingURL=MailchimpApi.credentials.js.map

  // --- Next Credential File ---

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

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MailchimpApi = void 0;
  class MailchimpApi {
      constructor() {
          this.name = 'mailchimpApi';
          this.displayName = 'Mailchimp API';
          this.documentationUrl = 'mailchimp';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=apikey {{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '=https://{{$credentials.apiKey.split("-").pop()}}.api.mailchimp.com/3.0',
                  url: '/lists',
              },
          };
      }
  }
  exports.MailchimpApi = MailchimpApi;
  //# sourceMappingURL=MailchimpApi.credentials.js.map

  // --- Next Credential File ---

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

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

  # Mailchimp node

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

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

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

  ## Operations

  * Campaign
      * Delete a campaign
      * Get a campaign
      * Get all the campaigns
      * Replicate a campaign
      * Creates a Resend to Non-Openers version of this campaign
      * Send a campaign
  * List Group
      * Get all groups
  * Member
      * Create a new member on list
      * Delete a member on list
      * Get a member on list
      * Get all members on list
      * Update a new member on list
  * Member Tag
      * Add tags from a list member
      * Remove tags from a list member

  ## Templates and examples

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

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

example_workflow:
  {"name":"Mailchimp Example Workflow","nodes":[{"parameters":{"authentication":"apiKey","resource":"campaign","operation":"delete","list":"","email":"user@example.com","status":"cleaned","jsonParameters":false,"options":{},"locationFieldsUi":{},"mergeFieldsUi":{},"mergeFieldsJson":null,"locationJson":null,"groupsUi":{},"groupJson":null,"returnAll":false,"limit":10,"updateFields":{},"tags":"[]","groupCategory":"","campaignId":"example-value"},"id":"vm44z2o3m29we6qk83dxe","name":"Mailchimp","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"authentication":"apiKey","resource":"campaign","operation":"delete","list":"","email":"user@example.com","status":"cleaned","jsonParameters":false,"options":{},"locationFieldsUi":{},"mergeFieldsUi":{},"mergeFieldsJson":null,"locationJson":null,"groupsUi":{},"groupJson":null,"returnAll":false,"limit":10,"updateFields":{},"tags":"[]","groupCategory":"","campaignId":"example-value"}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"apiKey","options":[{"name":"API Key","value":"apiKey"},{"name":"OAuth2","value":"oAuth2"}]},{"displayName":"Resource","name":"resource","type":"options","default":"member","required":true,"options":[{"name":"Campaign","value":"campaign"},{"name":"List Group","value":"listGroup"},{"name":"Member","value":"member"},{"name":"Member Tag","value":"memberTag"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","required":true,"description":"Create a new member on list","options":[{"name":"Create","value":"create","description":"Create a new member on list"},{"name":"Delete","value":"delete","description":"Delete a member on list"},{"name":"Get","value":"get","description":"Get a member on list"},{"name":"Get Many","value":"getAll","description":"Get many members on a list"},{"name":"Update","value":"update","description":"Update a new member on list"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","required":true,"description":"Add tags from a list member","options":[{"name":"Create","value":"create","description":"Add tags from a list member"},{"name":"Delete","value":"delete","description":"Remove tags from a list member"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getAll","required":true,"description":"Get many groups","options":[{"name":"Get Many","value":"getAll","description":"Get many groups"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getAll","required":true,"description":"Delete a campaign","options":[{"name":"Delete","value":"delete","description":"Delete a campaign"},{"name":"Get","value":"get","description":"Get a campaign"},{"name":"Get Many","value":"getAll","description":"Get many campaigns"},{"name":"Replicate","value":"replicate","description":"Replicate a campaign"},{"name":"Resend","value":"resend","description":"Creates a Resend to Non-Openers version of this campaign"},{"name":"Send","value":"send","description":"Send a campaign"}]},{"displayName":"List Name or ID","name":"list","type":"options","default":"","required":true,"description":"List of lists. Choose from the list, or specify an ID using an <a href="},{"displayName":"Email","name":"email","type":"string","default":"","required":true,"description":"Email address for a subscriber","placeholder":"name@email.com"},{"displayName":"Status","name":"status","type":"options","default":"","required":true,"description":"Subscriber","options":[{"name":"Cleaned","value":"cleaned"},{"name":"Pending","value":"pending"},{"name":"Subscribed","value":"subscribed"},{"name":"Transactional","value":"transactional"},{"name":"Unsubscribed","value":"unsubscribed"}]},{"displayName":"JSON Parameters","name":"jsonParameters","type":"boolean","default":false},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Type of email this member asked to get","placeholder":"Add Option"},{"displayName":"Location","name":"locationFieldsUi","type":"fixedCollection","default":"{","required":true,"description":"Subscriber location information.n","placeholder":"Add Location"},{"displayName":"Merge Fields","name":"mergeFieldsUi","type":"fixedCollection","default":"{","required":true,"description":"An individual merge var and value for a member","placeholder":"Add Merge Fields"},{"displayName":"Merge Fields","name":"mergeFieldsJson","type":"json","default":""},{"displayName":"Location","name":"locationJson","type":"json","default":""},{"displayName":"Interest Groups","name":"groupsUi","type":"fixedCollection","default":"{","description":"Choose from the list, or specify an ID using an <a href=","placeholder":"Add Interest Group"},{"displayName":"Interest Groups","name":"groupJson","type":"json","default":""},{"displayName":"List Name or ID","name":"list","type":"options","default":"","required":true,"description":"List of lists. Choose from the list, or specify an ID using an <a href="},{"displayName":"Email","name":"email","type":"string","default":"","required":true,"description":"Member","placeholder":"name@email.com"},{"displayName":"List Name or ID","name":"list","type":"options","default":"","required":true,"description":"List of lists. Choose from the list, or specify an ID using an <a href="},{"displayName":"Email","name":"email","type":"string","default":"","required":true,"description":"Member","placeholder":"name@email.com"},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"A comma-separated list of fields to return","placeholder":"Add Option"},{"displayName":"List Name or ID","name":"list","type":"options","default":"","required":true,"description":"List of lists. Choose from the list, or specify an ID using an <a href="},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":500,"description":"Max number of results to return"},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Restrict results to subscribers whose information changed before the set timeframe","placeholder":"Add Option"},{"displayName":"List Name or ID","name":"list","type":"options","default":"","required":true,"description":"List of lists. Choose from the list, or specify an ID using an <a href="},{"displayName":"Email","name":"email","type":"string","default":"","required":true,"description":"Email address of the subscriber","placeholder":"name@email.com"},{"displayName":"JSON Parameters","name":"jsonParameters","type":"boolean","default":false},{"displayName":"Update Fields","name":"updateFields","type":"collection","default":"{","required":true,"description":"Type of email this member asked to get","placeholder":"Add Field"},{"displayName":"Merge Fields","name":"mergeFieldsJson","type":"json","default":""},{"displayName":"Location","name":"locationJson","type":"json","default":""},{"displayName":"Interest Groups","name":"groupJson","type":"json","default":""},{"displayName":"List Name or ID","name":"list","type":"options","default":"","required":true,"description":"List of lists. Choose from the list, or specify an ID using an <a href="},{"displayName":"Email","name":"email","type":"string","default":"","required":true,"description":"Email address of the subscriber","placeholder":"name@email.com"},{"displayName":"Tags","name":"tags","type":"string","default":"[]"},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Whether automations based on the tags in the request will not fire","placeholder":"Add Option"},{"displayName":"List Name or ID","name":"list","type":"options","default":"","required":true,"description":"List of lists. Choose from the list, or specify an ID using an <a href="},{"displayName":"Group Category Name or ID","name":"groupCategory","type":"options","default":"","required":true,"description":"Choose from the list, or specify an ID using an <a href="},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":500,"description":"Max number of results to return"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":10,"description":"Max number of results to return"},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Restrict the response to campaigns created before the set time","placeholder":"Add Option"},{"displayName":"Campaign ID","name":"campaignId","type":"string","default":"","required":true,"description":"List of Campaigns"}]


node_type: n8n-nodes-base.ManualTrigger
name: ManualTrigger
display_name: Manual Trigger
description: Runs the flow on clicking a button in n8n
category: trigger
icon: fa:mouse-pointer
code_hash: 3f35cd3f09861e28f965057221a8ecbf622153067834b57309d254a96f85c787
example_parameters: {"notice":null,"pollTimes":{"item":[{"mode":"everyMinute"}]}}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:53
updated_at: 2025-06-12 08:58:53
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

workflow_examples:
  [{"name":"populate_a_pinecone_vector_database_from_a_website","workflow":{"name":"Populate a Pinecone vector database from a website","nodes":[{"parameters":{"model":"text-embedding-3-large","options":{},"requestOptions":{}},"id":"856f2426-b4b5-4180-a422-d26692844afb","name":"Embeddings OpenAI","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","typeVersion":1,"position":[80,1040],"credentials":{"openAiApi":{"id":"tW3bkXa0SAK0OzvR","name":"OpenAi account Debs"}}},{"parameters":{"options":{},"requestOptions":{}},"id":"1e702984-6f79-416e-981a-6728d4b3c233","name":"Default Data Loader","type":"@n8n/n8n-nodes-langchain.documentDefaultDataLoader","typeVersion":1,"position":[260,960]},{"parameters":{"options":{"splitCode":"markdown"},"requestOptions":{}},"id":"2d1f30fd-f251-4389-8f6d-2c950018a91f","name":"Recursive Character Text Splitter","type":"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter","typeVersion":1,"position":[300,1160]},{"parameters":{"batchSize":10,"options":{}},"id":"4e8a9d4c-6009-4d9b-b603-0438c65ba9df","name":"Loop Over Items","type":"n8n-nodes-base.splitInBatches","typeVersion":3,"position":[-840,1040]},{"parameters":{"model":{"__rl":true,"value":"gpt-4o","mode":"list","cachedResultName":"gpt-4o"},"options":{},"requestOptions":{}},"id":"e7967355-41b4-4bc5-b192-c8bc0699e925","name":"OpenAI Model","type":"@n8n/n8n-nodes-langchain.lmOpenAi","typeVersion":1,"position":[-1320,1680],"credentials":{"openAiApi":{"id":"tW3bkXa0SAK0OzvR","name":"OpenAi account Debs"}}},{"parameters":{"url":"https://n8n-io.github.io/n8n-demo-website/sitemap.xml","options":{}},"id":"5fb88663-f28b-4da2-acd9-1cbb0c5d28e7","name":"Get sitemap","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[-1480,740]},{"parameters":{"options":{"explicitRoot":false,"ignoreAttrs":true}},"id":"0e6287b8-9a65-4af0-8e69-3aae3648fd13","name":"Turn XML sitemap into JSON","type":"n8n-nodes-base.xml","typeVersion":1,"position":[-1260,740]},{"parameters":{"fieldToSplitOut":"url","options":{}},"id":"acd3e717-99f5-4238-aa4d-795caef660b1","name":"Turn the URL array into multiple items","type":"n8n-nodes-base.splitOut","typeVersion":1,"position":[-1040,740]},{"parameters":{},"id":"f3b4ad5e-b261-4b97-9077-3b9259d5b37d","name":"Wait 5 seconds","type":"n8n-nodes-base.wait","typeVersion":1.1,"position":[-320,1060],"webhookId":"f4e7dead-77ad-4216-a5a0-ef95914bf3ab"},{"parameters":{"url":"={{ $json.loc }}","options":{}},"id":"361b2a70-d0c5-4498-8a70-0688710e76e6","name":"Get pages listed in the sitemap","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[-580,1060]},{"parameters":{},"id":"14ddd282-9bf0-459f-9595-5154e16f9cc0","name":"Chat Trigger","type":"@n8n/n8n-nodes-langchain.chatTrigger","typeVersion":1,"position":[-1620,1420],"webhookId":"4b338d3c-b03f-42f2-94c1-9353d0f1fbc2"},{"parameters":{"promptType":"define","text":"={{ $('Chat Trigger').item.json.chatInput }}"},"id":"263585e6-02bb-4940-9bb3-15f32b0f8079","name":"Question and Answer Chain","type":"@n8n/n8n-nodes-langchain.chainRetrievalQa","typeVersion":1.3,"position":[-1280,1420]},{"parameters":{"topK":10,"requestOptions":{}},"id":"91ad53ec-a761-43f6-a6f1-835263222e0c","name":"Vector Store Retriever","type":"@n8n/n8n-nodes-langchain.retrieverVectorStore","typeVersion":1,"position":[-1080,1620]},{"parameters":{"model":"text-embedding-3-large","options":{},"requestOptions":{}},"id":"5c55cb38-be26-405d-bd39-d29e0a33b683","name":"Embeddings OpenAI2","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","typeVersion":1,"position":[-780,2040],"credentials":{"openAiApi":{"id":"tW3bkXa0SAK0OzvR","name":"OpenAi account Debs"}}},{"parameters":{"fieldsToAggregate":{"fieldToAggregate":[{"fieldToAggregate":"content"}]},"options":{}},"id":"48dbd7f7-1ca1-41e2-9fd5-e916ea76589b","name":"Aggregate","type":"n8n-nodes-base.aggregate","typeVersion":1,"position":[-100,740]},{"parameters":{"content":"**Aggregate into one item**\n\nThe Pinecone node loops over each input item. This is standard n8n node behavior.\n\nThis means if you want to use the **Clear namespace** setting in the Pinecone node, you need to input a single item.","height":381.66422439067196,"color":5},"id":"5b70d4ae-1889-43d3-b92d-bf73e43236bd","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-160,520]},{"parameters":{"content":"### Workflow to scrape data and send it to Pinecone","height":878.8927796727229,"width":2382.6739342193496,"color":7},"id":"e9b5d557-51af-48d1-af33-8783f9ca3718","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-1856.703373323493,480]},{"parameters":{"content":"### Workflow to chat and get answers from the Pinecone vector database","height":825.9872504327399,"width":1181.407211476183,"color":7},"id":"7efa097b-d4f2-49a4-9da5-4fcf6b83be3b","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-1680,1380]},{"parameters":{"content":"## Try it out \n\n1. Set credentials and choose your Pinecone vector database. See the notes on individual nodes for details.\n2. Select **Execute workflow** to run the main workflow and load data into Pinecone.\n3. Select **Chat** and try asking:\n\n_What is the purpose of the n8n demo website?_","height":326.49681260818465,"color":4},"id":"f21bc32b-a405-4d71-b6c9-7bffbb6faed9","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-2040,560]},{"parameters":{"content":"**Setup**\n\n1. In Pinecone, create a vector database. Set **Dimensions** to `3072` and **Metric** to `cosine`. You can use the free starter plan.\n2. In the Pinecone node, set your credentials.\n3. Select your Pinecone index.","height":381.3701016273242,"width":304.1011298750183,"color":2},"id":"4be87782-f811-418f-b4b5-9e12c4cf7970","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[140,520]},{"parameters":{"mode":"insert","pineconeIndex":{},"options":{"clearNamespace":true,"pineconeNamespace":"test-web-scraper"}},"id":"94035a97-5a09-493c-aaae-dcba7bbf8526","name":"Pinecone Vector Store","type":"@n8n/n8n-nodes-langchain.vectorStorePinecone","typeVersion":1,"position":[160,740],"credentials":{"pineconeApi":{"id":"lruA9GaKZSEY8dky","name":"Debs Pinecone"}}},{"parameters":{"content":"## Next steps\n\nLearn more about [Advanced AI in n8n](https://docs.n8n.io/advanced-ai/)","width":331.8066536811489},"id":"2be1433b-0488-4c7e-8c10-e771d4dd4686","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[460,1280]},{"parameters":{"content":"**Set your credentials**","height":206.68134932939768,"width":182.42633582707612,"color":2},"id":"fffbb04d-6d61-4dfa-bfd3-46b8c92a36d5","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[20,1000]},{"parameters":{"content":"**Set your credentials**","height":184.89671964234537,"width":173.09006596119673,"color":2},"id":"810ac5e1-d730-47af-9282-64ab0b4fca16","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-1369.107685156473,1620.2285847094058]},{"parameters":{"content":"**Set your credentials**","height":192.67694453057842,"width":221.3274602682409,"color":2},"id":"2cecc8ac-3c65-4294-8a5d-2842bc07d10a","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-860,1980]},{"parameters":{"pineconeIndex":{"__rl":true,"value":"debs-test","mode":"list","cachedResultName":"debs-test"},"options":{"pineconeNamespace":"test-web-scraper"}},"id":"e673c46e-0815-4b58-9a8f-2fb86445b578","name":"Pinecone Vector Store2","type":"@n8n/n8n-nodes-langchain.vectorStorePinecone","typeVersion":1,"position":[-980,1840],"credentials":{"pineconeApi":{"id":"lruA9GaKZSEY8dky","name":"Debs Pinecone"}}},{"parameters":{"content":"**Set your credentials**\n\n**Select your Pinecone index***","width":367.59568816702017,"color":2},"id":"ca4499ae-4e27-4848-9654-f7e744c081e7","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-1080,1760]},{"parameters":{},"id":"b43ddbd1-adfd-4bba-bee5-4b81229e88dd","name":"Start the workflow by clicking \"Execute workflow\"","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[-1700,740]},{"parameters":{"operation":"extractHtmlContent","extractionValues":{"values":[{"key":"content","cssSelector":".md-content","returnValue":"html"}]},"options":{"trimValues":true,"cleanUpText":true}},"id":"d39624d7-93c0-4452-81b1-ffa04b216ceb","name":"Extract main content","type":"n8n-nodes-base.html","typeVersion":1.2,"position":[-380,740]},{"parameters":{"content":"**Batch the calls to the website**\n\nFor the small demo website in this example, this is not essential. If you want to use this example with a larger website, batching like this helps avoid timeouts. Using the Wait node between batches avoids hitting the website with too many requests too fast.","height":298.48800301054644,"width":316.2462039046831,"color":5},"id":"9825926d-ce6d-429e-9006-6ff5fd1f46ca","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-1220,1020]},{"parameters":{"content":"## How to scrape a different website\n\nThis workflow uses a small example website provided by n8n. To use a different site:\n\n1. Change the sitemap URL in **Get sitemap**.\n2. Update **Extract main content** according to the HTML structure of the website you're scraping.","height":356.06166718347},"id":"7c2e4bde-3900-49b0-9bee-704e34664163","name":"Sticky Note11","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-2040,960]}],"pinData":{},"connections":{"Embeddings OpenAI":{"ai_embedding":[[{"node":"Pinecone Vector Store","type":"ai_embedding","index":0}]]},"Default Data Loader":{"ai_document":[[{"node":"Pinecone Vector Store","type":"ai_document","index":0}]]},"Recursive Character Text Splitter":{"ai_textSplitter":[[{"node":"Default Data Loader","type":"ai_textSplitter","index":0}]]},"Loop Over Items":{"main":[[{"node":"Extract main content","type":"main","index":0}],[{"node":"Get pages listed in the sitemap","type":"main","index":0}]]},"Get sitemap":{"main":[[{"node":"Turn XML sitemap into JSON","type":"main","index":0}]]},"Turn XML sitemap into JSON":{"main":[[{"node":"Turn the URL array into multiple items","type":"main","index":0}]]},"Turn the URL array into multiple items":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Wait 5 seconds":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Get pages listed in the sitemap":{"main":[[{"node":"Wait 5 seconds","type":"main","index":0}]]},"Chat Trigger":{"main":[[{"node":"Question and Answer Chain","type":"main","index":0}]]},"OpenAI Model":{"ai_languageModel":[[{"node":"Question and Answer Chain","type":"ai_languageModel","index":0}]]},"Vector Store Retriever":{"ai_retriever":[[{"node":"Question and Answer Chain","type":"ai_retriever","index":0}]]},"Embeddings OpenAI2":{"ai_embedding":[[{"node":"Pinecone Vector Store2","type":"ai_embedding","index":0}]]},"Aggregate":{"main":[[{"node":"Pinecone Vector Store","type":"main","index":0}]]},"Pinecone Vector Store2":{"ai_vectorStore":[[{"node":"Vector Store Retriever","type":"ai_vectorStore","index":0}]]},"Start the workflow by clicking \"Execute workflow\"":{"main":[[{"node":"Get sitemap","type":"main","index":0}]]},"Extract main content":{"main":[[{"node":"Aggregate","type":"main","index":0}]]}}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[-1700,740]}],"connections":{"Embeddings OpenAI":{"ai_embedding":[[{"node":"Pinecone Vector Store","type":"ai_embedding","index":0}]]},"Default Data Loader":{"ai_document":[[{"node":"Pinecone Vector Store","type":"ai_document","index":0}]]},"Recursive Character Text Splitter":{"ai_textSplitter":[[{"node":"Default Data Loader","type":"ai_textSplitter","index":0}]]},"Loop Over Items":{"main":[[{"node":"Extract main content","type":"main","index":0}],[{"node":"Get pages listed in the sitemap","type":"main","index":0}]]},"Get sitemap":{"main":[[{"node":"Turn XML sitemap into JSON","type":"main","index":0}]]},"Turn XML sitemap into JSON":{"main":[[{"node":"Turn the URL array into multiple items","type":"main","index":0}]]},"Turn the URL array into multiple items":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Wait 5 seconds":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Get pages listed in the sitemap":{"main":[[{"node":"Wait 5 seconds","type":"main","index":0}]]},"Chat Trigger":{"main":[[{"node":"Question and Answer Chain","type":"main","index":0}]]},"OpenAI Model":{"ai_languageModel":[[{"node":"Question and Answer Chain","type":"ai_languageModel","index":0}]]},"Vector Store Retriever":{"ai_retriever":[[{"node":"Question and Answer Chain","type":"ai_retriever","index":0}]]},"Embeddings OpenAI2":{"ai_embedding":[[{"node":"Pinecone Vector Store2","type":"ai_embedding","index":0}]]},"Aggregate":{"main":[[{"node":"Pinecone Vector Store","type":"main","index":0}]]},"Pinecone Vector Store2":{"ai_vectorStore":[[{"node":"Vector Store Retriever","type":"ai_vectorStore","index":0}]]},"Start the workflow by clicking \"Execute workflow\"":{"main":[[{"node":"Get sitemap","type":"main","index":0}]]},"Extract main content":{"main":[[{"node":"Aggregate","type":"main","index":0}]]}},"source":"docs/_workflows/advanced-ai/examples/populate_a_pinecone_vector_database_from_a_website.json"},{"name":"data-transformation","workflow":{"name":"Data transformation","nodes":[{"parameters":{},"id":"3ada6076-1cfb-4c2d-a421-4fce5466fc2d","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[1340,840]},{"parameters":{"jsCode":"return [\n{\n\"user_id\":\n\"0001\",\n\"username\":\n\"nathan\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"0002\",\n\"username\":\n\"natalie\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"0003\",\n\"username\":\n\"nadia\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"naomi\",\n\"username\":\n\"hkhjk\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"0005\",\n\"username\":\n\"nolan\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n}\n]"},"id":"08e4d878-01ab-4f01-ab27-84ef5afbf581","name":"Code","type":"n8n-nodes-base.code","typeVersion":2,"position":[1560,840]},{"parameters":{},"id":"57a9330b-9e46-42a6-b432-681e906de93a","name":"Join items","type":"n8n-nodes-base.code","typeVersion":2,"position":[1780,840]}],"pinData":{},"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Code","type":"main","index":0}]]},"Code":{"main":[[{"node":"Join items","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"d7409102-d3af-4ddf-bead-2df008554458","id":"B4K5I5pN4nqu85ac","meta":{"instanceId":"c5aabef739d71e3d0ceb8b6078a241aaf1b145fa71cbbe36ecfb2c8c3fd64f5f"},"tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[1340,840]}],"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Code","type":"main","index":0}]]},"Code":{"main":[[{"node":"Join items","type":"main","index":0}]]}},"source":"docs/_workflows/ai-code/data-transformation.json","description":"Workflow example from docs/_workflows/ai-code/data-transformation.json"},{"name":"find-a-piece-of-data","workflow":{"name":"Find a piece of data","nodes":[{"parameters":{},"id":"5319a081-f4f9-44ac-a91e-a57270e6eaa8","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[460,460]},{"parameters":{"jsCode":"return [\n{\n\"title\":\n\"\",\n\"phone\":\n\"\",\n\"skype\":\n\"\",\n\"real_name\":\n\"Nathan Berlin\",\n\"email\": \"nathan@example.io\",\n\"real_name_normalized\":\n\"Nathan Berlin\",\n\"display_name\":\n\"Nathan Berlin\",\n\"display_name_normalized\":\n\"Nathan Berlin\",\n\"fields\":\n{\n},\n\"status_text\":\n\"\",\n\"status_emoji\":\n\"\",\n\"status_emoji_display_info\":\n[\n],\n\"status_expiration\":\n0,\n\"avatar_hash\":\n\"0856f5fbbd43\",\n\"image_original\":\n\"https://example.png\",\n\"is_custom_image\":\ntrue,\n\"huddle_state\":\n\"default_unset\",\n\"huddle_state_expiration_ts\":\n0,\n\"first_name\":\n\"Nathan\",\n\"last_name\":\n\"Berlin\",\n\"image_24\":\n\"https://example.png\",\n\"image_32\":\n\"https://example.png\",\n\"image_48\":\n\"https://example.png\",\n\"image_72\":\n\"https://example.png\",\n\"image_192\":\n\"https://example.png\",\n\"image_512\":\n\"https://example.png\",\n\"image_1024\":\n\"https://example.png\",\n\"status_text_canonical\":\n\"\"\n}\n]"},"id":"3ec439bc-7e3f-4ec2-b724-092466efaa18","name":"Mock Slack","type":"n8n-nodes-base.code","typeVersion":2,"position":[680,460]},{"parameters":{"jsCode":"return [\n{\n\"object\":\n\"user\",\n\"id\":\n\"1234\",\n\"name\":\n\"Nathan Berlin\",\n\"avatar_url\":\n\"https://example.jpeg\",\n\"type\":\n\"person\",\n\"person\":\n{\n\"email\":\n\"nathan@example.io\"\n}\n},\n{\n\"object\":\n\"user\",\n\"id\":\n\"5678\",\n\"name\":\n\"Natalie Berlin\",\n\"avatar_url\":\n\"https://example.jpeg\",\n\"type\":\n\"person\",\n\"person\":\n{\n\"email\":\n\"natalie@example.io\"\n}\n}\n]"},"id":"4bb97ec6-c73a-4f01-b935-a94ffbf15d23","name":"Mock Notion","type":"n8n-nodes-base.code","typeVersion":2,"position":[900,460]},{"parameters":{},"id":"330ecf72-cff0-4ada-9b04-b1c99bb0f4de","name":"Code","type":"n8n-nodes-base.code","typeVersion":2,"position":[1120,460]}],"pinData":{},"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock Slack","type":"main","index":0}]]},"Mock Slack":{"main":[[{"node":"Mock Notion","type":"main","index":0}]]},"Mock Notion":{"main":[[{"node":"Code","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"81cabd2b-2854-4afb-b656-90a0cb77fa96","id":"3Brrdjs5aRHo57EX","meta":{"instanceId":"c5aabef739d71e3d0ceb8b6078a241aaf1b145fa71cbbe36ecfb2c8c3fd64f5f"},"tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[460,460]}],"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock Slack","type":"main","index":0}]]},"Mock Slack":{"main":[[{"node":"Mock Notion","type":"main","index":0}]]},"Mock Notion":{"main":[[{"node":"Code","type":"main","index":0}]]}},"source":"docs/_workflows/ai-code/find-a-piece-of-data.json","description":"Workflow example from docs/_workflows/ai-code/find-a-piece-of-data.json"},{"name":"reference-incoming-data-explicitly","workflow":{"name":"Reference incoming data explicitly","nodes":[{"parameters":{},"id":"0abbe7f6-f8a0-4f71-8229-f4fd1a3c2683","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[620,520]},{"parameters":{"jsCode":"return [\n  {\n   \"id\": 0001,\n   \"personal_info\": {\n    \"first_name\": \"Natalie\",\n    \"surname\": \"Berlin\"\n   },\n   \"work_info\": {\n    \"job_title\": \"Automation engineer\"\n   }\n  },\n  {\n    \"id\": 0002,\n    \"personal_info\": {\n     \"first_name\": \"Nathan\",\n     \"surname\": \"Berlin\"\n    },\n    \"work_info\": {\n     \"job_title\": \"Automation designer\"\n    }\n   }\n]"},"id":"e19f11cd-c868-4aca-b88e-04b4ee6f0187","name":"Mock data","type":"n8n-nodes-base.code","typeVersion":2,"position":[840,520]},{"parameters":{},"id":"ef54d477-0596-441a-98e5-1ab005e9a268","name":"Code","type":"n8n-nodes-base.code","typeVersion":2,"position":[1060,520]}],"pinData":{},"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock data","type":"main","index":0}]]},"Mock data":{"main":[[{"node":"Code","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"4e3a0a21-c993-4851-848b-01bd5c090b6b","id":"EipyYyqKKQm7siq4","meta":{"instanceId":"c5aabef739d71e3d0ceb8b6078a241aaf1b145fa71cbbe36ecfb2c8c3fd64f5f"},"tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[620,520]}],"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock data","type":"main","index":0}]]},"Mock data":{"main":[[{"node":"Code","type":"main","index":0}]]}},"source":"docs/_workflows/ai-code/reference-incoming-data-explicitly.json","description":"Workflow example from docs/_workflows/ai-code/reference-incoming-data-explicitly.json"},{"name":"summarize-data","workflow":{"name":"Summarize data and prepare Slack message","nodes":[{"parameters":{},"id":"5d4bd82f-24e9-484e-a17e-c5de889087d9","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[860,540]},{"parameters":{},"id":"0d73c3df-300a-4397-8f53-fb0750dbf97f","name":"Summarize","type":"n8n-nodes-base.code","typeVersion":2,"position":[1300,540]},{"parameters":{"jsCode":"return [\n{\n\"id\":\n\"0001\",\n\"name\":\n\"Example feature 1\",\n\"url\": \"example.com\",\n\"property_tags\":\n[\n],\n\"property_type\":\n[\n\"Feature\"\n],\n\"property_votes\":\n2\n},\n{\n\"id\":\n\"0002\",\n\"name\":\n\"Example feature 2\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Feature\"\n],\n\"property_votes\":\n3\n},\n{\n\"id\":\n\"0003\",\n\"name\":\n\"Example feature 3\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Feature\"\n],\n\"property_votes\":\n1\n},\n{\n\"id\":\n\"0004\",\n\"name\":\n\"Example bug 1\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Bug\"\n],\n\"property_votes\":\n0\n},\n{\n\"id\":\n\"0005\",\n\"name\":\n\"Example idea 1\",\n\"url\": \"example.com\",\n\"property_type\":\n[\n\"Idea\"\n],\n\"property_votes\":\n4\n}\n]"},"id":"fda17968-61a5-4c0b-ab83-adb4e0bbf7c5","name":"Mock Ideas","type":"n8n-nodes-base.code","typeVersion":2,"position":[1080,540]}],"pinData":{},"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock Ideas","type":"main","index":0}]]},"Mock Ideas":{"main":[[{"node":"Summarize","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"077fe5dc-2214-4149-9f1b-ef6342e45dec","id":"5IoF8z4YUoSUpBUk","meta":{"instanceId":"c5aabef739d71e3d0ceb8b6078a241aaf1b145fa71cbbe36ecfb2c8c3fd64f5f"},"tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[860,540]}],"connections":{"When clicking \"Execute Workflow\"":{"main":[[{"node":"Mock Ideas","type":"main","index":0}]]},"Mock Ideas":{"main":[[{"node":"Summarize","type":"main","index":0}]]}},"source":"docs/_workflows/ai-code/summarize-data.json","description":"Workflow example from docs/_workflows/ai-code/summarize-data.json"},{"name":"chapter-2","workflow":{"nodes":[{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[0,0],"id":"5738d1d8-ae7d-4e04-bca4-885c59e1d9e8","name":"When clicking ‘Execute workflow’"},{"parameters":{"resource":"all","limit":10,"additionalFields":{"keyword":"automation"}},"type":"n8n-nodes-base.hackerNews","typeVersion":1,"position":[220,0],"id":"65e9d0a6-5261-4c7d-8d85-6ff49de04dee","name":"Hacker News","notesInFlow":true,"notes":"Get the 10 latest articles."}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Hacker News","type":"main","index":0}]]}},"pinData":{},"meta":{"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[0,0]}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Hacker News","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-2.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-2.json"},{"name":"chapter-5.1","workflow":{"nodes":[{"parameters":{"url":"https://internal.users.n8n.cloud/webhook/custom-erp","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendHeaders":true,"headerParameters":{"parameters":[{"name":"unique_id","value":"<YOUR_UNIQUE_ID_HERE>"}]},"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[340,-680],"id":"ada6becf-c320-41a7-bdca-a842ea3ee769","name":"HTTP Request1","credentials":{"httpHeaderAuth":{"id":"sMuanZ4xGobAurzY","name":"Nathan's ABCorp data warehouse account"}}},{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[140,-680],"id":"ffa1a8ce-1a1e-48c4-8a0d-6af28c0447a5","name":"When clicking ‘Execute workflow’"}],"connections":{"HTTP Request1":{"main":[[]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[140,-680]}],"connections":{"HTTP Request1":{"main":[[]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-5/chapter-5.1.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-5/chapter-5.1.json"},{"name":"chapter-5.2","workflow":{"nodes":[{"parameters":{"url":"https://internal.users.n8n.cloud/webhook/custom-erp","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendHeaders":true,"headerParameters":{"parameters":[{"name":"unique_id","value":"<YOUR_UNIQUE_ID_HERE>"}]},"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[340,-680],"id":"ada6becf-c320-41a7-bdca-a842ea3ee769","name":"HTTP Request1","credentials":{"httpHeaderAuth":{"id":"sMuanZ4xGobAurzY","name":"Nathan's ABCorp data warehouse account"}}},{"parameters":{"operation":"create","base":{"__rl":true,"value":"app9nOVsRxdypoknP","mode":"list","cachedResultName":"beginner course"},"table":{"__rl":true,"value":"tblo2KuMyn5X4jU0s","mode":"list","cachedResultName":"orders"},"columns":{"mappingMode":"autoMapInputData","value":{},"matchingColumns":[],"schema":[{"id":"orderID","displayName":"orderID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"customerID","displayName":"customerID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"employeeName","displayName":"employeeName","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false},{"id":"orderPrice","displayName":"orderPrice","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"orderStatus","displayName":"orderStatus","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"type":"n8n-nodes-base.airtable","typeVersion":2.1,"position":[560,-680],"id":"5e60ca72-d773-439c-b39a-4b14c54f795b","name":"Airtable1","credentials":{"airtableTokenApi":{"id":"UT32NHUYnp4pn1H3","name":"Airtable Personal Access Token account"}}},{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[140,-680],"id":"ffa1a8ce-1a1e-48c4-8a0d-6af28c0447a5","name":"When clicking ‘Execute workflow’"}],"connections":{"HTTP Request1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[140,-680]}],"connections":{"HTTP Request1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-5/chapter-5.2.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-5/chapter-5.2.json"},{"name":"chapter-5.3","workflow":{"nodes":[{"parameters":{"url":"https://internal.users.n8n.cloud/webhook/custom-erp","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendHeaders":true,"headerParameters":{"parameters":[{"name":"unique_id","value":"<YOUR_UNIQUE_ID_HERE>"}]},"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[340,-680],"id":"ada6becf-c320-41a7-bdca-a842ea3ee769","name":"HTTP Request1","credentials":{"httpHeaderAuth":{"id":"sMuanZ4xGobAurzY","name":"Nathan's ABCorp data warehouse account"}}},{"parameters":{"operation":"create","base":{"__rl":true,"value":"app9nOVsRxdypoknP","mode":"list","cachedResultName":"beginner course"},"table":{"__rl":true,"value":"tblo2KuMyn5X4jU0s","mode":"list","cachedResultName":"orders"},"columns":{"mappingMode":"autoMapInputData","value":{},"matchingColumns":[],"schema":[{"id":"orderID","displayName":"orderID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"customerID","displayName":"customerID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"employeeName","displayName":"employeeName","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false},{"id":"orderPrice","displayName":"orderPrice","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"orderStatus","displayName":"orderStatus","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"type":"n8n-nodes-base.airtable","typeVersion":2.1,"position":[800,-680],"id":"5e60ca72-d773-439c-b39a-4b14c54f795b","name":"Airtable1","credentials":{"airtableTokenApi":{"id":"UT32NHUYnp4pn1H3","name":"Airtable Personal Access Token account"}}},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"526cb30c-0f90-4f66-8f98-b64ceb2e52f2","leftValue":"={{ $json.orderStatus }}","rightValue":"processing","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[540,-680],"id":"70e4db65-f827-4e4f-8673-b405b7986d6e","name":"If1"},{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[140,-680],"id":"ffa1a8ce-1a1e-48c4-8a0d-6af28c0447a5","name":"When clicking ‘Execute workflow’"}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Airtable1","type":"main","index":0}],[]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[140,-680]}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Airtable1","type":"main","index":0}],[]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-5/chapter-5.3.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-5/chapter-5.3.json"},{"name":"chapter-5.4","workflow":{"nodes":[{"parameters":{"url":"https://internal.users.n8n.cloud/webhook/custom-erp","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendHeaders":true,"headerParameters":{"parameters":[{"name":"unique_id","value":"<YOUR_UNIQUE_ID_HERE>"}]},"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[300,-520],"id":"ada6becf-c320-41a7-bdca-a842ea3ee769","name":"HTTP Request1","credentials":{"httpHeaderAuth":{"id":"sMuanZ4xGobAurzY","name":"Nathan's ABCorp data warehouse account"}}},{"parameters":{"operation":"create","base":{"__rl":true,"value":"app9nOVsRxdypoknP","mode":"list","cachedResultName":"beginner course"},"table":{"__rl":true,"value":"tblTIOsm4BLJD9Tql","mode":"list","cachedResultName":"processingOrders"},"columns":{"mappingMode":"autoMapInputData","value":{},"matchingColumns":[],"schema":[{"id":"orderID","displayName":"orderID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"employeeName","displayName":"employeeName","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"type":"n8n-nodes-base.airtable","typeVersion":2.1,"position":[1020,-600],"id":"5e60ca72-d773-439c-b39a-4b14c54f795b","name":"Airtable1","credentials":{"airtableTokenApi":{"id":"UT32NHUYnp4pn1H3","name":"Airtable Personal Access Token account"}}},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"526cb30c-0f90-4f66-8f98-b64ceb2e52f2","leftValue":"={{ $json.orderStatus }}","rightValue":"processing","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[520,-520],"id":"70e4db65-f827-4e4f-8673-b405b7986d6e","name":"If1"},{"parameters":{"assignments":{"assignments":[{"id":"20d37948-763a-4d7b-b725-e65f3802af03","name":"orderID","value":"={{ $json.orderID }}","type":"number"},{"id":"9df108a7-6b13-42ab-a6dd-9ca582ba8b49","name":"employeeName","value":"={{ $json.employeeName }}","type":"string"}]},"options":{}},"type":"n8n-nodes-base.set","typeVersion":3.4,"position":[800,-600],"id":"a3d3dc53-32f1-4f44-bf95-50bc5450d601","name":"Edit Fields1"},{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[80,-520],"id":"ffa1a8ce-1a1e-48c4-8a0d-6af28c0447a5","name":"When clicking ‘Execute workflow’"}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[80,-520]}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-5/chapter-5.4.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-5/chapter-5.4.json"},{"name":"chapter-5.5","workflow":{"nodes":[{"parameters":{"url":"https://internal.users.n8n.cloud/webhook/custom-erp","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendHeaders":true,"headerParameters":{"parameters":[{"name":"unique_id","value":"<YOUR_UNIQUE_ID_HERE>"}]},"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[300,-520],"id":"ada6becf-c320-41a7-bdca-a842ea3ee769","name":"HTTP Request1","credentials":{"httpHeaderAuth":{"id":"sMuanZ4xGobAurzY","name":"Nathan's ABCorp data warehouse account"}}},{"parameters":{"operation":"create","base":{"__rl":true,"value":"app9nOVsRxdypoknP","mode":"list","cachedResultName":"beginner course"},"table":{"__rl":true,"value":"tblTIOsm4BLJD9Tql","mode":"list","cachedResultName":"processingOrders"},"columns":{"mappingMode":"autoMapInputData","value":{},"matchingColumns":[],"schema":[{"id":"orderID","displayName":"orderID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"employeeName","displayName":"employeeName","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"type":"n8n-nodes-base.airtable","typeVersion":2.1,"position":[1020,-600],"id":"5e60ca72-d773-439c-b39a-4b14c54f795b","name":"Airtable1","credentials":{"airtableTokenApi":{"id":"UT32NHUYnp4pn1H3","name":"Airtable Personal Access Token account"}}},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"526cb30c-0f90-4f66-8f98-b64ceb2e52f2","leftValue":"={{ $json.orderStatus }}","rightValue":"processing","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[520,-520],"id":"70e4db65-f827-4e4f-8673-b405b7986d6e","name":"If1"},{"parameters":{"assignments":{"assignments":[{"id":"20d37948-763a-4d7b-b725-e65f3802af03","name":"orderID","value":"={{ $json.orderID }}","type":"number"},{"id":"9df108a7-6b13-42ab-a6dd-9ca582ba8b49","name":"employeeName","value":"={{ $json.employeeName }}","type":"string"}]},"options":{}},"type":"n8n-nodes-base.set","typeVersion":3.4,"position":[800,-600],"id":"a3d3dc53-32f1-4f44-bf95-50bc5450d601","name":"Edit Fields1"},{"parameters":{"jsCode":"let items = $input.all();\nlet totalBooked = items.length;\nlet bookedSum = 0;\n\nfor (let i=0; i < items.length; i++) {\n  bookedSum = bookedSum + items[i].json.orderPrice;\n}\n\nreturn [{ json: {totalBooked, bookedSum} }];"},"type":"n8n-nodes-base.code","typeVersion":2,"position":[760,-420],"id":"d24ea5e9-c9e6-4d06-b6ee-8db1abd42bc0","name":"Code1"},{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[80,-520],"id":"ffa1a8ce-1a1e-48c4-8a0d-6af28c0447a5","name":"When clicking ‘Execute workflow’"}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[{"node":"Code1","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"Code1":{"main":[[]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[80,-520]}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[{"node":"Code1","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"Code1":{"main":[[]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-5/chapter-5.5.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-5/chapter-5.5.json"},{"name":"chapter-5.6","workflow":{"nodes":[{"parameters":{"url":"https://internal.users.n8n.cloud/webhook/custom-erp","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendHeaders":true,"headerParameters":{"parameters":[{"name":"unique_id","value":"<YOUR_UNIQUE_ID_HERE>"}]},"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[300,-520],"id":"ada6becf-c320-41a7-bdca-a842ea3ee769","name":"HTTP Request1","credentials":{"httpHeaderAuth":{"id":"sMuanZ4xGobAurzY","name":"Nathan's ABCorp data warehouse account"}}},{"parameters":{"operation":"create","base":{"__rl":true,"value":"app9nOVsRxdypoknP","mode":"list","cachedResultName":"beginner course"},"table":{"__rl":true,"value":"tblTIOsm4BLJD9Tql","mode":"list","cachedResultName":"processingOrders"},"columns":{"mappingMode":"autoMapInputData","value":{},"matchingColumns":[],"schema":[{"id":"orderID","displayName":"orderID","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"employeeName","displayName":"employeeName","required":false,"defaultMatch":false,"canBeUsedToMatch":true,"display":true,"type":"string","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"type":"n8n-nodes-base.airtable","typeVersion":2.1,"position":[1020,-600],"id":"5e60ca72-d773-439c-b39a-4b14c54f795b","name":"Airtable1","credentials":{"airtableTokenApi":{"id":"UT32NHUYnp4pn1H3","name":"Airtable Personal Access Token account"}}},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"526cb30c-0f90-4f66-8f98-b64ceb2e52f2","leftValue":"={{ $json.orderStatus }}","rightValue":"processing","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[520,-520],"id":"70e4db65-f827-4e4f-8673-b405b7986d6e","name":"If1"},{"parameters":{"assignments":{"assignments":[{"id":"20d37948-763a-4d7b-b725-e65f3802af03","name":"orderID","value":"={{ $json.orderID }}","type":"number"},{"id":"9df108a7-6b13-42ab-a6dd-9ca582ba8b49","name":"employeeName","value":"={{ $json.employeeName }}","type":"string"}]},"options":{}},"type":"n8n-nodes-base.set","typeVersion":3.4,"position":[800,-600],"id":"a3d3dc53-32f1-4f44-bf95-50bc5450d601","name":"Edit Fields1"},{"parameters":{"jsCode":"let items = $input.all();\nlet totalBooked = items.length;\nlet bookedSum = 0;\n\nfor (let i=0; i < items.length; i++) {\n  bookedSum = bookedSum + items[i].json.orderPrice;\n}\n\nreturn [{ json: {totalBooked, bookedSum} }];"},"type":"n8n-nodes-base.code","typeVersion":2,"position":[760,-420],"id":"d24ea5e9-c9e6-4d06-b6ee-8db1abd42bc0","name":"Code1"},{"parameters":{"authentication":"webhook","content":"=This week we've {{$json[\"totalBooked\"]}} booked orders with a total value of {{$json[\"bookedSum\"]}}. My Unique ID: {{ $('HTTP Request1').params[\"headerParameters\"][\"parameters\"][0][\"value\"] }}","options":{}},"type":"n8n-nodes-base.discord","typeVersion":2,"position":[1000,-420],"id":"ed380465-c655-4c38-8eb3-2008b9e7869f","name":"Discord1","webhookId":"eff0b651-f0be-4cae-8f18-7d831385be3c","credentials":{"discordWebhookApi":{"id":"lOieo0mIb6h1Wi9R","name":"Discord Webhook account"}}},{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[80,-520],"id":"ffa1a8ce-1a1e-48c4-8a0d-6af28c0447a5","name":"When clicking ‘Execute workflow’"}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[{"node":"Code1","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"Code1":{"main":[[{"node":"Discord1","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[80,-520]}],"connections":{"HTTP Request1":{"main":[[{"node":"If1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Edit Fields1","type":"main","index":0}],[{"node":"Code1","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Airtable1","type":"main","index":0}]]},"Code1":{"main":[[{"node":"Discord1","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-5/chapter-5.6.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-5/chapter-5.6.json"},{"name":"get-most-recent-file","workflow":{"meta":{"instanceId":"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"},"nodes":[{"parameters":{"operation":"download","fileId":{"__rl":true,"value":"={{ $json.id }}","mode":"id"},"options":{}},"id":"45b53bcd-7dcf-4266-8b6e-bfc12008f9e2","name":"Google Drive1","type":"n8n-nodes-base.googleDrive","typeVersion":3,"position":[1500,300]},{"parameters":{},"id":"ba223e7c-4fed-41dd-8c80-2e8fd742629f","name":"When clicking ‘Execute workflow’","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[620,300]},{"parameters":{"resource":"fileFolder","searchMethod":"query","returnAll":true,"filter":{"whatToSearch":"files"},"options":{"fields":["*"]}},"id":"42799909-16f3-4f0a-9ad9-4dd0375814a0","name":"Google Drive","type":"n8n-nodes-base.googleDrive","typeVersion":3,"position":[840,300]},{"parameters":{"sortFieldsUi":{"sortField":[{"fieldName":"modifiedTime","order":"descending"}]},"options":{}},"id":"bfb8baa6-1b8c-4540-9ad6-b5d7c3f7521b","name":"Sort","type":"n8n-nodes-base.sort","typeVersion":1,"position":[1060,300]},{"parameters":{},"id":"2883d39a-f7d9-4244-bf7d-b06878678ccc","name":"Limit","type":"n8n-nodes-base.limit","typeVersion":1,"position":[1280,300]}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Google Drive","type":"main","index":0}]]},"Google Drive":{"main":[[{"node":"Sort","type":"main","index":0}]]},"Sort":{"main":[[{"node":"Limit","type":"main","index":0}]]},"Limit":{"main":[[{"node":"Google Drive1","type":"main","index":0}]]}},"pinData":{}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[620,300]}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Google Drive","type":"main","index":0}]]},"Google Drive":{"main":[[{"node":"Sort","type":"main","index":0}]]},"Sort":{"main":[[{"node":"Limit","type":"main","index":0}]]},"Limit":{"main":[[{"node":"Google Drive1","type":"main","index":0}]]}},"source":"docs/_workflows/integrations/builtin/app-nodes/n8n-nodes-base.googledrive/get-most-recent-file.json","description":"Workflow example from docs/_workflows/integrations/builtin/app-nodes/n8n-nodes-base.googledrive/get-most-recent-file.json"},{"name":"rss-feed-example","workflow":{"nodes":[{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[0,0],"id":"e6e1cfe6-eff1-48bd-b21c-6ba83d4244d9","name":"When clicking ‘Execute workflow’"},{"parameters":{"jsCode":"return [\n\t{\n\t\tjson: {\n\t\t\turl: 'https://medium.com/feed/n8n-io',\n\t\t}\n\t},\n\t{\n\t\tjson: {\n\t\t\turl: 'https://dev.to/feed/n8n',\n\t\t}\n\t}\n];"},"type":"n8n-nodes-base.code","typeVersion":2,"position":[220,0],"id":"137f1128-45b6-4bc4-a9fb-8660baa652a9","name":"Code"},{"parameters":{"options":{}},"type":"n8n-nodes-base.splitInBatches","typeVersion":3,"position":[440,0],"id":"3449a953-49c2-4a36-ba3d-cbc0573f3f6c","name":"Loop Over Items"},{"parameters":{"url":"={{ $json.url }}","options":{}},"type":"n8n-nodes-base.rssFeedRead","typeVersion":1.1,"position":[660,100],"id":"cc2e59d7-0a9b-4640-8052-d8f7f8d8c9fe","name":"RSS Read"}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Code","type":"main","index":0}]]},"Code":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Loop Over Items":{"main":[[],[{"node":"RSS Read","type":"main","index":0}]]},"RSS Read":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]}},"pinData":{},"meta":{"instanceId":"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[0,0]}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Code","type":"main","index":0}]]},"Code":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Loop Over Items":{"main":[[],[{"node":"RSS Read","type":"main","index":0}]]},"RSS Read":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]}},"source":"docs/_workflows/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/rss-feed-example.json","description":"Workflow example from docs/_workflows/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/rss-feed-example.json"},{"name":"very-quick-quickstart-workflow","workflow":{"nodes":[{"parameters":{"operation":"getAllPeople","returnAll":true},"id":"ed1fd9cd-cc4f-4e0e-ba73-9f842db382c3","name":"Customer Datastore","type":"n8n-nodes-base.n8nTrainingCustomerDatastore","position":[540,280],"typeVersion":1},{"parameters":{"content":"**Get fake sample data**","height":300,"width":220},"id":"5ddf393f-62b8-4240-adf8-f9a8f539df4b","name":"Note1","type":"n8n-nodes-base.stickyNote","position":[480,180],"typeVersion":1},{"parameters":{"content":"**Extract data and prepare it for use in the next node**","height":300,"width":220},"id":"6ad194ea-9821-40eb-ae2c-f50cc030300b","name":"Note2","type":"n8n-nodes-base.stickyNote","position":[760,180],"typeVersion":1},{"parameters":{},"id":"5af4b83b-31b6-4c29-aa55-3449f3851e2a","name":"When clicking \"Test Workflow\"","type":"n8n-nodes-base.manualTrigger","position":[300,280],"typeVersion":1},{"parameters":{"assignments":{"assignments":[{"id":"df041e3c-fc09-4ba2-8e6b-37f2c6a02526","name":"customer_id","type":"string","value":"={{ $json.id }}"},{"id":"bf288953-4fef-4f55-a45f-c223714919c0","name":"customer_name","type":"string","value":"={{ $json.name }}"},{"id":"1cff0b21-6740-4697-9d2c-9bcb045af0be","name":"customer_description","type":"string","value":"={{ $json.notes }}"}]},"options":{}},"id":"5dcd5776-5137-4f97-8b76-9f38e1d9ff9e","name":"Edit Fields1","type":"n8n-nodes-base.set","position":[820,280],"typeVersion":3.3},{"parameters":{"customerId":"={{ $json.customer_id }}","message":"=Hi {{ $json.customer_name }}. Your description is: {{  $json.customer_description }}"},"type":"n8n-nodes-base.n8nTrainingCustomerMessenger","typeVersion":1,"position":[1040,280],"id":"a726dcfd-f491-440f-ad64-6ba17472352f","name":"Customer Messenger (n8n training)"}],"connections":{"Customer Datastore":{"main":[[{"node":"Edit Fields1","type":"main","index":0}]]},"When clicking \"Test Workflow\"":{"main":[[{"node":"Customer Datastore","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Customer Messenger (n8n training)","type":"main","index":0}]]}},"pinData":{},"meta":{"instanceId":"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.manualTrigger","version":1,"parameters":{},"position":[300,280]}],"connections":{"Customer Datastore":{"main":[[{"node":"Edit Fields1","type":"main","index":0}]]},"When clicking \"Test Workflow\"":{"main":[[{"node":"Customer Datastore","type":"main","index":0}]]},"Edit Fields1":{"main":[[{"node":"Customer Messenger (n8n training)","type":"main","index":0}]]}},"source":"docs/_workflows/try-it-out/quickstart/very-quick-quickstart-workflow.json","description":"Workflow example from docs/_workflows/try-it-out/quickstart/very-quick-quickstart-workflow.json"}]

node_connections:
  [{"fromNode":"Embeddings OpenAI","toNode":"Pinecone Vector Store","connectionType":"ai_embedding"},{"fromNode":"Default Data Loader","toNode":"Pinecone Vector Store","connectionType":"ai_document"},{"fromNode":"Recursive Character Text Splitter","toNode":"Default Data Loader","connectionType":"ai_textSplitter"},{"fromNode":"Loop Over Items","toNode":"Extract main content","connectionType":"main"},{"fromNode":"Loop Over Items","toNode":"Get pages listed in the sitemap","connectionType":"main"},{"fromNode":"Get sitemap","toNode":"Turn XML sitemap into JSON","connectionType":"main"},{"fromNode":"Turn XML sitemap into JSON","toNode":"Turn the URL array into multiple items","connectionType":"main"},{"fromNode":"Turn the URL array into multiple items","toNode":"Loop Over Items","connectionType":"main"},{"fromNode":"Wait 5 seconds","toNode":"Loop Over Items","connectionType":"main"},{"fromNode":"Get pages listed in the sitemap","toNode":"Wait 5 seconds","connectionType":"main"},{"fromNode":"Chat Trigger","toNode":"Question and Answer Chain","connectionType":"main"},{"fromNode":"OpenAI Model","toNode":"Question and Answer Chain","connectionType":"ai_languageModel"},{"fromNode":"Vector Store Retriever","toNode":"Question and Answer Chain","connectionType":"ai_retriever"},{"fromNode":"Embeddings OpenAI2","toNode":"Pinecone Vector Store2","connectionType":"ai_embedding"},{"fromNode":"Aggregate","toNode":"Pinecone Vector Store","connectionType":"main"},{"fromNode":"Pinecone Vector Store2","toNode":"Vector Store Retriever","connectionType":"ai_vectorStore"},{"fromNode":"Start the workflow by clicking \"Execute workflow\"","toNode":"Get sitemap","connectionType":"main"},{"fromNode":"Extract main content","toNode":"Aggregate","connectionType":"main"},{"fromNode":"When clicking \"Execute Workflow\"","toNode":"Code","connectionType":"main"},{"fromNode":"Code","toNode":"Join items","connectionType":"main"},{"fromNode":"When clicking \"Execute Workflow\"","toNode":"Mock Slack","connectionType":"main"},{"fromNode":"Mock Slack","toNode":"Mock Notion","connectionType":"main"},{"fromNode":"Mock Notion","toNode":"Code","connectionType":"main"},{"fromNode":"When clicking \"Execute Workflow\"","toNode":"Mock data","connectionType":"main"},{"fromNode":"Mock data","toNode":"Code","connectionType":"main"},{"fromNode":"When clicking \"Execute Workflow\"","toNode":"Mock Ideas","connectionType":"main"},{"fromNode":"Mock Ideas","toNode":"Summarize","connectionType":"main"},{"fromNode":"When clicking ‘Execute workflow’","toNode":"Hacker News","connectionType":"main"},{"fromNode":"When clicking ‘Execute workflow’","toNode":"HTTP Request1","connectionType":"main"},{"fromNode":"HTTP Request1","toNode":"Airtable1","connectionType":"main"},{"fromNode":"HTTP Request1","toNode":"If1","connectionType":"main"},{"fromNode":"If1","toNode":"Airtable1","connectionType":"main"},{"fromNode":"If1","toNode":"Edit Fields1","connectionType":"main"},{"fromNode":"Edit Fields1","toNode":"Airtable1","connectionType":"main"},{"fromNode":"If1","toNode":"Code1","connectionType":"main"},{"fromNode":"Code1","toNode":"Discord1","connectionType":"main"},{"fromNode":"When clicking ‘Execute workflow’","toNode":"Google Drive","connectionType":"main"},{"fromNode":"Google Drive","toNode":"Sort","connectionType":"main"},{"fromNode":"Sort","toNode":"Limit","connectionType":"main"},{"fromNode":"Limit","toNode":"Google Drive1","connectionType":"main"},{"fromNode":"When clicking ‘Execute workflow’","toNode":"Code","connectionType":"main"},{"fromNode":"Code","toNode":"Loop Over Items","connectionType":"main"},{"fromNode":"Loop Over Items","toNode":"RSS Read","connectionType":"main"},{"fromNode":"RSS Read","toNode":"Loop Over Items","connectionType":"main"},{"fromNode":"Customer Datastore","toNode":"Edit Fields1","connectionType":"main"},{"fromNode":"When clicking \"Test Workflow\"","toNode":"Customer Datastore","connectionType":"main"},{"fromNode":"Edit Fields1","toNode":"Customer Messenger (n8n training)","connectionType":"main"}]

example_workflow:
  {"name":"Manual Trigger Example Workflow","nodes":[{"parameters":{"notice":null,"pollTimes":{"item":[{"mode":"everyMinute"}]}},"id":"j19xba8ho211s0djju4hdn","name":"Manual Trigger","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"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":""}]


node_type: n8n-nodes-base.Mailjet
name: Mailjet
display_name: Mailjet
description: Consume Mailjet API
category: output
icon: file:mailjet.svg
code_hash: 9a100847b669fd304f2adac69dade7b637bd6b0910312a076e1061b42b66f35c
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Mailjet
documentation_title: Mailjet node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"mailjet","description":"Templates for mailjet"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"email","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:53
updated_at: 2025-06-12 08:58:53
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 node documentation
  description: Learn how to use the Mailjet node in n8n. Follow technical documentation to integrate Mailjet node into your workflows.
  contentType: [integration, reference]
  ---

  # Mailjet node

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

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

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

  ## Operations

  * Email
      * Send an email
      * Send an email template
  * SMS
      * Send an SMS

  ## Templates and examples

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

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"email","options":[{"name":"Email","value":"email"},{"name":"SMS","value":"sms"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EmailDescription_1.emailOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EmailDescription_1.emailFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SmsDescription_1.smsOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SmsDescription_1.smsFields"}]


node_type: n8n-nodes-base.Mailgun
name: Mailgun
display_name: Mailgun
description: Sends an email via Mailgun
category: output
icon: file:mailgun.svg
code_hash: c3138d05def2613a2fc1ee670a81307bc48fc7a70ed95b0077f03a6ebd69f044
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Mailgun
documentation_title: Mailgun node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"mailgun","description":"Templates for mailgun"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:53
updated_at: 2025-06-12 08:58:53
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

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MailgunApi = void 0;
  class MailgunApi {
      constructor() {
          this.name = 'mailgunApi';
          this.displayName = 'Mailgun API';
          this.documentationUrl = 'mailgun';
          this.properties = [
              {
                  displayName: 'API Domain',
                  name: 'apiDomain',
                  type: 'options',
                  options: [
                      {
                          name: 'api.eu.mailgun.net',
                          value: 'api.eu.mailgun.net',
                      },
                      {
                          name: 'api.mailgun.net',
                          value: 'api.mailgun.net',
                      },
                  ],
                  default: 'api.mailgun.net',
                  description: 'The configured mailgun API domain',
              },
              {
                  displayName: 'Email Domain',
                  name: 'emailDomain',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  auth: {
                      username: 'api',
                      password: '={{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '=https://{{$credentials.apiDomain}}/v3',
                  url: '/domains',
              },
          };
      }
  }
  exports.MailgunApi = MailgunApi;
  //# sourceMappingURL=MailgunApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MailgunApi = void 0;
  class MailgunApi {
      constructor() {
          this.name = 'mailgunApi';
          this.displayName = 'Mailgun API';
          this.documentationUrl = 'mailgun';
          this.properties = [
              {
                  displayName: 'API Domain',
                  name: 'apiDomain',
                  type: 'options',
                  options: [
                      {
                          name: 'api.eu.mailgun.net',
                          value: 'api.eu.mailgun.net',
                      },
                      {
                          name: 'api.mailgun.net',
                          value: 'api.mailgun.net',
                      },
                  ],
                  default: 'api.mailgun.net',
                  description: 'The configured mailgun API domain',
              },
              {
                  displayName: 'Email Domain',
                  name: 'emailDomain',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  auth: {
                      username: 'api',
                      password: '={{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '=https://{{$credentials.apiDomain}}/v3',
                  url: '/domains',
              },
          };
      }
  }
  exports.MailgunApi = MailgunApi;
  //# sourceMappingURL=MailgunApi.credentials.js.map

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

  # Mailgun node

  Use the Mailgun node to automate work in Mailgun, and integrate Mailgun with other applications. n8n has built-in support for sending emails with Mailgun. 

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

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

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

  ## Operations

  - Send an email

  ## Templates and examples

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

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

example_workflow:
  {"name":"Mailgun Example Workflow","nodes":[{"parameters":{"fromEmail":"user@example.com","toEmail":"user@example.com","ccEmail":"user@example.com","bccEmail":"user@example.com","subject":"example-value","text":"example-value","html":"example-value","attachments":"example-value"},"id":"7npfd708hgff9u7pk8dnbh","name":"Mailgun","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"fromEmail":"user@example.com","toEmail":"user@example.com","ccEmail":"user@example.com","bccEmail":"user@example.com","subject":"example-value","text":"example-value","html":"example-value","attachments":"example-value"}

properties_schema:
  [{"displayName":"From Email","name":"fromEmail","type":"string","default":"","required":true,"description":"Email address of the sender optional with name","placeholder":"Admin <admin@example.com>"},{"displayName":"To Email","name":"toEmail","type":"string","default":"","required":true,"description":"Email address of the recipient. Multiple ones can be separated by comma.","placeholder":"info@example.com"},{"displayName":"Cc Email","name":"ccEmail","type":"string","default":"","description":"Cc Email address of the recipient. Multiple ones can be separated by comma."},{"displayName":"Bcc Email","name":"bccEmail","type":"string","default":"","description":"Bcc Email address of the recipient. Multiple ones can be separated by comma."},{"displayName":"Subject","name":"subject","type":"string","default":"","description":"Subject line of the email","placeholder":"My subject line"},{"displayName":"Text","name":"text","type":"string","default":"","description":"Plain text message of email"},{"displayName":"HTML","name":"html","type":"string","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."}]


node_type: n8n-nodes-base.Marketstack
name: Marketstack
display_name: Marketstack
description: Consume Marketstack API
category: transform
icon: file:marketstack.svg
code_hash: 098ff7375610f64c4f10cdaa78dbfa45ab7c388f1349b0dec97e88a16ec18538
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Marketstack
documentation_title: marketstack node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"marketstack","description":"Templates for marketstack"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"endOfDayData","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:53
updated_at: 2025-06-12 08:58:53
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

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MarketstackApi = void 0;
  class MarketstackApi {
      constructor() {
          this.name = 'marketstackApi';
          this.displayName = 'Marketstack API';
          this.documentationUrl = 'marketstack';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Use HTTPS',
                  name: 'useHttps',
                  type: 'boolean',
                  default: false,
                  description: 'Whether to use HTTPS (paid plans only)',
              },
          ];
      }
  }
  exports.MarketstackApi = MarketstackApi;
  //# sourceMappingURL=MarketstackApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MarketstackApi = void 0;
  class MarketstackApi {
      constructor() {
          this.name = 'marketstackApi';
          this.displayName = 'Marketstack API';
          this.documentationUrl = 'marketstack';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Use HTTPS',
                  name: 'useHttps',
                  type: 'boolean',
                  default: false,
                  description: 'Whether to use HTTPS (paid plans only)',
              },
          ];
      }
  }
  exports.MarketstackApi = MarketstackApi;
  //# sourceMappingURL=MarketstackApi.credentials.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: marketstack node documentation
  description: Learn how to use the marketstack node in n8n. Follow technical documentation to integrate marketstack node into your workflows.
  contentType: [integration, reference]
  ---
  <!-- marketstack is not a typo. The brand name is all lowercase, so we match it -->
  # marketstack node

  Use the marketstack node to automate work in marketstack, and integrate marketstack with other applications. n8n has built-in support for a wide range of marketstack features, including getting exchanges, end-of-day data, and tickers. 

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

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

  ## Operations

  * End-of-Day Data
      * Get All
  * Exchange
      * Get
  * Ticker
      * Get

  ## Templates and examples

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"endOfDayData","required":true,"description":"Stock market closing data","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"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.endOfDayDataOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.endOfDayDataFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.exchangeOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.exchangeFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.tickerOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.tickerFields"}]


node_type: n8n-nodes-base.Matrix
name: Matrix
display_name: Matrix
description: Consume Matrix API
category: output
icon: file:matrix.png
code_hash: 91e527aaf38b57561fef448ed86f0079de7a086d1320bda1df4c98a5c3c6a43c
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Matrix
documentation_title: Matrix node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"matrix","description":"Templates for matrix"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"account","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:53
updated_at: 2025-06-12 08:58:53
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

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MatrixApi = void 0;
  class MatrixApi {
      constructor() {
          this.name = 'matrixApi';
          this.displayName = 'Matrix API';
          this.documentationUrl = 'matrix';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Homeserver URL',
                  name: 'homeserverUrl',
                  type: 'string',
                  default: 'https://matrix-client.matrix.org',
              },
          ];
      }
  }
  exports.MatrixApi = MatrixApi;
  //# sourceMappingURL=MatrixApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MatrixApi = void 0;
  class MatrixApi {
      constructor() {
          this.name = 'matrixApi';
          this.displayName = 'Matrix API';
          this.documentationUrl = 'matrix';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Homeserver URL',
                  name: 'homeserverUrl',
                  type: 'string',
                  default: 'https://matrix-client.matrix.org',
              },
          ];
      }
  }
  exports.MatrixApi = MatrixApi;
  //# sourceMappingURL=MatrixApi.credentials.js.map

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

  # Matrix node

  Use the Matrix node to automate work in Matrix, and integrate Matrix with other applications. n8n has built-in support for a wide range of Matrix features, including getting current user's account information, sending media and messages to a room, and getting room members and messages.

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

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

  ## Operations

  * Account
      * Get current user's account information
  * Event
      * Get single event by ID
  * Media
      * Send media to a chat room
  * Message
      * Send a message to a room
      * Gets all messages from a room
  * Room
      * New chat room with defined settings
      * Invite a user to a room
      * Join a new room
      * Kick a user from a room
      * Leave a room
  * Room Member
      * Get all members

  ## Templates and examples

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"message","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"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AccountDescription_1.accountOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EventDescription_1.eventOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EventDescription_1.eventFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...MediaDescription_1.mediaOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...MediaDescription_1.mediaFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...MessageDescription_1.messageOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...MessageDescription_1.messageFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...RoomDescription_1.roomOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...RoomDescription_1.roomFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...RoomMemberDescription_1.roomMemberOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...RoomMemberDescription_1.roomMemberFields"}]


node_type: n8n-nodes-base.Mandrill
name: Mandrill
display_name: Mandrill
description: Consume Mandrill API
category: output
icon: file:mandrill.svg
code_hash: 657483f4909d3e32f7e699bcb912c62b28ebb22b51a309fd9b7b73c498f6680b
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Mandrill
documentation_title: Mandrill node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"mandrill","description":"Templates for mandrill"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:53
updated_at: 2025-06-12 08:58:53
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

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

  // --- Next Credential File ---

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

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

  # Mandrill node

  Use the Mandrill node to automate work in Mandrill, and integrate Mandrill with other applications. n8n supports sending messages based on templates or HTML with Mandrill.

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

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

  ## Operations

  * Message
      * Send message based on template.
      * Send message based on HTML.

  ## Templates and examples

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

example_workflow:
  {"name":"Mandrill Example Workflow","nodes":[{"parameters":{"resource":"message","operation":"sendTemplate","template":"","fromEmail":"user@example.com","toEmail":"user@example.com","jsonParameters":false,"options":{},"mergeVarsJson":null,"mergeVarsUi":{},"metadataUi":{},"metadataJson":null,"attachmentsJson":null,"attachmentsUi":{},"headersJson":null,"headersUi":{}},"id":"k2svtsvyeyojxw35fphy8","name":"Mandrill","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"resource":"message","operation":"sendTemplate","template":"","fromEmail":"user@example.com","toEmail":"user@example.com","jsonParameters":false,"options":{},"mergeVarsJson":null,"mergeVarsUi":{},"metadataUi":{},"metadataJson":null,"attachmentsJson":null,"attachmentsUi":{},"headersJson":null,"headersUi":{}}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"message","description":"Send a message","options":[{"name":"Message","value":"message","description":"Send a message"}]},{"displayName":"Operation","name":"operation","type":"options","default":"sendTemplate","description":"Send message based on template","options":[{"name":"Send Template","value":"sendTemplate","description":"Send message based on template"},{"name":"Send HTML","value":"sendHtml","description":"Send message based on HTML"}]},{"displayName":"Template Name or ID","name":"template","type":"options","default":"","required":true,"description":"The template you want to send. Choose from the list, or specify an ID using an <a href="},{"displayName":"From Email","name":"fromEmail","type":"string","default":"","required":true,"description":"Email address of the sender optional with name","placeholder":"Admin <example@yourdomain.com>"},{"displayName":"To Email","name":"toEmail","type":"string","default":"","required":true,"description":"Email address of the recipient. Multiple ones can be separated by comma.","placeholder":"info@example.com"},{"displayName":"JSON Parameters","name":"jsonParameters","type":"boolean","default":false},{"displayName":"Options","name":"options","type":"collection","default":"{","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 ","placeholder":"Add Option"},{"displayName":"Merge Vars","name":"mergeVarsJson","type":"json","default":"","description":"Global merge variables","placeholder":"[\n\t{\n\t\t{ "},{"displayName":"Merge Vars","name":"mergeVarsUi","type":"fixedCollection","default":"{","description":"Per-recipient merge variables","placeholder":"Add Merge Vars"},{"displayName":"Metadata","name":"metadataUi","type":"fixedCollection","default":"{","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.","placeholder":"Add Metadata"},{"displayName":"Metadata","name":"metadataJson","type":"json","default":"","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.","placeholder":"{\n\t"},{"displayName":"Attachments","name":"attachmentsJson","type":"json","default":"","description":"An array of supported attachments to add to the message","placeholder":"[\n\t{\n\t\t"},{"displayName":"Attachments","name":"attachmentsUi","type":"fixedCollection","default":"","description":"The MIME type of the attachment","placeholder":"Add Attachments"},{"displayName":"Headers","name":"headersJson","type":"json","default":"","description":"Optional extra headers to add to the message (most headers are allowed)","placeholder":"{\n\t"},{"displayName":"Headers","name":"headersUi","type":"fixedCollection","default":"{","description":"Optional extra headers to add to the message (most headers are allowed)","placeholder":"Add Headers"}]


node_type: n8n-nodes-base.Markdown
name: Markdown
display_name: Markdown
description: Convert data between Markdown and HTML
category: output
icon: file:markdown.svg
code_hash: 32b117c3ea879ef7772b83158e47c9db429370a9fd5b3a30dcb41fba78d4fd06
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.Markdown
documentation_title: Markdown
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"markdown","description":"Templates for markdown"}]
related_resources: []
required_scopes: []
parameter_schemas: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:53
updated_at: 2025-06-12 08:58:53
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}.

troubleshooting_info:
  [{"issue":"Node parameters","solution":"* **HTML** or **Markdown**: Enter the data you want to convert. The field name changes based on which **Mode** you select.\n* **Destination Key**: Enter the field you want to put the output in. Specify nested fields using dots, for example `level1.level2.newKey`."},{"issue":"Node options","solution":"The node's **Options** depend on the **Mode** selected."},{"issue":"Markdown to HTML options","solution":"| Option | Description | Default |\n| ------ | ----------- | ------- |\n| **Add Blank To Links** | Whether to open links a new window (enabled) or not (disabled). | Disabled |\n| **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 |\n| **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 |\n| **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 |\n| **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 |\n| **Emoji Support** | Whether to support emojis (enabled) or not (disabled). | Disabled. |\n| **Encode Emails** | Whether to transform ASCII character emails into their equivalent decimal entities (enabled) or not (disabled). | Enabled | \n| **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 |\n| **GitHub Code Blocks** | Whether to enable GitHub Flavored Markdown code blocks (enabled) or not (disabled). | Enabled |\n| **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 |\n| **GitHub Mention Link** | Change the link used with **GitHub Mentions**.  | Disabled |\n| **GitHub Mentions** | Whether to support tagging GitHub users with `@` (enabled) or not (disabled). When enabled, n8n replaces `@name` with `https://github.com/name`. | Disabled |\n| **GitHub Task Lists** | Whether to support GitHub Flavored Markdown task lists (enabled) or not (disabled). | Disabled |\n| **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 |\n| **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 |\n| **Middle Word Asterisks** | Whether n8n should treat asterisks in words as Markdown (disabled) or render them as literal asterisks (enabled). | Disabled |\n| **Middle Word Underscores** | Whether n8n should treat underscores in words as Markdown (disabled) or render them as literal underscores (enabled). | Disabled |\n| **No Header ID** | Disable automatic generation of header IDs (enabled). | Disabled |\n| **Parse Image Dimensions** | Support setting maximum image dimensions in Markdown syntax (enabled). | Disabled |\n| **Prefix Header ID** | Define a prefix to add to header IDs. | None |\n| **Raw Header ID** | Whether to remove spaces, `'`, and `\"` from header IDs, including prefixes, replacing them with `-` (enabled) or not (disabled). | Disabled |\n| **Raw Prefix Header ID** | Whether to prevent n8n from modifying header prefixes (enabled) or not (disabled) | Disabled |\n| **Simple Line Breaks** | Whether to create line breaks without a double space at the end of a line (enabled) or not (disabled). | Disabled |\n| **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 |\n| **Spaces Indented Sublists** | Whether to remove the requirement to indent sublists four spaces (enabled) or not (disabled). | Disabled |\n| **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 |\n| **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 |\n| **Tables Header ID** | Whether to add an ID to table header tags (enabled) or not (disabled). | Disabled |\n| **Tables Support** | Whether to support tables (enabled) or not (disabled). | Disabled |"},{"issue":"HTML to Markdown options","solution":"| Option | Description | Default |\n| ------ | ----------- | ------- |\n| **Bullet Marker** | Specify the character to use for unordered lists. | * |\n| **Code Block Fence** | Specify the characters to use for code blocks. | ``` |\n| **Emphasis Delimiter** | Specify the character `<em>`. | _ |\n| **Global Escape Pattern** | Overrides the default character escape settings. You may want to use Text Replacement Pattern instead. | None |\n| **Ignored Elements** | Ignore given HTML elements, and their children. | None |\n| **Keep Images With Data** | Whether to keep images with data (enabled) or not (disabled). Support files up to 1MB. | Disabled |\n| **Line Start Escape Pattern** | Overrides the default character escape settings. You may want to use Text Replacement Pattern instead. | None |\n| **Max Consecutive New Lines** | Number. Specify the maximum number of consecutive new lines allowed. | 3 |\n| **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 |\n| **Strong Delimiter** | Specify the characters for `<strong>`. | ** |\n| **Style For Code Block** | Specify the styling for code blocks. Options are **Fence** and **Indented**. | Fence |\n| **Text Replacement Pattern** | Define a text replacement pattern using regex. | None |\n| **Treat As Blocks** | Specify HTML elements to treat as blocks (surround with blank lines) | None |"},{"issue":"Parsers","solution":"n8n uses the following parsers:"}]

example_workflow:
  {"name":"Markdown Example Workflow","nodes":[{"parameters":{"mode":"markdownToHtml","html":"example-value","markdown":"example-value","destinationKey":"data","options":{}},"id":"d9lumonk10abmcg18yrft8","name":"Markdown","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"mode":"markdownToHtml","html":"example-value","markdown":"example-value","destinationKey":"data","options":{}}

properties_schema:
  [{"displayName":"Mode","name":"mode","type":"options","default":"htmlToMarkdown","description":"Convert data from Markdown to HTML","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"}]},{"displayName":"HTML","name":"html","type":"string","default":"","required":true,"description":"The HTML to be converted to markdown"},{"displayName":"Markdown","name":"markdown","type":"string","default":"","required":true,"description":"The Markdown to be converted to html"},{"displayName":"Destination Key","name":"destinationKey","type":"string","default":"data","required":true,"description":"The field to put the output in. Specify nested fields using dots, e.g."},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Specify bullet marker, default *","placeholder":"Add Option"},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Whether to open all links in new windows (by adding the attribute target=","placeholder":"Add Option"}]


node_type: n8n-nodes-base.MailerLite
name: MailerLite
display_name: MailerLite
description: Consume Mailer Lite API
category: input
icon: file:mailerLite.png
code_hash: 0af5a52cc8e0d27ceca5f43ceaaa2ad33788a2b44bba34875a96dc54014452fb
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.MailerLite
documentation_title: MailerLite node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"mailerlite","description":"Templates for mailerlite"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"subscriber","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:53
updated_at: 2025-06-12 08:58:53
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

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

  // --- Next Credential File ---

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

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

  # MailerLite node

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

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

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

  ## Operations

  * Subscriber
      * Create a new subscriber
      * Get an subscriber
      * Get all subscribers
      * Update an subscriber

  ## Templates and examples

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"subscriber","options":[{"name":"Subscriber","value":"subscriber"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SubscriberDescription_1.subscriberOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...SubscriberDescription_1.subscriberFields"}]


node_type: n8n-nodes-base.Mattermost
name: Mattermost
display_name: Mattermost
description: Sends data to Mattermost
category: output
icon: file:mattermost.svg
code_hash: 9a4b0669740615e90e6eefc2f30d8de6a43dac3305dd908b29e49c48787130fb
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Mattermost
documentation_title: Mattermost node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"mattermost","description":"Templates for mattermost"}]
related_resources: [{"title":"Mattermost's documentation","url":"https://api.mattermost.com/","type":"api"}]
required_scopes: []
parameter_schemas: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-12 08:58:54
updated_at: 2025-06-12 08:58:54
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

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MattermostApi = void 0;
  class MattermostApi {
      constructor() {
          this.name = 'mattermostApi';
          this.displayName = 'Mattermost API';
          this.documentationUrl = 'mattermost';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Base URL',
                  name: 'baseUrl',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.accessToken}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.baseUrl.replace(/\\/$/, "")}}/api/v4',
                  url: '/users',
                  skipSslCertificateValidation: '={{$credentials?.allowUnauthorizedCerts}}',
              },
          };
      }
  }
  exports.MattermostApi = MattermostApi;
  //# sourceMappingURL=MattermostApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MattermostApi = void 0;
  class MattermostApi {
      constructor() {
          this.name = 'mattermostApi';
          this.displayName = 'Mattermost API';
          this.documentationUrl = 'mattermost';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Base URL',
                  name: 'baseUrl',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.accessToken}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.baseUrl.replace(/\\/$/, "")}}/api/v4',
                  url: '/users',
                  skipSslCertificateValidation: '={{$credentials?.allowUnauthorizedCerts}}',
              },
          };
      }
  }
  exports.MattermostApi = MattermostApi;
  //# sourceMappingURL=MattermostApi.credentials.js.map

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

  # Mattermost node

  Use the Mattermost node to automate work in Mattermost, and integrate Mattermost with other applications. n8n has built-in support for a wide range of Mattermost features, including creating, deleting, and getting channels, and users, as well as posting messages, and adding reactions.

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

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

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

  ## Operations

  * Channel
      * Add a user to a channel
      * Create a new channel
      * Soft delete a channel
      * Get a page of members for a channel
      * Restores a soft deleted channel
      * Search for a channel
      * Get statistics for a channel
  * Message
      * Soft delete a post, by marking the post as deleted in the database
      * Post a message into a channel
      * Post an ephemeral message into a channel
  * Reaction
      * Add a reaction to a post.
      * Remove a reaction from a post
      * Get all the reactions to one or more posts
  * User
      * Create a new user
      * Deactivates the user and revokes all its sessions by archiving its user object.
      * Retrieve all users
      * Get a user by email
      * Get a user by ID
      * Invite user to team


  ## Templates and examples

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

  ## Related resources

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

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

  ## Channel ID field error

  If you're not the System Administrator, you might get an error: **there was a problem loading the parameter options from server: "Mattermost error response: You do not have the appropriate permissions.** next to the **Channel ID** field.

  Ask your system administrator to grant you the `post:channel` permission.

  ## Find the channel ID

  To find the channel ID in Mattermost:

  1. Select the channel from the left sidebar.
  2. Select the channel name at the top.
  3. Select **View Info**.

troubleshooting_info:
  [{"issue":"Channel ID field error","solution":"If you're not the System Administrator, you might get an error: **there was a problem loading the parameter options from server: \"Mattermost error response: You do not have the appropriate permissions.** next to the **Channel ID** field."},{"issue":"Find the channel ID","solution":"To find the channel ID in Mattermost:"}]

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


node_type: n8n-nodes-base.Merge
name: Merge
display_name: Merge
description: Merges data of multiple streams once data from both is available
category: transform
icon: fa:code-branch
code_hash: 7ea8c21ecbdf79a2e935cdf1aa4e4c4c9f9c1139d9ffaaea0a767c41878b1ce8
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.Merge
documentation_title: Merge
operations: []
api_methods: []
templates: [{"name":"merge","description":"Templates for merge"}]
related_resources: []
required_scopes: []
parameter_schemas: []
version_info: {"breakingChanges":[],"currentVersion":"0.194.0"}
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-12 08:58:54
updated_at: 2025-06-12 08:58:54
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 -->

documentation_examples:
  [{"type":"text","language":"sql","code":"SELECT * FROM input1 LEFT JOIN input2 ON input1.name = input2.id","title":"Clash Handling","description":"Example:"},{"type":"javascript","language":"js","code":"return [\n  {\n    json: {\n      name: 'Stefan',\n      language: 'de',\n    }\n  },\n  {\n    json: {\n      name: 'Jim',\n      language: 'en',\n    }\n  },\n  {\n    json: {\n      name: 'Hans',\n      language: 'de',\n    }\n  }\n];","title":"Set up sample data using the Code nodes","description":"2. Paste the following JavaScript code snippet in the **JavaScript Code** field:"},{"type":"javascript","language":"js","code":"return [\n\t  {\n    json: {\n      greeting: 'Hello',\n      language: 'en',\n    }\n  },\n  {\n    json: {\n      greeting: 'Hallo',\n      language: 'de',\n    }\n  }\n];","title":"4. Paste the following JavaScript code snippet in the **JavaScript Code** field","description":"4. Paste the following JavaScript code snippet in the **JavaScript Code** field:"}]

troubleshooting_info:
  [{"issue":"Node parameters","solution":"You can specify how the Merge node should combine data from different data streams by choosing a **Mode**:"},{"issue":"Append","solution":"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. "},{"issue":"Combine","solution":"Combine data from two inputs. Select an option in **Combine By** to determine how you want to merge the input data."},{"issue":"Matching Fields","solution":"Compare items by field values. Enter the fields you want to compare in **Fields to Match**. "},{"issue":"Position","solution":"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."},{"issue":"All Possible Combinations","solution":"Output all possible item combinations, while merging fields with the same name."},{"issue":"Combine mode options","solution":"When merging data by **Mode > Combine**, you can set these **Options**:"},{"issue":"Clash Handling","solution":"--8<-- \"_snippets/integrations/builtin/core-nodes/merge/field-value-clash.md\""},{"issue":"SQL Query","solution":"Write a custom SQL Query to merge the data. "},{"issue":"Choose Branch","solution":"Choose which input to keep. This option always waits until the data from both inputs is available. You can choose to **Output**:"},{"issue":"Merging data streams with uneven numbers of items","solution":"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."},{"issue":"Branch execution with If and Merge nodes","solution":"--8<-- \"_snippets/integrations/builtin/core-nodes/merge/if-merge-branch-execution.md\""},{"issue":"Try it out: A step by step example","solution":"Create a workflow with some example input data to try out the Merge node."},{"issue":"Set up sample data using the Code nodes","solution":"1. Add a Code node to the canvas and connect it to the Start node.\n2. Paste the following JavaScript code snippet in the **JavaScript Code** field:\n```js\nreturn [\n  {\n    json: {\n      name: 'Stefan',\n      language: 'de',\n    }\n  },\n  {\n    json: {\n      name: 'Jim',\n      language: 'en',\n    }\n  },\n  {\n    json: {\n      name: 'Hans',\n      language: 'de',\n    }\n  }\n];\n```\n3. Add a second Code node, and connect it to the Start node.\n4. Paste the following JavaScript code snippet in the **JavaScript Code** field:\n```js\nreturn [\n\t  {\n    json: {\n      greeting: 'Hello',\n      language: 'en',\n    }\n  },\n  {\n    json: {\n      greeting: 'Hallo',\n      language: 'de',\n    }\n  }\n];\n```"},{"issue":"Try out different merge modes","solution":"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."},{"issue":"Append","solution":"Select **Mode** > **Append**, then select **Execute step**."},{"issue":"Combine by Matching Fields","solution":"You can merge these two data inputs so that each person gets the correct greeting for their language."},{"issue":"Combine by Position","solution":"Select **Mode** > **Combine**, **Combine by** > **Position**, then select **Execute step**."},{"issue":"Keep unpaired items","solution":"If you want to keep all items, select **Add Option** > **Include Any Unpaired Items**, then turn on **Include Any Unpaired Items**."},{"issue":"Combine by All Possible Combinations","solution":"Select **Mode** > **Combine**, **Combine by** > **All Possible Combinations**, then select **Execute step**."}]

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


node_type: n8n-nodes-base.Medium
name: Medium
display_name: Medium
description: Consume Medium API
category: output
icon: file:medium.png
code_hash: bdfe9b89bafe735fe0197d624433da4cc151dac20cf5436856ca2885380539f9
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Medium
documentation_title: Medium node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"medium","description":"Templates for medium"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:54
updated_at: 2025-06-12 08:58:54
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

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

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MediumOAuth2Api = void 0;
  class MediumOAuth2Api {
      constructor() {
          this.name = 'mediumOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Medium OAuth2 API';
          this.documentationUrl = 'medium';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://medium.com/m/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://medium.com/v1/tokens',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'basicProfile,publishPost,listPublications',
              },
              {
                  displayName: 'Client ID',
                  name: 'clientId',
                  type: 'string',
                  default: '',
                  required: true,
              },
              {
                  displayName: 'Client Secret',
                  name: 'clientSecret',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  required: true,
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.MediumOAuth2Api = MediumOAuth2Api;
  //# sourceMappingURL=MediumOAuth2Api.credentials.js.map

  // --- Next Credential File ---

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

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MediumOAuth2Api = void 0;
  class MediumOAuth2Api {
      constructor() {
          this.name = 'mediumOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Medium OAuth2 API';
          this.documentationUrl = 'medium';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://medium.com/m/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://medium.com/v1/tokens',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'basicProfile,publishPost,listPublications',
              },
              {
                  displayName: 'Client ID',
                  name: 'clientId',
                  type: 'string',
                  default: '',
                  required: true,
              },
              {
                  displayName: 'Client Secret',
                  name: 'clientSecret',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  required: true,
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.MediumOAuth2Api = MediumOAuth2Api;
  //# sourceMappingURL=MediumOAuth2Api.credentials.js.map

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

  # Medium node

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

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

  /// warning | Medium API no longer supported
  Medium has stopped supporting the Medium API. The Medium node still appears within n8n, but you won't be able to configure new API keys to authenticate with.

  Refer to [Medium credentials](/integrations/builtin/credentials/medium.md) for guidance on setting up existing API keys.
  ///

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


  ## Operations

  * Post
      * Create a post
  * Publication
      * Get all publications

  ## Templates and examples

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

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

example_workflow:
  {"name":"Medium Example Workflow","nodes":[{"parameters":{"authentication":"accessToken","resource":"post","operation":"getAll","publication":false,"publicationId":"","title":"example-value","contentFormat":"html","content":"example-value","additionalFields":{},"returnAll":false,"limit":100},"id":"lscahlmvapooo3day5phym","name":"Medium","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"authentication":"accessToken","resource":"post","operation":"getAll","publication":false,"publicationId":"","title":"example-value","contentFormat":"html","content":"example-value","additionalFields":{},"returnAll":false,"limit":100}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"accessToken","options":[{"name":"Access Token","value":"accessToken"},{"name":"OAuth2","value":"oAuth2"}]},{"displayName":"Resource","name":"resource","type":"options","default":"post","options":[{"name":"Post","value":"post"},{"name":"Publication","value":"publication"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a post","options":[{"name":"Create","value":"create","description":"Create a post"}]},{"displayName":"Publication","name":"publication","type":"boolean","default":false,"description":"Whether you are posting for a publication"},{"displayName":"Publication Name or ID","name":"publicationId","type":"options","default":"","description":"Publication IDs. Choose from the list, or specify an ID using an <a href="},{"displayName":"Title","name":"title","type":"string","default":"","required":true,"description":"Title of the post. Max Length : 100 characters.","placeholder":"My Open Source Contribution"},{"displayName":"Content Format","name":"contentFormat","type":"options","default":"","required":true,"description":"The format of the content to be posted","options":[{"name":"HTML","value":"html"},{"name":"Markdown","value":"markdown"}]},{"displayName":"Content","name":"content","type":"string","default":"","required":true,"description":"The body of the post, in a valid semantic HTML fragment, or Markdown","placeholder":"My open source contribution"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The original home of this content, if it was originally published elsewhere","placeholder":"Add Field"},{"displayName":"Operation","name":"operation","type":"options","default":"publication","description":"Get many publications","options":[{"name":"Get Many","value":"getAll","description":"Get many publications"}]},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":100,"description":"Max number of results to return"}]


