# nodes

node_type: n8n-nodes-base.MessageBird
name: MessageBird
display_name: MessageBird
description: Sends SMS via MessageBird
category: Other
code_hash: faf1b5016a688104f7c30fde0b8b2b93731a2df58937aad8efc85e0be6ece42c
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/messagebird
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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 credentials
  description: Documentation for MessageBird credentials. Use these credentials to authenticate MessageBird in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # MessageBird credentials

  You can use these credentials to authenticate the following nodes:

  - [MessageBird](/integrations/builtin/app-nodes/n8n-nodes-base.messagebird.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: To generate an appropriate key, visit the [Access keys](https://app.bird.com/settings/access-keys){:target=_blank .external-link} page in MessageBird. Refer to the [API authorization documentation](https://docs.bird.com/api/api-access/api-authorization){:target=_blank .external-link} for detailed instructions. 

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"c75b0f18-9688-4dec-9918-c8528d86cdf8","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"2855c6637959fea432157aa6085ef992dc0a105b064e1f3a8fbeb133494c063a"}}


node_type: n8n-nodes-base.Metabase
name: Metabase
display_name: Metabase
description: Use the Metabase API
category: Other
code_hash: 629de446f4ba15b8957d92fa93685d006e99cb0fee1e36c14a0e40ceeaf99abd
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/metabase
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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 credentials
  description: Documentation for Metabase credentials. Use these credentials to authenticate Metabase in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Metabase credentials

  You can use these credentials to authenticate the following nodes:

  - [Metabase node](/integrations/builtin/app-nodes/n8n-nodes-base.metabase.md)

  ## Prerequisites

  Create a [Metabase](https://www.metabase.com/){:target=_blank .external-link} account with access to a Metabase instance.

  ## Supported authentication methods

  - Basic auth

  ## Related resources

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

  ## Using basic auth

  To configure this credential, you'll need:

  - A **URL**: Enter the base URL of your Metabase instance. If you're using a custom domain, use that URL.
  - A **Username**: Enter your Metabase username.
  - A **Password**: Enter your Metabase password.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"1c1f3d47-e094-4d82-80ea-03423f7f0541","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"c36a4fd0ef9ee0f3170ec7320696ffdef638ed9b211bb30a014e511544370396"}}


node_type: n8n-nodes-base.Mindee
name: Mindee
display_name: Mindee
description: Consume Mindee API
category: Other
code_hash: e1b1546baf295f10ce7fdfc174b3cd8ef000536f32d745f5b0220db885ec1fa2
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mindee
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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 credentials
  description: Documentation for Mindee credentials. Use these credentials to authenticate Mindee in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Mindee credentials

  You can use these credentials to authenticate the following nodes:

  - [Mindee](/integrations/builtin/app-nodes/n8n-nodes-base.mindee.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - Invoice API key: For use with the [Invoice OCR API](https://www.mindee.com/product/invoice-ocr-api){:target=_blank .external-link}
  - Receipt API key: For use with the [Receipt OCR API](https://www.mindee.com/product/receipt-ocr-api-copy){:target=_blank .external-link}

  ## Related resources

  Refer to [Mindee's Invoice OCR API documentation](https://developers.mindee.com/docs/invoice-ocr){:target=_blank .external-link} and [Mindee's Receipt OCR API documentation](https://developers.mindee.com/docs/receipt-ocr){:target=_blank .external-link} for more information about each service.

  ## Using invoice API key

  To configure this credential, you'll need:

  - An **API Key**: Refer to the Mindee [Create & Manage API Keys documentation](https://developers.mindee.com/docs/create-api-key){:target=_blank .external-link} for instructions on creating API keys.

  ## Using receipt API key

  To configure this credential, you'll need:

  - An **API Key**: Refer to the Mindee [Create & Manage API Keys documentation](https://developers.mindee.com/docs/create-api-key){:target=_blank .external-link} for instructions on creating API keys.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"79de613a-5270-4f9c-92fc-9f055387102d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"26199a4596fb8c841b1c0008baf2e585aa3aeabf45cd492b88b7f5166f9b948a"}}


node_type: n8n-nodes-base.MoveBinaryData
name: MoveBinaryData
display_name: Convert to/from binary data
description: Move data between binary and JSON properties
category: Other
code_hash: ab3fdb9328e05205e42d286ec989c12c8f2379707d331ec8ad0731004bdbbd48
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  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":"48b74d59-6629-45ca-bcb4-9e8078b4dc1a","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"e7fe1266a9f2e9ef625cd03aa3b6e3dc00c41f9dfc285dbb61b31dc361ce374e"}}


node_type: n8n-nodes-base.Misp
name: Misp
display_name: MISP
description: Consume the MISP API
category: Other
code_hash: 70ea7dbd5226d92f7c70290d0f29ecb75282633ded988db37a2b68e5f40404bd
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/misp
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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 credentials
  description: Documentation for MISP credentials. Use these credentials to authenticate MISP in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # MISP credentials

  You can use these credentials to authenticate the following nodes:

  - [MISP](/integrations/builtin/app-nodes/n8n-nodes-base.misp.md)

  ## Prerequisites

  Install and run a [MISP](https://misp.github.io/MISP/){:target=_blank .external-link} instance.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [MISP's Automation API documentation](https://www.circl.lu/doc/misp/automation){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: In MISP, these are called Automation keys. Get an automation key from **Event Actions > Automation**. Refer to [MISP's automation keys documentation](https://www.circl.lu/doc/misp/automation/#automation-key){:target=_blank .external-link} for instructions on generating more keys.
  - A **Base URL**: Your MISP URL.
  - Select whether to **Allow Unauthorized Certificates**: If turned on, the credential will connect even if SSL certificate validation fails.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"f82cb574-bcc4-43aa-9454-eb9234473b37","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"f2ff0ce76266d849350bb2a185c2b206bc3913561846e815cdbeb3d2b163722f"}}


node_type: n8n-nodes-base.Mocean
name: Mocean
display_name: Mocean
description: Send SMS and voice messages via Mocean
category: Other
code_hash: bdddaf8866b35055676200185cbfc23b07a661b4300009e3eeacb5ce74fc057e
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mocean
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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 credentials
  description: Documentation for Mocean credentials. Use these credentials to authenticate Mocean in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Mocean credentials

  You can use these credentials to authenticate the following nodes:

  - [Mocean](/integrations/builtin/app-nodes/n8n-nodes-base.mocean.md)

  ## Prerequisites

  Create a [Mocean](https://moceanapi.com/) account.

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

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

  Both the key and secret are accessible in your Mocean [Dashboard](https://dashboard.moceanapi.com/). Refer to [API Authentication](https://moceanapi.com/docs/#authentication){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"dbc1baab-0f26-4817-909b-d5e2badfd3c0","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"c6a07f7faf2842cc8674a633306516a389774c5e1c3125e17170e8fe2c335c4d"}}


node_type: n8n-nodes-base.MondayCom
name: MondayCom
display_name: Monday.com
description: Consume Monday.com API
category: Other
code_hash: 2d6d2778a0bd18f40f8fe7d6ba9d6fe081f822e1491320263604668ca13d5bb3
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mondaycom
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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 credentials
  description: Documentation for monday.com credentials. Use these credentials to authenticate monday.com in n8n, a workflow automation platform.
  contentType: [integration, reference]
  priority: medium
  ---

  # monday.com credentials

  You can use these credentials to authenticate the following nodes:

  - [monday.com](/integrations/builtin/app-nodes/n8n-nodes-base.mondaycom.md)

  /// info | Minimum required version
  The monday.com node requires n8n version 1.22.6 or above.
  ///

  ## Supported authentication methods

  - API token
  - OAuth2

  ## Related resources

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

  ## Using API token

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

  - An API **Token V2**

  To get your token:

  1. In your monday.com account, select your profile picture in the top right corner.
  2. Select **Developers**. The Developer Center opens in a new tab.
  3. In the Developer Center, select **My Access Tokens > Show**.
  4. Copy your personal token and enter it in your n8n credential as the **Token V2**.

  Refer to [monday.com API Authentication](https://developer.monday.com/api-reference/docs/authentication){:target=_blank .external-link} for more information.

  ## Using OAuth2

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

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

  To generate both these fields, register a new monday.com application:

  1. In your monday.com account, select your profile picture in the top right corner.
  2. Select **Developers**. The Developer Center opens in a new tab.
  3. In the Developer Center, select **Build app**. The app details open.
  4. Enter a **Name** for your app, like `n8n integration`.
  5. Copy the **Client ID** and enter it in your n8n credential.
  6. **Show** the **Client Secret**, copy it, and enter it in your n8n credential.
  7. In the left menu, select **OAuth**.
  8. For **Scopes**, select `boards:write` and `boards:read`.
  9. Select **Save Scopes**.
  10. Select the **Redirect URLs** tab.
  11. Copy the **OAuth Redirect URL** from n8n and enter it as the **Redirect URL**.
  12. **Save** your changes in monday.com.
  13. In n8n, select **Connect my account** to finish the setup.

   Refer to [Create an app](https://developer.monday.com/apps/docs/create-an-app){:target=_blank .external-link} for more information on creating apps.
   
   Refer to [OAuth and permissions](https://developer.monday.com/apps/docs/oauth){:target=_blank .external-link} for more information on the available scopes and setting up the Redirect URL.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"dc098f7a-07c6-496b-bedf-866e38e6c3eb","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"4ada12c84ce1b7142d15e6241d9272e08813902aa2a076dc02dc32b9a395c3de"}}


node_type: n8n-nodes-base.MongoDb
name: MongoDb
display_name: MongoDB
description: Find, insert and update documents in MongoDB
category: Other
code_hash: b2ba16dd51375f7dbee76439f8443f7c8377528cce99ef36d8b45f549e6b6471
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mongodb
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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 credentials
  description: Documentation for MongoDB credentials. Use these credentials to authenticate MongoDB in n8n, a workflow automation platform.
  contentType: [integration, reference]
  priority: medium
  ---

  # MongoDB credentials

  You can use these credentials to authenticate the following nodes:

  - [MongoDB](/integrations/builtin/app-nodes/n8n-nodes-base.mongodb.md)
  - [MongoDB Atlas Vector Store](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoremongodbatlas.md)
  - [MongoDB Chat Memory](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorymongochat.md)

  ## Prerequisites

  - Create a user account with the appropriate permissions on a [MongoDB](https://www.mongodb.com/){:target=_blank .external-link} server.
  - As a Project Owner, add all the [n8n IP addresses](/manage-cloud/cloud-ip.md) to the IP Access List Entries in the project's **Network Access**. Refer to [Add IP Access List entries](https://www.mongodb.com/docs/atlas/security/ip-access-list/#add-ip-access-list-entries){:target=_blank .external-link} for detailed instructions.

  If you are setting up MongoDB from scratch, create a cluster and a database. Refer to the [MongoDB Atlas documentation](https://www.mongodb.com/docs/atlas/){:target=_blank .external-link} for more detailed instructions on these steps.

  ## Supported authentication methods

  - Database connection - Connection string
  - Database connection - Values

  ## Related resources

  Refer to the [MongoDBs Atlas documentation](https://www.mongodb.com/docs/atlas/){:target=_blank .external-link} for more information about the service.

  ## Using database connection - Connection string

  To configure this credential, you'll need the [Prerequisites](#prerequisites) listed above. Then:

  1. Select **Connection String** as the **Configuration Type**.
  2. Enter your MongoDB **Connection String**. To get your connection string in MongoDB, go to **Database > Connect**.
      1. Select **Drivers**.
      2. Copy the code you see in **Add your connection string into your application code**. It will be something like: `mongodb+srv://yourName:yourPassword@clusterName.mongodb.net/?retryWrites=true&w=majority`.
      3. Replace the `<password>` and `<username>` in the connection string with the database user's credentials you'll be using.
      4. Enter that connection string into n8n.
      5. Refer to [Connection String](https://www.mongodb.com/docs/manual/reference/connection-string/){:target=_blank .external-link} for information on finding and formatting your connection string.
  3. Enter your **Database** name. This is the name of the database that the user whose details you added to the connection string is logging into.
  4. Select whether to **Use TLS**: Turn on to use TLS. You must have your MongoDB database configured to use TLS and have an x.509 certificate generated. Add information for these certificate fields in n8n:
      - **CA Certificate**
      - **Public Client Certificate**
      - **Private Client Key**
      - **Passphrase**

  Refer to [MongoDB's x.509 documentation](https://www.mongodb.com/docs/manual/core/security-x.509/#std-label-client-x509-certificates-requirements) for more information on working with x.509 certificates.

  ## Using database connection - Values

  To configure this credential, you'll need the [Prerequisites](#prerequisites) listed above. Then:

  1. Select **Values** as the **Configuration Type**.
  2. Enter the database **Host** name or address.
  3. Enter the **Database** name.
  4. Enter the **User** you'd like to log in as.
  5. Enter the user's **Password**.
  6. Enter the **Port** to connect over. This is the port number your server uses to listen for incoming connections.
  7. Select whether to **Use TLS**: Turn on to use TLS. You must have your MongoDB database configured to use TLS and have an x.509 certificate generated. Add information for these certificate fields in n8n:
      - **CA Certificate**
      - **Public Client Certificate**
      - **Private Client Key**
      - **Passphrase**

  Refer to [MongoDB's x.509 documentation](https://www.mongodb.com/docs/manual/core/security-x.509/#std-label-client-x509-certificates-requirements) for more information on working with x.509 certificates.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"767ea53c-32cf-4c3d-b6b0-5c113f2b90db","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"50028376434b24dca4ada757619abbbf9de0961e2be476daf7a218212013ff2d"}}


node_type: n8n-nodes-base.MonicaCrm
name: MonicaCrm
display_name: Monica CRM
description: Consume the Monica CRM API
category: Other
code_hash: 0db18b80574c5a1563944176ada3f2416c35261c67a5e76e2b90db7993bcbf90
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/monicacrm
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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 credentials
  description: Documentation for Monica CRM credentials. Use these credentials to authenticate Monica CRM in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Monica CRM credentials

  You can use these credentials to authenticate the following nodes:

  - [Monica CRM](/integrations/builtin/app-nodes/n8n-nodes-base.monicacrm.md)

  ## Prerequisites

  Sign up for a [Monica CRM](https://www.monicahq.com/){:target=_blank .external-link} account or self-host an instance.

  ## Supported authentication methods

  - API token

  ## Related resources

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

  ## Using API token

  To configure this credential, you'll need:

  - Your **Environment**:
      - Select **Cloud-Hosted** if you access your Monica instance through Monica.
      - Select **Self-Hosted** if you have self-hosted Monica on your own server. Provide your **Self-Hosted Domain**.
  - An **API Token**: Generate a token in **Settings > API**.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b2f27613-c19f-4a20-84fd-b552fc840950","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"41d5a0aec2dabe4db3b3b00ffcbae0dcd02febbbd75c7ccb9e6b00f0af0386a2"}}


node_type: n8n-nodes-base.Msg91
name: Msg91
display_name: MSG91
description: Sends transactional SMS via MSG91
category: Other
code_hash: 2f2d50fba570ecb3206112e2444333e5650effbec0b672b39030df8621bfce89
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/msg91
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Msg91 = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Msg91 {
      constructor() {
          this.description = {
              displayName: 'MSG91',
              name: 'msg91',
              icon: 'file:msg91.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends transactional SMS via MSG91',
              defaults: {
                  name: 'MSG91',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'msg91Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                      ],
                      default: 'sms',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send SMS',
                              action: 'Send an SMS',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'Sender ID',
                      name: 'from',
                      type: 'string',
                      default: '',
                      placeholder: '4155238886',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The number from which to send the message',
                  },
                  {
                      displayName: 'To',
                      name: 'to',
                      type: 'string',
                      default: '',
                      placeholder: '+14155238886',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The number, with coutry code, to which to send the message',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The message to send',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let operation;
          let resource;
          let body;
          let qs;
          let requestMethod;
          let endpoint;
          for (let i = 0; i < items.length; i++) {
              endpoint = '';
              body = {};
              qs = {};
              resource = this.getNodeParameter('resource', i);
              operation = this.getNodeParameter('operation', i);
              if (resource === 'sms') {
                  if (operation === 'send') {
                      requestMethod = 'GET';
                      endpoint = '/sendhttp.php';
                      qs.route = 4;
                      qs.country = 0;
                      qs.sender = this.getNodeParameter('from', i);
                      qs.mobiles = this.getNodeParameter('to', i);
                      qs.message = this.getNodeParameter('message', i);
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                  }
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                      itemIndex: i,
                  });
              }
              const responseData = await GenericFunctions_1.msg91ApiRequest.call(this, requestMethod, endpoint, body, qs);
              returnData.push({ requestId: responseData });
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Msg91 = Msg91;
  //# sourceMappingURL=Msg91.node.js.map

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

  # MSG91 credentials

  You can use these credentials to authenticate the following nodes:

  - [MSG91](/integrations/builtin/app-nodes/n8n-nodes-base.msg91.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **Authentication Key**: To get your Authentication Key, go to the user menu and select **Authkey**. Refer to MSG91's [Where can I find my authentication key? documentation](https://msg91.com/help/where-can-i-find-my-authentication-key){:target=_blank .external-link} for more information.

  ## IP Security

  MSG91 enables [IP Security](https://msg91.com/help/what-do-you-mean-by-api-security){:target=_blank .external-link} by default for authkeys.

  For the n8n credentials to function with this setting enabled, add all the [n8n IP addresses](/manage-cloud/cloud-ip.md) as whitelisted IPs in MSG91. You can add them in one of two places, depending on your desired security level:

  - To allow any/all authkeys in the account to work with n8n, add the n8n IP addresses in the **Company's whitelisted IPs** section of the **Authkey** page.
  - To allow only specific authkeys to work with n8n, add the n8n IP addresses in the **Whitelisted IPs** section of an authkey's details.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"c6b6c528-df71-4ba6-ab1b-1c9995c31942","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"dc82c48c9a2cbfb037fd183ba5ba7a3b5a271af320330231f15af5b5df36c464"}}


node_type: n8n-nodes-base.MySql
name: MySql
display_name: MySQL
description: Get, add and update data in MySQL
category: Other
code_hash: c632d9b472738f3cd1ce6ce0231920d56e6b160054dbd6ff4f5b38505f8003bb
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/mysql
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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

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

  # MySQL credentials

  You can use these credentials to authenticate the following nodes:

  - [MySQL](/integrations/builtin/app-nodes/n8n-nodes-base.mysql/index.md)
  - [Agent](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/index.md)

  /// note | Agent node users
  The Agent node doesn't support SSH tunnels.
  ///

  ## Prerequisites

  Create a user account on a [MySQL](https://www.mysql.com/){:target=_blank .external-link} server database.

  ## Supported authentication methods

  - Database connection

  ## Related resources

  Refer to [MySQL's documentation](https://dev.mysql.com/doc/refman/8.3/en/){:target=_blank .external-link} for more information about the service.

  ## Using database connection

  To configure this credential, you'll need:

  - The server **Host**: The database's host name or IP address.
  - The **Database** name.
  - A **User** name.
  - A **Password** for that user.
  - The **Port** number used by the MySQL server.
  - **Connect Timeout**: The number of milliseconds during the initial database connection before a timeout occurs.
  - **SSL**: If your database is using SSL, turn this on and add details for the SSL certificate.
  - **SSH Tunnel**: Choose whether to connect over an SSH tunnel. An SSH tunnel lets un-encrypted traffic pass over an encrypted connection and enables authorized remote access to servers protected from outside connections by a firewall.

  To set up your database connection credential:

  1. Enter your database's hostname as the **Host** in your n8n credential. Run this query to confirm the hostname:

      ```
      SHOW VARIABLES WHERE Variable_name = 'hostname';
      ```

  2. Enter your database's name as the **Database** in your n8n credential. Run this query to confirm the database name:

      ```
      SHOW DATABASES;
      ```

  3. Enter the username of a **User** in the database. This user should have appropriate permissions for whatever actions you want n8n to perform.
  4. Enter the **Password** for that user.
  5. Enter the **Port** number used by the MySQL server (default is `3306`). Run this query to confirm the port number:

      ```
      SHOW VARIABLES WHERE Variable_name = 'port';
      ```

  6. Enter the **Connect Timeout** you'd like the node to use. The Connect Timeout is the number of milliseconds during the initial database connection the node should wait before timing out. n8n defaults to `10000` which is the default used by MySQL of 10 seconds. If you want to match your database's `connect_timeout`, run this query to get it, then multiply by 1000 before entering it in n8n:

      ```
      SHOW VARIABLES WHERE Variable_name = 'connect_timeout';
      ```

  7. If your database uses SSL and you'd like to use **SSL** for the connection, turn this option on in the credential. If you turn it on, enter the information from your MySQL SSL certificate in these fields:
      1. Enter the `ca.pem` file contents in the **CA Certificate** field.
      2. Enter the `client-key.pem` file contents in the **Client Private Key** field.
      3. Enter the `client-cert.pem` file contents in the **Client Certificate** field.
  8. If you want to use **SSH Tunnel** for the connection, turn this option on in the credential. Otherwise, skip it. If you turn it on:
      1. Select the **SSH Authenticate with** to set the SSH Tunnel type to build:
          - Select **Password** if you want to connect to SSH using a password.
          - Select **Private Key** if you want to connect to SSH using an identity file (private key) and a passphrase. 
      2. Enter the **SSH Host**. n8n uses this host to create the SSH URI formatted as: `[user@]host:port`.
      3. Enter the **SSH Port**. n8n uses this port to create the SSH URI formatted as: `[user@]host:port`.
      4. Enter the **SSH User** to connect with. n8n uses this user to create the SSH URI formatted as: `[user@]host:port`.
      5. If you selected **Password** for **SSH Authenticate with**, add the **SSH Password**.
      6. If you selected **Private Key** for **SSH Authenticate with**:
          1. Add the contents of the **Private Key** or identity file used for SSH. This is the same as using the `ssh-identity-file` option with the `shell-connect()` command in MySQL.
          2. If the **Private Key** was created with a passphrase, enter that **Passphrase**. This is the same as using the `ssh-identity-pass` option with the `shell-connect()` command in MySQL. If the **Private Key** has no passphrase, leave this field blank.

  Refer to [MySQL | Creating SSL and RSA Certificates and Keys](https://dev.mysql.com/doc/refman/8.0/en/creating-ssl-rsa-files.html){:target=_blank .external-link} for more information on working with SSL certificates in MySQL. Refer to [MySQL | Using an SSH Tunnel](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-connection-ssh.html){:target=_blank .external-link} for more information on working with SSH tunnels in MySQL.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"138b9800-76a7-44ed-8616-48517959daab","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"d553a3cb361a301db4a21463e340b56b11e528d9630eea744604c8c637095055"}}


node_type: n8n-nodes-base.N8n
name: N8n
display_name: n8n
description: Handle events and perform actions on your n8n instance
category: Other
code_hash: 25e366d56d1bd2a332ffffad191bc91b827011483a2ac2e0ca54ae1573799d5f
documentation_url: https://docs.n8n.io/courses/index
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:26
updated_at: 2025-06-08 08:05:26
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.N8n = void 0;
  const AuditDescription_1 = require("./AuditDescription");
  const CredentialDescription_1 = require("./CredentialDescription");
  const ExecutionDescription_1 = require("./ExecutionDescription");
  const WorkflowDescription_1 = require("./WorkflowDescription");
  const WorkflowLocator_1 = require("./WorkflowLocator");
  class N8n {
      constructor() {
          this.description = {
              displayName: 'n8n',
              name: 'n8n',
              icon: 'file:n8n.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Handle events and perform actions on your n8n instance',
              defaults: {
                  name: 'n8n',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'n8nApi',
                      required: true,
                  },
              ],
              requestDefaults: {
                  returnFullResponse: true,
                  baseURL: '={{ $credentials.baseUrl.replace(new RegExp("/$"), "") }}',
                  headers: {
                      Accept: 'application/json',
                      'Content-Type': 'application/json',
                  },
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Audit',
                              value: 'audit',
                          },
                          {
                              name: 'Credential',
                              value: 'credential',
                          },
                          {
                              name: 'Execution',
                              value: 'execution',
                          },
                          {
                              name: 'Workflow',
                              value: 'workflow',
                          },
                      ],
                      default: 'workflow',
                  },
                  ...AuditDescription_1.auditOperations,
                  ...AuditDescription_1.auditFields,
                  ...CredentialDescription_1.credentialOperations,
                  ...CredentialDescription_1.credentialFields,
                  ...ExecutionDescription_1.executionOperations,
                  ...ExecutionDescription_1.executionFields,
                  ...WorkflowDescription_1.workflowOperations,
                  ...WorkflowDescription_1.workflowFields,
              ],
          };
          this.methods = {
              listSearch: {
                  searchWorkflows: WorkflowLocator_1.searchWorkflows,
              },
          };
      }
  }
  exports.N8n = N8n;
  //# sourceMappingURL=N8n.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Text courses
  description: Access n8n text courses. Find beginner and intermediate courses to learn how to build automation workflows using n8n. 
  contentType: overview
  ---

  # Text courses

  If you've found your way here, it means you're serious about your interest in automation. Maybe you're tired of manually entering data into the same spreadsheet every day, of clicking through a series of tabs and buttons for that one piece of information you need, of managing tens of different tools and systems.

  Whatever the reason, one thing is clear: you shouldn't spend precious time doing things that don't spark joy or contribute to your personal and professional growth.

  These tasks can and should be automated! And you don't need advanced technical knowledge or excellent coding skills to do this–with no-code tools like n8n, automation is for everyone.

  ## Available courses

  - [Level 1: Beginner course](/courses/level-one/index.md)
  - [Level 2: Intermediate course](/courses/level-two/index.md)

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"cdd16324-7e02-4306-8af4-769cb442b127","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"99e2b9b706dcd90b4000346f8518416502b6ac89e127a1a18b0f8f2cc3780cb8"}}


node_type: n8n-nodes-base.N8nTrainingCustomerMessenger
name: N8nTrainingCustomerMessenger
display_name: Customer Messenger (n8n training)
description: Dummy node used for n8n training
category: Other
code_hash: 9d9edad934e5d070c2f6c86b293bbc30e6ffe3836a7266c1abf0f68e9d89e0dc
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.n8ntrainingcustomermessenger
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.N8nTrainingCustomerMessenger = void 0;
  class N8nTrainingCustomerMessenger {
      constructor() {
          this.description = {
              displayName: 'Customer Messenger (n8n training)',
              name: 'n8nTrainingCustomerMessenger',
              icon: 'file:n8nTrainingCustomerMessenger.svg',
              group: ['transform'],
              version: 1,
              description: 'Dummy node used for n8n training',
              defaults: {
                  name: 'Customer Messenger (n8n training)',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Customer ID',
                      name: 'customerId',
                      type: 'string',
                      required: true,
                      default: '',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      required: true,
                      typeOptions: {
                          rows: 4,
                      },
                      default: '',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          for (let i = 0; i < length; i++) {
              const customerId = this.getNodeParameter('customerId', i);
              const message = this.getNodeParameter('message', i);
              responseData = { output: `Sent message to customer ${customerId}:  ${message}` };
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.N8nTrainingCustomerMessenger = N8nTrainingCustomerMessenger;
  //# sourceMappingURL=N8nTrainingCustomerMessenger.node.js.map

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

  # Customer Messenger (n8n Training) node

  Use this node only for the n8n new user onboarding tutorial. It provides no further functionality.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"37024db5-dade-4516-80a4-0168fcec3977","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"9337703135b6085e6dc91cb65204ebb53314f6e4c32eb7974478021137034e1b"}}


node_type: n8n-nodes-base.N8nTrainingCustomerDatastore
name: N8nTrainingCustomerDatastore
display_name: Customer Datastore (n8n training)
description: Dummy node used for n8n training
category: Other
code_hash: 1eace80e610dd97823a1e152f5ba5308299a1e2b8feaf724095e37ce1c7c92cc
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.n8ntrainingcustomerdatastore
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.N8nTrainingCustomerDatastore = void 0;
  const data = [
      {
          id: '23423532',
          name: 'Jay Gatsby',
          email: 'gatsby@west-egg.com',
          notes: 'Keeps asking about a green light??',
          country: 'US',
          created: '1925-04-10',
      },
      {
          id: '23423533',
          name: 'José Arcadio Buendía',
          email: 'jab@macondo.co',
          notes: 'Lots of people named after him. Very confusing',
          country: 'CO',
          created: '1967-05-05',
      },
      {
          id: '23423534',
          name: 'Max Sendak',
          email: 'info@in-and-out-of-weeks.org',
          notes: 'Keeps rolling his terrible eyes',
          country: 'US',
          created: '1963-04-09',
      },
      {
          id: '23423535',
          name: 'Zaphod Beeblebrox',
          email: 'captain@heartofgold.com',
          notes: 'Felt like I was talking to more than one person',
          country: null,
          created: '1979-10-12',
      },
      {
          id: '23423536',
          name: 'Edmund Pevensie',
          email: 'edmund@narnia.gov',
          notes: 'Passionate sailor',
          country: 'UK',
          created: '1950-10-16',
      },
  ];
  class N8nTrainingCustomerDatastore {
      constructor() {
          this.description = {
              displayName: 'Customer Datastore (n8n training)',
              name: 'n8nTrainingCustomerDatastore',
              icon: 'file:n8nTrainingCustomerDatastore.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"]}}',
              description: 'Dummy node used for n8n training',
              defaults: {
                  name: 'Customer Datastore (n8n training)',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Get One Person',
                              value: 'getOnePerson',
                          },
                          {
                              name: 'Get All People',
                              value: 'getAllPeople',
                          },
                      ],
                      default: 'getOnePerson',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAllPeople'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['getAllPeople'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 10,
                      },
                      default: 5,
                      description: 'Max number of results to return',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < length; i++) {
              if (operation === 'getOnePerson') {
                  responseData = data[0];
              }
              if (operation === 'getAllPeople') {
                  const returnAll = this.getNodeParameter('returnAll', i);
                  if (returnAll) {
                      responseData = data;
                  }
                  else {
                      const limit = this.getNodeParameter('limit', i);
                      responseData = data.slice(0, limit);
                  }
              }
              if (Array.isArray(responseData)) {
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push.apply(returnData, executionData);
              }
              else if (responseData !== undefined) {
                  returnData.push({ json: responseData });
              }
          }
          return [returnData];
      }
  }
  exports.N8nTrainingCustomerDatastore = N8nTrainingCustomerDatastore;
  //# sourceMappingURL=N8nTrainingCustomerDatastore.node.js.map

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

  # Customer Datastore (n8n Training) node

  Use this node only for the n8n new user onboarding tutorial. It provides dummy data for testing purposes and has no further functionality.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"82b33ea8-a0ae-47a4-b979-febed6e1fa0a","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"362e0505c10bd03654a32a43b10b12f3f64822766a05c7f9083c108022be28ff"}}


node_type: n8n-nodes-base.N8nTrigger
name: N8nTrigger
display_name: n8n Trigger
description: Handle events and perform actions on your n8n instance
category: Other
code_hash: 49ad2807ae9b686c67c1b63651607ff4bf9d2730636ac4ee6b1ee6dac7520e05
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.n8ntrigger
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.N8nTrigger = void 0;
  class N8nTrigger {
      constructor() {
          this.description = {
              displayName: 'n8n Trigger',
              name: 'n8nTrigger',
              icon: 'file:n8nTrigger.svg',
              group: ['trigger'],
              version: 1,
              description: 'Handle events and perform actions on your n8n instance',
              eventTriggerDescription: '',
              mockManualExecution: true,
              defaults: {
                  name: 'n8n Trigger',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Events',
                      name: 'events',
                      type: 'multiOptions',
                      required: true,
                      default: [],
                      description: 'Specifies under which conditions an execution should happen: <b>Instance started</b>: Triggers when this n8n instance is started or re-started',
                      options: [
                          {
                              name: 'Instance Started',
                              value: 'init',
                              description: 'Triggers when this n8n instance is started or re-started',
                          },
                      ],
                  },
              ],
          };
      }
      async trigger() {
          const events = this.getNodeParameter('events', []);
          const activationMode = this.getActivationMode();
          if (events.includes(activationMode)) {
              let event;
              if (activationMode === 'init') {
                  event = 'Instance started';
              }
              this.emit([
                  this.helpers.returnJsonArray([
                      { event, timestamp: new Date().toISOString(), workflow_id: this.getWorkflow().id },
                  ]),
              ]);
          }
          const manualTriggerFunction = async () => {
              this.emit([
                  this.helpers.returnJsonArray([
                      {
                          event: 'Manual execution',
                          timestamp: new Date().toISOString(),
                          workflow_id: this.getWorkflow().id,
                      },
                  ]),
              ]);
          };
          return {
              manualTriggerFunction,
          };
      }
  }
  exports.N8nTrigger = N8nTrigger;
  //# sourceMappingURL=N8nTrigger.node.js.map

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

  # n8n Trigger node

  The n8n Trigger node triggers when the current workflow updates or activates, or when the n8n instance starts or restarts. You can use the n8n Trigger node to notify when these events occur.

  ## Node parameters

  The node includes a single parameter to identify the **Events** that should trigger it. Choose from these events:

  - **Active Workflow Updated**: If you select this event, the node triggers when this workflow is updated.
  - **Instance started**: If you select this event, the node triggers when the n8n instance starts or restarts.
  - **Workflow Activated**: If you select this event, the node triggers when this workflow is activated.

  You can select one or more of these events.

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"8c33a1d9-d4da-4774-9237-9d97dc325d83","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"895c0498c9d3cd5d40122c119a29fc75e06e3529269f92158ec9bf9881afc7f7"}}


node_type: n8n-nodes-base.Nasa
name: Nasa
display_name: NASA
description: Retrieve data from the NASA API
category: Other
code_hash: f7745392ff0a92efee6e82a6d34f397404666cfd4c56ac723875c1b6aa5d0589
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/nasa
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
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.Nasa = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_1 = __importDefault(require("moment"));
  class Nasa {
      constructor() {
          this.description = {
              displayName: 'NASA',
              name: 'nasa',
              icon: 'file:nasa.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}',
              description: 'Retrieve data from the NASA API',
              defaults: {
                  name: 'NASA',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'nasaApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Asteroid Neo-Browse',
                              value: 'asteroidNeoBrowse',
                          },
                          {
                              name: 'Asteroid Neo-Feed',
                              value: 'asteroidNeoFeed',
                          },
                          {
                              name: 'Asteroid Neo-Lookup',
                              value: 'asteroidNeoLookup',
                          },
                          {
                              name: 'Astronomy Picture of the Day',
                              value: 'astronomyPictureOfTheDay',
                          },
                          {
                              name: 'DONKI Coronal Mass Ejection',
                              value: 'donkiCoronalMassEjection',
                          },
                          {
                              name: 'DONKI High Speed Stream',
                              value: 'donkiHighSpeedStream',
                          },
                          {
                              name: 'DONKI Interplanetary Shock',
                              value: 'donkiInterplanetaryShock',
                          },
                          {
                              name: 'DONKI Magnetopause Crossing',
                              value: 'donkiMagnetopauseCrossing',
                          },
                          {
                              name: 'DONKI Notification',
                              value: 'donkiNotifications',
                          },
                          {
                              name: 'DONKI Radiation Belt Enhancement',
                              value: 'donkiRadiationBeltEnhancement',
                          },
                          {
                              name: 'DONKI Solar Energetic Particle',
                              value: 'donkiSolarEnergeticParticle',
                          },
                          {
                              name: 'DONKI Solar Flare',
                              value: 'donkiSolarFlare',
                          },
                          {
                              name: 'DONKI WSA+EnlilSimulation',
                              value: 'donkiWsaEnlilSimulation',
                          },
                          {
                              name: 'Earth Asset',
                              value: 'earthAssets',
                          },
                          {
                              name: 'Earth Imagery',
                              value: 'earthImagery',
                          },
                      ],
                      default: 'astronomyPictureOfTheDay',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['astronomyPictureOfTheDay'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the Astronomy Picture of the Day',
                              action: 'Get the astronomy picture of the day',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoFeed'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve a list of asteroids based on their closest approach date to Earth',
                              action: 'Get an asteroid neo feed',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoLookup'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Look up an asteroid based on its NASA SPK-ID',
                              action: 'Get an asteroid neo lookup',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoBrowse'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Browse the overall asteroid dataset',
                              action: 'Get many asteroid neos',
                          },
                      ],
                      default: 'getAll',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiCoronalMassEjection'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI coronal mass ejection data',
                              action: 'Get a DONKI coronal mass ejection',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiGeomagneticStorm'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI geomagnetic storm data',
                              action: 'Get a DONKI geomagnetic storm',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiInterplanetaryShock'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI interplanetary shock data',
                              action: 'Get a DONKI interplanetary shock',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiSolarFlare'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI solar flare data',
                              action: 'Get a DONKI solar flare',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiSolarEnergeticParticle'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI solar energetic particle data',
                              action: 'Get a DONKI solar energetic particle',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiMagnetopauseCrossing'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve data on DONKI magnetopause crossings',
                              action: 'Get a DONKI magnetopause crossing',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiRadiationBeltEnhancement'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI radiation belt enhancement data',
                              action: 'Get a DONKI radiation belt enhancement',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiHighSpeedStream'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI high speed stream data',
                              action: 'Get a DONKI high speed stream',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiWsaEnlilSimulation'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI WSA+EnlilSimulation data',
                              action: 'Get a DONKI wsa enlil simulation',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiNotifications'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI notifications data',
                              action: 'Get a DONKI notifications',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['earthImagery'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Earth imagery',
                              action: 'Get Earth imagery',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['earthAssets'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Earth assets',
                              action: 'Get Earth assets',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['inSightMarsWeatherService'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Insight Mars Weather Service data',
                              action: 'Get Insight Mars Weather Service',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['imageAndVideoLibrary'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Image and Video Library data',
                              action: 'Get image and video library data',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['techTransfer'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve TechTransfer data',
                              action: 'Get a TechTransfer data',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['twoLineElementSet'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Two-Line Element Set data',
                              action: 'Get a Two-Line Element Set',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Asteroid ID',
                      name: 'asteroidId',
                      type: 'string',
                      required: true,
                      default: '',
                      placeholder: '3542519',
                      description: 'The ID of the asteroid to be returned',
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoLookup'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoLookup'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Include Close Approach Data',
                              name: 'includeCloseApproachData',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to include all the close approach data in the asteroid lookup',
                          },
                      ],
                  },
                  {
                      displayName: 'Download Image',
                      name: 'download',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['astronomyPictureOfTheDay'],
                          },
                      },
                      default: true,
                      description: 'By default just the URL of the image is returned. When set to true the image will be downloaded.',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['astronomyPictureOfTheDay'],
                              download: [true],
                          },
                      },
                      description: 'Name of the binary property to which to write to',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add field',
                      displayOptions: {
                          show: {
                              resource: ['astronomyPictureOfTheDay'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Date',
                              name: 'date',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add field',
                      displayOptions: {
                          show: {
                              resource: [
                                  'asteroidNeoFeed',
                                  'donkiCoronalMassEjection',
                                  'donkiGeomagneticStorm',
                                  'donkiSolarFlare',
                                  'donkiSolarEnergeticParticle',
                                  'donkiMagnetopauseCrossing',
                                  'donkiRadiationBeltEnhancement',
                                  'donkiHighSpeedStream',
                                  'donkiWsaEnlilSimulation',
                                  'donkiNotifications',
                              ],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Start Date',
                              name: 'startDate',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                          {
                              displayName: 'End Date',
                              name: 'endDate',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add field',
                      displayOptions: {
                          show: {
                              resource: ['donkiInterplanetaryShock'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Start Date',
                              name: 'startDate',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                          {
                              displayName: 'End Date',
                              name: 'endDate',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                          {
                              displayName: 'Location',
                              name: 'location',
                              type: 'options',
                              default: 'ALL',
                              description: 'The location of the geomagnetic storm',
                              options: [
                                  {
                                      name: 'All',
                                      value: 'ALL',
                                  },
                                  {
                                      name: 'Earth',
                                      value: 'earth',
                                  },
                                  {
                                      name: 'Messenger',
                                      value: 'MESSENGER',
                                  },
                                  {
                                      name: 'Stereo A',
                                      value: 'STEREO A',
                                  },
                                  {
                                      name: 'Stereo B',
                                      value: 'STEREO B',
                                  },
                              ],
                          },
                          {
                              displayName: 'Catalog',
                              name: 'catalog',
                              type: 'options',
                              default: 'ALL',
                              description: 'The catalog of the geomagnetic storm',
                              options: [
                                  {
                                      name: 'All',
                                      value: 'ALL',
                                  },
                                  {
                                      name: 'SWRC Catalog',
                                      value: 'SWRC_CATALOG',
                                  },
                                  {
                                      name: 'Winslow Messenger ICME Catalog',
                                      value: 'WINSLOW_MESSENGER_ICME_CATALOG',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Latitude',
                      name: 'lat',
                      type: 'number',
                      default: '',
                      placeholder: '47.751076',
                      description: 'Latitude for the location of the image',
                      displayOptions: {
                          show: {
                              resource: ['earthImagery', 'earthAssets'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Longitude',
                      name: 'lon',
                      type: 'number',
                      default: '',
                      placeholder: '-120.740135',
                      description: 'Longitude for the location of the image',
                      displayOptions: {
                          show: {
                              resource: ['earthImagery', 'earthAssets'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['earthImagery'],
                          },
                      },
                      description: 'Name of the binary property to which to write to',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add field',
                      displayOptions: {
                          show: {
                              resource: ['earthImagery', 'earthAssets'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Date',
                              name: 'date',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                              description: 'Date of the image',
                          },
                          {
                              displayName: 'Degrees',
                              name: 'dim',
                              type: 'number',
                              default: '',
                              placeholder: '0.025',
                              description: 'Width and height of the image in degrees',
                          },
                      ],
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      description: 'Max number of results to return',
                      default: 20,
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const qs = {};
          let returnAll = false;
          let propertyName = '';
          let download = false;
          for (let i = 0; i < items.length; i++) {
              try {
                  let endpoint = '';
                  let includeCloseApproachData = false;
                  let additionalFields;
                  try {
                      additionalFields = this.getNodeParameter('additionalFields', i);
                  }
                  catch (error) {
                      additionalFields = {};
                  }
                  if (resource === 'astronomyPictureOfTheDay') {
                      if (operation === 'get') {
                          endpoint = '/planetary/apod';
                          qs.date =
                              (0, moment_1.default)(additionalFields.date).format('YYYY-MM-DD') ||
                                  (0, moment_1.default)().format('YYYY-MM-DD');
                      }
                  }
                  if (resource === 'asteroidNeoFeed') {
                      if (operation === 'get') {
                          endpoint = '/neo/rest/v1/feed';
                          propertyName = 'near_earth_objects';
                          const currentDate = (0, moment_1.default)().format('YYYY-MM-DD');
                          qs.start_date =
                              (0, moment_1.default)(additionalFields.startDate).format('YYYY-MM-DD') || currentDate;
                          qs.end_date =
                              (0, moment_1.default)(additionalFields.endDate).format('YYYY-MM-DD') || currentDate;
                      }
                  }
                  if (resource === 'asteroidNeoLookup') {
                      if (operation === 'get') {
                          const asteroidId = this.getNodeParameter('asteroidId', i);
                          includeCloseApproachData = additionalFields.includeCloseApproachData;
                          endpoint = `/neo/rest/v1/neo/${asteroidId}`;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation '${operation}' is unknown!`, { itemIndex: i });
                      }
                  }
                  if (resource === 'asteroidNeoBrowse') {
                      if (operation === 'getAll') {
                          returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              qs.size = this.getNodeParameter('limit', 0);
                          }
                          propertyName = 'near_earth_objects';
                          endpoint = '/neo/rest/v1/neo/browse';
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation '${operation}' is unknown!`, { itemIndex: i });
                      }
                  }
                  if (resource.startsWith('donki')) {
                      if (additionalFields.startDate) {
                          qs.startDate = (0, moment_1.default)(additionalFields.startDate).format('YYYY-MM-DD');
                      }
                      else {
                          qs.startDate = (0, moment_1.default)().subtract(30, 'days').format('YYYY-MM-DD');
                      }
                      if (additionalFields.endDate) {
                          qs.endDate = (0, moment_1.default)(additionalFields.endDate).format('YYYY-MM-DD');
                      }
                      else {
                          qs.endDate = (0, moment_1.default)().format('YYYY-MM-DD');
                      }
                      if (resource === 'donkiCoronalMassEjection') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/CME';
                          }
                      }
                      else if (resource === 'donkiGeomagneticStorm') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/GST';
                          }
                      }
                      else if (resource === 'donkiInterplanetaryShock') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/IPS';
                              qs.location = additionalFields.location || 'ALL';
                              qs.catalog = additionalFields.catalog || 'ALL';
                          }
                      }
                      else if (resource === 'donkiSolarFlare') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/FLR';
                          }
                      }
                      else if (resource === 'donkiSolarEnergeticParticle') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/SEP';
                          }
                      }
                      else if (resource === 'donkiMagnetopauseCrossing') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/MPC';
                          }
                      }
                      else if (resource === 'donkiRadiationBeltEnhancement') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/RBE';
                          }
                      }
                      else if (resource === 'donkiHighSpeedStream') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/HSS';
                          }
                      }
                      else if (resource === 'donkiWsaEnlilSimulation') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/WSAEnlilSimulations';
                          }
                      }
                      else if (resource === 'donkiNotifications') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/notifications';
                              qs.type = additionalFields.type || 'all';
                          }
                      }
                  }
                  if (resource === 'earthImagery') {
                      if (operation === 'get') {
                          endpoint = '/planetary/earth/imagery';
                          qs.lat = this.getNodeParameter('lat', i);
                          qs.lon = this.getNodeParameter('lon', i);
                          qs.dim = additionalFields.dim || 0.025;
                          if (additionalFields.date) {
                              qs.date = (0, moment_1.default)(additionalFields.date).format('YYYY-MM-DD');
                          }
                          else {
                              qs.date = (0, moment_1.default)().format('YYYY-MM-DD');
                          }
                      }
                  }
                  if (resource === 'earthAssets') {
                      if (operation === 'get') {
                          endpoint = '/planetary/earth/assets';
                          qs.lat = this.getNodeParameter('lat', i);
                          qs.lon = this.getNodeParameter('lon', i);
                          qs.dim = additionalFields.dim || 0.025;
                          if (additionalFields.date) {
                              qs.date = (0, moment_1.default)(additionalFields.date).format('YYYY-MM-DD');
                          }
                      }
                      if (operation === 'get') {
                          endpoint = '/insight_weather/earth/imagery';
                          qs.feedtype = 'json';
                          qs.ver = '1.0';
                      }
                  }
                  if (returnAll) {
                      responseData = GenericFunctions_1.nasaApiRequestAllItems.call(this, propertyName, 'GET', endpoint, qs);
                  }
                  else {
                      responseData = await GenericFunctions_1.nasaApiRequest.call(this, 'GET', endpoint, qs);
                      if (propertyName !== '') {
                          responseData = responseData[propertyName];
                      }
                  }
                  if (resource === 'asteroidNeoLookup' && operation === 'get' && !includeCloseApproachData) {
                      delete responseData.close_approach_data;
                  }
                  if (resource === 'asteroidNeoFeed') {
                      const date = Object.keys(responseData)[0];
                      responseData = responseData[date];
                  }
                  if (resource === 'earthImagery') {
                      const binaryProperty = this.getNodeParameter('binaryPropertyName', i);
                      const data = await GenericFunctions_1.nasaApiRequest.call(this, 'GET', endpoint, qs, { encoding: null });
                      const newItem = {
                          json: items[i].json,
                          binary: {},
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      items[i] = newItem;
                      items[i].binary[binaryProperty] = await this.helpers.prepareBinaryData(data);
                  }
                  if (resource === 'astronomyPictureOfTheDay') {
                      download = this.getNodeParameter('download', 0);
                      if (download) {
                          const binaryProperty = this.getNodeParameter('binaryPropertyName', i);
                          const data = await GenericFunctions_1.nasaApiRequest.call(this, 'GET', endpoint, qs, { encoding: null }, responseData.hdurl);
                          const filename = responseData.hdurl.split('/');
                          const newItem = {
                              json: items[i].json,
                              binary: {},
                          };
                          Object.assign(newItem.json, responseData);
                          if (items[i].binary !== undefined) {
                              Object.assign(newItem.binary, items[i].binary);
                          }
                          items[i] = newItem;
                          items[i].binary[binaryProperty] = await this.helpers.prepareBinaryData(data, filename[filename.length - 1]);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (resource === 'earthImagery' && operation === 'get') {
                          items[i].json = { error: error.message };
                      }
                      else if (resource === 'astronomyPictureOfTheDay' && operation === 'get' && download) {
                          items[i].json = { error: error.message };
                      }
                      else {
                          const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                          returnData.push(...executionErrorData);
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (resource === 'earthImagery' && operation === 'get') {
              return [items];
          }
          else if (resource === 'astronomyPictureOfTheDay' && operation === 'get' && download) {
              return [items];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.Nasa = Nasa;
  //# sourceMappingURL=Nasa.node.js.map

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

  # NASA credentials

  You can use these credentials to authenticate the following nodes:

  - [NASA](/integrations/builtin/app-nodes/n8n-nodes-base.nasa.md)

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to the **Browse APIs** section of the [NASA Open APIs](https://api.nasa.gov/){:target=_blank .external-link} for more information about the service.

  ## Using an API key

  To configure this credential, you'll need:

  - An **API Key**

  To generate an API key:

  1. Go to the [NASA Open APIs](https://api.nasa.gov/){:target=_blank .external-link} page.
  2. Complete the fields in the **Generate API Key** section.
  3. Copy the **API Key** and enter it in your n8n credential.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"4b48cc1a-2f8a-4e9a-99a3-0f904cea75d3","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"3b939e88449107443096790315fa2004e829a9d79a346315290f7945985541db"}}


node_type: n8n-nodes-base.Netlify
name: Netlify
display_name: Netlify
description: Consume Netlify API
category: Other
code_hash: da09d02d0d7620d84e394d150cea0f5613386191bcbea87271e7f06c30b5b31a
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/netlify
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Netlify = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const DeployDescription_1 = require("./DeployDescription");
  const SiteDescription_1 = require("./SiteDescription");
  class Netlify {
      constructor() {
          this.description = {
              displayName: 'Netlify',
              name: 'netlify',
              icon: 'file:netlify.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Netlify API',
              defaults: {
                  name: 'Netlify',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'netlifyApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Deploy',
                              value: 'deploy',
                          },
                          {
                              name: 'Site',
                              value: 'site',
                          },
                      ],
                      default: 'deploy',
                      required: true,
                  },
                  ...DeployDescription_1.deployOperations,
                  ...DeployDescription_1.deployFields,
                  ...SiteDescription_1.siteOperations,
                  ...SiteDescription_1.siteFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getSites() {
                      const returnData = [];
                      const sites = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', '/sites');
                      for (const site of sites) {
                          returnData.push({
                              name: site.name,
                              value: site.site_id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          let responseData;
          const returnData = [];
          const qs = {};
          const body = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'deploy') {
                      if (operation === 'cancel') {
                          const deployId = this.getNodeParameter('deployId', i);
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'POST', `/deploys/${deployId}/cancel`, body, qs);
                      }
                      if (operation === 'create') {
                          const siteId = this.getNodeParameter('siteId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                          if (body.title) {
                              qs.title = body.title;
                              delete body.title;
                          }
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'POST', `/sites/${siteId}/deploys`, body, qs);
                      }
                      if (operation === 'get') {
                          const siteId = this.getNodeParameter('siteId', i);
                          const deployId = this.getNodeParameter('deployId', i);
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', `/sites/${siteId}/deploys/${deployId}`, body, qs);
                      }
                      if (operation === 'getAll') {
                          const siteId = this.getNodeParameter('siteId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.netlifyRequestAllItems.call(this, 'GET', `/sites/${siteId}/deploys`);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', `/sites/${siteId}/deploys`, {}, { per_page: limit });
                          }
                      }
                  }
                  if (resource === 'site') {
                      if (operation === 'delete') {
                          const siteId = this.getNodeParameter('siteId', i);
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'DELETE', `/sites/${siteId}`);
                      }
                      if (operation === 'get') {
                          const siteId = this.getNodeParameter('siteId', i);
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', `/sites/${siteId}`);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.netlifyRequestAllItems.call(this, 'GET', '/sites', {}, { filter: 'all' });
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', '/sites', {}, { filter: 'all', per_page: limit });
                          }
                      }
                  }
                  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.Netlify = Netlify;
  //# sourceMappingURL=Netlify.node.js.map

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

  # Netlify credentials

  You can use these credentials to authenticate the following nodes:

  - [Netlify](/integrations/builtin/app-nodes/n8n-nodes-base.netlify.md)
  - [Netlify Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.netlifytrigger.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API access token

  ## Related resources

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

  ## Using API access token

  To configure this credential, you'll need:

  - An **Access Token**: Generate an Access Token in **Applications > Personal Access Tokens**. Refer to [Netlify API Authentication](https://docs.netlify.com/api/get-started/#authentication){:target=_blank .external-link} for more detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"3c3ecdec-177d-42a5-b153-b576271d78f9","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"fc5066361a4680d2ce92d215016516b34528c8082e318e54d1224119f5158c47"}}


node_type: n8n-nodes-base.NextCloud
name: NextCloud
display_name: Nextcloud
description: Access data on Nextcloud
category: Other
code_hash: c16a62145bd04153b769ec1f971038acce59dcb941fc062aed1ae114514924ea
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/nextcloud
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.NextCloud = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const url_1 = require("url");
  const xml2js_1 = require("xml2js");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utilities_1 = require("../../utils/utilities");
  class NextCloud {
      constructor() {
          this.description = {
              displayName: 'Nextcloud',
              name: 'nextCloud',
              icon: 'file:nextcloud.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Access data on Nextcloud',
              defaults: {
                  name: 'Nextcloud',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'nextCloudApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'nextCloudOAuth2Api',
                      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: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Folder',
                              value: 'folder',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'file',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Copy',
                              value: 'copy',
                              description: 'Copy a file',
                              action: 'Copy a file',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a file',
                              action: 'Delete a file',
                          },
                          {
                              name: 'Download',
                              value: 'download',
                              description: 'Download a file',
                              action: 'Download a file',
                          },
                          {
                              name: 'Move',
                              value: 'move',
                              description: 'Move a file',
                              action: 'Move a file',
                          },
                          {
                              name: 'Share',
                              value: 'share',
                              description: 'Share a file',
                              action: 'Share a file',
                          },
                          {
                              name: 'Upload',
                              value: 'upload',
                              description: 'Upload a file',
                              action: 'Upload a file',
                          },
                      ],
                      default: 'upload',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['folder'],
                          },
                      },
                      options: [
                          {
                              name: 'Copy',
                              value: 'copy',
                              description: 'Copy a folder',
                              action: 'Copy a folder',
                          },
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a folder',
                              action: 'Create a folder',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a folder',
                              action: 'Delete a folder',
                          },
                          {
                              name: 'List',
                              value: 'list',
                              description: 'Return the contents of a given folder',
                              action: 'List a folder',
                          },
                          {
                              name: 'Move',
                              value: 'move',
                              description: 'Move a folder',
                              action: 'Move a folder',
                          },
                          {
                              name: 'Share',
                              value: 'share',
                              description: 'Share a folder',
                              action: 'Share a folder',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Invite a user to a NextCloud organization',
                              action: 'Create a user',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a user',
                              action: 'Delete a user',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve information about a single user',
                              action: 'Get a user',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Retrieve a list of users',
                              action: 'Get many users',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Edit attributes related to a user',
                              action: 'Update a user',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'From Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['copy'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/original.txt',
                      description: 'The path of file or folder to copy. The path should start with "/".',
                  },
                  {
                      displayName: 'To Path',
                      name: 'toPath',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['copy'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/copy.txt',
                      description: 'The destination path of file or folder. The path should start with "/".',
                  },
                  {
                      displayName: 'Delete Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The path to delete. Can be a single file or a whole folder. The path should start with "/".',
                  },
                  {
                      displayName: 'From Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['move'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/old_name.txt',
                      description: 'The path of file or folder to move. The path should start with "/".',
                  },
                  {
                      displayName: 'To Path',
                      name: 'toPath',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['move'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/new_name.txt',
                      description: 'The new path of file or folder. The path should start with "/".',
                  },
                  {
                      displayName: 'File Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The file path of the file to download. Has to contain the full path. The path should start with "/".',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      description: 'Name of the binary property to which to write the data of the read file',
                  },
                  {
                      displayName: 'File Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The absolute file path of the file to upload. Has to contain the full path. The parent folder has to exist. Existing files get overwritten.',
                  },
                  {
                      displayName: 'Binary Data',
                      name: 'binaryDataUpload',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                  },
                  {
                      displayName: 'File Content',
                      name: 'fileContent',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              binaryDataUpload: [false],
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'The text content of the file to upload',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              binaryDataUpload: [true],
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file to be uploaded',
                  },
                  {
                      displayName: 'File Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['share'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The file path of the file to share. Has to contain the full path. The path should start with "/".',
                  },
                  {
                      displayName: 'Share Type',
                      name: 'shareType',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['share'],
                              resource: ['file', 'folder'],
                          },
                      },
                      options: [
                          {
                              name: 'Circle',
                              value: 7,
                          },
                          {
                              name: 'Email',
                              value: 4,
                          },
                          {
                              name: 'Group',
                              value: 1,
                          },
                          {
                              name: 'Public Link',
                              value: 3,
                          },
                          {
                              name: 'User',
                              value: 0,
                          },
                      ],
                      default: 0,
                      description: 'The share permissions to set',
                  },
                  {
                      displayName: 'Circle ID',
                      name: 'circleId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                              shareType: [7],
                          },
                      },
                      default: '',
                      description: 'The ID of the circle to share with',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                              shareType: [4],
                          },
                      },
                      default: '',
                      description: 'The Email address to share with',
                  },
                  {
                      displayName: 'Group ID',
                      name: 'groupId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                              shareType: [1],
                          },
                      },
                      default: '',
                      description: 'The ID of the group to share with',
                  },
                  {
                      displayName: 'User',
                      name: 'user',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                              shareType: [0],
                          },
                      },
                      default: '',
                      description: 'The user to share with',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Password',
                              name: 'password',
                              type: 'string',
                              typeOptions: { password: true },
                              displayOptions: {
                                  show: {
                                      '/resource': ['file', 'folder'],
                                      '/operation': ['share'],
                                      '/shareType': [3],
                                  },
                              },
                              default: '',
                              description: 'Optional search string',
                          },
                          {
                              displayName: 'Permissions',
                              name: 'permissions',
                              type: 'options',
                              options: [
                                  {
                                      name: 'All',
                                      value: 31,
                                  },
                                  {
                                      name: 'Create',
                                      value: 4,
                                  },
                                  {
                                      name: 'Delete',
                                      value: 8,
                                  },
                                  {
                                      name: 'Read',
                                      value: 1,
                                  },
                                  {
                                      name: 'Update',
                                      value: 2,
                                  },
                              ],
                              default: 1,
                              description: 'The share permissions to set',
                          },
                      ],
                  },
                  {
                      displayName: 'Folder',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['folder'],
                          },
                      },
                      placeholder: '/invoices/2019',
                      description: 'The folder to create. The parent folder has to exist. The path should start with "/".',
                  },
                  {
                      displayName: 'Folder Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                              resource: ['folder'],
                          },
                      },
                      placeholder: '/invoices/2019/',
                      description: 'The path of which to list the content. The path should start with "/".',
                  },
                  {
                      displayName: 'Username',
                      name: 'userId',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['create'],
                          },
                      },
                      placeholder: 'john',
                      description: 'Username the user will have',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['create'],
                          },
                      },
                      placeholder: 'john@email.com',
                      description: 'The email of the user to invite',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['create'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Display Name',
                              name: 'displayName',
                              type: 'string',
                              default: '',
                              description: 'The display name of the user to invite',
                          },
                      ],
                  },
                  {
                      displayName: 'Username',
                      name: 'userId',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['delete', 'get', 'update'],
                          },
                      },
                      placeholder: 'john',
                      description: 'Username the user will have',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 50,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['getAll'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Search',
                              name: 'search',
                              type: 'string',
                              default: '',
                              description: 'Optional search string',
                          },
                          {
                              displayName: 'Offset',
                              name: 'offset',
                              type: 'number',
                              default: '',
                              description: 'Optional offset value',
                          },
                      ],
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: false,
                      },
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['update'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Fields',
                              name: 'field',
                              values: [
                                  {
                                      displayName: 'Key',
                                      name: 'key',
                                      type: 'options',
                                      default: 'email',
                                      options: [
                                          {
                                              name: 'Address',
                                              value: 'address',
                                              description: 'The new address for the user',
                                          },
                                          {
                                              name: 'Display Name',
                                              value: 'displayname',
                                              description: 'The new display name for the user',
                                          },
                                          {
                                              name: 'Email',
                                              value: 'email',
                                              description: 'The new email for the user',
                                          },
                                          {
                                              name: 'Password',
                                              value: 'password',
                                              description: 'The new password for the user',
                                          },
                                          {
                                              name: 'Twitter',
                                              value: 'twitter',
                                              description: 'The new twitter handle for the user',
                                          },
                                          {
                                              name: 'Website',
                                              value: 'website',
                                              description: 'The new website for the user',
                                          },
                                      ],
                                      description: 'Key of the updated attribute',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                      description: 'Value of the updated attribute',
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData().slice();
          const returnData = [];
          const authenticationMethod = this.getNodeParameter('authentication', 0);
          let credentials;
          if (authenticationMethod === 'accessToken') {
              credentials = await this.getCredentials('nextCloudApi');
          }
          else {
              credentials = await this.getCredentials('nextCloudOAuth2Api');
          }
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let endpoint = '';
          let requestMethod = '';
          let responseData;
          let body = '';
          const headers = {};
          let qs;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'file') {
                      if (operation === 'download') {
                          requestMethod = 'GET';
                          endpoint = this.getNodeParameter('path', i);
                      }
                      else if (operation === 'upload') {
                          requestMethod = 'PUT';
                          endpoint = this.getNodeParameter('path', i);
                          if (this.getNodeParameter('binaryDataUpload', i) === true) {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              this.helpers.assertBinaryData(i, binaryPropertyName);
                              body = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          }
                          else {
                              body = this.getNodeParameter('fileContent', i);
                          }
                      }
                  }
                  else if (resource === 'folder') {
                      if (operation === 'create') {
                          requestMethod = 'MKCOL';
                          endpoint = this.getNodeParameter('path', i);
                      }
                      else if (operation === 'list') {
                          requestMethod = 'PROPFIND';
                          endpoint = this.getNodeParameter('path', i);
                      }
                  }
                  if (['file', 'folder'].includes(resource)) {
                      if (operation === 'copy') {
                          requestMethod = 'COPY';
                          endpoint = this.getNodeParameter('path', i);
                          const toPath = this.getNodeParameter('toPath', i);
                          headers.Destination = `${credentials.webDavUrl}/${encodeURI(toPath)}`;
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          endpoint = this.getNodeParameter('path', i);
                      }
                      else if (operation === 'move') {
                          requestMethod = 'MOVE';
                          endpoint = this.getNodeParameter('path', i);
                          const toPath = this.getNodeParameter('toPath', i);
                          headers.Destination = `${credentials.webDavUrl}/${encodeURI(toPath)}`;
                      }
                      else if (operation === 'share') {
                          requestMethod = 'POST';
                          endpoint = 'ocs/v2.php/apps/files_sharing/api/v1/shares';
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                          const bodyParameters = this.getNodeParameter('options', i);
                          bodyParameters.path = this.getNodeParameter('path', i);
                          bodyParameters.shareType = this.getNodeParameter('shareType', i);
                          if (bodyParameters.shareType === 0) {
                              bodyParameters.shareWith = this.getNodeParameter('user', i);
                          }
                          else if (bodyParameters.shareType === 7) {
                              bodyParameters.shareWith = this.getNodeParameter('circleId', i);
                          }
                          else if (bodyParameters.shareType === 4) {
                              bodyParameters.shareWith = this.getNodeParameter('email', i);
                          }
                          else if (bodyParameters.shareType === 1) {
                              bodyParameters.shareWith = this.getNodeParameter('groupId', i);
                          }
                          body = new url_1.URLSearchParams(bodyParameters).toString();
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = 'ocs/v1.php/cloud/users';
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                          const userid = this.getNodeParameter('userId', i);
                          const email = this.getNodeParameter('email', i);
                          body = `userid=${userid}&email=${email}`;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.displayName) {
                              body += `&displayName=${additionalFields.displayName}`;
                          }
                      }
                      if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const userid = this.getNodeParameter('userId', i);
                          endpoint = `ocs/v1.php/cloud/users/${userid}`;
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                      }
                      if (operation === 'get') {
                          requestMethod = 'GET';
                          const userid = this.getNodeParameter('userId', i);
                          endpoint = `ocs/v1.php/cloud/users/${userid}`;
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                      }
                      if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          endpoint = 'ocs/v1.php/cloud/users';
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                      }
                      if (operation === 'update') {
                          requestMethod = 'PUT';
                          const userid = this.getNodeParameter('userId', i);
                          endpoint = `ocs/v1.php/cloud/users/${userid}`;
                          body = Object.entries(this.getNodeParameter('updateFields', i).field)
                              .map((entry) => {
                              const [key, value] = entry;
                              return `${key}=${value}`;
                          })
                              .join('&');
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  let webDavUrl = credentials.webDavUrl;
                  if (webDavUrl.slice(-1) === '/') {
                      webDavUrl = webDavUrl.slice(0, -1);
                  }
                  let encoding = undefined;
                  if (resource === 'file' && operation === 'download') {
                      encoding = null;
                  }
                  try {
                      responseData = await GenericFunctions_1.nextCloudApiRequest.call(this, requestMethod, endpoint, body, headers, encoding, qs);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          if (resource === 'file' && operation === 'download') {
                              items[i].json = { error: error.message };
                          }
                          else {
                              returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
                          }
                          continue;
                      }
                      throw error;
                  }
                  if (resource === 'file' && operation === 'download') {
                      const newItem = {
                          json: items[i].json,
                          pairedItem: { item: i },
                          binary: {},
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      items[i] = newItem;
                      const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                      items[i].binary[binaryPropertyName] = await this.helpers.prepareBinaryData(responseData, endpoint);
                  }
                  else if (['file', 'folder'].includes(resource) && operation === 'share') {
                      const jsonResponseData = await new Promise((resolve, reject) => {
                          (0, xml2js_1.parseString)(responseData, { explicitArray: false }, (err, data) => {
                              if (err) {
                                  return reject(err);
                              }
                              if (data.ocs.meta.status !== 'ok') {
                                  return reject(new n8n_workflow_1.NodeApiError(this.getNode(), data.ocs.meta.message || data.ocs.meta.status));
                              }
                              resolve(data.ocs.data);
                          });
                      });
                      const executionData = this.helpers.constructExecutionMetaData((0, utilities_1.wrapData)(jsonResponseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (resource === 'user') {
                      if (operation !== 'getAll') {
                          const jsonResponseData = await new Promise((resolve, reject) => {
                              (0, xml2js_1.parseString)(responseData, { explicitArray: false }, (err, data) => {
                                  if (err) {
                                      return reject(err);
                                  }
                                  if (data.ocs.meta.status !== 'ok') {
                                      return reject(new n8n_workflow_1.NodeApiError(this.getNode(), (data.ocs.meta.message || data.ocs.meta.status)));
                                  }
                                  if (operation === 'delete' || operation === 'update') {
                                      resolve(data.ocs.meta);
                                  }
                                  else {
                                      resolve(data.ocs.data);
                                  }
                              });
                          });
                          const executionData = this.helpers.constructExecutionMetaData((0, utilities_1.wrapData)(jsonResponseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else {
                          const jsonResponseData = await new Promise((resolve, reject) => {
                              (0, xml2js_1.parseString)(responseData, { explicitArray: false }, (err, data) => {
                                  if (err) {
                                      return reject(err);
                                  }
                                  if (data.ocs.meta.status !== 'ok') {
                                      return reject(new n8n_workflow_1.NodeApiError(this.getNode(), data.ocs.meta.message));
                                  }
                                  if (typeof data.ocs.data.users.element === 'string') {
                                      resolve([data.ocs.data.users.element]);
                                  }
                                  else {
                                      resolve(data.ocs.data.users.element);
                                  }
                              });
                          });
                          jsonResponseData.forEach((value) => {
                              returnData.push({ json: { id: value }, pairedItem: { item: i } });
                          });
                      }
                  }
                  else if (resource === 'folder' && operation === 'list') {
                      const jsonResponseData = await new Promise((resolve, reject) => {
                          (0, xml2js_1.parseString)(responseData, { explicitArray: false }, (err, data) => {
                              if (err) {
                                  return reject(err);
                              }
                              resolve(data);
                          });
                      });
                      const propNames = {
                          'd:getlastmodified': 'lastModified',
                          'd:getcontentlength': 'contentLength',
                          'd:getcontenttype': 'contentType',
                      };
                      if (jsonResponseData['d:multistatus'] !== undefined &&
                          jsonResponseData['d:multistatus'] !== null &&
                          jsonResponseData['d:multistatus']['d:response'] !== undefined &&
                          jsonResponseData['d:multistatus']['d:response'] !== null) {
                          let skippedFirst = false;
                          if (Array.isArray(jsonResponseData['d:multistatus']['d:response'])) {
                              for (const item of jsonResponseData['d:multistatus']['d:response']) {
                                  if (!skippedFirst) {
                                      skippedFirst = true;
                                      continue;
                                  }
                                  const newItem = {};
                                  newItem.path = item['d:href'].slice(19);
                                  let props = {};
                                  if (Array.isArray(item['d:propstat'])) {
                                      props = item['d:propstat'][0]['d:prop'];
                                  }
                                  else {
                                      props = item['d:propstat']['d:prop'];
                                  }
                                  for (const propName of Object.keys(propNames)) {
                                      if (props[propName] !== undefined) {
                                          newItem[propNames[propName]] = props[propName];
                                      }
                                  }
                                  if (props['d:resourcetype'] === '') {
                                      newItem.type = 'file';
                                  }
                                  else {
                                      newItem.type = 'folder';
                                  }
                                  newItem.eTag = props['d:getetag'].slice(1, -1);
                                  returnData.push({ json: newItem, pairedItem: { item: i } });
                              }
                          }
                      }
                  }
                  else {
                      const executionData = this.helpers.constructExecutionMetaData((0, utilities_1.wrapData)(responseData), {
                          itemData: { item: i },
                      });
                      returnData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (resource === 'file' && operation === 'download') {
                          items[i].json = { error: error.message };
                      }
                      else {
                          returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (resource === 'file' && operation === 'download') {
              return [items];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.NextCloud = NextCloud;
  //# sourceMappingURL=NextCloud.node.js.map

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

  # Nextcloud credentials

  You can use these credentials to authenticate the following nodes:

  - [Nextcloud](/integrations/builtin/app-nodes/n8n-nodes-base.nextcloud.md)

  ## Supported authentication methods

  - Basic auth
  - OAuth2

  ## Related resources

  Refer to [Nextcloud's API documentation](https://nextcloud-server.netlify.app/){:target=_blank .external-link} for more information about the service.

  Refer to [Nextcloud's user manual](https://docs.nextcloud.com/server/stable/user_manual/en/contents.html){:target=_blank .external-link} for more information on installing and configuring Nextcloud.

  ## Using basic auth

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

  - Your **Web DAV URL**
  - Your **User** name
  - Your **Password** or an app password

  To set it up:

  1. To create your **Web DAV URL**: If Nextcloud is in the root of your domain: Enter the URL you use to access Nextcloud and add `/remote.php/webdav/`. For example, if you access Nextcloud at `https://cloud.n8n.com`, your WebDAV URL is `https://cloud.n8n.com/remote.php/webdav`.
      - If you have Nextcloud installed in a subdirectory, enter the URL you use to access Nextcloud and add `/<subdirectory>/remote.php/webdav/`. Replace `<subdirectory>` with the subdirectory Nextcloud's installed in.
      - Refer to Nextcloud's [Third-party WebDAV clients](https://docs.nextcloud.com/server/stable/user_manual/en/files/access_webdav.html#third-party-webdav-clients){:target=_blank .external-link} documentation for more information on constructing your WebDAV URL.
  2. Enter your **User** name.
  3. For the **Password**, Nextcloud recommends using an app password rather than your user password. To create an app password:
      1. In the Nextcloud Web interface, select your avatar in the top right and select **Personal settings**.
      2. In the left menu, choose **Security**.
      3. Scroll to the bottom to the **App Password** section and create a new app password.
      4. Copy that app password and enter it in n8n as your **Password**.

  ## Using OAuth2

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

  - An **Authorization URL** and **Access Token URL**: These depend on the URL you use to access Nextcloud.
  - A **Client ID**: Generated once you add an OAuth2 client application in **Administrator Security Settings**.
  - A **Client Secret**: Generated once you add an OAuth2 client application in **Administrator Security Settings**.
  - A **Web DAV URL**: This depends on the URL you use to access Nextcloud.

  To set it up:

  1. In Nextcloud, open your **Administrator Security Settings**.
  2. Find the **Add client** section under **OAuth 2.0 clients**.
  3. Enter a **Name** for your client, like `n8n integration`.
  4. Copy the **OAuth Callback URL** from n8n and enter it as the **Redirection URI**.
  5. Then select **Add** in Nextcloud.
  6. In n8n, update the **Authorization URL** to replace `https://nextcloud.example.com` with the URL you use to access Nextcloud. For example, if you access Nextcloud at `https://cloud.n8n.com`, the Authorization URL is `https://cloud.n8n.com/apps/oauth2/authorize`.
  7. In n8n, update the **Access Token URL** to replace `https://nextcloud.example.com` with the URL you use to access Nextcloud. For example, if you access Nextcloud at `https://cloud.n8n.com`, the Access Token URL is `https://cloud.n8n.com/apps/oauth2/api/v1/token`.

      /// note | Pretty URL configuration
      The **Authorization URL** and **Access Token URL** assume that you've configured Nextcloud to use [Pretty URLs](https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#pretty-urls){:target=_blank .external-link}. If you haven't, you must add `/index.php/` between your Nextcloud URL and the `/apps/oauth2` portion, for example: `https://cloud.n8n.com/index.php/apps/oauth2/api/v1/token`.
      ///
      
  8. Copy the Nextcloud **Client Identifier** for your OAuth2 client and enter it as the **Client ID** in n8n.
  9. Copy the Nextcloud **Secret** and enter it as the **Client Secret** in n8n.
  10. In n8n, to create your **Web DAV URL**: If Nextcloud is in the root of your domain, enter the URL you use to access Nextcloud and add `/remote.php/webdav/`. For example, if you access Nextcloud at `https://cloud.n8n.com`, your WebDAV URL is `https://cloud.n8n.com/remote.php/webdav`.
      - If you have Nextcloud installed in a subdirectory, enter the URL you use to access Nextcloud and add `/<subdirectory>/remote.php/webdav/`. Replace `<subdirectory>` with the subdirectory Nextcloud's installed in.
      - Refer to Nextcloud's [Third-party WebDAV clients](https://docs.nextcloud.com/server/stable/user_manual/en/files/access_webdav.html#third-party-webdav-clients){:target=_blank .external-link} documentation for more information on constructing your WebDAV URL.

  Refer to the Nextcloud [OAuth2 Configuration documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/oauth2.html){:target=_blank .external-link} for more detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"74b2496e-bf52-41b6-81c8-0fc0d7212986","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"eb088f803de261e211faf4acdc45cbaa355260a2475a43a98db1bf85d5d87bba"}}


node_type: n8n-nodes-base.NoOp
name: NoOp
display_name: No Operation, do nothing
description: No Operation
category: Other
code_hash: 278af9bf87c21e19e021d2b0d95db30e200ff832063dacdd6c6c9707ade374f6
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.noop
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.NoOp = void 0;
  class NoOp {
      constructor() {
          this.description = {
              displayName: 'No Operation, do nothing',
              name: 'noOp',
              icon: 'fa:arrow-right',
              group: ['organization'],
              version: 1,
              description: 'No Operation',
              defaults: {
                  name: 'No Operation, do nothing',
                  color: '#b0b0b0',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [],
          };
      }
      async execute() {
          const items = this.getInputData();
          return [items];
      }
  }
  exports.NoOp = NoOp;
  //# sourceMappingURL=NoOp.node.js.map

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

  # No Operation, do nothing

  Use the No Operation, do nothing node when you don't want to perform any operations. The purpose of this node is to make the workflow easier to read and understand where the flow of data stops. This can help others visually get a better understanding of the workflow.

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"1bb7a838-3247-445a-bfc3-0141e92442d1","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"53633f5880dd6c8dbc07c8b5f34f682a5438b76173e2312090c3717b1cfad75f"}}


node_type: n8n-nodes-base.Notion
name: Notion
display_name: Notion
description: Consume Notion API
category: Other
code_hash: c03a7082cc459b1fc4b4a722f00708276fbcd7889708aebbb5f396e16cf17439
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/notion
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Notion = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const NotionV1_node_1 = require("./v1/NotionV1.node");
  const NotionV2_node_1 = require("./v2/NotionV2.node");
  class Notion extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Notion',
              name: 'notion',
              icon: 'file:notion.svg',
              group: ['output'],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Notion API',
              defaultVersion: 2,
          };
          const nodeVersions = {
              1: new NotionV1_node_1.NotionV1(baseDescription),
              2: new NotionV2_node_1.NotionV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Notion = Notion;
  //# sourceMappingURL=Notion.node.js.map

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

  # Notion credentials

  You can use these credentials to authenticate the following nodes:

  - [Notion](/integrations/builtin/app-nodes/n8n-nodes-base.notion/index.md)
  - [Notion Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.notiontrigger.md)

  ## Prerequisites

  Create a [Notion](https://notion.so){:target=_blank .external-link} account with admin level access.

  ## Supported authentication methods

  - API integration token: Used for internal integrations.
  - OAuth2: Used for public integrations.

  /// note | Integration type
  Not sure which integration type to use? Refer to [Internal vs. public integrations](#internal-vs-public-integrations) below for more information.
  ///

  ## Related resources

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

  ## Using API integration token

  To configure this credential, you'll need:

  - An **Internal Integration Secret**: Generated once you create a Notion integration.

  To generate an integration secret, [create a Notion integration](https://developers.notion.com/docs/create-a-notion-integration#create-your-integration-in-notion){:target=_blank .external-link} and grab the integration secret from the **Secrets** tab:

  1. Go to your Notion [integration dashboard](https://www.notion.com/my-integrations){:target=_blank .external-link}.
  2. Select the **+ New integration** button.
  3. Enter a **Name** for your integration, for example `n8n integration`. If desired, add a **Logo**.
  4. Select **Submit** to create your integration.
  5. Open the **Capabilities** tab. Select these capabilities:
      - `Read content`
      - `Update content`
      - `Insert content`
      - `User information without email addresses`
  6. Be sure to **Save changes**.
  7. Select the **Secrets** tab.
  8. Copy the **Internal Integration Token** and add it as your n8n **Internal Integration Secret**.

  Refer to the [Internal integration auth flow setup documentation](https://developers.notion.com/docs/authorization#internal-integration-auth-flow-set-up){:target=_blank .external-link} for more information about authenticating to the service.

  ### Share Notion page(s) with the integration

  For your integration to interact with Notion, you must [give your integration page permission](https://developers.notion.com/docs/create-a-notion-integration#give-your-integration-page-permissions){:target=_blank .external-link} to interact with page(s) in your Notion workspace:

  1. Visit the page in your Notion workspace.
  2. Select the triple dot menu at the top right of a page.
  3. In **Connections**, select **Connect to**.
  4. Use the search bar to find and select your integration from the dropdown list.

  Once you share at least one page with the integration, you can start making API requests. If the page isn't shared, any API requests made will respond with an error.

  Refer to [Integration permissions](https://developers.notion.com/docs/authorization#integration-permissions){:target=_blank .external-link} for more information.

  ## Using OAuth2

  To configure this credential, you'll need:

  - A **Client ID**: Generated once you configure a public integration.
  - A **Client Secret**: Generated once you configure a public integration.

  You must [create a Notion integration](https://developers.notion.com/docs/create-a-notion-integration#create-your-integration-in-notion){:target=_blank .external-link} and set it to public distribution:

  1. Go to your Notion [integration dashboard](https://www.notion.so/my-integrations){:target=_blank .external-link}.
  2. Select the **+ New integration** button.
  3. Enter a **Name** for your integration, for example `n8n integration`. If desired, add a **Logo**.
  4. Select **Submit** to create your integration.
  5. Open the **Capabilities** tab. Select these capabilities:
      - `Read content`
      - `Update content`
      - `Insert content`
      - `User information without email addresses`
  6. Select **Save changes**.
  7. Go to the **Distribution** tab.
  8. Turn on the **Do you want to make this integration public?** control.
  9. Enter your company name and website in the **Organization Information** section.
  10. Copy the n8n **OAuth Redirect URL** and add it to as a **Redirect URI** in the Notion integration's **OAuth Domain & URLs** section.
  11. Go to the **Secrets** tab.
  12. Copy the **Client ID** and **Client Secret** and add them to your n8n credential.

  Refer to Notion's [public integration auth flow setup](https://developers.notion.com/docs/authorization#public-integration-auth-flow-set-up){:target=_blank .external-link} for more information about authenticating to the service.

  ## Internal vs. public integrations

  **Internal** integrations are:

  * Specific to a single workspace.
  * Accessible only to members of that workspace.
  * Ideal for custom workspace enhancements.

  Internal integrations use a simpler authentication process (the integration secret) and don't require any security review before publishing.

  **Public** integrations are:

  * Usable across multiple, unrelated Notion workspaces.
  * Accessible by any Notion user, regardless of their workspace.
  * Ideal for catering to broad use cases.

  Public integrations use the OAuth 2.0 protocol for authentication. They require a Notion security review before publishing.

  For a more detailed breakdown of the two integration types, refer to Notion's [Internal vs. Public Integrations documentation](https://developers.notion.com/docs/getting-started#internal-vs-public-integrations){:target=_blank .external-link}.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"dc0ba070-1f9f-4038-8a8e-b71436b345aa","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"388bd2e76206ba0995af4df86a2d13a4007c4a732509916391c40dc9d9228b89"}}


node_type: n8n-nodes-base.NocoDB
name: NocoDB
display_name: NocoDB
description: Read, update, write and delete data from NocoDB
category: Other
code_hash: 7d751f624d7bbb1b691ac33e2946f2b503c7a129ad9b490811c60d03b5f90921
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/nocodb
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.NocoDB = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const OperationDescription_1 = require("./OperationDescription");
  class NocoDB {
      constructor() {
          this.description = {
              displayName: 'NocoDB',
              name: 'nocoDb',
              icon: 'file:nocodb.svg',
              group: ['input'],
              version: [1, 2],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Read, update, write and delete data from NocoDB',
              defaults: {
                  name: 'NocoDB',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'nocoDb',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['nocoDb'],
                          },
                      },
                  },
                  {
                      name: 'nocoDbApiToken',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['nocoDbApiToken'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'User Token',
                              value: 'nocoDb',
                          },
                          {
                              name: 'API Token',
                              value: 'nocoDbApiToken',
                          },
                      ],
                      default: 'nocoDb',
                  },
                  {
                      displayName: 'API Version',
                      name: 'version',
                      type: 'options',
                      displayOptions: {
                          show: {
                              '@version': [1],
                          },
                      },
                      isNodeSetting: true,
                      options: [
                          {
                              name: 'Before v0.90.0',
                              value: 1,
                          },
                          {
                              name: 'v0.90.0 Onwards',
                              value: 2,
                          },
                      ],
                      default: 1,
                  },
                  {
                      displayName: 'API Version',
                      name: 'version',
                      type: 'options',
                      displayOptions: {
                          show: {
                              '@version': [2],
                          },
                      },
                      isNodeSetting: true,
                      options: [
                          {
                              name: 'Before v0.90.0',
                              value: 1,
                          },
                          {
                              name: 'v0.90.0 Onwards',
                              value: 2,
                          },
                      ],
                      default: 2,
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Row',
                              value: 'row',
                          },
                      ],
                      default: 'row',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['row'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a row',
                              action: 'Create a row',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a row',
                              action: 'Delete a row',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve a row',
                              action: 'Get a row',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Retrieve many rows',
                              action: 'Get many rows',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a row',
                              action: 'Update a row',
                          },
                      ],
                      default: 'get',
                  },
                  ...OperationDescription_1.operationFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getProjects() {
                      try {
                          const requestMethod = 'GET';
                          const endpoint = '/api/v1/db/meta/projects/';
                          const responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endpoint, {}, {});
                          return responseData.list.map((i) => ({ name: i.title, value: i.id }));
                      }
                      catch (e) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), new Error('Error while fetching projects!', { cause: e }));
                      }
                  },
                  async getTables() {
                      const projectId = this.getNodeParameter('projectId', 0);
                      if (projectId) {
                          try {
                              const requestMethod = 'GET';
                              const endpoint = `/api/v1/db/meta/projects/${projectId}/tables`;
                              const responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endpoint, {}, {});
                              return responseData.list.map((i) => ({ name: i.title, value: i.id }));
                          }
                          catch (e) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), new Error('Error while fetching tables!', { cause: e }));
                          }
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No project selected!');
                      }
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let responseData;
          const version = this.getNodeParameter('version', 0);
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let returnAll = false;
          let requestMethod = '';
          let qs = {};
          let endPoint = '';
          const projectId = this.getNodeParameter('projectId', 0);
          const table = this.getNodeParameter('table', 0);
          if (resource === 'row') {
              if (operation === 'create') {
                  requestMethod = 'POST';
                  if (version === 1) {
                      endPoint = `/nc/${projectId}/api/v1/${table}/bulk`;
                  }
                  else if (version === 2) {
                      endPoint = `/api/v1/db/data/bulk/noco/${projectId}/${table}`;
                  }
                  const body = [];
                  for (let i = 0; i < items.length; i++) {
                      const newItem = {};
                      const dataToSend = this.getNodeParameter('dataToSend', i);
                      if (dataToSend === 'autoMapInputData') {
                          const incomingKeys = Object.keys(items[i].json);
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputDataToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of incomingKeys) {
                              if (inputDataToIgnore.includes(key))
                                  continue;
                              newItem[key] = items[i].json[key];
                          }
                      }
                      else {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          for (const field of fields) {
                              if (!field.binaryData) {
                                  newItem[field.fieldName] = field.fieldValue;
                              }
                              else if (field.binaryProperty) {
                                  const binaryPropertyName = field.binaryProperty;
                                  const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                  const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                                  const formData = {
                                      file: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                              contentType: binaryData.mimeType,
                                          },
                                      },
                                      json: JSON.stringify({
                                          api: 'xcAttachmentUpload',
                                          project_id: projectId,
                                          dbAlias: 'db',
                                          args: {},
                                      }),
                                  };
                                  let postUrl = '';
                                  if (version === 1) {
                                      postUrl = '/dashboard';
                                  }
                                  else if (version === 2) {
                                      postUrl = '/api/v1/db/storage/upload';
                                  }
                                  responseData = await GenericFunctions_1.apiRequest.call(this, 'POST', postUrl, {}, { project_id: projectId }, undefined, {
                                      formData,
                                  });
                                  newItem[field.fieldName] = JSON.stringify([responseData]);
                              }
                          }
                      }
                      body.push(newItem);
                  }
                  try {
                      responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endPoint, body, qs);
                      let id = responseData[0];
                      for (let i = body.length - 1; i >= 0; i--) {
                          body[i].id = id--;
                      }
                      returnData.push(...body);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          returnData.push({ error: error.toString() });
                      }
                      throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                  }
              }
              if (operation === 'delete') {
                  requestMethod = 'DELETE';
                  let primaryKey = 'id';
                  if (version === 1) {
                      endPoint = `/nc/${projectId}/api/v1/${table}/bulk`;
                  }
                  else if (version === 2) {
                      endPoint = `/api/v1/db/data/bulk/noco/${projectId}/${table}`;
                      primaryKey = this.getNodeParameter('primaryKey', 0);
                      if (primaryKey === 'custom') {
                          primaryKey = this.getNodeParameter('customPrimaryKey', 0);
                      }
                  }
                  const body = [];
                  for (let i = 0; i < items.length; i++) {
                      const id = this.getNodeParameter('id', i);
                      body.push({ [primaryKey]: id });
                  }
                  try {
                      responseData = (await GenericFunctions_1.apiRequest.call(this, requestMethod, endPoint, body, qs));
                      if (version === 1) {
                          returnData.push(...items.map((item) => item.json));
                      }
                      else if (version === 2) {
                          returnData.push(...responseData.map((result, index) => {
                              if (result === 0) {
                                  const errorMessage = `The row with the ID "${body[index].id}" could not be deleted. It probably doesn't exist.`;
                                  if (this.continueOnFail()) {
                                      return { error: errorMessage };
                                  }
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: errorMessage }, { message: errorMessage, itemIndex: index });
                              }
                              return {
                                  success: true,
                              };
                          }));
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          returnData.push({ error: error.toString() });
                      }
                      throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                  }
              }
              if (operation === 'getAll') {
                  const data = [];
                  const downloadAttachments = this.getNodeParameter('downloadAttachments', 0);
                  try {
                      for (let i = 0; i < items.length; i++) {
                          requestMethod = 'GET';
                          if (version === 1) {
                              endPoint = `/nc/${projectId}/api/v1/${table}`;
                          }
                          else if (version === 2) {
                              endPoint = `/api/v1/db/data/noco/${projectId}/${table}`;
                          }
                          returnAll = this.getNodeParameter('returnAll', 0);
                          qs = this.getNodeParameter('options', i, {});
                          if (qs.sort) {
                              const properties = qs.sort.property;
                              qs.sort = properties
                                  .map((prop) => `${prop.direction === 'asc' ? '' : '-'}${prop.field}`)
                                  .join(',');
                          }
                          if (qs.fields) {
                              qs.fields = qs.fields.join(',');
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.apiRequestAllItems.call(this, requestMethod, endPoint, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endPoint, {}, qs);
                              if (version === 2) {
                                  responseData = responseData.list;
                              }
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                          if (downloadAttachments) {
                              const downloadFieldNames = this.getNodeParameter('downloadFieldNames', 0).split(',');
                              const response = await GenericFunctions_1.downloadRecordAttachments.call(this, responseData, downloadFieldNames);
                              data.push(...response);
                          }
                      }
                      if (downloadAttachments) {
                          return [data];
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          returnData.push({ json: { error: error.toString() } });
                      }
                      else {
                          throw error;
                      }
                  }
                  return [returnData];
              }
              if (operation === 'get') {
                  requestMethod = 'GET';
                  const newItems = [];
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const id = this.getNodeParameter('id', i);
                          if (version === 1) {
                              endPoint = `/nc/${projectId}/api/v1/${table}/${id}`;
                          }
                          else if (version === 2) {
                              endPoint = `/api/v1/db/data/noco/${projectId}/${table}/${id}`;
                          }
                          responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endPoint, {}, qs);
                          if (version === 2) {
                              if (Object.keys(responseData).length === 0) {
                                  const errorMessage = `The row with the ID "${id}" could not be queried. It probably doesn't exist.`;
                                  if (this.continueOnFail()) {
                                      newItems.push({ json: { error: errorMessage } });
                                      continue;
                                  }
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: errorMessage }, { message: errorMessage, itemIndex: i });
                              }
                          }
                          const downloadAttachments = this.getNodeParameter('downloadAttachments', i);
                          if (downloadAttachments) {
                              const downloadFieldNames = this.getNodeParameter('downloadFieldNames', i).split(',');
                              const data = await GenericFunctions_1.downloadRecordAttachments.call(this, [responseData], downloadFieldNames);
                              const newItem = {
                                  binary: data[0].binary,
                                  json: {},
                              };
                              const executionData = this.helpers.constructExecutionMetaData([newItem], { itemData: { item: i } });
                              newItems.push(...executionData);
                          }
                          else {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                              newItems.push(...executionData);
                          }
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.toString() }), { itemData: { item: i } });
                              newItems.push(...executionData);
                              continue;
                          }
                          throw new n8n_workflow_1.NodeApiError(this.getNode(), error, { itemIndex: i });
                      }
                  }
                  return [newItems];
              }
              if (operation === 'update') {
                  requestMethod = 'PATCH';
                  let primaryKey = 'id';
                  if (version === 1) {
                      endPoint = `/nc/${projectId}/api/v1/${table}/bulk`;
                      requestMethod = 'PUT';
                  }
                  else if (version === 2) {
                      endPoint = `/api/v1/db/data/bulk/noco/${projectId}/${table}`;
                      primaryKey = this.getNodeParameter('primaryKey', 0);
                      if (primaryKey === 'custom') {
                          primaryKey = this.getNodeParameter('customPrimaryKey', 0);
                      }
                  }
                  const body = [];
                  for (let i = 0; i < items.length; i++) {
                      const id = this.getNodeParameter('id', i);
                      const newItem = { [primaryKey]: id };
                      const dataToSend = this.getNodeParameter('dataToSend', i);
                      if (dataToSend === 'autoMapInputData') {
                          const incomingKeys = Object.keys(items[i].json);
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputDataToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of incomingKeys) {
                              if (inputDataToIgnore.includes(key))
                                  continue;
                              newItem[key] = items[i].json[key];
                          }
                      }
                      else {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          for (const field of fields) {
                              if (!field.binaryData) {
                                  newItem[field.fieldName] = field.fieldValue;
                              }
                              else if (field.binaryProperty) {
                                  const binaryPropertyName = field.binaryProperty;
                                  const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                  const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                                  const formData = {
                                      file: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                              contentType: binaryData.mimeType,
                                          },
                                      },
                                      json: JSON.stringify({
                                          api: 'xcAttachmentUpload',
                                          project_id: projectId,
                                          dbAlias: 'db',
                                          args: {},
                                      }),
                                  };
                                  let postUrl = '';
                                  if (version === 1) {
                                      postUrl = '/dashboard';
                                  }
                                  else if (version === 2) {
                                      postUrl = '/api/v1/db/storage/upload';
                                  }
                                  responseData = await GenericFunctions_1.apiRequest.call(this, 'POST', postUrl, {}, { project_id: projectId }, undefined, {
                                      formData,
                                  });
                                  newItem[field.fieldName] = JSON.stringify([responseData]);
                              }
                          }
                      }
                      body.push(newItem);
                  }
                  try {
                      responseData = (await GenericFunctions_1.apiRequest.call(this, requestMethod, endPoint, body, qs));
                      if (version === 1) {
                          returnData.push(...body);
                      }
                      else if (version === 2) {
                          returnData.push(...responseData.map((result, index) => {
                              if (result === 0) {
                                  const errorMessage = `The row with the ID "${body[index].id}" could not be updated. It probably doesn't exist.`;
                                  if (this.continueOnFail()) {
                                      return { error: errorMessage };
                                  }
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: errorMessage }, { message: errorMessage, itemIndex: index });
                              }
                              return {
                                  success: true,
                              };
                          }));
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          returnData.push({ error: error.toString() });
                      }
                      throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                  }
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.NocoDB = NocoDB;
  //# sourceMappingURL=NocoDB.node.js.map

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

  # NocoDB credentials

  You can use these credentials to authenticate the following nodes:

  - [NocoDB](/integrations/builtin/app-nodes/n8n-nodes-base.nocodb.md)

  ## Supported authentication methods

  - API token (recommended)
  - User auth token

      /// note | User auth token deprecation
      NocoDB deprecated user auth tokens in v0.205.1. Use [API tokens](#using-api-token) instead.
      ///

  ## Related resources

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

  ## Using API token

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

  - An **API Token**
  - Your database **Host**

  To generate an API token:

  1. Log into NocoDB and select the **User menu** in the bottom left sidebar.
  2. Select **Account Settings**.
  3. Open the **Tokens** tab.
  4. Select **Add new API token**.
  5. Enter a **Name** for your token, like `n8n integration`.
  6. Select **Save**.
  7. Copy the **API Token** and enter it in your n8n credential.
  8. Enter the **Host** of your NocoDB instance in your n8n credential, for example `http://localhost:8080`.

  Refer to the NocoDB [API Tokens documentation](https://docs.nocodb.com/account-settings/api-tokens/){:target=_blank .external-link} for more detailed instructions.

  ## Using user auth token

  Before NocoDB deprecated it, user auth token was a temporary token designed for quick experiments with the API, valid for a session until the user logs out or for 10 hours.

  /// note | User auth token deprecation
  NocoDB deprecated user auth tokens in v0.205.1. Use [API tokens](#using-api-token) instead.
  ///

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

  - A **User Token**
  - Your database **Host**

  To generate a user auth token:

  1. Log into NocoDB and select the **User menu** in the bottom left sidebar.
  2. Select **Copy Auth token**.
  3. Enter that auth token as the **User Token** in n8n. 
  4. Enter the **Host** of your NocoDB instance, for example `http://localhost:8080`.

  Refer to the NocoDB [Auth Tokens documentation](https://docs.nocodb.com/account-settings/api-tokens/#auth-tokens){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"1c0d2c85-3c30-453f-8bd8-46bdc09e76c8","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"d44aa1b4086d7742d4c7842e216990ba1a696407340cd48bb2908b05a858842d"}}


node_type: n8n-nodes-base.Orbit
name: Orbit
display_name: Orbit
description: Consume Orbit API
category: Other
code_hash: a764c179c3c5124709b80cdb672b1ef5f68ca0d0116cd4dcb0f972b61cdee72e
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
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.Orbit = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ActivityDescription_1 = require("./ActivityDescription");
  const MemberDescription_1 = require("./MemberDescription");
  const NoteDescription_1 = require("./NoteDescription");
  const PostDescription_1 = require("./PostDescription");
  const moment_1 = __importDefault(require("moment"));
  class Orbit {
      constructor() {
          this.description = {
              displayName: 'Orbit',
              name: 'orbit',
              icon: 'file:orbit.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Orbit API',
              defaults: {
                  name: 'Orbit',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'orbitApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                          {
                              name: 'Member',
                              value: 'member',
                          },
                          {
                              name: 'Note',
                              value: 'note',
                          },
                          {
                              name: 'Post',
                              value: 'post',
                          },
                      ],
                      default: 'member',
                  },
                  ...ActivityDescription_1.activityOperations,
                  ...ActivityDescription_1.activityFields,
                  ...MemberDescription_1.memberOperations,
                  ...MemberDescription_1.memberFields,
                  ...NoteDescription_1.noteOperations,
                  ...NoteDescription_1.noteFields,
                  ...PostDescription_1.postOperations,
                  ...PostDescription_1.postFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getWorkspaces() {
                      const returnData = [];
                      const workspaces = await GenericFunctions_1.orbitApiRequest.call(this, 'GET', '/workspaces');
                      for (const workspace of workspaces.data) {
                          returnData.push({
                              name: workspace.attributes.name,
                              value: workspace.attributes.slug,
                          });
                      }
                      return returnData;
                  },
                  async getActivityTypes() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.orbitApiRequest.call(this, 'GET', '/activity_types');
                      for (const activityType of data) {
                          returnData.push({
                              name: activityType.attributes.short_name,
                              value: activityType.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'activity') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const title = this.getNodeParameter('title', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              title,
                          };
                          if (additionalFields.description) {
                              body.description = additionalFields.description;
                          }
                          if (additionalFields.link) {
                              body.link = additionalFields.link;
                          }
                          if (additionalFields.linkText) {
                              body.link_text = additionalFields.linkText;
                          }
                          if (additionalFields.activityType) {
                              body.activity_type = additionalFields.activityType;
                          }
                          if (additionalFields.key) {
                              body.key = additionalFields.key;
                          }
                          if (additionalFields.occurredAt) {
                              body.occurred_at = additionalFields.occurredAt;
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'POST', `/${workspaceId}/members/${memberId}/activities`, body);
                          responseData = responseData.data;
                      }
                      if (operation === 'getAll') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          let endpoint = `/${workspaceId}/activities`;
                          if (filters.memberId) {
                              endpoint = `/${workspaceId}/members/${filters.memberId}/activities`;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                  }
                  if (resource === 'member') {
                      if (operation === 'upsert') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const member = {};
                          const identity = {};
                          if (additionalFields.bio) {
                              member.bio = additionalFields.bio;
                          }
                          if (additionalFields.birthday) {
                              member.birthday = (0, moment_1.default)(additionalFields.birthday).format('MM-DD-YYYY');
                          }
                          if (additionalFields.company) {
                              member.company = additionalFields.company;
                          }
                          if (additionalFields.location) {
                              member.location = additionalFields.location;
                          }
                          if (additionalFields.name) {
                              member.name = additionalFields.name;
                          }
                          if (additionalFields.bio) {
                              member.bio = additionalFields.bio;
                          }
                          if (additionalFields.pronouns) {
                              member.pronouns = additionalFields.pronouns;
                          }
                          if (additionalFields.shippingAddress) {
                              member.shipping_address = additionalFields.shippingAddress;
                          }
                          if (additionalFields.slug) {
                              member.slug = additionalFields.slug;
                          }
                          if (additionalFields.tagsToAdd) {
                              member.tags_to_add = additionalFields.tagsToAdd;
                          }
                          if (additionalFields.tagList) {
                              member.tag_list = additionalFields.tagList;
                          }
                          if (additionalFields.tshirt) {
                              member.tshirt = additionalFields.tshirt;
                          }
                          if (additionalFields.hasOwnProperty('teammate')) {
                              member.teammate = additionalFields.teammate;
                          }
                          if (additionalFields.url) {
                              member.url = additionalFields.url;
                          }
                          const data = this.getNodeParameter('identityUi', i)
                              .identityValue;
                          if (data) {
                              if (['github', 'twitter', 'discourse'].includes(data.source)) {
                                  identity.source = data.source;
                                  const searchBy = data.searchBy;
                                  if (searchBy === 'id') {
                                      identity.uid = data.id;
                                  }
                                  else {
                                      identity.username = data.username;
                                  }
                                  if (data.source === 'discourse') {
                                      identity.source_host = data.host;
                                  }
                              }
                              else {
                                  identity.email = data.email;
                              }
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'POST', `/${workspaceId}/members`, {
                              member,
                              identity,
                          });
                          responseData = responseData.data;
                      }
                      if (operation === 'delete') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'DELETE', `/${workspaceId}/members/${memberId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const resolve = this.getNodeParameter('resolveIdentities', 0);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'GET', `/${workspaceId}/members/${memberId}`);
                          if (resolve) {
                              (0, GenericFunctions_1.resolveIdentities)(responseData);
                          }
                          responseData = responseData.data;
                      }
                      if (operation === 'getAll') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const options = this.getNodeParameter('options', i);
                          Object.assign(qs, options);
                          qs.resolveIdentities = this.getNodeParameter('resolveIdentities', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', `/${workspaceId}/members`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', `/${workspaceId}/members`, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'lookup') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const source = this.getNodeParameter('source', i);
                          if (['github', 'twitter', 'discourse'].includes(source)) {
                              qs.source = this.getNodeParameter('source', i);
                              const searchBy = this.getNodeParameter('searchBy', i);
                              if (searchBy === 'id') {
                                  qs.uid = this.getNodeParameter('id', i);
                              }
                              else {
                                  qs.username = this.getNodeParameter('username', i);
                              }
                              if (source === 'discourse') {
                                  qs.source_host = this.getNodeParameter('host', i);
                              }
                          }
                          else {
                              qs.email = this.getNodeParameter('email', i);
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'GET', `/${workspaceId}/members/find`, {}, qs);
                          responseData = responseData.data;
                      }
                      if (operation === 'update') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.bio) {
                              body.bio = updateFields.bio;
                          }
                          if (updateFields.birthday) {
                              body.birthday = (0, moment_1.default)(updateFields.birthday).format('MM-DD-YYYY');
                          }
                          if (updateFields.company) {
                              body.company = updateFields.company;
                          }
                          if (updateFields.location) {
                              body.location = updateFields.location;
                          }
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.bio) {
                              body.bio = updateFields.bio;
                          }
                          if (updateFields.pronouns) {
                              body.pronouns = updateFields.pronouns;
                          }
                          if (updateFields.shippingAddress) {
                              body.shipping_address = updateFields.shippingAddress;
                          }
                          if (updateFields.slug) {
                              body.slug = updateFields.slug;
                          }
                          if (updateFields.tagsToAdd) {
                              body.tags_to_add = updateFields.tagsToAdd;
                          }
                          if (updateFields.tagList) {
                              body.tag_list = updateFields.tagList;
                          }
                          if (updateFields.tshirt) {
                              body.tshirt = updateFields.tshirt;
                          }
                          if (updateFields.hasOwnProperty('teammate')) {
                              body.teammate = updateFields.teammate;
                          }
                          if (updateFields.url) {
                              body.url = updateFields.url;
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'PUT', `/${workspaceId}/members/${memberId}`, body);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'note') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const note = this.getNodeParameter('note', i);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'POST', `/${workspaceId}/members/${memberId}/notes`, { body: note });
                          responseData = responseData.data;
                      }
                      if (operation === 'getAll') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs.resolveMember = this.getNodeParameter('resolveMember', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', `/${workspaceId}/members/${memberId}/notes`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', `/${workspaceId}/members/${memberId}/notes`, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'update') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const noteId = this.getNodeParameter('noteId', i);
                          const note = this.getNodeParameter('note', i);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'PUT', `/${workspaceId}/members/${memberId}/notes/${noteId}`, { body: note });
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'post') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const url = this.getNodeParameter('url', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              type: 'post',
                              activity_type: 'post',
                              url,
                          };
                          if (additionalFields.publishedAt) {
                              body.occurred_at = additionalFields.publishedAt;
                              delete body.publishedAt;
                          }
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'POST', `/${workspaceId}/members/${memberId}/activities/`, body);
                          responseData = responseData.data;
                      }
                      if (operation === 'getAll') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          let endpoint = `/${workspaceId}/activities`;
                          qs.type = 'content';
                          if (filters.memberId) {
                              endpoint = `/${workspaceId}/members/${filters.memberId}/activities`;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.orbitApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'delete') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const postId = this.getNodeParameter('postId', i);
                          responseData = await GenericFunctions_1.orbitApiRequest.call(this, 'DELETE', `/${workspaceId}/members/${memberId}/activities/${postId}`);
                          responseData = { success: true };
                      }
                  }
                  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.Orbit = Orbit;
  //# sourceMappingURL=Orbit.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"89de26d2-48eb-4ed8-b56b-a9670b89e940","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"07cbcee949254e087f42fb31755c71759194479bb2ff4dfbdc7c658dab4a6c64"}}


