# nodes

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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Mailcheck 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:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"7a48a1d7-2874-4a82-99de-2f0a43d28129","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"6b04d49265530fe91de6ee4a42d84ae973f8d8a8b3720749661885e6ac009d84"}}


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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"30d2759d-1d38-4ec8-b5f5-15fbccb7451a","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"e5c58073952d4ea3236fed1ff55708976c6b3c0edb78520d52aeab06c0cc0951"}}


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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Mailgun 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:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"264fc349-2dab-47dc-b1e8-15016233b978","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"1fae54f35f3f09b57cc85d9b036d492c728c2a283b5cd54fb5c12140f34e356c"}}


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

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

  # MailerLite Trigger node

  [MailerLite](https://www.mailerlite.com/){:target=_blank .external-link} is an email marketing solution that provides you with a user-friendly content editor, simplified subscriber management, and campaign reports with the most important statistics.

  On this page, you'll find a list of events the MailerLite Trigger node can respond to and links to more resources.

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

  ///  note  | Examples and templates
  For usage examples and templates to help you get started, refer to n8n's [MailerLite Trigger integrations](https://n8n.io/integrations/mailerlite-trigger/){:target=_blank .external-link} page.
  ///

  ## Events

  - Campaign Sent
  - Subscriber Added to Group
  - Subscriber Automation Completed
  - Subscriber Automation Triggered
  - Subscriber Bounced
  - Subscriber Created
  - Subscriber Complained
  - Subscriber Removed from Group
  - Subscriber Unsubscribe
  - Subscriber Updated

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"d03b1feb-c2ce-4bb4-9a3b-52f78d9a989e","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"d859a61d4e53cb1e33942eada8b957fcc750f98a297a5a8eb302f608ef0285ef"}}


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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: marketstack 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:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"a1d580c0-0fa1-439a-a5b1-700839e660aa","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"8eca94ac3e1f46536688ae8ae39c90983575fba873e16833b3725b05b5aba777"}}


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/trigger-nodes/n8n-nodes-base.mailjettrigger
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:12
updated_at: 2025-06-08 09:18:12
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 Trigger node documentation
  description: Learn how to use the Mailjet Trigger node in n8n. Follow technical documentation to integrate Mailjet Trigger node into your workflows.
  contentType: [integration, reference]
  ---

  # Mailjet Trigger node

  [Mailjet](https://www.mailjet.com/){:target=_blank .external-link} is a cloud-based email sending and tracking system. The platform allows professionals to send both marketing emails and transactional emails. It includes tools for designing emails, sending massive volumes and tracking these messages.

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

  ///  note  | Examples and templates
  For usage examples and templates to help you get started, refer to n8n's [Mailjet Trigger integrations](https://n8n.io/integrations/mailjet-trigger/){:target=_blank .external-link} page.
  ///

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"f9e534fc-e7a5-466f-9a1e-7ac5b1f4b1ba","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"b6307d1cf8822674e8cf3277bfeb7ec7843d8e0280385036ba4852a6c79346fa"}}


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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Mandrill 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:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b38b2337-49ac-4507-ad49-8066a122cd74","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"5ff85251a1c4561cd3e7489026ad65edc7b8391e0512895995b2d30e9536c1d5"}}


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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Matrix 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:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"0be274c7-bc4d-4827-afba-afb779aa1638","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"03a23e277908a95b1fc9ea4b347ca3573f296d086b9c02eb5bbfb231637f23aa"}}


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

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

  # Markdown

  The Markdown node converts between Markdown and HTML formats.

  ## Operations

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

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

  ## Node parameters

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

  ## Node options

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

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

  ### Markdown to HTML options

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

  ### HTML to Markdown options

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

  ## Templates and examples

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

  ## Parsers

  n8n uses the following parsers:

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"6074f4cd-c604-483a-b37e-82874eeaa3c7","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"3ee90ba8074c05e9171bcc4897ddd7b46f11bf5c5f7707ff41ea62b371172b69"}}


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
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 09:18:13
updated_at: 2025-06-08 09:18:13
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mattermost = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const MattermostV1_node_1 = require("./v1/MattermostV1.node");
  class Mattermost extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Mattermost',
              name: 'mattermost',
              icon: 'file:mattermost.svg',
              group: ['output'],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends data to Mattermost',
              defaultVersion: 1,
          };
          const nodeVersions = {
              1: new MattermostV1_node_1.MattermostV1(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Mattermost = Mattermost;
  //# sourceMappingURL=Mattermost.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Mattermost 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**.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"666c6950-c189-4f50-8648-b0312d325a24","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"6fc20851d402d51c5cc76b6bb28f2d2dfcac8091d42d328afd77589a847ba484"}}


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

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

  # Mautic Trigger node

  [Mautic](https://www.mautic.org/){:target=_blank .external-link} is an open-source marketing automation software that helps online businesses automate their repetitive marketing tasks such as lead generation, contact scoring, contact segmentation, and marketing campaigns.

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

  ///  note  | Examples and templates
  For usage examples and templates to help you get started, refer to n8n's [Mautic Trigger integrations](https://n8n.io/integrations/mautic-trigger/){:target=_blank .external-link} page.
  ///

  ## Related resources

  n8n provides an app node for Mautic. You can find the node docs [here](/integrations/builtin/app-nodes/n8n-nodes-base.mautic.md).

  View [example workflows and related content](https://n8n.io/integrations/mautic/){:target=_blank .external-link} on n8n's website.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"7cfd3779-9d4a-4003-8d49-e2a59fa0651a","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"ec3f17ad4751ad59929c5613fd083a6089938d95a43a9ffa313451910a7196ad"}}


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

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Medium 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:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"16c42607-db83-40e1-967c-12635ded543c","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"aa42339682f04ccdfabccc7cfd4927200dd7716a52058c86848f9dd23b70ecc3"}}


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
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 09:18:13
updated_at: 2025-06-08 09:18:13
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Merge = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const MergeV1_node_1 = require("./v1/MergeV1.node");
  const MergeV2_node_1 = require("./v2/MergeV2.node");
  class Merge extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Merge',
              name: 'merge',
              icon: 'fa:code-branch',
              group: ['transform'],
              subtitle: '={{$parameter["mode"]}}',
              description: 'Merges data of multiple streams once data from both is available',
              defaultVersion: 2.1,
          };
          const nodeVersions = {
              1: new MergeV1_node_1.MergeV1(baseDescription),
              2: new MergeV2_node_1.MergeV2(baseDescription),
              2.1: new MergeV2_node_1.MergeV2(baseDescription),
              2.2: new MergeV2_node_1.MergeV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Merge = Merge;
  //# sourceMappingURL=Merge.node.js.map

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

  # Merge

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

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

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

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

  ## Node parameters

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

  ### Append

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

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

  ### Combine

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

  #### Matching Fields

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

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

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

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


  #### Position

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

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


  #### All Possible Combinations

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

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

  #### Combine mode options

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

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

  ##### Clash Handling

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

  ### SQL Query

  Write a custom SQL Query to merge the data. 

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

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

  ### Choose Branch

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

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

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

  ## Templates and examples

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

  ## Merging data streams with uneven numbers of items

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

  ## Branch execution with If and Merge nodes

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


  ## Try it out: A step by step example

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

  ### Set up sample data using the Code nodes

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

  ### Try out different merge modes

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

  The final workflow should look like this:

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

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

  #### Append

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

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

  #### Combine by Matching Fields

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

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

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

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

  #### Combine by Position

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

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

  ##### Keep unpaired items

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

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

  #### Combine by All Possible Combinations 

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

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"61e4a39a-cf26-4a9e-bccb-ba8411640e46","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"aed9570e0026c68ea419aa543f5d59eff041421724bf05027ba76ded1aaf87d6"}}


node_type: n8n-nodes-base.Metabase
name: Metabase
display_name: Metabase
description: Use the Metabase API
category: transform
icon: file:metabase.svg
code_hash: 629de446f4ba15b8957d92fa93685d006e99cb0fee1e36c14a0e40ceeaf99abd
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.metabase
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:13
updated_at: 2025-06-08 09:18:13
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Metabase = void 0;
  const QuestionsDescription_1 = require("./QuestionsDescription");
  const MetricsDescription_1 = require("./MetricsDescription");
  const DatabasesDescription_1 = require("./DatabasesDescription");
  const AlertsDescription_1 = require("./AlertsDescription");
  class Metabase {
      constructor() {
          this.description = {
              displayName: 'Metabase',
              name: 'metabase',
              icon: 'file:metabase.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Use the Metabase API',
              defaults: {
                  name: 'Metabase',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'metabaseApi',
                      required: true,
                  },
              ],
              requestDefaults: {
                  returnFullResponse: true,
                  baseURL: '={{$credentials.url.replace(new RegExp("/$"), "")}}',
                  headers: {},
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Alert',
                              value: 'alerts',
                          },
                          {
                              name: 'Database',
                              value: 'databases',
                          },
                          {
                              name: 'Metric',
                              value: 'metrics',
                          },
                          {
                              name: 'Question',
                              value: 'questions',
                          },
                      ],
                      default: 'questions',
                  },
                  ...QuestionsDescription_1.questionsOperations,
                  ...QuestionsDescription_1.questionsFields,
                  ...MetricsDescription_1.metricsOperations,
                  ...MetricsDescription_1.metricsFields,
                  ...DatabasesDescription_1.databasesOperations,
                  ...DatabasesDescription_1.databasesFields,
                  ...AlertsDescription_1.alertsOperations,
                  ...AlertsDescription_1.alertsFields,
              ],
          };
      }
  }
  exports.Metabase = Metabase;
  //# sourceMappingURL=Metabase.node.js.map

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

  # Metabase node

  Use the Metabase node to automate work in Metabase, and integrate Metabase with other applications. n8n has built-in support for a wide range of Metabase features, including adding, and getting alerts, databases, metrics, and questions. 

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

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

  ## Operations

  * Alert
      * Get
      * Get All
  * Database
      * Add
      * Get All
      * Get Fields
  * Metric
      * Get
      * Get All
  * Question
      * Get
      * Get All
      * Result Data

  ## Templates and examples

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

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"cbb2ae09-10d2-4f02-96a2-a6848e00140b","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"6e370143805c82f40538a37bd0a7aaa12251d210af0371ad9806a7ddf29c412f"}}


node_type: n8n-nodes-base.MessageBird
name: MessageBird
display_name: MessageBird
description: Sends SMS via MessageBird
category: output
icon: file:messagebird.svg
code_hash: faf1b5016a688104f7c30fde0b8b2b93731a2df58937aad8efc85e0be6ece42c
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.messagebird
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:13
updated_at: 2025-06-08 09:18:13
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MessageBird = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class MessageBird {
      constructor() {
          this.description = {
              displayName: 'MessageBird',
              name: 'messageBird',
              icon: 'file:messagebird.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends SMS via MessageBird',
              defaults: {
                  name: 'MessageBird',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'messageBirdApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                          {
                              name: 'Balance',
                              value: 'balance',
                          },
                      ],
                      default: 'sms',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send text messages (SMS)',
                              action: 'Send an SMS',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['balance'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the balance',
                              action: 'Get the current balance',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'From',
                      name: 'originator',
                      type: 'string',
                      default: '',
                      placeholder: '14155238886',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The number from which to send the message',
                  },
                  {
                      displayName: 'To',
                      name: 'recipients',
                      type: 'string',
                      default: '',
                      placeholder: '14155238886/+14155238886',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'All recipients separated by commas',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The message to be send',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      placeholder: 'Add Fields',
                      default: {},
                      options: [
                          {
                              displayName: 'Created Date-Time',
                              name: 'createdDatetime',
                              type: 'dateTime',
                              default: '',
                              description: 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP)',
                          },
                          {
                              displayName: 'Datacoding',
                              name: 'datacoding',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Auto',
                                      value: 'auto',
                                  },
                                  {
                                      name: 'Plain',
                                      value: 'plain',
                                  },
                                  {
                                      name: 'Unicode',
                                      value: 'unicode',
                                  },
                              ],
                              default: '',
                              description: 'Using unicode will limit the maximum number of characters to 70 instead of 160',
                          },
                          {
                              displayName: 'Gateway',
                              name: 'gateway',
                              type: 'number',
                              default: '',
                              description: 'The SMS route that is used to send the message',
                          },
                          {
                              displayName: 'Group IDs',
                              name: 'groupIds',
                              placeholder: '1,2',
                              type: 'string',
                              default: '',
                              description: 'Group IDs separated by commas, If provided recipients can be omitted',
                          },
                          {
                              displayName: 'Message Type',
                              name: 'mclass',
                              type: 'options',
                              placeholder: 'Permissible values from 0-3',
                              options: [
                                  {
                                      name: 'Flash',
                                      value: 1,
                                  },
                                  {
                                      name: 'Normal',
                                      value: 0,
                                  },
                              ],
                              default: 1,
                              description: 'Indicated the message type. 1 is a normal message, 0 is a flash message.',
                          },
                          {
                              displayName: 'Reference',
                              name: 'reference',
                              type: 'string',
                              default: '',
                              description: 'A client reference',
                          },
                          {
                              displayName: 'Report Url',
                              name: 'reportUrl',
                              type: 'string',
                              default: '',
                              description: 'The status report URL to be used on a per-message basis. Reference is required for a status report webhook to be sent.',
                          },
                          {
                              displayName: 'Scheduled Date-Time',
                              name: 'scheduledDatetime',
                              type: 'dateTime',
                              default: '',
                              description: 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP)',
                          },
                          {
                              displayName: 'Type',
                              name: 'type',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Binary',
                                      value: 'binary',
                                  },
                                  {
                                      name: 'Flash',
                                      value: 'flash',
                                  },
                                  {
                                      name: 'SMS',
                                      value: 'sms',
                                  },
                              ],
                              default: '',
                              description: 'The type of message. Values can be: sms, binary, or flash.',
                          },
                          {
                              displayName: 'Type Details',
                              name: 'typeDetails',
                              type: 'string',
                              default: '',
                              description: 'A hash with extra information. Is only used when a binary message is sent.',
                          },
                          {
                              displayName: 'Validity',
                              name: 'validity',
                              type: 'number',
                              default: 1,
                              typeOptions: {
                                  minValue: 1,
                              },
                              description: 'The amount of seconds that the message is valid',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let operation;
          let resource;
          let bodyRequest = {};
          let qs;
          let requestMethod;
          let requestPath;
          for (let i = 0; i < items.length; i++) {
              qs = {};
              try {
                  resource = this.getNodeParameter('resource', i);
                  operation = this.getNodeParameter('operation', i);
                  if (resource === 'sms') {
                      if (operation === 'send') {
                          requestMethod = 'POST';
                          requestPath = '/messages';
                          const originator = this.getNodeParameter('originator', i);
                          const body = this.getNodeParameter('message', i);
                          bodyRequest = {
                              recipients: [],
                              originator,
                              body,
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.groupIds) {
                              bodyRequest.groupIds = additionalFields.groupIds;
                          }
                          if (additionalFields.type) {
                              bodyRequest.type = additionalFields.type;
                          }
                          if (additionalFields.reference) {
                              bodyRequest.reference = additionalFields.reference;
                          }
                          if (additionalFields.reportUrl) {
                              bodyRequest.reportUrl = additionalFields.reportUrl;
                          }
                          if (additionalFields.validity) {
                              bodyRequest.validity = additionalFields.reportUrl;
                          }
                          if (additionalFields.gateway) {
                              bodyRequest.gateway = additionalFields.gateway;
                          }
                          if (additionalFields.typeDetails) {
                              bodyRequest.typeDetails = additionalFields.typeDetails;
                          }
                          if (additionalFields.datacoding) {
                              bodyRequest.datacoding = additionalFields.datacoding;
                          }
                          if (additionalFields.mclass) {
                              bodyRequest.mclass = additionalFields.mclass;
                          }
                          if (additionalFields.scheduledDatetime) {
                              bodyRequest.scheduledDatetime = additionalFields.scheduledDatetime;
                          }
                          if (additionalFields.createdDatetime) {
                              bodyRequest.createdDatetime = additionalFields.createdDatetime;
                          }
                          const receivers = this.getNodeParameter('recipients', i);
                          bodyRequest.recipients = receivers.split(',').map((item) => {
                              return parseInt(item, 10);
                          });
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'balance') {
                      requestMethod = 'GET';
                      requestPath = '/balance';
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  const responseData = await GenericFunctions_1.messageBirdApiRequest.call(this, requestMethod, requestPath, bodyRequest, qs);
                  returnData.push(responseData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.MessageBird = MessageBird;
  //# sourceMappingURL=MessageBird.node.js.map

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

  # MessageBird node

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

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

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

  ## Operations

  * SMS
      * Send text messages (SMS)
  * Balance
      * Get the balance

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"f8c9796d-c56d-48b2-a665-83076621584d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"94b332f78a146a66aab51152ea0ee71772f33e0a0b9599508fbb6f6236335f94"}}


node_type: n8n-nodes-base.Mindee
name: Mindee
display_name: Mindee
description: Consume Mindee API
category: input
icon: file:mindee.svg
code_hash: e1b1546baf295f10ce7fdfc174b3cd8ef000536f32d745f5b0220db885ec1fa2
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.mindee
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 09:18:14
updated_at: 2025-06-08 09:18:14
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mindee = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Mindee {
      constructor() {
          this.description = {
              displayName: 'Mindee',
              name: 'mindee',
              icon: 'file:mindee.svg',
              group: ['input'],
              version: [1, 2, 3],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Mindee API',
              defaults: {
                  name: 'Mindee',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mindeeReceiptApi',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['receipt'],
                          },
                      },
                  },
                  {
                      name: 'mindeeInvoiceApi',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['invoice'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'API Version',
                      name: 'apiVersion',
                      type: 'options',
                      isNodeSetting: true,
                      displayOptions: {
                          show: {
                              '@version': [1],
                          },
                      },
                      options: [
                          {
                              name: '1',
                              value: 1,
                          },
                          {
                              name: '3',
                              value: 3,
                          },
                          {
                              name: '4',
                              value: 4,
                          },
                      ],
                      default: 1,
                      description: 'Which Mindee API Version to use',
                  },
                  {
                      displayName: 'API Version',
                      name: 'apiVersion',
                      type: 'options',
                      isNodeSetting: true,
                      displayOptions: {
                          show: {
                              '@version': [2],
                          },
                      },
                      options: [
                          {
                              name: '1',
                              value: 1,
                          },
                          {
                              name: '3',
                              value: 3,
                          },
                          {
                              name: '4',
                              value: 4,
                          },
                      ],
                      default: 3,
                      description: 'Which Mindee API Version to use',
                  },
                  {
                      displayName: 'API Version',
                      name: 'apiVersion',
                      type: 'options',
                      isNodeSetting: true,
                      displayOptions: {
                          show: {
                              '@version': [3],
                          },
                      },
                      options: [
                          {
                              name: '1',
                              value: 1,
                          },
                          {
                              name: '3',
                              value: 3,
                          },
                          {
                              name: '4',
                              value: 4,
                          },
                      ],
                      default: 4,
                      description: 'Which Mindee API Version to use',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Invoice',
                              value: 'invoice',
                          },
                          {
                              name: 'Receipt',
                              value: 'receipt',
                          },
                      ],
                      default: 'receipt',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Predict',
                              value: 'predict',
                          },
                      ],
                      default: 'predict',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['predict'],
                              resource: ['receipt', 'invoice'],
                          },
                      },
                      description: 'Name of the binary property which containsthe data for the file to be uploaded',
                  },
                  {
                      displayName: 'RAW Data',
                      name: 'rawData',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to return the data exactly in the way it got received from the API',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const version = this.getNodeParameter('apiVersion', 0);
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let endpoint;
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'receipt') {
                      if (operation === 'predict') {
                          const rawData = this.getNodeParameter('rawData', i);
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          if (version === 1) {
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', '/expense_receipts/v2/predict', {}, {}, {
                                  formData: {
                                      file: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else if (version === 3) {
                              endpoint = '/expense_receipts/v3/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      document: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else if (version === 4) {
                              endpoint = '/expense_receipts/v4/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      document: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          if (!rawData) {
                              if (version === 1) {
                                  responseData = (0, GenericFunctions_1.cleanDataPreviousApiVersions)(responseData.predictions);
                              }
                              else if (version === 3 || version === 4) {
                                  responseData = (0, GenericFunctions_1.cleanData)(responseData.document);
                              }
                          }
                      }
                  }
                  if (resource === 'invoice') {
                      if (operation === 'predict') {
                          const rawData = this.getNodeParameter('rawData', i);
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          if (version === 1) {
                              endpoint = '/invoices/v1/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      file: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else if (version === 3) {
                              endpoint = '/invoices/v3/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      document: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else if (version === 4) {
                              endpoint = '/invoices/v4/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      document: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid API version');
                          }
                          if (!rawData) {
                              if (version === 1) {
                                  responseData = (0, GenericFunctions_1.cleanDataPreviousApiVersions)(responseData.predictions);
                              }
                              else if (version === 3 || version === 4) {
                                  responseData = (0, GenericFunctions_1.cleanData)(responseData.document);
                              }
                          }
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else if (responseData !== undefined) {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Mindee = Mindee;
  //# sourceMappingURL=Mindee.node.js.map

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

  # Mindee node

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

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

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

  ## Operations

  - **Invoice**
      - Predict
  - **Receipt**
      - Predict

  ## Templates and examples

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

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"0d2d3066-1095-43b3-9fa4-9892ac3e9755","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"2895716be7f8d3c9c0559a6891a3b66f8e5329a9c0e6da1614d5191279f58426"}}


node_type: n8n-nodes-base.MoveBinaryData
name: MoveBinaryData
display_name: Convert to/from binary data
description: Move data between binary and JSON properties
category: transform
icon: fa:exchange-alt
code_hash: ab3fdb9328e05205e42d286ec989c12c8f2379707d331ec8ad0731004bdbbd48
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:17
updated_at: 2025-06-08 09:18:17
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.MoveBinaryData = void 0;
  const get_1 = __importDefault(require("lodash/get"));
  const set_1 = __importDefault(require("lodash/set"));
  const unset_1 = __importDefault(require("lodash/unset"));
  const pretty_bytes_1 = __importDefault(require("pretty-bytes"));
  const n8n_workflow_1 = require("n8n-workflow");
  const iconv_lite_1 = __importDefault(require("iconv-lite"));
  iconv_lite_1.default.encodingExists('utf8');
  const bomAware = [];
  const encodeDecodeOptions = [];
  const encodings = iconv_lite_1.default.encodings;
  Object.keys(encodings).forEach((encoding) => {
      if (!(encoding.startsWith('_') || typeof encodings[encoding] === 'string')) {
          if (encodings[encoding].bomAware) {
              bomAware.push(encoding);
          }
          encodeDecodeOptions.push({ name: encoding, value: encoding });
      }
  });
  encodeDecodeOptions.sort((a, b) => {
      if (a.name < b.name) {
          return -1;
      }
      if (a.name > b.name) {
          return 1;
      }
      return 0;
  });
  class MoveBinaryData {
      constructor() {
          this.description = {
              displayName: 'Convert to/from binary data',
              name: 'moveBinaryData',
              icon: 'fa:exchange-alt',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["mode"]==="binaryToJson" ? "Binary to JSON" : "JSON to Binary"}}',
              description: 'Move data between binary and JSON properties',
              defaults: {
                  name: 'Convert to/from binary data',
                  color: '#7722CC',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      options: [
                          {
                              name: 'Binary to JSON',
                              value: 'binaryToJson',
                              description: 'Move data from Binary to JSON',
                          },
                          {
                              name: 'JSON to Binary',
                              value: 'jsonToBinary',
                              description: 'Move data from JSON to Binary',
                          },
                      ],
                      default: 'binaryToJson',
                      description: 'From and to where data should be moved',
                  },
                  {
                      displayName: 'Set All Data',
                      name: 'setAllData',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              mode: ['binaryToJson'],
                          },
                      },
                      default: true,
                      description: 'Whether all JSON data should be replaced with the data retrieved from binary key. Else the data will be written to a single key.',
                  },
                  {
                      displayName: 'Source Key',
                      name: 'sourceKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['binaryToJson'],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: 'data',
                      description: 'The name of the binary key to get data from. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.currentKey".',
                  },
                  {
                      displayName: 'Destination Key',
                      name: 'destinationKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['binaryToJson'],
                              setAllData: [false],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: '',
                      description: 'The name the JSON key to copy data to. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.newKey".',
                  },
                  {
                      displayName: 'Convert All Data',
                      name: 'convertAllData',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              mode: ['jsonToBinary'],
                          },
                      },
                      default: true,
                      description: 'Whether all JSON data should be converted to binary. Else only the data of one key will be converted.',
                  },
                  {
                      displayName: 'Source Key',
                      name: 'sourceKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              convertAllData: [false],
                              mode: ['jsonToBinary'],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: 'data',
                      description: 'The name of the JSON key to get data from. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.currentKey".',
                  },
                  {
                      displayName: 'Destination Key',
                      name: 'destinationKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['jsonToBinary'],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: 'data',
                      description: 'The name the binary key to copy data to. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.newKey".',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Data Is Base64',
                              name: 'dataIsBase64',
                              type: 'boolean',
                              displayOptions: {
                                  hide: {
                                      useRawData: [true],
                                  },
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                      '/convertAllData': [false],
                                  },
                              },
                              default: false,
                              description: 'Whether to keep the binary data as base64 string',
                          },
                          {
                              displayName: 'Encoding',
                              name: 'encoding',
                              type: 'options',
                              options: encodeDecodeOptions,
                              displayOptions: {
                                  show: {
                                      '/mode': ['binaryToJson', 'jsonToBinary'],
                                  },
                              },
                              default: 'utf8',
                              description: 'Set the encoding of the data stream',
                          },
                          {
                              displayName: 'Strip BOM',
                              name: 'stripBOM',
                              displayOptions: {
                                  show: {
                                      '/mode': ['binaryToJson'],
                                      encoding: bomAware,
                                  },
                              },
                              type: 'boolean',
                              default: true,
                          },
                          {
                              displayName: 'Add BOM',
                              name: 'addBOM',
                              displayOptions: {
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                      encoding: bomAware,
                                  },
                              },
                              type: 'boolean',
                              default: false,
                          },
                          {
                              displayName: 'File Name',
                              name: 'fileName',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                  },
                              },
                              default: '',
                              placeholder: 'example.json',
                              description: 'The file name to set',
                          },
                          {
                              displayName: 'JSON Parse',
                              name: 'jsonParse',
                              type: 'boolean',
                              displayOptions: {
                                  hide: {
                                      keepAsBase64: [true],
                                  },
                                  show: {
                                      '/mode': ['binaryToJson'],
                                      '/setAllData': [false],
                                  },
                              },
                              default: false,
                              description: 'Whether to run JSON parse on the data to get proper object data',
                          },
                          {
                              displayName: 'Keep Source',
                              name: 'keepSource',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the source key should be kept. By default it will be deleted.',
                          },
                          {
                              displayName: 'Keep As Base64',
                              name: 'keepAsBase64',
                              type: 'boolean',
                              displayOptions: {
                                  hide: {
                                      jsonParse: [true],
                                  },
                                  show: {
                                      '/mode': ['binaryToJson'],
                                      '/setAllData': [false],
                                  },
                              },
                              default: false,
                              description: 'Whether to keep the binary data as base64 string',
                          },
                          {
                              displayName: 'MIME Type',
                              name: 'mimeType',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                  },
                              },
                              default: 'application/json',
                              placeholder: 'application/json',
                              description: 'The mime-type to set. By default will the mime-type for JSON be set.',
                          },
                          {
                              displayName: 'Use Raw Data',
                              name: 'useRawData',
                              type: 'boolean',
                              displayOptions: {
                                  hide: {
                                      dataIsBase64: [true],
                                  },
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                  },
                              },
                              default: false,
                              description: 'Whether to use data as is and do not JSON.stringify it',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const mode = this.getNodeParameter('mode', 0);
          const returnData = [];
          let item;
          let newItem;
          let options;
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              item = items[itemIndex];
              options = this.getNodeParameter('options', itemIndex, {});
              newItem = {
                  json: {},
                  pairedItem: {
                      item: itemIndex,
                  },
              };
              if (mode === 'binaryToJson') {
                  const setAllData = this.getNodeParameter('setAllData', itemIndex);
                  const sourceKey = this.getNodeParameter('sourceKey', itemIndex);
                  const value = (0, get_1.default)(item.binary, sourceKey);
                  if (value === undefined) {
                      continue;
                  }
                  const encoding = options.encoding || 'utf8';
                  const buffer = await this.helpers.getBinaryDataBuffer(itemIndex, sourceKey);
                  let convertedValue;
                  if (setAllData) {
                      convertedValue = iconv_lite_1.default.decode(buffer, encoding, {
                          stripBOM: options.stripBOM,
                      });
                      newItem.json = (0, n8n_workflow_1.jsonParse)(convertedValue);
                  }
                  else {
                      newItem.json = (0, n8n_workflow_1.deepCopy)(item.json);
                      if (options.keepAsBase64 !== true) {
                          convertedValue = iconv_lite_1.default.decode(buffer, encoding, {
                              stripBOM: options.stripBOM,
                          });
                      }
                      else {
                          convertedValue = Buffer.from(buffer).toString(n8n_workflow_1.BINARY_ENCODING);
                      }
                      if (options.jsonParse) {
                          convertedValue = (0, n8n_workflow_1.jsonParse)(convertedValue);
                      }
                      const destinationKey = this.getNodeParameter('destinationKey', itemIndex, '');
                      (0, set_1.default)(newItem.json, destinationKey, convertedValue);
                  }
                  if (options.keepSource === true) {
                      newItem.binary = item.binary;
                  }
                  else {
                      newItem.binary = (0, n8n_workflow_1.deepCopy)(item.binary);
                      (0, unset_1.default)(newItem.binary, sourceKey);
                  }
              }
              else if (mode === 'jsonToBinary') {
                  const convertAllData = this.getNodeParameter('convertAllData', itemIndex);
                  const destinationKey = this.getNodeParameter('destinationKey', itemIndex);
                  const encoding = options.encoding || 'utf8';
                  let value = item.json;
                  if (!convertAllData) {
                      const sourceKey = this.getNodeParameter('sourceKey', itemIndex);
                      value = (0, get_1.default)(item.json, sourceKey);
                  }
                  if (value === undefined) {
                      continue;
                  }
                  if (item.binary !== undefined) {
                      newItem.binary = (0, n8n_workflow_1.deepCopy)(item.binary);
                  }
                  else {
                      newItem.binary = {};
                  }
                  const mimeType = options.mimeType || 'application/json';
                  const convertedValue = {
                      data: '',
                      mimeType,
                      fileType: (0, n8n_workflow_1.fileTypeFromMimeType)(mimeType),
                  };
                  if (options.dataIsBase64 !== true) {
                      if (options.useRawData !== true || typeof value === 'object') {
                          value = JSON.stringify(value);
                      }
                      convertedValue.fileSize = (0, pretty_bytes_1.default)(value.length);
                      convertedValue.data = iconv_lite_1.default
                          .encode(value, encoding, { addBOM: options.addBOM })
                          .toString(n8n_workflow_1.BINARY_ENCODING);
                  }
                  else {
                      convertedValue.data = value;
                  }
                  if (options.fileName) {
                      convertedValue.fileName = options.fileName;
                  }
                  (0, set_1.default)(newItem.binary, destinationKey, convertedValue);
                  if (options.keepSource === true) {
                      newItem.json = item.json;
                  }
                  else {
                      if (convertAllData) {
                          newItem.json = {};
                      }
                      else {
                          newItem.json = (0, n8n_workflow_1.deepCopy)(item.json);
                          const sourceKey = this.getNodeParameter('sourceKey', itemIndex);
                          (0, unset_1.default)(newItem.json, sourceKey);
                      }
                  }
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${mode}" is not known!`, {
                      itemIndex,
                  });
              }
              returnData.push(newItem);
          }
          return [returnData];
      }
  }
  exports.MoveBinaryData = MoveBinaryData;
  //# sourceMappingURL=MoveBinaryData.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"d9aac142-6efd-40ad-bad6-ecaa4d68a382","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"1e0965dc6c660dc42aff4c336c8217645cd026d21b6b1ac5de0b844796783021"}}


node_type: n8n-nodes-base.MySql
name: MySql
display_name: MySQL
description: Get, add and update data in MySQL
category: input
icon: file:mysql.svg
code_hash: c632d9b472738f3cd1ce6ce0231920d56e6b160054dbd6ff4f5b38505f8003bb
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 09:18:17
updated_at: 2025-06-08 09:18:17
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MySql = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const MySqlV1_node_1 = require("./v1/MySqlV1.node");
  const MySqlV2_node_1 = require("./v2/MySqlV2.node");
  class MySql extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'MySQL',
              name: 'mySql',
              icon: 'file:mysql.svg',
              group: ['input'],
              defaultVersion: 2.2,
              description: 'Get, add and update data in MySQL',
          };
          const nodeVersions = {
              1: new MySqlV1_node_1.MySqlV1(baseDescription),
              2: new MySqlV2_node_1.MySqlV2(baseDescription),
              2.1: new MySqlV2_node_1.MySqlV2(baseDescription),
              2.2: new MySqlV2_node_1.MySqlV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.MySql = MySql;
  //# sourceMappingURL=MySql.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"695f29d6-2c08-45ef-a0f6-c4ad2ae988c3","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"f6c8f9f75078e4ea6d88fdccfc4e7b695178d908b0df715027d145e6d53d10a6"}}


node_type: n8n-nodes-base.Mocean
name: Mocean
display_name: Mocean
description: Send SMS and voice messages via Mocean
category: transform
icon: file:mocean.svg
code_hash: bdddaf8866b35055676200185cbfc23b07a661b4300009e3eeacb5ce74fc057e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.mocean
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:17
updated_at: 2025-06-08 09:18:17
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mocean = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Mocean {
      constructor() {
          this.description = {
              displayName: 'Mocean',
              name: 'mocean',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              icon: 'file:mocean.svg',
              group: ['transform'],
              version: 1,
              description: 'Send SMS and voice messages via Mocean',
              defaults: {
                  name: 'Mocean',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'moceanApi',
                      required: true,
                      testedBy: 'moceanApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                          {
                              name: 'Voice',
                              value: 'voice',
                          },
                      ],
                      default: 'sms',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['sms', 'voice'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send SMS/Voice message',
                              action: 'Send an SMS',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'From',
                      name: 'from',
                      type: 'string',
                      default: '',
                      placeholder: 'Sender Number',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms', 'voice'],
                          },
                      },
                      description: 'Number to which to send the message',
                  },
                  {
                      displayName: 'To',
                      name: 'to',
                      type: 'string',
                      default: '',
                      placeholder: 'Receipient number',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms', 'voice'],
                          },
                      },
                      description: 'Number from which to send the message',
                  },
                  {
                      displayName: 'Language',
                      name: 'language',
                      type: 'options',
                      options: [
                          {
                              name: 'Chinese Mandarin (China)',
                              value: 'cmn-CN',
                          },
                          {
                              name: 'English (United Kingdom)',
                              value: 'en-GB',
                          },
                          {
                              name: 'English (United States)',
                              value: 'en-US',
                          },
                          {
                              name: 'Japanese (Japan)',
                              value: 'ja-JP',
                          },
                          {
                              name: 'Korean (Korea)',
                              value: 'ko-KR',
                          },
                      ],
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['voice'],
                          },
                      },
                      default: 'en-US',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      default: '',
                      placeholder: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms', 'voice'],
                          },
                      },
                      description: 'Message to send',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Delivery Report URL',
                              name: 'dlrUrl',
                              type: 'string',
                              default: '',
                              placeholder: '',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async moceanApiTest(credential) {
                      const credentials = credential.data;
                      const query = {};
                      query['mocean-api-key'] = credentials['mocean-api-key'];
                      query['mocean-api-secret'] = credentials['mocean-api-secret'];
                      const options = {
                          method: 'GET',
                          qs: query,
                          uri: 'https://rest.moceanapi.com/rest/2/account/balance',
                          json: true,
                      };
                      try {
                          await this.helpers.request(options);
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: `Connection details not valid: ${error.message}`,
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Authentication successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let endpoint;
          let operation;
          let requestMethod;
          let resource;
          let text;
          let dlrUrl;
          let dataKey;
          let body;
          let qs;
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              body = {};
              qs = {};
              try {
                  resource = this.getNodeParameter('resource', itemIndex, '');
                  operation = this.getNodeParameter('operation', itemIndex, '');
                  text = this.getNodeParameter('message', itemIndex, '');
                  requestMethod = 'POST';
                  body['mocean-from'] = this.getNodeParameter('from', itemIndex, '');
                  body['mocean-to'] = this.getNodeParameter('to', itemIndex, '');
                  if (resource === 'voice') {
                      const language = this.getNodeParameter('language', itemIndex);
                      const command = [
                          {
                              action: 'say',
                              language,
                              text,
                          },
                      ];
                      dataKey = 'voice';
                      body['mocean-command'] = JSON.stringify(command);
                      endpoint = '/rest/2/voice/dial';
                  }
                  else if (resource === 'sms') {
                      dlrUrl = this.getNodeParameter('options.dlrUrl', itemIndex, '');
                      dataKey = 'messages';
                      body['mocean-text'] = text;
                      if (dlrUrl !== '') {
                          body['mocean-dlr-url'] = dlrUrl;
                          body['mocean-dlr-mask'] = '1';
                      }
                      endpoint = '/rest/2/sms';
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource ${resource}`, {
                          itemIndex,
                      });
                  }
                  if (operation === 'send') {
                      const responseData = await GenericFunctions_1.moceanApiRequest.call(this, requestMethod, endpoint, body, qs);
                      for (const item of responseData[dataKey]) {
                          item.type = resource;
                          returnData.push(item);
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation ${operation}`, {
                          itemIndex,
                      });
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Mocean = Mocean;
  //# sourceMappingURL=Mocean.node.js.map

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

  # Mocean node

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

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

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

  ## Operations

  * SMS
      * Send SMS/Voice message
  * Voice
      * Send SMS/Voice message

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"13ae8870-4873-4adb-b66e-90614065c1a8","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"73a00c85359e6f2058b1dcd2989d4bb0cfc043bc54129218b5f9342c38abd477"}}


node_type: n8n-nodes-base.Misp
name: Misp
display_name: MISP
description: Consume the MISP API
category: transform
icon: file:misp.svg
code_hash: 70ea7dbd5226d92f7c70290d0f29ecb75282633ded988db37a2b68e5f40404bd
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.misp
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:17
updated_at: 2025-06-08 09:18:17
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Misp = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Misp {
      constructor() {
          this.description = {
              displayName: 'MISP',
              name: 'misp',
              icon: 'file:misp.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the MISP API',
              defaults: {
                  name: 'MISP',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mispApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Attribute',
                              value: 'attribute',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Event Tag',
                              value: 'eventTag',
                          },
                          {
                              name: 'Feed',
                              value: 'feed',
                          },
                          {
                              name: 'Galaxy',
                              value: 'galaxy',
                          },
                          {
                              name: 'Noticelist',
                              value: 'noticelist',
                          },
                          {
                              name: 'Organisation',
                              value: 'organisation',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                          {
                              name: 'Warninglist',
                              value: 'warninglist',
                          },
                      ],
                      default: 'attribute',
                  },
                  ...descriptions_1.attributeOperations,
                  ...descriptions_1.attributeFields,
                  ...descriptions_1.eventOperations,
                  ...descriptions_1.eventFields,
                  ...descriptions_1.eventTagOperations,
                  ...descriptions_1.eventTagFields,
                  ...descriptions_1.feedOperations,
                  ...descriptions_1.feedFields,
                  ...descriptions_1.galaxyOperations,
                  ...descriptions_1.galaxyFields,
                  ...descriptions_1.noticelistOperations,
                  ...descriptions_1.noticelistFields,
                  ...descriptions_1.organisationOperations,
                  ...descriptions_1.organisationFields,
                  ...descriptions_1.tagOperations,
                  ...descriptions_1.tagFields,
                  ...descriptions_1.userOperations,
                  ...descriptions_1.userFields,
                  ...descriptions_1.warninglistOperations,
                  ...descriptions_1.warninglistFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getOrgs() {
                      const responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/organisations'));
                      return responseData.map((i) => ({ name: i.Organisation.name, value: i.Organisation.id }));
                  },
                  async getSharingGroups() {
                      const responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/sharing_groups'));
                      return responseData.response.map((i) => ({
                          name: i.SharingGroup.name,
                          value: i.SharingGroup.id,
                      }));
                  },
                  async getTags() {
                      const responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/tags'));
                      return responseData.Tag.map((i) => ({ name: i.name, value: i.id }));
                  },
                  async getUsers() {
                      const responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/admin/users'));
                      return responseData.map((i) => ({ name: i.User.email, value: i.User.id }));
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'attribute') {
                      if (operation === 'create') {
                          const body = {
                              type: this.getNodeParameter('type', i),
                              value: this.getNodeParameter('value', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          GenericFunctions_1.throwOnMissingSharingGroup.call(this, additionalFields);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/attributes/add/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint, body);
                          responseData = responseData.Attribute;
                      }
                      else if (operation === 'delete') {
                          const attributeId = this.getNodeParameter('attributeId', i);
                          const endpoint = `/attributes/delete/${attributeId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const attributeId = this.getNodeParameter('attributeId', i);
                          const endpoint = `/attributes/view/${attributeId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Attribute;
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.mispApiRequestAllItems.call(this, '/attributes');
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          GenericFunctions_1.throwOnMissingSharingGroup.call(this, updateFields);
                          Object.assign(body, updateFields);
                          const attributeId = this.getNodeParameter('attributeId', i);
                          const endpoint = `/attributes/edit/${attributeId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', endpoint, body);
                          responseData = responseData.Attribute;
                      }
                  }
                  else if (resource === 'event') {
                      if (operation === 'create') {
                          const body = {
                              org_id: this.getNodeParameter('org_id', i),
                              info: this.getNodeParameter('information', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          GenericFunctions_1.throwOnMissingSharingGroup.call(this, additionalFields);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', '/events', body);
                          responseData = responseData.Event;
                      }
                      else if (operation === 'delete') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/delete/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/view/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Event;
                          delete responseData.Attribute;
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.mispApiRequestAllItems.call(this, '/events');
                      }
                      else if (operation === 'publish') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/publish/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                      else if (operation === 'unpublish') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/unpublish/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          GenericFunctions_1.throwOnMissingSharingGroup.call(this, updateFields);
                          Object.assign(body, updateFields);
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/edit/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', endpoint, body);
                          responseData = responseData.Event;
                          delete responseData.Attribute;
                      }
                  }
                  else if (resource === 'eventTag') {
                      if (operation === 'add') {
                          const body = {
                              event: this.getNodeParameter('eventId', i),
                              tag: this.getNodeParameter('tagId', i),
                          };
                          const endpoint = '/events/addTag';
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint, body);
                      }
                      else if (operation === 'remove') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const tagId = this.getNodeParameter('tagId', i);
                          const endpoint = `/events/removeTag/${eventId}/${tagId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                  }
                  else if (resource === 'feed') {
                      if (operation === 'create') {
                          const url = this.getNodeParameter('url', i);
                          GenericFunctions_1.throwOnInvalidUrl.call(this, url);
                          const body = {
                              name: this.getNodeParameter('name', i),
                              provider: this.getNodeParameter('provider', i),
                              url,
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', '/feeds/add', body);
                          responseData = responseData.Feed;
                      }
                      else if (operation === 'disable') {
                          const feedId = this.getNodeParameter('feedId', i);
                          const endpoint = `/feeds/disable/${feedId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                      else if (operation === 'enable') {
                          const feedId = this.getNodeParameter('feedId', i);
                          const endpoint = `/feeds/enable/${feedId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                      else if (operation === 'get') {
                          const feedId = this.getNodeParameter('feedId', i);
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', `/feeds/view/${feedId}`);
                          responseData = responseData.Feed;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/feeds'));
                          responseData = responseData.map((entry) => entry.Feed);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          if (updateFields.url) {
                              GenericFunctions_1.throwOnInvalidUrl.call(this, updateFields.url);
                          }
                          Object.assign(body, updateFields);
                          const feedId = this.getNodeParameter('feedId', i);
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', `/feeds/edit/${feedId}`, body);
                          responseData = responseData.Feed;
                      }
                  }
                  else if (resource === 'galaxy') {
                      if (operation === 'delete') {
                          const galaxyId = this.getNodeParameter('galaxyId', i);
                          const endpoint = `/galaxies/delete/${galaxyId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const galaxyId = this.getNodeParameter('galaxyId', i);
                          const endpoint = `/galaxies/view/${galaxyId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Galaxy;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/galaxies'));
                          responseData = responseData.map((entry) => entry.Galaxy);
                      }
                  }
                  else if (resource === 'noticelist') {
                      if (operation === 'get') {
                          const noticelistId = this.getNodeParameter('noticelistId', i);
                          const endpoint = `/noticelists/view/${noticelistId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Noticelist;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/noticelists'));
                          responseData = responseData.map((entry) => entry.Noticelist);
                      }
                  }
                  else if (resource === 'organisation') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          const endpoint = '/admin/organisations/add';
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint, body);
                          responseData = responseData.Organisation;
                      }
                      else if (operation === 'delete') {
                          const organisationId = this.getNodeParameter('organisationId', i);
                          const endpoint = `/admin/organisations/delete/${organisationId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const organisationId = this.getNodeParameter('organisationId', i);
                          const endpoint = `/organisations/view/${organisationId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Organisation;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/organisations'));
                          responseData = responseData.map((entry) => entry.Organisation);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          Object.assign(body, updateFields);
                          const organisationId = this.getNodeParameter('organisationId', i);
                          const endpoint = `/admin/organisations/edit/${organisationId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', endpoint, body);
                          responseData = responseData.Organisation;
                      }
                  }
                  else if (resource === 'tag') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const { colour } = this.getNodeParameter('additionalFields', i);
                          if (colour) {
                              Object.assign(body, {
                                  colour: !colour.startsWith('#') ? `#${colour}` : colour,
                              });
                          }
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', '/tags/add', body);
                          responseData = responseData.Tag;
                      }
                      else if (operation === 'delete') {
                          const tagId = this.getNodeParameter('tagId', i);
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', `/tags/delete/${tagId}`);
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/tags'));
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.Tag.slice(0, limit);
                          }
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          Object.assign(body, updateFields);
                          const { colour, name } = updateFields;
                          Object.assign(body, {
                              ...(name && { name }),
                              ...(colour && { colour: !colour.startsWith('#') ? `#${colour}` : colour }),
                          });
                          const tagId = this.getNodeParameter('tagId', i);
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', `/tags/edit/${tagId}`, body);
                          responseData = responseData.Tag;
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'create') {
                          const body = {
                              email: this.getNodeParameter('email', i),
                              role_id: this.getNodeParameter('role_id', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', '/admin/users/add', body);
                          responseData = responseData.User;
                      }
                      else if (operation === 'delete') {
                          const userId = this.getNodeParameter('userId', i);
                          const endpoint = `/admin/users/delete/${userId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const userId = this.getNodeParameter('userId', i);
                          const endpoint = `/admin/users/view/${userId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.User;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/admin/users'));
                          responseData = responseData.map((entry) => entry.User);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          Object.assign(body, updateFields);
                          const userId = this.getNodeParameter('userId', i);
                          const endpoint = `/admin/users/edit/${userId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', endpoint, body);
                          responseData = responseData.User;
                      }
                  }
                  else if (resource === 'warninglist') {
                      if (operation === 'get') {
                          const warninglistId = this.getNodeParameter('warninglistId', i);
                          const endpoint = `/warninglists/view/${warninglistId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Warninglist;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/warninglists'));
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.Warninglists.slice(0, limit).map((entry) => entry.Warninglist);
                          }
                          else {
                              responseData = responseData.Warninglists.map((entry) => entry.Warninglist);
                          }
                      }
                  }
              }
              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.Misp = Misp;
  //# sourceMappingURL=Misp.node.js.map

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

  # MISP node

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

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

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

  ## Operations

  * Attribute
      * Create
      * Delete
      * Get
      * Get All
  	* Search
      * Update
  * Event
      * Create
      * Delete
      * Get
      * Get All
      * Publish
  	* Search
      * Unpublish
      * Update
  * Event Tag
      * Add
      * Remove
  * Feed
      * Create
      * Disable
      * Enable
      * Get
      * Get All
      * Update
  * Galaxy
      * Delete
      * Get
      * Get All
  * Noticelist
      * Get
      * Get All
  * Object
  	* Search
  * Organisation
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Tag
      * Create
      * Delete
      * Get All
      * Update
  * User
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Warninglist
      * Get
      * Get All

  ## Templates and examples

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

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"6a305189-894d-4c8e-af33-5cd74f50ff91","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"c221f9e3de3db890e1704aa484deecbb784d815aa8b5f6b9f1d3c0ab2188403c"}}


node_type: n8n-nodes-base.MondayCom
name: MondayCom
display_name: Monday.com
description: Consume Monday.com API
category: output
icon: file:mondayCom.svg
code_hash: 2d6d2778a0bd18f40f8fe7d6ba9d6fe081f822e1491320263604668ca13d5bb3
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.mondaycom
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:17
updated_at: 2025-06-08 09:18:17
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MondayCom = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const BoardDescription_1 = require("./BoardDescription");
  const BoardColumnDescription_1 = require("./BoardColumnDescription");
  const BoardGroupDescription_1 = require("./BoardGroupDescription");
  const BoardItemDescription_1 = require("./BoardItemDescription");
  const change_case_1 = require("change-case");
  class MondayCom {
      constructor() {
          this.description = {
              displayName: 'Monday.com',
              name: 'mondayCom',
              icon: 'file:mondayCom.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Monday.com API',
              defaults: {
                  name: 'Monday.com',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mondayComApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'mondayComOAuth2Api',
                      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: 'Board',
                              value: 'board',
                          },
                          {
                              name: 'Board Column',
                              value: 'boardColumn',
                          },
                          {
                              name: 'Board Group',
                              value: 'boardGroup',
                          },
                          {
                              name: 'Board Item',
                              value: 'boardItem',
                          },
                      ],
                      default: 'board',
                  },
                  ...BoardDescription_1.boardOperations,
                  ...BoardDescription_1.boardFields,
                  ...BoardColumnDescription_1.boardColumnOperations,
                  ...BoardColumnDescription_1.boardColumnFields,
                  ...BoardGroupDescription_1.boardGroupOperations,
                  ...BoardGroupDescription_1.boardGroupFields,
                  ...BoardItemDescription_1.boardItemOperations,
                  ...BoardItemDescription_1.boardItemFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getBoards() {
                      const returnData = [];
                      const body = {
                          query: `query ($page: Int, $limit: Int) {
  							boards (page: $page, limit: $limit){
  								id
  								description
  								name
  							}
  						}`,
                          variables: {
                              page: 1,
                          },
                      };
                      const boards = await GenericFunctions_1.mondayComApiRequestAllItems.call(this, 'data.boards', body);
                      if (boards === undefined) {
                          return returnData;
                      }
                      for (const board of boards) {
                          const boardName = board.name;
                          const boardId = board.id;
                          const boardDescription = board.description;
                          returnData.push({
                              name: boardName,
                              value: boardId,
                              description: boardDescription,
                          });
                      }
                      return returnData;
                  },
                  async getColumns() {
                      const returnData = [];
                      const boardId = parseInt(this.getCurrentNodeParameter('boardId'), 10);
                      const body = {
                          query: `query ($boardId: [Int]) {
  							boards (ids: $boardId){
  								columns() {
  									id
  									title
  								}
  							}
  						}`,
                          variables: {
                              page: 1,
                              boardId,
                          },
                      };
                      const { data } = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                      if (data === undefined) {
                          return returnData;
                      }
                      const columns = data.boards[0].columns;
                      for (const column of columns) {
                          const columnName = column.title;
                          const columnId = column.id;
                          returnData.push({
                              name: columnName,
                              value: columnId,
                          });
                      }
                      return returnData;
                  },
                  async getGroups() {
                      const returnData = [];
                      const boardId = parseInt(this.getCurrentNodeParameter('boardId'), 10);
                      const body = {
                          query: `query ($boardId: Int!) {
  							boards ( ids: [$boardId]){
  								groups () {
  									id
  									title
  								}
  							}
  						}`,
                          variables: {
                              boardId,
                          },
                      };
                      const { data } = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                      if (data === undefined) {
                          return returnData;
                      }
                      const groups = data.boards[0].groups;
                      for (const group of groups) {
                          const groupName = group.title;
                          const groupId = group.id;
                          returnData.push({
                              name: groupName,
                              value: groupId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'board') {
                      if (operation === 'archive') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const body = {
                              query: `mutation ($id: Int!) {
  									archive_board (board_id: $id) {
  										id
  									}
  								}`,
                              variables: {
                                  id: boardId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.archive_board;
                      }
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const kind = this.getNodeParameter('kind', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              query: `mutation ($name: String!, $kind: BoardKind!, $templateId: Int) {
  									create_board (board_name: $name, board_kind: $kind, template_id: $templateId) {
  										id
  									}
  								}`,
                              variables: {
                                  name,
                                  kind,
                              },
                          };
                          if (additionalFields.templateId) {
                              body.variables.templateId = additionalFields.templateId;
                          }
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_board;
                      }
                      if (operation === 'get') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const body = {
                              query: `query ($id: [Int]) {
  									boards (ids: $id){
  										id
  										name
  										description
  										state
  										board_folder_id
  										board_kind
  										owner() {
  											id
  										}
  									}
  								}`,
                              variables: {
                                  id: boardId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.boards;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const body = {
                              query: `query ($page: Int, $limit: Int) {
  									boards (page: $page, limit: $limit){
  										id
  										name
  										description
  										state
  										board_folder_id
  										board_kind
  										owner() {
  											id
  										}
  									}
  								}`,
                              variables: {
                                  page: 1,
                              },
                          };
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mondayComApiRequestAllItems.call(this, 'data.boards', body);
                          }
                          else {
                              body.variables.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                              responseData = responseData.data.boards;
                          }
                      }
                  }
                  if (resource === 'boardColumn') {
                      if (operation === 'create') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const title = this.getNodeParameter('title', i);
                          const columnType = this.getNodeParameter('columnType', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $title: String!, $columnType: ColumnType, $defaults: JSON ) {
  									create_column (board_id: $boardId, title: $title, column_type: $columnType, defaults: $defaults) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  title,
                                  columnType: (0, change_case_1.snakeCase)(columnType),
                              },
                          };
                          if (additionalFields.defaults) {
                              try {
                                  JSON.parse(additionalFields.defaults);
                              }
                              catch (error) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Defauls must be a valid JSON', {
                                      itemIndex: i,
                                  });
                              }
                              body.variables.defaults = JSON.stringify(JSON.parse(additionalFields.defaults));
                          }
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_column;
                      }
                      if (operation === 'getAll') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const body = {
                              query: `query ($boardId: [Int]) {
  									boards (ids: $boardId){
  										columns() {
  											id
  											title
  											type
  											settings_str
  											archived
  										}
  									}
  								}`,
                              variables: {
                                  page: 1,
                                  boardId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.boards[0].columns;
                      }
                  }
                  if (resource === 'boardGroup') {
                      if (operation === 'create') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $groupName: String!) {
  									create_group (board_id: $boardId, group_name: $groupName) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  groupName: name,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_group;
                      }
                      if (operation === 'delete') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const groupId = this.getNodeParameter('groupId', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $groupId: String!) {
  									delete_group (board_id: $boardId, group_id: $groupId) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  groupId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.delete_group;
                      }
                      if (operation === 'getAll') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const body = {
                              query: `query ($boardId: [Int]) {
  									boards (ids: $boardId, ){
  										id
  										groups() {
  											id
  											title
  											color
  											position
  											archived
  										}
  									}
  								}`,
                              variables: {
                                  boardId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.boards[0].groups;
                      }
                  }
                  if (resource === 'boardItem') {
                      if (operation === 'addUpdate') {
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const value = this.getNodeParameter('value', i);
                          const body = {
                              query: `mutation ($itemId: Int!, $value: String!) {
  									create_update (item_id: $itemId, body: $value) {
  										id
  									}
  								}`,
                              variables: {
                                  itemId,
                                  value,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_update;
                      }
                      if (operation === 'changeColumnValue') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const columnId = this.getNodeParameter('columnId', i);
                          const value = this.getNodeParameter('value', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $itemId: Int!, $columnId: String!, $value: JSON!) {
  									change_column_value (board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  itemId,
                                  columnId,
                              },
                          };
                          try {
                              JSON.parse(value);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom Values must be a valid JSON', {
                                  itemIndex: i,
                              });
                          }
                          body.variables.value = JSON.stringify(JSON.parse(value));
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.change_column_value;
                      }
                      if (operation === 'changeMultipleColumnValues') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const columnValues = this.getNodeParameter('columnValues', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $itemId: Int!, $columnValues: JSON!) {
  									change_multiple_column_values (board_id: $boardId, item_id: $itemId, column_values: $columnValues) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  itemId,
                              },
                          };
                          try {
                              JSON.parse(columnValues);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom Values must be a valid JSON', {
                                  itemIndex: i,
                              });
                          }
                          body.variables.columnValues = JSON.stringify(JSON.parse(columnValues));
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.change_multiple_column_values;
                      }
                      if (operation === 'create') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const groupId = this.getNodeParameter('groupId', i);
                          const itemName = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $groupId: String!, $itemName: String!, $columnValues: JSON) {
  									create_item (board_id: $boardId, group_id: $groupId, item_name: $itemName, column_values: $columnValues) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  groupId,
                                  itemName,
                              },
                          };
                          if (additionalFields.columnValues) {
                              try {
                                  JSON.parse(additionalFields.columnValues);
                              }
                              catch (error) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom Values must be a valid JSON', {
                                      itemIndex: i,
                                  });
                              }
                              body.variables.columnValues = JSON.stringify(JSON.parse(additionalFields.columnValues));
                          }
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_item;
                      }
                      if (operation === 'delete') {
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const body = {
                              query: `mutation ($itemId: Int!) {
  									delete_item (item_id: $itemId) {
  										id
  									}
  								}`,
                              variables: {
                                  itemId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.delete_item;
                      }
                      if (operation === 'get') {
                          const itemIds = this.getNodeParameter('itemId', i)
                              .split(',')
                              .map((n) => parseInt(n, 10));
                          const body = {
                              query: `query ($itemId: [Int!]){
  									items (ids: $itemId) {
  										id
  										name
  										created_at
  										state
  										column_values() {
  											id
  											text
  											title
  											type
  											value
  											additional_info
  										}
  									}
  								}`,
                              variables: {
                                  itemId: itemIds,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.items;
                      }
                      if (operation === 'getAll') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const groupId = this.getNodeParameter('groupId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const body = {
                              query: `query ($boardId: [Int], $groupId: [String], $page: Int, $limit: Int) {
  									boards (ids: $boardId) {
  										groups (ids: $groupId) {
  											id
  											items(limit: $limit, page: $page) {
  												id
  												name
  												created_at
  												state
  												column_values() {
  													id
  													text
  													title
  													type
  													value
  													additional_info
  												}
  											}
  										}
  									}
  								}`,
                              variables: {
                                  boardId,
                                  groupId,
                              },
                          };
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mondayComApiRequestAllItems.call(this, 'data.boards[0].groups[0].items', body);
                          }
                          else {
                              body.variables.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                              responseData = responseData.data.boards[0].groups[0].items;
                          }
                      }
                      if (operation === 'getByColumnValue') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const columnId = this.getNodeParameter('columnId', i);
                          const columnValue = this.getNodeParameter('columnValue', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const body = {
                              query: `query ($boardId: Int!, $columnId: String!, $columnValue: String!, $page: Int, $limit: Int ){
  									items_by_column_values (board_id: $boardId, column_id: $columnId, column_value: $columnValue, page: $page, limit: $limit) {
  										id
  										name
  										created_at
  										state
  										board {
  											id
  										}
  										column_values() {
  											id
  											text
  											title
  											type
  											value
  											additional_info
  										}
  									}
  								}`,
                              variables: {
                                  boardId,
                                  columnId,
                                  columnValue,
                              },
                          };
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mondayComApiRequestAllItems.call(this, 'data.items_by_column_values', body);
                          }
                          else {
                              body.variables.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                              responseData = responseData.data.items_by_column_values;
                          }
                      }
                      if (operation === 'move') {
                          const groupId = this.getNodeParameter('groupId', i);
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const body = {
                              query: `mutation ($groupId: String!, $itemId: Int!) {
  									move_item_to_group (group_id: $groupId, item_id: $itemId) {
  										id
  									}
  								}`,
                              variables: {
                                  groupId,
                                  itemId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.move_item_to_group;
                      }
                  }
                  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.MondayCom = MondayCom;
  //# sourceMappingURL=MondayCom.node.js.map

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

  # monday.com node

  Use the monday.com node to automate work in monday.com, and integrate monday.com with other applications. n8n has built-in support for a wide range of monday.com features, including creating a new board, and adding, deleting, and getting items on the board.

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

  /// warning | Minimum required version
  This node requires n8n version 1.22.6 or above.
  ///

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

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

  ## Operations

  * Board
      * Archive a board
      * Create a new board
      * Get a board
      * Get all boards
  * Board Column
      * Create a new column
      * Get all columns
  * Board Group
      * Delete a group in a board
      * Create a group in a board
      * Get list of groups in a board
  * Board Item
      * Add an update to an item.
      * Change a column value for a board item
      * Change multiple column values for a board item
      * Create an item in a board's group
      * Delete an item
      * Get an item
      * Get all items
      * Get items by column value
      * Move item to group

  ## Templates and examples

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

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"dfd5554a-94c2-483e-be40-69a653b7e412","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"4b0a5807154fb21edfe79c92d98c5f9a7057f665c2a011015f35ac97973c2dbb"}}


node_type: n8n-nodes-base.MongoDb
name: MongoDb
display_name: MongoDB
description: Find, insert and update documents in MongoDB
category: input
icon: file:mongodb.svg
code_hash: b2ba16dd51375f7dbee76439f8443f7c8377528cce99ef36d8b45f549e6b6471
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:17
updated_at: 2025-06-08 09:18:17
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MongoDb = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const mongodb_1 = require("mongodb");
  const MongoDbProperties_1 = require("./MongoDbProperties");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utilities_1 = require("../../utils/utilities");
  class MongoDb {
      constructor() {
          this.description = {
              displayName: 'MongoDB',
              name: 'mongoDb',
              icon: 'file:mongodb.svg',
              group: ['input'],
              version: 1,
              description: 'Find, insert and update documents in MongoDB',
              defaults: {
                  name: 'MongoDB',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mongoDb',
                      required: true,
                      testedBy: 'mongoDbCredentialTest',
                  },
              ],
              properties: MongoDbProperties_1.nodeProperties,
          };
          this.methods = {
              credentialTest: {
                  async mongoDbCredentialTest(credential) {
                      const credentials = credential.data;
                      try {
                          const database = (credentials.database || '').trim();
                          let connectionString = '';
                          if (credentials.configurationType === 'connectionString') {
                              connectionString = (credentials.connectionString || '').trim();
                          }
                          else {
                              connectionString = (0, GenericFunctions_1.buildParameterizedConnString)(credentials);
                          }
                          const client = await mongodb_1.MongoClient.connect(connectionString);
                          const { databases } = await client.db().admin().listDatabases();
                          if (!databases.map((db) => db.name).includes(database)) {
                              throw new Error(`Database "${database}" does not exist`);
                          }
                          await client.close();
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const { database, connectionString } = (0, GenericFunctions_1.validateAndResolveMongoCredentials)(this, await this.getCredentials('mongoDb'));
          const client = await mongodb_1.MongoClient.connect(connectionString);
          const mdb = client.db(database);
          const returnItems = [];
          let responseData = [];
          const items = this.getInputData();
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'aggregate') {
              try {
                  const queryParameter = JSON.parse(this.getNodeParameter('query', 0));
                  if (queryParameter._id && typeof queryParameter._id === 'string') {
                      queryParameter._id = new mongodb_1.ObjectId(queryParameter._id);
                  }
                  const query = mdb
                      .collection(this.getNodeParameter('collection', 0))
                      .aggregate(queryParameter);
                  responseData = await query.toArray();
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      responseData = [{ error: error.message }];
                  }
                  else {
                      throw error;
                  }
              }
          }
          else if (operation === 'delete') {
              try {
                  const { deletedCount } = await mdb
                      .collection(this.getNodeParameter('collection', 0))
                      .deleteMany(JSON.parse(this.getNodeParameter('query', 0)));
                  responseData = [{ deletedCount }];
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      responseData = [{ error: error.message }];
                  }
                  else {
                      throw error;
                  }
              }
          }
          else if (operation === 'find') {
              try {
                  const queryParameter = JSON.parse(this.getNodeParameter('query', 0));
                  if (queryParameter._id && typeof queryParameter._id === 'string') {
                      queryParameter._id = new mongodb_1.ObjectId(queryParameter._id);
                  }
                  let query = mdb
                      .collection(this.getNodeParameter('collection', 0))
                      .find(queryParameter);
                  const options = this.getNodeParameter('options', 0);
                  const limit = options.limit;
                  const skip = options.skip;
                  const sort = options.sort && JSON.parse(options.sort);
                  if (skip > 0) {
                      query = query.skip(skip);
                  }
                  if (limit > 0) {
                      query = query.limit(limit);
                  }
                  if (sort && Object.keys(sort).length !== 0 && sort.constructor === Object) {
                      query = query.sort(sort);
                  }
                  const queryResult = await query.toArray();
                  responseData = queryResult;
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      responseData = [{ error: error.message }];
                  }
                  else {
                      throw error;
                  }
              }
          }
          else if (operation === 'findOneAndReplace') {
              const fields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('fields', 0));
              const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false);
              const dateFields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('options.dateFields', 0, ''));
              const updateKey = (this.getNodeParameter('updateKey', 0) || '').trim();
              const updateOptions = this.getNodeParameter('upsert', 0)
                  ? { upsert: true }
                  : undefined;
              const updateItems = (0, GenericFunctions_1.prepareItems)(items, fields, updateKey, useDotNotation, dateFields);
              for (const item of updateItems) {
                  try {
                      const filter = { [updateKey]: item[updateKey] };
                      if (updateKey === '_id') {
                          filter[updateKey] = new mongodb_1.ObjectId(item[updateKey]);
                          delete item._id;
                      }
                      await mdb
                          .collection(this.getNodeParameter('collection', 0))
                          .findOneAndReplace(filter, item, updateOptions);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          item.json = { error: error.message };
                          continue;
                      }
                      throw error;
                  }
              }
              responseData = updateItems;
          }
          else if (operation === 'findOneAndUpdate') {
              const fields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('fields', 0));
              const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false);
              const dateFields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('options.dateFields', 0, ''));
              const updateKey = (this.getNodeParameter('updateKey', 0) || '').trim();
              const updateOptions = this.getNodeParameter('upsert', 0)
                  ? { upsert: true }
                  : undefined;
              const updateItems = (0, GenericFunctions_1.prepareItems)(items, fields, updateKey, useDotNotation, dateFields);
              for (const item of updateItems) {
                  try {
                      const filter = { [updateKey]: item[updateKey] };
                      if (updateKey === '_id') {
                          filter[updateKey] = new mongodb_1.ObjectId(item[updateKey]);
                          delete item._id;
                      }
                      await mdb
                          .collection(this.getNodeParameter('collection', 0))
                          .findOneAndUpdate(filter, { $set: item }, updateOptions);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          item.json = { error: error.message };
                          continue;
                      }
                      throw error;
                  }
              }
              responseData = updateItems;
          }
          else if (operation === 'insert') {
              try {
                  const fields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('fields', 0));
                  const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false);
                  const dateFields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('options.dateFields', 0, ''));
                  const insertItems = (0, GenericFunctions_1.prepareItems)(items, fields, '', useDotNotation, dateFields);
                  const { insertedIds } = await mdb
                      .collection(this.getNodeParameter('collection', 0))
                      .insertMany(insertItems);
                  for (const i of Object.keys(insertedIds)) {
                      responseData.push({
                          ...insertItems[parseInt(i, 10)],
                          id: insertedIds[parseInt(i, 10)],
                      });
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      responseData = [{ error: error.message }];
                  }
                  else {
                      throw error;
                  }
              }
          }
          else if (operation === 'update') {
              const fields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('fields', 0));
              const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false);
              const dateFields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('options.dateFields', 0, ''));
              const updateKey = (this.getNodeParameter('updateKey', 0) || '').trim();
              const updateOptions = this.getNodeParameter('upsert', 0)
                  ? { upsert: true }
                  : undefined;
              const updateItems = (0, GenericFunctions_1.prepareItems)(items, fields, updateKey, useDotNotation, dateFields);
              for (const item of updateItems) {
                  try {
                      const filter = { [updateKey]: item[updateKey] };
                      if (updateKey === '_id') {
                          filter[updateKey] = new mongodb_1.ObjectId(item[updateKey]);
                          delete item._id;
                      }
                      await mdb
                          .collection(this.getNodeParameter('collection', 0))
                          .updateOne(filter, { $set: item }, updateOptions);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          item.json = { error: error.message };
                          continue;
                      }
                      throw error;
                  }
              }
              responseData = updateItems;
          }
          else {
              if (this.continueOnFail()) {
                  responseData = [{ error: `The operation "${operation}" is not supported!` }];
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`, { itemIndex: 0 });
              }
          }
          await client.close();
          (0, GenericFunctions_1.stringifyObjectIDs)(responseData);
          const itemData = (0, utilities_1.generatePairedItemData)(items.length);
          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData });
          returnItems.push(...executionData);
          return [returnItems];
      }
  }
  exports.MongoDb = MongoDb;
  //# sourceMappingURL=MongoDb.node.js.map

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

  # MongoDB Atlas Vector Store node

  MongoDB Atlas Vector Search is a feature of MongoDB Atlas that enables users to store and query vector embeddings. Use this node to interact with Vector Search indexes in your MongoDB Atlas collections. You can insert documents, retrieve documents, and use the vector store in chains or as a tool for agents.

  On this page, you'll find the node parameters for the MongoDB Atlas Vector Store node, and links to more resources.

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

  --8<-- "_snippets/integrations/builtin/cluster-nodes/sub-node-expression-resolution.md"

  ## Prerequisites

  Before using this node, create a [Vector Search index](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/) in your MongoDB Atlas collection. Follow these steps to create one:

  1. Log in to the [MongoDB Atlas dashboard](https://cloud.mongodb.com/).

  3. Select your organization and project.
  4. Find "Search & Vector Search" section.
  5. Select your cluster and click "Go to search".
  7. Click "Create Search Index".
  8. Choose "Vector Search" mode and use the visual or JSON editors. For example:
     ```json
     {
       "fields": [
         {
           "type": "vector",
           "path": "<field-name>",
           "numDimensions": 1536, // any other value
           "similarity": "<similarity-function>"
         }
       ]
     }
     ```

  9. Adjust the "dimensions" value according to your embedding model (For example, `1536` for OpenAI's `text-embedding-small-3`).
  10. Name your index and create.

  Make sure to note the following values which are required when configuring the node:

  - Collection name
  - Vector index name 
  - Field names for embeddings and metadata

  ## Node usage patterns

  You can use the MongoDB Atlas Vector Store node in the following patterns:

  ### Use as a regular node to insert and retrieve documents

  You can use the MongoDB Atlas Vector Store as a regular node to insert or get documents. This pattern places the MongoDB Atlas Vector Store in the regular connection flow without using an agent.

  You can see an example of this in scenario 1 of [this template](https://n8n.io/workflows/2621-ai-agent-to-chat-with-files-in-supabase-storage/) (the template uses the Supabase Vector Store, but the pattern is the same).

  ### Connect directly to an AI agent as a tool

  You can connect the MongoDB Atlas Vector Store node directly to the tool connector of an [AI agent](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/index.md) to use the vector store as a resource when answering queries.

  Here, the connection would be: AI agent (tools connector) -> MongoDB Atlas Vector Store node.

  ### Use a retriever to fetch documents

  You can use the [Vector Store Retriever](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.retrievervectorstore.md) node with the MongoDB Atlas Vector Store node to fetch documents from the MongoDB Atlas Vector Store node. This is often used with the [Question and Answer Chain](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainretrievalqa/index.md) node to fetch documents from the vector store that match the given chat input.

  An [example of the connection flow](https://n8n.io/workflows/1960-ask-questions-about-a-pdf-using-ai/) (the linked example uses Pinecone, but the pattern is the same) would be: Question and Answer Chain (Retriever connector) -> Vector Store Retriever (Vector Store connector) -> MongoDB Atlas Vector Store.

  ### Use the Vector Store Question Answer Tool to answer questions

  Another pattern uses the [Vector Store Question Answer Tool](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolvectorstore.md) to summarize results and answer questions from the MongoDB Atlas Vector Store node. Rather than connecting the MongoDB Atlas Vector Store directly as a tool, this pattern uses a tool specifically designed to summarize data in the vector store.

  The [connections flow](https://n8n.io/workflows/2465-building-your-first-whatsapp-chatbot/) (the linked example uses the In-Memory Vector Store, but the pattern is the same) in this case would look like this: AI agent (tools connector) -> Vector Store Question Answer Tool (Vector Store connector) -> In-Memory Vector store.

  ## Node parameters

  --8<-- "_snippets/integrations/builtin/cluster-nodes/vector-store-mode.md"

  <!-- vale off -->
  ### Get Many parameters
  <!-- vale on -->

  - **Mongo Collection**: Enter the name of the MongoDB collection to use.
  - **Vector Index Name**: Enter the name of the Vector Search index in your MongoDB Atlas collection.
  - **Embedding Field**: Enter the field name in your documents that contains the vector embeddings.
  - **Metadata Field**: Enter the field name in your documents that contains the text metadata.

  ### Insert Documents parameters

  - **Mongo Collection**: Enter the name of the MongoDB collection to use.
  - **Vector Index Name**: Enter the name of the Vector Search index in your MongoDB Atlas collection.
  - **Embedding Field**: Enter the field name in your documents that contains the vector embeddings.
  - **Metadata Field**: Enter the field name in your documents that contains the text metadata.

  ### Retrieve Documents parameters (As Vector Store for Chain/Tool)

  - **Mongo Collection**: Enter the name of the MongoDB collection to use.
  - **Vector Index Name**: Enter the name of the Vector Search index in your MongoDB Atlas collection.
  - **Embedding Field**: Enter the field name in your documents that contains the vector embeddings.
  - **Metadata Field**: Enter the field name in your documents that contains the text metadata.

  ### Retrieve Documents (As Tool for AI Agent) parameters

  - **Name**: The name of the vector store.
  - **Description**: Explain to the LLM what this tool does. A good, specific description allows LLMs to produce expected results more often.
  - **Mongo Collection**: Enter the name of the MongoDB collection to use.
  - **Vector Index Name**: Enter the name of the Vector Search index in your MongoDB Atlas collection.
  - **Limit**: Enter how many results to retrieve from the vector store. For example, set this to `10` to get the ten best results.

  ## Node options

  ### Options

  - **Metadata Filter**: Filters results based on metadata.

  ## Templates and examples

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

  ## Related resources

  Refer to:

  - [LangChain's MongoDB Atlas Vector Search documentation](https://js.langchain.com/docs/integrations/vectorstores/mongodb_atlas){:target=_blank .external-link} for more information about the service.
  - [MongoDB Atlas Vector Search documentation](https://www.mongodb.com/docs/atlas/atlas-vector-search/){:target=_blank .external-link} for more information about MongoDB Atlas Vector Search.

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

  --8<-- "_snippets/self-hosting/starter-kits/self-hosted-ai-starter-kit.md"

documentation_url:
  https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoremongodbatlas

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"8898da27-d3a3-4027-b560-c7d64fc8b9e2","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"856ddc96e8d62516acf016cb7ef2e6cc63a40f4746da3ba6d3b7855526f8a53e"}}


node_type: n8n-nodes-base.MonicaCrm
name: MonicaCrm
display_name: Monica CRM
description: Consume the Monica CRM API
category: transform
icon: file:monicaCrm.png
code_hash: 0db18b80574c5a1563944176ada3f2416c35261c67a5e76e2b90db7993bcbf90
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.monicacrm
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:17
updated_at: 2025-06-08 09:18:17
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MonicaCrm = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class MonicaCrm {
      constructor() {
          this.description = {
              displayName: 'Monica CRM',
              name: 'monicaCrm',
              icon: 'file:monicaCrm.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Monica CRM API',
              defaults: {
                  name: 'Monica CRM',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'monicaCrmApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                          {
                              name: 'Call',
                              value: 'call',
                          },
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                          {
                              name: 'Contact Field',
                              value: 'contactField',
                          },
                          {
                              name: 'Contact Tag',
                              value: 'contactTag',
                          },
                          {
                              name: 'Conversation',
                              value: 'conversation',
                          },
                          {
                              name: 'Conversation Message',
                              value: 'conversationMessage',
                          },
                          {
                              name: 'Journal Entry',
                              value: 'journalEntry',
                          },
                          {
                              name: 'Note',
                              value: 'note',
                          },
                          {
                              name: 'Reminder',
                              value: 'reminder',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                      ],
                      default: 'contact',
                  },
                  ...descriptions_1.activityOperations,
                  ...descriptions_1.activityFields,
                  ...descriptions_1.callOperations,
                  ...descriptions_1.callFields,
                  ...descriptions_1.contactOperations,
                  ...descriptions_1.contactFields,
                  ...descriptions_1.contactFieldOperations,
                  ...descriptions_1.contactFieldFields,
                  ...descriptions_1.contactTagOperations,
                  ...descriptions_1.contactTagFields,
                  ...descriptions_1.conversationOperations,
                  ...descriptions_1.conversationFields,
                  ...descriptions_1.conversationMessageOperations,
                  ...descriptions_1.conversationMessageFields,
                  ...descriptions_1.journalEntryOperations,
                  ...descriptions_1.journalEntryFields,
                  ...descriptions_1.noteOperations,
                  ...descriptions_1.noteFields,
                  ...descriptions_1.reminderOperations,
                  ...descriptions_1.reminderFields,
                  ...descriptions_1.tagOperations,
                  ...descriptions_1.tagFields,
                  ...descriptions_1.taskOperations,
                  ...descriptions_1.taskFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getActivityTypes() {
                      const responseData = (await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', '/activitytypes'));
                      return (0, GenericFunctions_1.toOptions)(responseData);
                  },
                  async getTagsToAdd() {
                      const responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/tags', {}, {}, { forLoader: true });
                      return responseData.map(({ name }) => ({ value: name, name }));
                  },
                  async getTagsToRemove() {
                      const responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/tags', {}, {}, { forLoader: true });
                      return responseData.map(({ id, name }) => ({ value: id, name }));
                  },
                  async getContactFieldTypes() {
                      const responseData = (await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', '/contactfieldtypes'));
                      return (0, GenericFunctions_1.toOptions)(responseData);
                  },
                  async getGenders() {
                      const responseData = (await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', '/genders'));
                      return (0, GenericFunctions_1.toOptions)(responseData);
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'activity') {
                      if (operation === 'create') {
                          const contacts = this.getNodeParameter('contacts', i);
                          const happenedAt = this.getNodeParameter('happenedAt', i);
                          const body = {
                              activity_type_id: this.getNodeParameter('activityTypeId', i),
                              contacts: contacts.split(','),
                              happened_at: happenedAt.split('T')[0],
                              summary: this.getNodeParameter('summary', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/activities', body);
                      }
                      else if (operation === 'delete') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const endpoint = `/activities/${activityId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const endpoint = `/activities/${activityId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const endpoint = '/activities';
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/activities/${activityId}`);
                          const body = {
                              activity_type_id: data.activity_type.id,
                              contacts: data.attendees.contacts.map((contact) => contact.id),
                              happened_at: data.happened_at,
                              summary: data.summary,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          body.happened_at = body.happened_at.split('T')[0];
                          if (typeof body.contacts === 'string') {
                              body.contacts = body.contacts.split(',');
                          }
                          const endpoint = `/activities/${activityId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'call') {
                      if (operation === 'create') {
                          const body = {
                              called_at: this.getNodeParameter('calledAt', i),
                              contact_id: this.getNodeParameter('contactId', i),
                              content: this.getNodeParameter('content', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/calls', body);
                      }
                      else if (operation === 'delete') {
                          const callId = this.getNodeParameter('callId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/calls/${callId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const callId = this.getNodeParameter('callId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/calls/${callId}`);
                      }
                      else if (operation === 'getAll') {
                          const endpoint = '/calls';
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const callId = this.getNodeParameter('callId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/calls/${callId}`);
                          const body = {
                              called_at: data.called_at,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/calls/${callId}`, body);
                      }
                  }
                  else if (resource === 'contact') {
                      if (operation === 'create') {
                          const body = {
                              first_name: this.getNodeParameter('firstName', i),
                              gender_id: this.getNodeParameter('genderId', i),
                          };
                          const { isDeceased = false, deceasedDate, birthdate, ...rest } = this.getNodeParameter('additionalFields', i);
                          body.is_birthdate_known = false;
                          body.is_deceased = isDeceased;
                          body.is_deceased_date_known = false;
                          if (birthdate) {
                              body.is_birthdate_known = true;
                              const [day, month, year] = (0, GenericFunctions_1.getDateParts)(birthdate);
                              body.birthdate_day = day;
                              body.birthdate_month = month;
                              body.birthdate_year = year;
                          }
                          if (deceasedDate) {
                              body.is_deceased = true;
                              body.is_deceased_date_known = true;
                              const [day, month, year] = (0, GenericFunctions_1.getDateParts)(deceasedDate);
                              body.deceased_date_day = day;
                              body.deceased_date_month = month;
                              body.deceased_date_year = year;
                          }
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/contacts', body);
                      }
                      else if (operation === 'delete') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contacts/${contactId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contacts/${contactId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/contacts', {}, qs);
                      }
                      else if (operation === 'update') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/contacts/${contactId}`);
                          const body = {
                              first_name: data.first_name,
                          };
                          const { is_deaceased = false, deceased_date, birthdate, ...rest } = this.getNodeParameter('updateFields', i);
                          body.is_birthdate_known = false;
                          body.is_deceased = is_deaceased;
                          body.is_deceased_date_known = false;
                          if (birthdate) {
                              body.is_birthdate_known = true;
                              const [day, month, year] = (0, GenericFunctions_1.getDateParts)(birthdate);
                              body.birthdate_day = day;
                              body.birthdate_month = month;
                              body.birthdate_year = year;
                          }
                          if (deceased_date) {
                              body.is_deceased = true;
                              body.is_deceased_date_known = true;
                              const [day, month, year] = (0, GenericFunctions_1.getDateParts)(deceased_date);
                              body.deceased_date_day = day;
                              body.deceased_date_month = month;
                              body.deceased_date_year = year;
                          }
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          const endpoint = `/contacts/${contactId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'contactField') {
                      if (operation === 'create') {
                          const body = {
                              contact_field_type_id: this.getNodeParameter('contactFieldTypeId', i),
                              contact_id: this.getNodeParameter('contactId', i),
                              data: this.getNodeParameter('data', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/contactfields', body);
                      }
                      else if (operation === 'delete') {
                          const contactFieldId = this.getNodeParameter('contactFieldId', i);
                          const endpoint = `/contactfields/${contactFieldId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const contactFieldId = this.getNodeParameter('contactFieldId', i);
                          const endpoint = `/contactfields/${contactFieldId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contact/${contactId}/contactfields`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const body = {
                              contact_field_type_id: this.getNodeParameter('contactFieldTypeId', i),
                              contact_id: this.getNodeParameter('contactId', i),
                              data: this.getNodeParameter('data', i),
                          };
                          const contactFieldId = this.getNodeParameter('contactFieldId', i);
                          const endpoint = `/contactfields/${contactFieldId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'contactTag') {
                      if (operation === 'add') {
                          const body = {
                              tags: this.getNodeParameter('tagsToAdd', i),
                          };
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contacts/${contactId}/setTags`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', endpoint, body);
                      }
                      else if (operation === 'remove') {
                          const body = {
                              tags: this.getNodeParameter('tagsToRemove', i),
                          };
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contacts/${contactId}/unsetTag`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', endpoint, body);
                      }
                  }
                  else if (resource === 'conversation') {
                      if (operation === 'create') {
                          const body = {
                              contact_field_type_id: this.getNodeParameter('contactFieldTypeId', i),
                              contact_id: this.getNodeParameter('contactId', i),
                              happened_at: this.getNodeParameter('happenedAt', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/conversations', body);
                      }
                      else if (operation === 'delete') {
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const endpoint = `/conversations/${conversationId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const endpoint = `/conversations/${conversationId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const body = {
                              contact_field_type_id: this.getNodeParameter('contactFieldTypeId', i),
                              happened_at: this.getNodeParameter('happenedAt', i),
                          };
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const endpoint = `/conversations/${conversationId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'conversationMessage') {
                      if (operation === 'add') {
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const endpoint = `/conversations/${conversationId}/messages`;
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/conversations/${conversationId}`);
                          const body = {
                              contact_id: data.contact.id,
                              content: this.getNodeParameter('content', i),
                              written_at: this.getNodeParameter('writtenAt', i),
                              written_by_me: this.getNodeParameter('writtenByMe', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', endpoint, body);
                      }
                      else if (operation === 'update') {
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const messageId = this.getNodeParameter('messageId', i);
                          const endpoint = `/conversations/${conversationId}/messages/${messageId}`;
                          const updateFields = this.getNodeParameter('updateFields', i, {});
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/conversations/${conversationId}`);
                          const message = data.messages.filter((entry) => entry.id === parseInt(messageId, 10))[0];
                          const body = {
                              contact_id: data.contact.id,
                              content: message.content,
                              written_at: message.written_at,
                              written_by_me: message.written_by_me,
                          };
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'journalEntry') {
                      if (operation === 'create') {
                          const body = {
                              title: this.getNodeParameter('title', i),
                              post: this.getNodeParameter('post', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/journal', body);
                      }
                      else if (operation === 'delete') {
                          const journalId = this.getNodeParameter('journalId', i);
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/journal/${journalId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const journalId = this.getNodeParameter('journalId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/journal/${journalId}`);
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/journal');
                      }
                      else if (operation === 'update') {
                          const journalId = this.getNodeParameter('journalId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/journal/${journalId}`);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              post: data.post,
                              title: data.title,
                          };
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/journal/${journalId}`, body);
                      }
                  }
                  else if (resource === 'note') {
                      if (operation === 'create') {
                          const body = {
                              body: this.getNodeParameter('body', i),
                              contact_id: this.getNodeParameter('contactId', i),
                          };
                          body.is_favorited = this.getNodeParameter('additionalFields.isFavorited', i, false);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/notes', body);
                      }
                      else if (operation === 'delete') {
                          const noteId = this.getNodeParameter('noteId', i);
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/notes/${noteId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const noteId = this.getNodeParameter('noteId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/notes/${noteId}`);
                      }
                      else if (operation === 'getAll') {
                          const endpoint = '/notes';
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const noteId = this.getNodeParameter('noteId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/notes/${noteId}`);
                          const body = {
                              body: data.body,
                              contact_id: data.contact.id,
                          };
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/notes/${noteId}`, body);
                      }
                  }
                  else if (resource === 'reminder') {
                      if (operation === 'create') {
                          const initialDate = this.getNodeParameter('initialDate', i);
                          const body = {
                              contact_id: this.getNodeParameter('contactId', i),
                              frequency_type: this.getNodeParameter('frequencyType', i),
                              frequency_number: this.getNodeParameter('frequencyNumber', i, 1),
                              initial_date: initialDate.split('T')[0],
                              title: this.getNodeParameter('title', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/reminders', body);
                      }
                      else if (operation === 'delete') {
                          const reminderId = this.getNodeParameter('reminderId', i);
                          const endpoint = `/reminders/${reminderId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const reminderId = this.getNodeParameter('reminderId', i);
                          const endpoint = `/reminders/${reminderId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/reminders');
                      }
                      else if (operation === 'update') {
                          const reminderId = this.getNodeParameter('reminderId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/reminders/${reminderId}`);
                          const body = {
                              contact_id: data.contact.id,
                              frequency_type: data.frequency_type,
                              frequency_number: data.frequency_number,
                              initial_date: data.initial_date,
                              title: data.title,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          body.initial_date = body.initial_date.split('T')[0];
                          const endpoint = `/reminders/${reminderId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'tag') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/tags', body);
                      }
                      else if (operation === 'delete') {
                          const tagId = this.getNodeParameter('tagId', i);
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/tags/${tagId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const tagId = this.getNodeParameter('tagId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/tags/${tagId}`);
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/tags');
                      }
                      else if (operation === 'update') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const tagId = this.getNodeParameter('tagId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/tags/${tagId}`, body);
                      }
                  }
                  else if (resource === 'task') {
                      if (operation === 'create') {
                          const body = {
                              contact_id: this.getNodeParameter('contactId', i),
                              title: this.getNodeParameter('title', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/tasks', body);
                      }
                      else if (operation === 'delete') {
                          const taskId = this.getNodeParameter('taskId', i);
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/tasks/${taskId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/tasks/${taskId}`);
                      }
                      else if (operation === 'getAll') {
                          const endpoint = '/tasks';
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const taskId = this.getNodeParameter('taskId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/tasks/${taskId}`);
                          const body = {
                              contact_id: data.contact.id,
                              title: data.title,
                              completed: data.completed,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/tasks/${taskId}`, 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;
              }
              if (['create', 'get', 'update', 'add'].includes(operation)) {
                  responseData = responseData.data;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.MonicaCrm = MonicaCrm;
  //# sourceMappingURL=MonicaCrm.node.js.map

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

  # Monica CRM node

  Use the Monica CRM node to automate work in Monica CRM, and integrate Monica CRM with other applications. n8n has built-in support for a wide range of Monica CRM features, including creating, updating, deleting, and getting activities, calls, contracts, messages, tasks, and notes. 

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

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

  ## Operations

  * Activity
      * Create an activity
      * Delete an activity
      * Retrieve an activity
      * Retrieve all activities
      * Update an activity
  * Call
      * Create a call
      * Delete a call
      * Retrieve a call
      * Retrieve all calls
      * Update a call
  * Contact
      * Create a contact
      * Delete a contact
      * Retrieve a contact
      * Retrieve all contacts
      * Update a contact
  * Contact Field
      * Create a contact field
      * Delete a contact field
      * Retrieve a contact field
      * Update a contact field
  * Contact Tag
      * Add
      * Remove
  * Conversation
      * Create a conversation
      * Delete a conversation
      * Retrieve a conversation
      * Update a conversation
  * Conversation Message
      * Add a message to a conversation
      * Update a message in a conversation
  * Journal Entry
      * Create a journal entry
      * Delete a journal entry
      * Retrieve a journal entry
      * Retrieve all journal entries
      * Update a journal entry
  * Note
      * Create a note
      * Delete a note
      * Retrieve a note
      * Retrieve all notes
      * Update a note
  * Reminder
      * Create a reminder
      * Delete a reminder
      * Retrieve a reminder
      * Retrieve all reminders
      * Update a reminder
  * Tag
      * Create a tag
      * Delete a tag
      * Retrieve a tag
      * Retrieve all tags
      * Update a tag
  * Task
      * Create a task
      * Delete a task
      * Retrieve a task
      * Retrieve all tasks
      * Update a task

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"532bbb30-38bb-44f3-b355-f46852a7b086","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"7b80dfe1be0c65a69e332d6a4fdc7f473d22b9ed50f103abb9ff963917a78974"}}


