# nodes

node_type: n8n-nodes-base.Phantombuster
name: Phantombuster
display_name: Phantombuster
description: Consume Phantombuster API
category: Other
code_hash: 75f694de00a8499a39f024ef57ca0c79526b4ea2590dd834c4fdc04f94c2266e
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/phantombuster
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.Phantombuster = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const AgentDescription_1 = require("./AgentDescription");
  class Phantombuster {
      constructor() {
          this.description = {
              displayName: 'Phantombuster',
              name: 'phantombuster',
              icon: 'file:phantombuster.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Phantombuster API',
              defaults: {
                  name: 'Phantombuster',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'phantombusterApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Agent',
                              value: 'agent',
                          },
                      ],
                      default: 'agent',
                  },
                  ...AgentDescription_1.agentOperations,
                  ...AgentDescription_1.agentFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getAgents() {
                      const returnData = [];
                      const responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/agents/fetch-all');
                      for (const item of responseData) {
                          returnData.push({
                              name: item.name,
                              value: item.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          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 === 'agent') {
                      if (operation === 'delete') {
                          const agentId = this.getNodeParameter('agentId', i);
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'POST', '/agents/delete', {
                              id: agentId,
                          });
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const agentId = this.getNodeParameter('agentId', i);
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/agents/fetch', {}, { id: agentId });
                      }
                      if (operation === 'getOutput') {
                          const agentId = this.getNodeParameter('agentId', i);
                          const resolveData = this.getNodeParameter('resolveData', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          qs.id = agentId;
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/agents/fetch-output', {}, qs);
                          if (resolveData) {
                              const { resultObject } = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/containers/fetch-result-object', {}, { id: responseData.containerId });
                              if (resultObject === null) {
                                  responseData = {};
                              }
                              else {
                                  responseData = JSON.parse(resultObject);
                              }
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/agents/fetch-all');
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'launch') {
                          const agentId = this.getNodeParameter('agentId', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const resolveData = this.getNodeParameter('resolveData', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              id: agentId,
                          };
                          if (jsonParameters) {
                              if (additionalFields.argumentsJson) {
                                  body.arguments = (0, GenericFunctions_1.validateJSON)(this, additionalFields.argumentsJson, 'Arguments');
                                  delete additionalFields.argumentsJson;
                              }
                              if (additionalFields.bonusArgumentJson) {
                                  body.bonusArgument = (0, GenericFunctions_1.validateJSON)(this, additionalFields.bonusArgumentJson, 'Bonus Argument');
                                  delete additionalFields.bonusArgumentJson;
                              }
                          }
                          else {
                              const argumentParameters = ((_a = additionalFields.argumentsUi) === null || _a === void 0 ? void 0 : _a.argumentValues) ||
                                  [];
                              body.arguments = argumentParameters.reduce((object, currentValue) => {
                                  object[currentValue.key] = currentValue.value;
                                  return object;
                              }, {});
                              delete additionalFields.argumentsUi;
                              const bonusParameters = ((_b = additionalFields.bonusArgumentUi) === null || _b === void 0 ? void 0 : _b.bonusArgumentValue) || [];
                              body.bonusArgument = bonusParameters.reduce((object, currentValue) => {
                                  object[currentValue.key] = currentValue.value;
                                  return object;
                              }, {});
                              delete additionalFields.bonusArgumentUi;
                          }
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'POST', '/agents/launch', body);
                          if (resolveData) {
                              responseData = await GenericFunctions_1.phantombusterApiRequest.call(this, 'GET', '/containers/fetch', {}, { id: responseData.containerId });
                          }
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Phantombuster = Phantombuster;
  //# sourceMappingURL=Phantombuster.node.js.map

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

  # PhantomBuster credentials

  You can use these credentials to authenticate the following nodes:

  - [PhantomBuster](/integrations/builtin/app-nodes/n8n-nodes-base.phantombuster.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: To get an API key, go to [**Workspace settings**](https://phantombuster.com/workspace-settings){:target=_blank .external-link} **> Third party API keys** and select **+ Add API Key**. Refer to [How to find my API key](https://hub.phantombuster.com/docs/api#how-to-find-my-api-key){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"86b284a7-dc17-4750-9b44-1a0166e90d01","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"05591951a57fbd8bf31128e36168081962386891480a38ef712327556f11343a"}}


node_type: n8n-nodes-base.PostHog
name: PostHog
display_name: PostHog
description: Consume PostHog API
category: Other
code_hash: ab084fdded448bc9cbe6673f2443a4b06bd38e4ef43646e6448998cdf46905d1
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/posthog
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
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.PostHog = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const AliasDescription_1 = require("./AliasDescription");
  const EventDescription_1 = require("./EventDescription");
  const TrackDescription_1 = require("./TrackDescription");
  const IdentityDescription_1 = require("./IdentityDescription");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class PostHog {
      constructor() {
          this.description = {
              displayName: 'PostHog',
              name: 'postHog',
              icon: 'file:postHog.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume PostHog API',
              defaults: {
                  name: 'PostHog',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'postHogApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Alias',
                              value: 'alias',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Identity',
                              value: 'identity',
                          },
                          {
                              name: 'Track',
                              value: 'track',
                          },
                      ],
                      default: 'event',
                  },
                  ...AliasDescription_1.aliasOperations,
                  ...AliasDescription_1.aliasFields,
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...IdentityDescription_1.identityOperations,
                  ...IdentityDescription_1.identityFields,
                  ...TrackDescription_1.trackOperations,
                  ...TrackDescription_1.trackFields,
              ],
          };
      }
      async execute() {
          var _a, _b, _c, _d, _e;
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          if (resource === 'alias') {
              if (operation === 'create') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const distinctId = this.getNodeParameter('distinctId', i);
                          const alias = this.getNodeParameter('alias', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const context = ((_a = additionalFields.contextUi) === null || _a === void 0 ? void 0 : _a.contextValues) || [];
                          const event = {
                              type: 'alias',
                              event: '$create_alias',
                              context: context.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                              properties: {
                                  distinct_id: distinctId,
                                  alias,
                              },
                          };
                          Object.assign(event, additionalFields);
                          if (additionalFields.timestamp) {
                              additionalFields.timestamp = (0, moment_timezone_1.default)(additionalFields.timestamp).toISOString();
                          }
                          responseData = await GenericFunctions_1.posthogApiRequest.call(this, 'POST', '/batch', event);
                          returnData.push(responseData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              returnData.push({ error: error.message });
                              continue;
                          }
                          throw error;
                      }
                  }
              }
          }
          if (resource === 'event') {
              if (operation === 'create') {
                  try {
                      const events = [];
                      for (let i = 0; i < length; i++) {
                          const eventName = this.getNodeParameter('eventName', i);
                          const distinctId = this.getNodeParameter('distinctId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const properties = ((_b = additionalFields.propertiesUi) === null || _b === void 0 ? void 0 : _b.propertyValues) ||
                              [];
                          const event = {
                              event: eventName,
                              properties: properties.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                          };
                          event.properties.distinct_id = distinctId;
                          Object.assign(event, additionalFields);
                          if (additionalFields.timestamp) {
                              additionalFields.timestamp = (0, moment_timezone_1.default)(additionalFields.timestamp).toISOString();
                          }
                          delete event.propertiesUi;
                          events.push(event);
                      }
                      responseData = await GenericFunctions_1.posthogApiRequest.call(this, 'POST', '/capture', { batch: events });
                      returnData.push(responseData);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          returnData.push({ error: error.message });
                      }
                      else {
                          throw error;
                      }
                  }
              }
          }
          if (resource === 'identity') {
              if (operation === 'create') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const distinctId = this.getNodeParameter('distinctId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const properties = ((_c = additionalFields.propertiesUi) === null || _c === void 0 ? void 0 : _c.propertyValues) ||
                              [];
                          const event = {
                              event: '$identify',
                              properties: properties.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                              distinct_id: distinctId,
                          };
                          Object.assign(event, additionalFields);
                          if (additionalFields.timestamp) {
                              additionalFields.timestamp = (0, moment_timezone_1.default)(additionalFields.timestamp).toISOString();
                          }
                          delete event.propertiesUi;
                          responseData = await GenericFunctions_1.posthogApiRequest.call(this, 'POST', '/batch', event);
                          returnData.push(responseData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              returnData.push({ error: error.message });
                              continue;
                          }
                          throw error;
                      }
                  }
              }
          }
          if (resource === 'track') {
              if (operation === 'page' || operation === 'screen') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const distinctId = this.getNodeParameter('distinctId', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const context = ((_d = additionalFields.contextUi) === null || _d === void 0 ? void 0 : _d.contextValues) || [];
                          const properties = ((_e = additionalFields.propertiesUi) === null || _e === void 0 ? void 0 : _e.propertyValues) ||
                              [];
                          const event = {
                              name,
                              type: operation,
                              event: `$${operation}`,
                              context: context.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                              distinct_id: distinctId,
                              properties: properties.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}),
                          };
                          Object.assign(event, additionalFields);
                          if (additionalFields.timestamp) {
                              additionalFields.timestamp = (0, moment_timezone_1.default)(additionalFields.timestamp).toISOString();
                          }
                          delete event.propertiesUi;
                          responseData = await GenericFunctions_1.posthogApiRequest.call(this, 'POST', '/batch', event);
                          returnData.push(responseData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              returnData.push({ error: error.message });
                              continue;
                          }
                          throw error;
                      }
                  }
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.PostHog = PostHog;
  //# sourceMappingURL=PostHog.node.js.map

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

  # PostHog credentials

  You can use these credentials to authenticate the following nodes:

  - [PostHog](/integrations/builtin/app-nodes/n8n-nodes-base.posthog.md)

  ## Prerequisites

  Create a [PostHog](https://posthog.com/){:target=_blank .external-link} account or host PostHog on your server.

  ## Supported authentication methods

  - API key

  ## Related resources

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


  ## Using API key

  To configure this credential, you'll need:

  - The API **URL**: Enter the correct domain for your API requests:
      - On US Cloud, use `https://us.i.posthog.com` for public POST-only endpoints or `https://us.posthog.com` for private endpoints.
      - On EU Cloud, use `https://eu.i.posthog.com` for public POST-only endpoints or `https://eu.posthog.com` for private endpoints.
      - For self-hosted instances, use your self-hosted domain. 
      - Confirm yours by checking your PostHog instance URL.
  - An **API Key**: The API key you use depends on whether you're accessing public or private endpoints:
      - For public POST-only endpoints, use a [Project API key](https://app.posthog.com/project/settings) from your project's **General** Settings.
      - For private endpoints, use a [Personal API key](https://app.posthog.com/settings/user-api-keys) from your User account's **Personal API Keys** Settings. Refer to [How to obtain a personal API key](https://posthog.com/docs/api#private-endpoint-authentication){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"6633e437-ca78-4805-9fc3-94f7bbaea949","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"c54e8ba288c20efd0917c789992ae26deaaf420a4a8c62ff24e5e565d0bf9860"}}


node_type: n8n-nodes-base.Plivo
name: Plivo
display_name: Plivo
description: Send SMS/MMS messages or make phone calls
category: Other
code_hash: 59e0f9f644243d74ed88941e6038e4e863bd1fdf3166997922be2484773ead0c
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/plivo
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Plivo = void 0;
  const SmsDescription_1 = require("./SmsDescription");
  const MmsDescription_1 = require("./MmsDescription");
  const CallDescription_1 = require("./CallDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Plivo {
      constructor() {
          this.description = {
              displayName: 'Plivo',
              name: 'plivo',
              icon: 'file:plivo.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Send SMS/MMS messages or make phone calls',
              defaults: {
                  name: 'Plivo',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'plivoApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Call',
                              value: 'call',
                          },
                          {
                              name: 'MMS',
                              value: 'mms',
                          },
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                      ],
                      default: 'sms',
                      required: true,
                  },
                  ...SmsDescription_1.smsOperations,
                  ...SmsDescription_1.smsFields,
                  ...MmsDescription_1.mmsOperations,
                  ...MmsDescription_1.mmsFields,
                  ...CallDescription_1.callOperations,
                  ...CallDescription_1.callFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              let responseData;
              if (resource === 'sms') {
                  if (operation === 'send') {
                      const body = {
                          src: this.getNodeParameter('from', i),
                          dst: this.getNodeParameter('to', i),
                          text: this.getNodeParameter('message', i),
                      };
                      responseData = await GenericFunctions_1.plivoApiRequest.call(this, 'POST', '/Message', body);
                  }
              }
              else if (resource === 'call') {
                  if (operation === 'make') {
                      const body = {
                          from: this.getNodeParameter('from', i),
                          to: this.getNodeParameter('to', i),
                          answer_url: this.getNodeParameter('answer_url', i),
                          answer_method: this.getNodeParameter('answer_method', i),
                      };
                      responseData = await GenericFunctions_1.plivoApiRequest.call(this, 'POST', '/Call', body);
                  }
              }
              else if (resource === 'mms') {
                  if (operation === 'send') {
                      const body = {
                          src: this.getNodeParameter('from', i),
                          dst: this.getNodeParameter('to', i),
                          text: this.getNodeParameter('message', i),
                          type: 'mms',
                          media_urls: this.getNodeParameter('media_urls', i),
                      };
                      responseData = await GenericFunctions_1.plivoApiRequest.call(this, 'POST', '/Message', body);
                  }
              }
              Array.isArray(responseData)
                  ? returnData.push(...responseData)
                  : returnData.push(responseData);
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Plivo = Plivo;
  //# sourceMappingURL=Plivo.node.js.map

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

  # Plivo credentials

  You can use these credentials to authenticate the following nodes:

  - [Plivo](/integrations/builtin/app-nodes/n8n-nodes-base.plivo.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - Basic auth

  ## Related resources

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

  ## Using basic auth

  To configure this credential, you'll need:

  - An **Auth ID**: Acts like your username. Copy yours from the **Overview** page of the Plivo [console](https://console.plivo.com/dashboard/){:target=_blank .external-link}.
  - An **Auth Token**: Acts like a password. Copy yours from the **Overview** page of the Plivo [console](https://console.plivo.com/dashboard/){:target=_blank .external-link}.

  Refer to [How can I change my Auth ID or Auth Token?](https://support.plivo.com/hc/en-us/articles/360041731231-How-can-I-change-my-Auth-ID-or-Auth-Token){:target=_blank .external-link} for more detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"15ac5982-2955-4420-8225-890c05b705d8","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"f83d79457c3a8364c1e5d4dc8725657feebe9100c22ced1dcd781e684e06f36b"}}


node_type: n8n-nodes-base.PostBin
name: PostBin
display_name: PostBin
description: Consume PostBin API
category: Other
code_hash: d01bdc82f547c37c7bfdb49f1c686731effa08a49d92aef848e18de371f08995
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.postbin
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PostBin = void 0;
  const BinDescription_1 = require("./BinDescription");
  const RequestDescription_1 = require("./RequestDescription");
  class PostBin {
      constructor() {
          this.description = {
              displayName: 'PostBin',
              name: 'postBin',
              icon: 'file:postbin.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
              description: 'Consume PostBin API',
              defaults: {
                  name: 'PostBin',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [],
              requestDefaults: {
                  baseURL: 'https://www.toptal.com',
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Bin',
                              value: 'bin',
                          },
                          {
                              name: 'Request',
                              value: 'request',
                          },
                      ],
                      default: 'bin',
                      required: true,
                  },
                  ...BinDescription_1.binOperations,
                  ...BinDescription_1.binFields,
                  ...RequestDescription_1.requestOperations,
                  ...RequestDescription_1.requestFields,
              ],
          };
      }
  }
  exports.PostBin = PostBin;
  //# sourceMappingURL=PostBin.node.js.map

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

  # PostBin node

  PostBin is a service that helps you test API clients and webhooks. Use the PostBin node to automate work in PostBin, and integrate PostBin with other applications. n8n has built-in support for a wide range of PostBin features, including creating and deleting bins, and getting and sending requests. 

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

  ## Operations

  * Bin
  	* Create
  	* Get
  	* Delete
  * Request
  	* Get
  	* Remove First
  	* Send

  ## Templates and examples

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

  ## Send requests

  To send requests to a PostBin bin:

  1. Go to [PostBin](https://www.toptal.com/developers/postbin/){:target=_blank .external-link} and follow the steps to generate a new bin. PostBin gives you a unique URL, including a bin ID.
  2. In the PostBin node, select the **Request** resource.
  3. Choose the type of **Operation** you want to perform.
  4. Enter your bin ID in **Bin ID**.

  ## Create and manage bins

  You can create and manage PostBin bins using the PostBin node. 

  1. In **Resource**, select **Bin**.
  2. Choose an **Operation**. You can create, delete, or get a bin.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"924456f1-8509-4fc8-80dd-55264fd88f9e","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"de194c83758d9a83f3185ed297263ffce36b896e1b26eeb43c32190f987c1ab4"}}


node_type: n8n-nodes-base.Postgres
name: Postgres
display_name: Postgres
description: Get, add and update data in Postgres
category: Other
code_hash: 6bdb276eca46056e106989dfd542127bc76e07d729529f072cb538f2e2e0d93f
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/postgres
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Postgres = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const PostgresV1_node_1 = require("./v1/PostgresV1.node");
  const PostgresV2_node_1 = require("./v2/PostgresV2.node");
  class Postgres extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Postgres',
              name: 'postgres',
              icon: 'file:postgres.svg',
              group: ['input'],
              defaultVersion: 2.3,
              description: 'Get, add and update data in Postgres',
          };
          const nodeVersions = {
              1: new PostgresV1_node_1.PostgresV1(baseDescription),
              2: new PostgresV2_node_1.PostgresV2(baseDescription),
              2.1: new PostgresV2_node_1.PostgresV2(baseDescription),
              2.2: new PostgresV2_node_1.PostgresV2(baseDescription),
              2.3: new PostgresV2_node_1.PostgresV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Postgres = Postgres;
  //# sourceMappingURL=Postgres.node.js.map

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

  # Postgres credentials

  You can use these credentials to authenticate the following nodes:

  - [Postgres](/integrations/builtin/app-nodes/n8n-nodes-base.postgres/index.md)
  - [Agent](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/index.md)
  - [Postgres Chat Memory](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorypostgreschat.md) 
  - [PGVector Vector Store](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepgvector.md) 

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

  ## Prerequisites

  [Create a user account](https://www.postgresql.org/docs/current/sql-createuser.html) on a Postgres server. 

  ## Supported authentication methods

  - Database connection

  ## Related resources

  Refer to [Postgres's documentation](https://www.postgresql.org/docs/16/index.html){:target=_blank .external-link} for more information about the service.

  ## Using database connection

  To configure this credential, you'll need:

  - The **Host** or domain name for the server.
  - The **Database** name.
  - A **User** name.
  - A user **Password**.
  - **Ignore SSL Issues**: Set whether the credential connects if SSL validation fails.
  - **SSL**: Choose whether to use SSL in your connection.
  - The **Port** number to use for the connection.
  - **SSH Tunnel**: Choose if you want to use SSH to encrypt the network connection with the Postgres server.

  To set up the database connection:

  1. Enter the **Host** or domain name for the Postgres server. You can either run the `/conninfo` command to confirm the host name or run this query:

      ```
      SELECT inet_server_addr();
      ```

  2. Enter the **Database** name. Run the `/conninfo` command to confirm the database name.
  3. Enter the **User** name of the user you wish to connect as.
  4. Enter the user's **Password**.
  5. **Ignore SSL Issues**: If you turn this on, the credential will connect even if SSL validation fails.
  6. **SSL**: Choose whether to use SSL in your connection. Refer to Postgres [SSL Support](https://www.postgresql.org/docs/16/libpq-ssl.html){:target=_blank .external-link} for more information. Options include:
      - **Allow**: Sets the `ssl-mode` parameter to `allow`. First try a non-SSL connection; if that fails, try an SSL connection.
      - **Disable**: Sets the `ssl-mode` parameter to `disable`. Only try a non-SSL connection.
      - **Require**: Sets the `ssl-mode` parameter to `require`. Only try an SSL connection. If a root CA file is present, verify that a trusted certificate authority (CA) issued the server certificate.
  7. Enter the **Port** number to use for the connection. You can either run the `/conninfo` command to confirm the host name or run this query:

      ```
      SELECT inet_server_port();
      ```

  8. **SSH Tunnel**: Turn this setting on to connect to the database over SSH. Refer to [SSH tunnel limitations](#ssh-tunnel-limitations) for some guidance around using SSH. Once turned on, you'll need:
      1. Select **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 remote bind address you're connecting to as the **SSH Host**.
      3. **SSH Port**: Enter the local port number for the SSH tunnel.
      4. **SSH Postgres Port**: Enter the remote end of the tunnel, the port number the database server is using.
      5. **SSH User**: Enter the username to log in as.
      6. If you selected **Password** for SSH Authenticate with, add the user's **SSH Password**.
      7. If you selected **Private Key** for **SSH Authenticate with**:
          1. Add the contents of the **Private Key** or identity file used for SSH.
          2. If the **Private Key** was created with a passphrase, enter that **Passphrase**. If the **Private Ke**y has no passphrase, leave this field blank.

  Refer to [Secure TCP/IP Connections with SSH Tunnels](https://www.postgresql.org/docs/16/ssh-tunnels.html){:target=_blank .external-link} for more information.

  ### SSH tunnel limitations

  Only use the **SSH Tunnel** setting if:

  - You're using the credential with the [Postgres](/integrations/builtin/app-nodes/n8n-nodes-base.postgres/index.md) node (Agent node doesn't support SSH tunnels).
  - You have an SSH server running on the same machine as the Postgres server.
  - You have a user account that can log in using `ssh`.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"21ab5aac-f9a8-4368-99a4-97a86e5365ec","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"b278d207bfac63bd67a4a6f7393b73dddd9d837bb8218b2390db88218a51566c"}}


node_type: n8n-nodes-base.Pushbullet
name: Pushbullet
display_name: Pushbullet
description: Consume Pushbullet API
category: Other
code_hash: 6352a9ed63d4fb5cd185cf85a29778fb67757992f84c8013c03bf4eab023e94a
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/pushbullet
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
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.Pushbullet = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Pushbullet {
      constructor() {
          this.description = {
              displayName: 'Pushbullet',
              name: 'pushbullet',
              icon: 'file:pushbullet.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Pushbullet API',
              defaults: {
                  name: 'Pushbullet',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pushbulletOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Push',
                              value: 'push',
                          },
                      ],
                      default: 'push',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a push',
                              action: 'Create a push',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a push',
                              action: 'Delete a push',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many pushes',
                              action: 'Get many pushes',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a push',
                              action: 'Update a push',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      type: 'options',
                      options: [
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Link',
                              value: 'link',
                          },
                          {
                              name: 'Note',
                              value: 'note',
                          },
                      ],
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                          },
                      },
                      default: 'note',
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              type: ['note', 'link'],
                          },
                      },
                      default: '',
                      description: 'Title of the push',
                  },
                  {
                      displayName: 'Body',
                      name: 'body',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              type: ['note', 'link', 'file'],
                          },
                      },
                      default: '',
                      description: 'Body of the push',
                  },
                  {
                      displayName: 'URL',
                      name: 'url',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              type: ['link'],
                          },
                      },
                      default: '',
                      description: 'URL of the push',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              type: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file to be created',
                  },
                  {
                      displayName: 'Target',
                      name: 'target',
                      type: 'options',
                      options: [
                          {
                              name: 'Channel Tag',
                              value: 'channel_tag',
                              description: 'Send the push to all subscribers to your channel that has this tag',
                          },
                          {
                              name: 'Default',
                              value: 'default',
                              description: "Broadcast it to all of the user's devices",
                          },
                          {
                              name: 'Device ID',
                              value: 'device_iden',
                              description: 'Send the push to a specific device',
                          },
                          {
                              name: 'Email',
                              value: 'email',
                              description: 'Send the push to this email address',
                          },
                      ],
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                          },
                      },
                      default: 'default',
                      description: 'Define the medium that will be used to send the push',
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                          },
                          hide: {
                              target: ['default', 'device_iden'],
                          },
                      },
                      default: '',
                      description: 'The value to be set depending on the target selected. For example, if the target selected is email then this field would take the email address of the person you are trying to send the push to.',
                  },
                  {
                      displayName: 'Value Name or ID',
                      name: 'value',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getDevices',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['create'],
                              target: ['device_iden'],
                          },
                      },
                      default: '',
                      description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                  },
                  {
                      displayName: 'Push ID',
                      name: 'pushId',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['delete'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['push'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['push'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 500,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['getAll'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Active',
                              name: 'active',
                              type: 'boolean',
                              default: false,
                              description: "Don't return deleted pushes",
                          },
                          {
                              displayName: 'Modified After',
                              name: 'modified_after',
                              type: 'dateTime',
                              default: '',
                              description: 'Request pushes modified after this timestamp',
                          },
                      ],
                  },
                  {
                      displayName: 'Push ID',
                      name: 'pushId',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['update'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Dismissed',
                      name: 'dismissed',
                      type: 'boolean',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['push'],
                              operation: ['update'],
                          },
                      },
                      default: false,
                      description: 'Whether to mark a push as having been dismissed by the user, will cause any notifications for the push to be hidden if possible',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getDevices() {
                      const returnData = [];
                      const { devices } = await GenericFunctions_1.pushbulletApiRequest.call(this, 'GET', '/devices');
                      for (const device of devices) {
                          returnData.push({
                              name: device.nickname,
                              value: device.iden,
                          });
                      }
                      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 === 'push') {
                      if (operation === 'create') {
                          const type = this.getNodeParameter('type', i);
                          const message = this.getNodeParameter('body', i);
                          const target = this.getNodeParameter('target', i);
                          const body = {
                              type,
                              body: message,
                          };
                          if (target !== 'default') {
                              const value = this.getNodeParameter('value', i);
                              body[target] = value;
                          }
                          if (['note', 'link'].includes(type)) {
                              body.title = this.getNodeParameter('title', i);
                              if (type === 'link') {
                                  body.url = this.getNodeParameter('url', i);
                              }
                          }
                          if (type === 'file') {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              const { upload_url: uploadUrl, file_name, file_type, file_url, } = await GenericFunctions_1.pushbulletApiRequest.call(this, 'POST', '/upload-request', {
                                  file_name: binaryData.fileName,
                                  file_type: binaryData.mimeType,
                              });
                              await GenericFunctions_1.pushbulletApiRequest.call(this, 'POST', '', {}, {}, uploadUrl, {
                                  formData: {
                                      file: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                                  json: false,
                              });
                              body.file_name = file_name;
                              body.file_type = file_type;
                              body.file_url = file_url;
                          }
                          responseData = await GenericFunctions_1.pushbulletApiRequest.call(this, 'POST', '/pushes', body);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          if (qs.modified_after) {
                              qs.modified_after = (0, moment_timezone_1.default)(qs.modified_after).unix();
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.pushbulletApiRequestAllItems.call(this, 'pushes', 'GET', '/pushes', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.pushbulletApiRequest.call(this, 'GET', '/pushes', {}, qs);
                              responseData = responseData.pushes;
                          }
                      }
                      if (operation === 'delete') {
                          const pushId = this.getNodeParameter('pushId', i);
                          responseData = await GenericFunctions_1.pushbulletApiRequest.call(this, 'DELETE', `/pushes/${pushId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'update') {
                          const pushId = this.getNodeParameter('pushId', i);
                          const dismissed = this.getNodeParameter('dismissed', i);
                          responseData = await GenericFunctions_1.pushbulletApiRequest.call(this, 'POST', `/pushes/${pushId}`, {
                              dismissed,
                          });
                      }
                  }
                  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.Pushbullet = Pushbullet;
  //# sourceMappingURL=Pushbullet.node.js.map

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

  # Pushbullet credentials

  You can use these credentials to authenticate the following nodes:

  - [Pushbullet](/integrations/builtin/app-nodes/n8n-nodes-base.pushbullet.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - OAuth2

  ## Related resources

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

  ## Using OAuth2

  To configure this credential, you'll need:

  - A **Client ID**: Generated when you create a Pushbullet app, also known as an OAuth client.
  - A **Client Secret**: Generated when you create a Pushbullet app, also known as an OAuth client.

  To generate the **Client ID** and **Client Secret**, go to the [create client](https://www.pushbullet.com/create-client) page. Copy the **OAuth Redirect URL** from n8n and add this as your **redirect_uri** for the app/client. Use the **client_id** and **client_secret** from the OAuth Client in your n8n credential.

  Refer to Pushbullet's [OAuth2 Guide](https://docs.pushbullet.com/#oauth2) for more information.

  /// note | Pushbullet OAuth test link
  Pushbullet offers a test link during the client creation process described above. This link isn't compatible with n8n. To verify the authentication works, use the **Connect my account** button in n8n.
  ///

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"a9dc57d1-66c2-4f53-86bc-55a5eda5841b","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"f6b7281320710afb993fa156abe836287b27446ad8d71575fc2381a09ce46a46"}}


node_type: n8n-nodes-base.ProfitWell
name: ProfitWell
display_name: ProfitWell
description: Consume ProfitWell API
category: Other
code_hash: 8d5fd3fd10d49adac3de5845568dad48b59fefc816b7de39f98c02e402fb38ae
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/profitwell
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ProfitWell = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const CompanyDescription_1 = require("./CompanyDescription");
  const MetricDescription_1 = require("./MetricDescription");
  class ProfitWell {
      constructor() {
          this.description = {
              displayName: 'ProfitWell',
              name: 'profitWell',
              icon: 'file:profitwell.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume ProfitWell API',
              defaults: {
                  name: 'ProfitWell',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'profitWellApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Company',
                              value: 'company',
                          },
                          {
                              name: 'Metric',
                              value: 'metric',
                          },
                      ],
                      default: 'metric',
                  },
                  ...CompanyDescription_1.companyOperations,
                  ...MetricDescription_1.metricOperations,
                  ...MetricDescription_1.metricFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getPlanIds() {
                      const returnData = [];
                      const planIds = await GenericFunctions_1.profitWellApiRequest.call(this, 'GET', '/metrics/plans');
                      for (const planId of planIds.plan_ids) {
                          returnData.push({
                              name: planId,
                              value: planId,
                          });
                      }
                      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 === 'company') {
                      if (operation === 'getSetting') {
                          responseData = await GenericFunctions_1.profitWellApiRequest.call(this, 'GET', '/company/settings/');
                      }
                  }
                  if (resource === 'metric') {
                      if (operation === 'get') {
                          const type = this.getNodeParameter('type', i);
                          const simple = this.getNodeParameter('simple', 0);
                          if (type === 'daily') {
                              qs.month = this.getNodeParameter('month', i);
                          }
                          const options = this.getNodeParameter('options', i);
                          Object.assign(qs, options);
                          if (qs.dailyMetrics) {
                              qs.metrics = qs.dailyMetrics.join(',');
                              delete qs.dailyMetrics;
                          }
                          if (qs.monthlyMetrics) {
                              qs.metrics = qs.monthlyMetrics.join(',');
                              delete qs.monthlyMetrics;
                          }
                          responseData = await GenericFunctions_1.profitWellApiRequest.call(this, 'GET', `/metrics/${type}`, {}, qs);
                          responseData = responseData.data;
                          if (simple) {
                              if (type === 'daily') {
                                  responseData = (0, GenericFunctions_1.simplifyDailyMetrics)(responseData);
                              }
                              else {
                                  responseData = (0, GenericFunctions_1.simplifyMontlyMetrics)(responseData);
                              }
                          }
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.ProfitWell = ProfitWell;
  //# sourceMappingURL=ProfitWell.node.js.map

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

  # ProfitWell credentials

  You can use these credentials to authenticate the following nodes:

  - [ProfitWell](/integrations/builtin/app-nodes/n8n-nodes-base.profitwell.md)

  ## Prerequisites

  Create a [ProfitWell](https://www2.profitwell.com/signup/start){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API token

  ## Related resources

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

  ## Using API token

  To configure this credential, you'll need:

  - An **API Token**: To get an API key or token, go to **Account Settings > Integrations** and select **ProfitWell API**. 

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"8e42cbcf-46af-4953-8566-86287391e8d4","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"062a9681be4e327e533baf91b78305f750eb123afa9b41ad228966f0311b9b12"}}


node_type: n8n-nodes-base.Pushcut
name: Pushcut
display_name: Pushcut
description: Consume Pushcut API
category: Other
code_hash: 7b69beb7d523647571e05d593f709612aad72eb64f56b0f87ac030ea69eb03eb
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/pushcut
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Pushcut = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Pushcut {
      constructor() {
          this.description = {
              displayName: 'Pushcut',
              name: 'pushcut',
              icon: 'file:pushcut.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Pushcut API',
              defaults: {
                  name: 'Pushcut',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pushcutApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Notification',
                              value: 'notification',
                          },
                      ],
                      default: 'notification',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['notification'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send a notification',
                              action: 'Send a notification',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'Notification Name or ID',
                      name: 'notificationName',
                      type: 'options',
                      description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                      typeOptions: {
                          loadOptionsMethod: 'getNotifications',
                      },
                      displayOptions: {
                          show: {
                              resource: ['notification'],
                              operation: ['send'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['notification'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Device Names or IDs',
                              name: 'devices',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getDevices',
                              },
                              default: [],
                              description: 'List of devices this notification is sent to. (default is all devices). Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Input',
                              name: 'input',
                              type: 'string',
                              default: '',
                              description: 'Value that is passed as input to the notification action',
                          },
                          {
                              displayName: 'Text',
                              name: 'text',
                              type: 'string',
                              default: '',
                              description: 'Text that is used instead of the one defined in the app',
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'Title that is used instead of the one defined in the app',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getDevices() {
                      const returnData = [];
                      const devices = await GenericFunctions_1.pushcutApiRequest.call(this, 'GET', '/devices');
                      for (const device of devices) {
                          returnData.push({
                              name: device.id,
                              value: device.id,
                          });
                      }
                      return returnData;
                  },
                  async getNotifications() {
                      const returnData = [];
                      const notifications = await GenericFunctions_1.pushcutApiRequest.call(this, 'GET', '/notifications');
                      for (const notification of notifications) {
                          returnData.push({
                              name: notification.title,
                              value: notification.id,
                          });
                      }
                      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++) {
              if (resource === 'notification') {
                  if (operation === 'send') {
                      const notificationName = this.getNodeParameter('notificationName', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {};
                      Object.assign(body, additionalFields);
                      responseData = await GenericFunctions_1.pushcutApiRequest.call(this, 'POST', `/notifications/${encodeURI(notificationName)}`, body);
                  }
              }
          }
          if (Array.isArray(responseData)) {
              returnData.push.apply(returnData, responseData);
          }
          else if (responseData !== undefined) {
              returnData.push(responseData);
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Pushcut = Pushcut;
  //# sourceMappingURL=Pushcut.node.js.map

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

  # Pushcut credentials

  You can use these credentials to authenticate the following nodes:

  - [Pushcut](/integrations/builtin/app-nodes/n8n-nodes-base.pushcut.md)
  - [Pushcut Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.pushcuttrigger.md)

  ## Prerequisites

  Download the [Pushcut](https://www.pushcut.io){:target=_blank .external-link} app.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Pushcut's Guides documentation](https://www.pushcut.io/guides){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: To generate an API key, go to **Account > Integrations > Add API Key**. Refer to [Create an API key](https://www.pushcut.io/guides/homekit-api-schedule-cancel#step_2){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"76ce3925-4f06-419f-9b98-843322e7b125","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"fd45b0738524c72c170c9300aa3a470a1f5ccaf38c287e1ab40dc52f1d55b7cc"}}


node_type: n8n-nodes-base.ReadBinaryFile
name: ReadBinaryFile
display_name: Read Binary File
description: Reads a binary file from disk
category: Other
code_hash: b25d91d1c599335bb399ef8f8b87952ebc8706ed057404aa453696513fd035f2
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ReadBinaryFile = void 0;
  class ReadBinaryFile {
      constructor() {
          this.description = {
              displayName: 'Read Binary File',
              name: 'readBinaryFile',
              icon: 'fa:file-import',
              group: ['input'],
              version: 1,
              hidden: true,
              description: 'Reads a binary file from disk',
              defaults: {
                  name: 'Read Binary File',
                  color: '#449922',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'File Path',
                      name: 'filePath',
                      type: 'string',
                      default: '',
                      required: true,
                      placeholder: '/data/example.jpg',
                      description: 'Path of the file to read',
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      description: 'Name of the binary property to which to write the data of the read file',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let item;
          for (let itemIndex = 0; itemIndex < length; itemIndex++) {
              try {
                  item = items[itemIndex];
                  const newItem = {
                      json: item.json,
                      binary: {},
                      pairedItem: {
                          item: itemIndex,
                      },
                  };
                  if (item.binary !== undefined && newItem.binary) {
                      Object.assign(newItem.binary, item.binary);
                  }
                  const filePath = this.getNodeParameter('filePath', itemIndex);
                  const stream = await this.helpers.createReadStream(filePath);
                  const dataPropertyName = this.getNodeParameter('dataPropertyName', itemIndex);
                  newItem.binary[dataPropertyName] = await this.helpers.prepareBinaryData(stream, filePath);
                  returnData.push(newItem);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.ReadBinaryFile = ReadBinaryFile;
  //# sourceMappingURL=ReadBinaryFile.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"13f30b3c-b969-4f78-b1e1-ede6ad4230c5","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"0ab18cdaf1aa194117fd630244b69aca53f75a01b8b2f8ad3b3d8b38588a5657"}}


node_type: n8n-nodes-base.Pushover
name: Pushover
display_name: Pushover
description: Consume Pushover API
category: Other
code_hash: 3a7a4089c5eeea56b94fe3d78b95dbf850e3eefb49b2255fd9e6a6a4de9cf4a9
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/pushover
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Pushover = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Pushover {
      constructor() {
          this.description = {
              displayName: 'Pushover',
              name: 'pushover',
              icon: 'file:pushover.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Pushover API',
              defaults: {
                  name: 'Pushover',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pushoverApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Message',
                              value: 'message',
                          },
                      ],
                      default: 'message',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Push',
                              value: 'push',
                              action: 'Push a message',
                          },
                      ],
                      default: 'push',
                  },
                  {
                      displayName: 'User Key',
                      name: 'userKey',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                          },
                      },
                      default: '',
                      description: 'The user/group key (not e-mail address) of your user (or you), viewable when logged into the <a href="https://pushover.net/">dashboard</a> (often referred to as <code>USER_KEY</code> in the <a href="https://support.pushover.net/i44-example-code-and-pushover-libraries">libraries</a> and code examples)',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                          },
                      },
                      default: '',
                      description: 'Your message',
                  },
                  {
                      displayName: 'Priority',
                      name: 'priority',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                          },
                      },
                      options: [
                          {
                              name: 'Lowest Priority',
                              value: -2,
                          },
                          {
                              name: 'Low Priority',
                              value: -1,
                          },
                          {
                              name: 'Normal Priority',
                              value: 0,
                          },
                          {
                              name: 'High Priority',
                              value: 1,
                          },
                          {
                              name: 'Emergency Priority',
                              value: 2,
                          },
                      ],
                      default: -2,
                      description: "Send as -2 to generate no notification/alert, -1 to always send as a quiet notification, 1 to display as high-priority and bypass the user's quiet hours, or 2 to also require confirmation from the user",
                  },
                  {
                      displayName: 'Retry (Seconds)',
                      name: 'retry',
                      type: 'number',
                      typeOptions: {
                          minValue: 0,
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                              priority: [2],
                          },
                      },
                      default: 30,
                      description: 'Specifies how often (in seconds) the Pushover servers will send the same notification to the user. This parameter must have a value of at least 30 seconds between retries.',
                  },
                  {
                      displayName: 'Expire (Seconds)',
                      name: 'expire',
                      type: 'number',
                      typeOptions: {
                          minValue: 0,
                          maxValue: 10800,
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                              priority: [2],
                          },
                      },
                      default: 30,
                      description: 'Specifies how many seconds your notification will continue to be retried for (every retry seconds)',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['push'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Attachment',
                              name: 'attachmentsUi',
                              placeholder: 'Add Attachments',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: false,
                              },
                              options: [
                                  {
                                      name: 'attachmentsValues',
                                      displayName: 'Attachment Property',
                                      values: [
                                          {
                                              displayName: 'Binary Property',
                                              name: 'binaryPropertyName',
                                              type: 'string',
                                              default: '',
                                              placeholder: 'data',
                                              description: 'Name of the binary properties which contain data which should be added to email as attachment',
                                          },
                                      ],
                                  },
                              ],
                              default: {},
                          },
                          {
                              displayName: 'Device',
                              name: 'device',
                              type: 'string',
                              default: '',
                              description: "Your user's device name to send the message directly to that device, rather than all of the user's devices (multiple devices may be separated by a comma)",
                          },
                          {
                              displayName: 'HTML Formatting',
                              name: 'html',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable messages formatting with HTML tags',
                          },
                          {
                              displayName: 'Sound Name or ID',
                              name: 'sound',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getSounds',
                              },
                              default: '',
                              description: 'The name of one of the sounds supported by device clients to override the user\'s default sound choice. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Timestamp',
                              name: 'timestamp',
                              type: 'dateTime',
                              default: '',
                              description: "A Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API",
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: "Your message's title, otherwise your app's name is used",
                          },
                          {
                              displayName: 'Timestamp',
                              name: 'timestamp',
                              type: 'dateTime',
                              default: '',
                              description: "A Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API",
                          },
                          {
                              displayName: 'URL',
                              name: 'url',
                              type: 'string',
                              default: '',
                              description: 'A supplementary URL to show with your message',
                          },
                          {
                              displayName: 'URL Title',
                              name: 'url_title',
                              type: 'string',
                              default: '',
                              description: 'A title for your supplementary URL, otherwise just the URL is shown',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getSounds() {
                      const { sounds } = await GenericFunctions_1.pushoverApiRequest.call(this, 'GET', '/sounds.json', {});
                      const returnData = [];
                      for (const key of Object.keys(sounds)) {
                          returnData.push({
                              name: sounds[key],
                              value: key,
                          });
                      }
                      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 === 'message') {
                      if (operation === 'push') {
                          const userKey = this.getNodeParameter('userKey', i);
                          const message = this.getNodeParameter('message', i);
                          const priority = this.getNodeParameter('priority', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.html !== undefined) {
                              additionalFields.html = additionalFields.html ? '1' : '';
                          }
                          const body = {
                              user: userKey,
                              message,
                              priority,
                          };
                          if (priority === 2) {
                              body.retry = this.getNodeParameter('retry', i);
                              body.expire = this.getNodeParameter('expire', i);
                          }
                          Object.assign(body, additionalFields);
                          if (body.attachmentsUi) {
                              const attachment = body.attachmentsUi
                                  .attachmentsValues;
                              if (attachment) {
                                  const binaryPropertyName = attachment.binaryPropertyName;
                                  const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                  const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                                  body.attachment = {
                                      value: dataBuffer,
                                      options: {
                                          filename: binaryData.fileName,
                                      },
                                  };
                                  delete body.attachmentsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.pushoverApiRequest.call(this, 'POST', '/messages.json', body);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Pushover = Pushover;
  //# sourceMappingURL=Pushover.node.js.map

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

  # Pushover credentials

  You can use these credentials to authenticate the following nodes:

  - [Pushover](/integrations/builtin/app-nodes/n8n-nodes-base.pushover.md)

  ## Prerequisites

  Create a [Pushover](https://pushover.net){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Pushover's API documentation](https://pushover.net/api){:target=_blank .external-link} for more information about authenticating with the service.

  ## Using API Key

  To configure this credential, you'll need:

  - An **API Key**: Generated when you [register an application](https://pushover.net/apps/build){:target=_blank .external-link}. Refer to [Application Registration](https://pushover.net/api#registration){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"0e4c857a-ea82-45f4-a82c-fa52e50ade4b","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"ec3a69cf72af8d5fdc533a24d5778b78342909ddb809475b876d42c1cb059730"}}


node_type: n8n-nodes-base.QuickChart
name: QuickChart
display_name: QuickChart
description: Create a chart via QuickChart
category: Other
code_hash: 236f4209dd03f420a5ab72f3149e71a3c515733d510f60f8c2bc8db5baa6fbb8
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.quickchart
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.QuickChart = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const constants_1 = require("./constants");
  class QuickChart {
      constructor() {
          this.description = {
              displayName: 'QuickChart',
              name: 'quickChart',
              icon: 'file:quickChart.svg',
              group: ['output'],
              description: 'Create a chart via QuickChart',
              version: 1,
              defaults: {
                  name: 'QuickChart',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Chart Type',
                      name: 'chartType',
                      type: 'options',
                      default: 'bar',
                      options: constants_1.CHART_TYPE_OPTIONS,
                      description: 'The type of chart to create',
                  },
                  {
                      displayName: 'Add Labels',
                      name: 'labelsMode',
                      type: 'options',
                      options: [
                          {
                              name: 'Manually',
                              value: 'manually',
                          },
                          {
                              name: 'From Array',
                              value: 'array',
                          },
                      ],
                      default: 'manually',
                  },
                  {
                      displayName: 'Labels',
                      name: 'labelsUi',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                          sortable: true,
                      },
                      default: {},
                      required: true,
                      description: 'Labels to use in the chart',
                      placeholder: 'Add Label',
                      options: [
                          {
                              name: 'labelsValues',
                              displayName: 'Labels',
                              values: [
                                  {
                                      displayName: 'Label',
                                      name: 'label',
                                      type: 'string',
                                      default: '',
                                  },
                              ],
                          },
                      ],
                      displayOptions: {
                          show: {
                              labelsMode: ['manually'],
                          },
                      },
                  },
                  {
                      displayName: 'Labels Array',
                      name: 'labelsArray',
                      type: 'string',
                      required: true,
                      default: '',
                      placeholder: 'e.g. ["Berlin", "Paris", "Rome", "New York"]',
                      displayOptions: {
                          show: {
                              labelsMode: ['array'],
                          },
                      },
                      description: 'The array of labels to be used in the chart',
                  },
                  {
                      displayName: 'Data',
                      name: 'data',
                      type: 'json',
                      default: '',
                      description: 'Data to use for the dataset, documentation and examples <a href="https://quickchart.io/documentation/chart-types/" target="_blank">here</a>',
                      placeholder: 'e.g. [60, 10, 12, 20]',
                      required: true,
                  },
                  {
                      displayName: 'Put Output In Field',
                      name: 'output',
                      type: 'string',
                      default: 'data',
                      required: true,
                      description: 'The binary data will be displayed in the Output panel on the right, under the Binary tab',
                      hint: 'The name of the output field to put the binary file data in',
                  },
                  {
                      displayName: 'Chart Options',
                      name: 'chartOptions',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Background Color',
                              name: 'backgroundColor',
                              type: 'color',
                              typeOptions: {
                                  showAlpha: true,
                              },
                              default: '',
                              description: 'Background color of the chart',
                          },
                          {
                              displayName: 'Device Pixel Ratio',
                              name: 'devicePixelRatio',
                              type: 'number',
                              default: 2,
                              typeOptions: {
                                  minValue: 1,
                                  maxValue: 2,
                              },
                              description: 'Pixel ratio of the chart',
                          },
                          {
                              displayName: 'Format',
                              name: 'format',
                              type: 'options',
                              default: 'png',
                              description: 'File format of the resulting chart',
                              options: [
                                  {
                                      name: 'PNG',
                                      value: 'png',
                                  },
                                  {
                                      name: 'PDF',
                                      value: 'pdf',
                                  },
                                  {
                                      name: 'SVG',
                                      value: 'svg',
                                  },
                                  {
                                      name: 'WebP',
                                      value: 'webp',
                                  },
                              ],
                          },
                          {
                              displayName: 'Height',
                              name: 'height',
                              type: 'number',
                              default: 300,
                              description: 'Height of the chart',
                          },
                          {
                              displayName: 'Horizontal',
                              name: 'horizontal',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the chart should use its Y axis horizontal',
                              displayOptions: {
                                  show: {
                                      '/chartType': constants_1.HORIZONTAL_CHARTS,
                                  },
                              },
                          },
                          {
                              displayName: 'Width',
                              name: 'width',
                              type: 'number',
                              default: 500,
                              description: 'Width of the chart',
                          },
                      ],
                  },
                  {
                      displayName: 'Dataset Options',
                      name: 'datasetOptions',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Background Color',
                              name: 'backgroundColor',
                              type: 'color',
                              default: '',
                              typeOptions: {
                                  showAlpha: true,
                              },
                              description: 'Color used for the background the dataset (area of a line graph, fill of a bar chart, etc.)',
                          },
                          {
                              displayName: 'Border Color',
                              name: 'borderColor',
                              type: 'color',
                              typeOptions: {
                                  showAlpha: true,
                              },
                              default: '',
                              description: 'Color used for lines of the dataset',
                          },
                          {
                              displayName: 'Fill',
                              name: 'fill',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to fill area of the dataset',
                              displayOptions: {
                                  show: {
                                      '/chartType': constants_1.Fill_CHARTS,
                                  },
                              },
                          },
                          {
                              displayName: 'Label',
                              name: 'label',
                              type: 'string',
                              default: '',
                              description: 'The label of the dataset',
                          },
                          {
                              displayName: 'Point Style',
                              name: 'pointStyle',
                              type: 'options',
                              default: 'circle',
                              description: 'Style to use for points of the dataset',
                              options: [
                                  {
                                      name: 'Circle',
                                      value: 'circle',
                                  },
                                  {
                                      name: 'Cross',
                                      value: 'cross',
                                  },
                                  {
                                      name: 'CrossRot',
                                      value: 'crossRot',
                                  },
                                  {
                                      name: 'Dash',
                                      value: 'dash',
                                  },
                                  {
                                      name: 'Line',
                                      value: 'line',
                                  },
                                  {
                                      name: 'Rect',
                                      value: 'rect',
                                  },
                                  {
                                      name: 'Rect Rot',
                                      value: 'rectRot',
                                  },
                                  {
                                      name: 'Rect Rounded',
                                      value: 'rectRounded',
                                  },
                                  {
                                      name: 'Star',
                                      value: 'star',
                                  },
                                  {
                                      name: 'Triangle',
                                      value: 'triangle',
                                  },
                              ],
                              displayOptions: {
                                  show: {
                                      '/chartType': constants_1.POINT_STYLE_CHARTS,
                                  },
                              },
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const datasets = [];
          let chartType = '';
          const labels = [];
          const labelsMode = this.getNodeParameter('labelsMode', 0);
          if (labelsMode === 'manually') {
              const labelsUi = this.getNodeParameter('labelsUi.labelsValues', 0, []);
              if (labelsUi.length) {
                  for (const labelValue of labelsUi) {
                      if (Array.isArray(labelValue.label)) {
                          labels === null || labels === void 0 ? void 0 : labels.push(...labelValue.label);
                      }
                      else {
                          labels === null || labels === void 0 ? void 0 : labels.push(labelValue.label);
                      }
                  }
              }
          }
          else {
              const labelsArray = this.getNodeParameter('labelsArray', 0, '');
              const errorMessage = 'Labels Array is not a valid array, use valid JSON format, or specify it by expressions';
              if (Array.isArray(labelsArray)) {
                  labels.push(...labelsArray);
              }
              else {
                  const labelsArrayParsed = (0, n8n_workflow_1.jsonParse)(labelsArray, {
                      errorMessage,
                  });
                  if (!Array.isArray(labelsArrayParsed)) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), errorMessage);
                  }
                  labels.push(...labelsArrayParsed);
              }
          }
          for (let i = 0; i < items.length; i++) {
              const data = this.getNodeParameter('data', i);
              const datasetOptions = this.getNodeParameter('datasetOptions', i);
              const backgroundColor = datasetOptions.backgroundColor;
              const borderColor = datasetOptions.borderColor;
              const fill = datasetOptions.fill;
              const label = datasetOptions.label || 'Chart';
              const pointStyle = datasetOptions.pointStyle;
              chartType = this.getNodeParameter('chartType', i);
              if (constants_1.HORIZONTAL_CHARTS.includes(chartType)) {
                  const horizontal = this.getNodeParameter('chartOptions.horizontal', i, false);
                  if (horizontal) {
                      chartType =
                          'horizontal' + chartType[0].toUpperCase() + chartType.substring(1, chartType.length);
                  }
              }
              let pointStyleName = 'pointStyle';
              if (constants_1.ITEM_STYLE_CHARTS.includes(chartType)) {
                  pointStyleName = 'itemStyle';
              }
              datasets.push({
                  label,
                  data,
                  backgroundColor,
                  borderColor,
                  type: chartType,
                  fill,
                  [pointStyleName]: pointStyle,
              });
          }
          const output = this.getNodeParameter('output', 0);
          const chartOptions = this.getNodeParameter('chartOptions', 0);
          const chart = {
              type: chartType,
              data: {
                  labels,
                  datasets,
              },
          };
          const options = {
              method: 'GET',
              url: 'https://quickchart.io/chart',
              qs: {
                  chart: JSON.stringify(chart),
                  ...chartOptions,
              },
              returnFullResponse: true,
              encoding: 'arraybuffer',
              json: false,
          };
          const response = (await this.helpers.httpRequest(options));
          let mimeType = response.headers['content-type'];
          mimeType = mimeType ? mimeType.split(';').find((value) => value.includes('/')) : undefined;
          return [
              [
                  {
                      binary: {
                          [output]: await this.helpers.prepareBinaryData(response.body, undefined, mimeType),
                      },
                      json: { chart },
                  },
              ],
          ];
      }
  }
  exports.QuickChart = QuickChart;
  //# sourceMappingURL=QuickChart.node.js.map

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

  # QuickChart node

  Use the QuickChart node to automate work in QuickChart, and integrate QuickChart with other applications. n8n has built-in support for a wide range of QuickChart chart types, including bar, doughnut, line, pie, and polar charts.

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

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

  ## Operations

  Create a chart by selecting the chart type:

  * Chart Type
  	* Bar Chart
  	* Doughnut Chart
  	* Line Chart
  	* Pie Chart
  	* Polar Chart

  ## Templates and examples

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

  ## Related resources

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"a450deda-656f-40d5-a932-e811bc5922c7","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"8b41e832cd99981461a5b5733b7a23447942fc603cf367c3a00fe884bf4b204b"}}


node_type: n8n-nodes-base.QuestDb
name: QuestDb
display_name: QuestDB
description: Get, add and update data in QuestDB
category: Other
code_hash: 574aabe37688781da940acac0261aa5557874f116089eed6b378a603b7580b71
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/questdb
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
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.QuestDb = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const pg_promise_1 = __importDefault(require("pg-promise"));
  const genericFunctions_1 = require("../Postgres/v1/genericFunctions");
  class QuestDb {
      constructor() {
          this.description = {
              displayName: 'QuestDB',
              name: 'questDb',
              icon: 'file:questdb.png',
              group: ['input'],
              version: 1,
              description: 'Get, add and update data in QuestDB',
              defaults: {
                  name: 'QuestDB',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'questDb',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Execute Query',
                              value: 'executeQuery',
                              description: 'Executes a SQL query',
                              action: 'Execute a SQL query',
                          },
                          {
                              name: 'Insert',
                              value: 'insert',
                              description: 'Insert rows in database',
                              action: 'Insert rows in database',
                          },
                      ],
                      default: 'insert',
                  },
                  {
                      displayName: 'Query',
                      name: 'query',
                      type: 'string',
                      noDataExpression: true,
                      typeOptions: {
                          editor: 'sqlEditor',
                          rows: 5,
                          sqlDialect: 'PostgreSQL',
                      },
                      displayOptions: {
                          show: {
                              operation: ['executeQuery'],
                          },
                      },
                      default: '',
                      placeholder: 'SELECT id, name FROM product WHERE quantity > $1 AND price <= $2',
                      required: true,
                      description: 'The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.',
                  },
                  {
                      displayName: 'Schema',
                      name: 'schema',
                      type: 'hidden',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      description: 'Name of the schema the table belongs to',
                  },
                  {
                      displayName: 'Table',
                      name: 'table',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the table in which to insert data to',
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      placeholder: 'id,name,description',
                      description: 'Comma-separated list of the properties which should used as columns for the new rows',
                  },
                  {
                      displayName: 'Return Fields',
                      name: 'returnFields',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '*',
                      description: 'Comma-separated list of the fields that the operation will return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['executeQuery'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Mode',
                              name: 'mode',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Independently',
                                      value: 'independently',
                                      description: 'Execute each query independently',
                                  },
                                  {
                                      name: 'Transaction',
                                      value: 'transaction',
                                      description: 'Executes all queries in a single transaction',
                                  },
                              ],
                              default: 'independently',
                              description: 'The way queries should be sent to database. Can be used in conjunction with <b>Continue on Fail</b>. See <a href="https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.questdb/">the docs</a> for more examples.',
                          },
                          {
                              displayName: 'Query Parameters',
                              name: 'queryParams',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['executeQuery'],
                                  },
                              },
                              default: '',
                              placeholder: 'quantity,price',
                              description: 'Comma-separated list of properties which should be used as query parameters',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'hidden',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const credentials = await this.getCredentials('questDb');
          const pgp = (0, pg_promise_1.default)();
          const config = {
              host: credentials.host,
              port: credentials.port,
              database: credentials.database,
              user: credentials.user,
              password: credentials.password,
              ssl: !['disable', undefined].includes(credentials.ssl),
              sslmode: credentials.ssl || 'disable',
          };
          const db = pgp(config);
          let returnItems = [];
          const items = this.getInputData();
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'executeQuery') {
              const additionalFields = this.getNodeParameter('additionalFields', 0);
              const mode = (additionalFields.mode || 'independently');
              const queryResult = await genericFunctions_1.pgQueryV2.call(this, pgp, db, items, this.continueOnFail(), {
                  overrideMode: mode,
                  resolveExpression: true,
              });
              returnItems = this.helpers.returnJsonArray(queryResult);
          }
          else if (operation === 'insert') {
              await (0, genericFunctions_1.pgInsert)(this.getNodeParameter, pgp, db, items, this.continueOnFail(), 'independently');
              const returnFields = this.getNodeParameter('returnFields', 0);
              const table = this.getNodeParameter('table', 0);
              const insertData = await db.any('SELECT ${columns:name} from ${table:name}', {
                  columns: returnFields
                      .split(',')
                      .map((value) => value.trim())
                      .filter((value) => !!value),
                  table,
              });
              returnItems = this.helpers.returnJsonArray(insertData);
          }
          else {
              await db.$pool.end();
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`);
          }
          await db.$pool.end();
          return [returnItems];
      }
  }
  exports.QuestDb = QuestDb;
  //# sourceMappingURL=QuestDb.node.js.map

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

  # QuestDB credentials

  You can use these credentials to authenticate the following nodes:

  - [QuestDB](/integrations/builtin/app-nodes/n8n-nodes-base.questdb.md)

  ## Prerequisites

  Create a user account on an instance of [QuestDB](https://questdb.io/){:target=_blank .external-link}.

  ## Supported authentication methods

  - Database connection

  ## Related resources

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

  ## Using database connection

  To configure this credential, you'll need:

  - The **Host**: Enter the host name or IP address for the server.
  - The **Database**: Enter the database name, for example `qdb`.
  - A **User**: Enter the username for the user account as configured in `pg.user` or `pg.readonly.user` property in `server.conf`. Default value is `admin`.
  - A **Password**: Enter the password for the user account as configured in `pg.password` or `pg.readonly.password` property in `server.conf`. Default value is `quest`.
  - **SSL**: Select whether the connection should use SSL, which sets the `sslmode` parameter. Options include:
      - **Allow**
      - **Disable**
      - **Require**
  - The **Port**: Enter the port number to use for the connection. Default is `8812`.

  Refer to [List of supported connection properties](https://questdb.io/docs/reference/api/postgres/#list-of-supported-connection-properties){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"8f931cc4-ccd5-4b53-92bb-56c923bc7b83","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"ed060d2ed1402a1f7e41994f411dccee0f6be1bc11219cbc9f8df197d4fefcc4"}}


node_type: n8n-nodes-base.QuickBase
name: QuickBase
display_name: Quick Base
description: Integrate with the Quick Base RESTful API
category: Other
code_hash: bfd2ee929fc7e48c79cc4f0913b3f3978c18ae98191cbce71e2b6c95fdc8c1c5
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/quickbase
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.QuickBase = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const FieldDescription_1 = require("./FieldDescription");
  const FileDescription_1 = require("./FileDescription");
  const RecordDescription_1 = require("./RecordDescription");
  const ReportDescription_1 = require("./ReportDescription");
  const utilities_1 = require("../../utils/utilities");
  class QuickBase {
      constructor() {
          this.description = {
              displayName: 'Quick Base',
              name: 'quickbase',
              icon: 'file:quickbase.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Integrate with the Quick Base RESTful API',
              defaults: {
                  name: 'Quick Base',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'quickbaseApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Field',
                              value: 'field',
                          },
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Record',
                              value: 'record',
                          },
                          {
                              name: 'Report',
                              value: 'report',
                          },
                      ],
                      default: 'record',
                  },
                  ...FieldDescription_1.fieldOperations,
                  ...FieldDescription_1.fieldFields,
                  ...FileDescription_1.fileOperations,
                  ...FileDescription_1.fileFields,
                  ...RecordDescription_1.recordOperations,
                  ...RecordDescription_1.recordFields,
                  ...ReportDescription_1.reportOperations,
                  ...ReportDescription_1.reportFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTableFields() {
                      const returnData = [];
                      const tableId = this.getCurrentNodeParameter('tableId');
                      const fields = await GenericFunctions_1.quickbaseApiRequest.call(this, 'GET', '/fields', {}, { tableId });
                      for (const field of fields) {
                          returnData.push({
                              name: field.label,
                              value: field.id,
                          });
                      }
                      return returnData;
                  },
                  async getUniqueTableFields() {
                      const returnData = [];
                      const tableId = this.getCurrentNodeParameter('tableId');
                      const fields = await GenericFunctions_1.quickbaseApiRequest.call(this, 'GET', '/fields', {}, { tableId });
                      for (const field of fields) {
                          if (field.unique === true && field.properties.primaryKey === false) {
                              returnData.push({
                                  name: field.label,
                                  value: field.id,
                              });
                          }
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const itemData = (0, utilities_1.generatePairedItemData)(items.length);
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          if (resource === 'field') {
              if (operation === 'getAll') {
                  for (let i = 0; i < length; i++) {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const tableId = this.getNodeParameter('tableId', i);
                      const options = this.getNodeParameter('options', i);
                      Object.assign({
                          tableId,
                      }, options);
                      responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'GET', '/fields', {}, qs);
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', i);
                          responseData = responseData.splice(0, limit);
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
          }
          if (resource === 'file') {
              if (operation === 'delete') {
                  for (let i = 0; i < length; i++) {
                      const tableId = this.getNodeParameter('tableId', i);
                      const recordId = this.getNodeParameter('recordId', i);
                      const fieldId = this.getNodeParameter('fieldId', i);
                      const versionNumber = this.getNodeParameter('versionNumber', i);
                      responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'DELETE', `/files/${tableId}/${recordId}/${fieldId}/${versionNumber}`);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'download') {
                  for (let i = 0; i < length; i++) {
                      const tableId = this.getNodeParameter('tableId', i);
                      const recordId = this.getNodeParameter('recordId', i);
                      const fieldId = this.getNodeParameter('fieldId', i);
                      const versionNumber = this.getNodeParameter('versionNumber', i);
                      const newItem = {
                          json: items[i].json,
                          binary: {},
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      items[i] = newItem;
                      const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i);
                      responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'GET', `/files/${tableId}/${recordId}/${fieldId}/${versionNumber}`, {}, {}, { json: false, resolveWithFullResponse: true });
                      const contentDisposition = responseData.headers['content-disposition'];
                      const data = Buffer.from(responseData.body, 'base64');
                      items[i].binary[dataPropertyNameDownload] = await this.helpers.prepareBinaryData(data, contentDisposition.split('=')[1]);
                  }
                  return [items];
              }
          }
          if (resource === 'record') {
              if (operation === 'create') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const simple = this.getNodeParameter('simple', 0);
                  const data = [];
                  const options = this.getNodeParameter('options', 0);
                  for (let i = 0; i < length; i++) {
                      const record = {};
                      const columns = this.getNodeParameter('columns', i);
                      const columnList = columns.split(',').map((column) => column.trim());
                      if (options.useFieldIDs === true) {
                          for (const key of Object.keys(items[i].json)) {
                              record[key] = { value: items[i].json[key] };
                          }
                      }
                      else {
                          const { fieldsLabelKey } = await GenericFunctions_1.getFieldsObject.call(this, tableId);
                          for (const key of Object.keys(items[i].json)) {
                              if (fieldsLabelKey.hasOwnProperty(key) && columnList.includes(key)) {
                                  record[fieldsLabelKey[key].toString()] = { value: items[i].json[key] };
                              }
                          }
                      }
                      data.push(record);
                  }
                  const body = {
                      data,
                      to: tableId,
                  };
                  body.fieldsToReturn = [3];
                  if (options.fields) {
                      body.fieldsToReturn = options.fields;
                  }
                  responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'POST', '/records', body);
                  if (simple) {
                      const { data: records } = responseData;
                      responseData = [];
                      for (const record of records) {
                          const recordData = {};
                          for (const [key, value] of Object.entries(record)) {
                              recordData[key] = value.value;
                          }
                          responseData.push(recordData);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData });
                  returnData.push(...executionData);
              }
              if (operation === 'delete') {
                  for (let i = 0; i < length; i++) {
                      const tableId = this.getNodeParameter('tableId', i);
                      const where = this.getNodeParameter('where', i);
                      const body = {
                          from: tableId,
                          where,
                      };
                      responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'DELETE', '/records', body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'getAll') {
                  for (let i = 0; i < length; i++) {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const tableId = this.getNodeParameter('tableId', i);
                      const options = this.getNodeParameter('options', i);
                      const body = {
                          from: tableId,
                      };
                      Object.assign(body, options);
                      if (options.sortByUi) {
                          const sort = options.sortByUi.sortByValues;
                          body.sortBy = sort;
                          delete body.sortByUi;
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.quickbaseApiRequestAllItems.call(this, 'POST', '/records/query', body, qs);
                      }
                      else {
                          body.options = { top: this.getNodeParameter('limit', i) };
                          responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'POST', '/records/query', body, qs);
                          const { data: records, fields } = responseData;
                          responseData = [];
                          const fieldsIdKey = {};
                          for (const field of fields) {
                              fieldsIdKey[field.id] = field.label;
                          }
                          for (const record of records) {
                              const data = {};
                              for (const [key, value] of Object.entries(record)) {
                                  data[fieldsIdKey[key]] = value.value;
                              }
                              responseData.push(data);
                          }
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'update') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const { fieldsLabelKey: _fieldsLabelKey, fieldsIdKey } = await GenericFunctions_1.getFieldsObject.call(this, tableId);
                  const simple = this.getNodeParameter('simple', 0);
                  const updateKey = this.getNodeParameter('updateKey', 0);
                  const data = [];
                  const options = this.getNodeParameter('options', 0);
                  for (let i = 0; i < length; i++) {
                      const record = {};
                      const columns = this.getNodeParameter('columns', i);
                      const columnList = columns.split(',').map((column) => column.trim());
                      if (options.useFieldIDs === true) {
                          for (const key of Object.keys(items[i].json)) {
                              record[key] = { value: items[i].json[key] };
                          }
                      }
                      else {
                          const { fieldsLabelKey } = await GenericFunctions_1.getFieldsObject.call(this, tableId);
                          for (const key of Object.keys(items[i].json)) {
                              if (fieldsLabelKey.hasOwnProperty(key) && columnList.includes(key)) {
                                  record[fieldsLabelKey[key].toString()] = { value: items[i].json[key] };
                              }
                          }
                      }
                      if (items[i].json[updateKey] === undefined) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The update key ${updateKey} could not be found in the input`, { itemIndex: i });
                      }
                      data.push(record);
                  }
                  const body = {
                      data,
                      to: tableId,
                  };
                  if (options.fields) {
                      body.fieldsToReturn = options.fields;
                  }
                  responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'POST', '/records', body);
                  if (simple) {
                      const { data: records } = responseData;
                      responseData = [];
                      for (const record of records) {
                          const recordData = {};
                          for (const [key, value] of Object.entries(record)) {
                              recordData[fieldsIdKey[key]] = value.value;
                          }
                          responseData.push(recordData);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData });
                  returnData.push(...executionData);
              }
              if (operation === 'upsert') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const simple = this.getNodeParameter('simple', 0);
                  const updateKey = this.getNodeParameter('updateKey', 0);
                  const mergeFieldId = this.getNodeParameter('mergeFieldId', 0);
                  const data = [];
                  const options = this.getNodeParameter('options', 0);
                  for (let i = 0; i < length; i++) {
                      const record = {};
                      const columns = this.getNodeParameter('columns', i);
                      const columnList = columns.split(',').map((column) => column.trim());
                      if (options.useFieldIDs === true) {
                          for (const key of Object.keys(items[i].json)) {
                              record[key] = { value: items[i].json[key] };
                          }
                      }
                      else {
                          const { fieldsLabelKey } = await GenericFunctions_1.getFieldsObject.call(this, tableId);
                          for (const key of Object.keys(items[i].json)) {
                              if (fieldsLabelKey.hasOwnProperty(key) && columnList.includes(key)) {
                                  record[fieldsLabelKey[key].toString()] = { value: items[i].json[key] };
                              }
                          }
                      }
                      if (items[i].json[updateKey] === undefined) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The update key ${updateKey} could not be found in the input`, { itemIndex: i });
                      }
                      record[mergeFieldId] = { value: items[i].json[updateKey] };
                      data.push(record);
                  }
                  const body = {
                      data,
                      to: tableId,
                      mergeFieldId,
                  };
                  body.fieldsToReturn = [3];
                  if (options.fields) {
                      body.fieldsToReturn = options.fields;
                  }
                  responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'POST', '/records', body);
                  if (simple) {
                      const { data: records } = responseData;
                      responseData = [];
                      for (const record of records) {
                          const recordData = {};
                          for (const [key, value] of Object.entries(record)) {
                              recordData[key] = value.value;
                          }
                          responseData.push(recordData);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData });
                  returnData.push(...executionData);
              }
          }
          if (resource === 'report') {
              if (operation === 'run') {
                  for (let i = 0; i < length; i++) {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const tableId = this.getNodeParameter('tableId', i);
                      const reportId = this.getNodeParameter('reportId', i);
                      qs.tableId = tableId;
                      if (returnAll) {
                          responseData = await GenericFunctions_1.quickbaseApiRequestAllItems.call(this, 'POST', `/reports/${reportId}/run`, {}, qs);
                      }
                      else {
                          qs.top = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'POST', `/reports/${reportId}/run`, {}, qs);
                          const { data: records, fields } = responseData;
                          responseData = [];
                          const fieldsIdKey = {};
                          for (const field of fields) {
                              fieldsIdKey[field.id] = field.label;
                          }
                          for (const record of records) {
                              const data = {};
                              for (const [key, value] of Object.entries(record)) {
                                  data[fieldsIdKey[key]] = value.value;
                              }
                              responseData.push(data);
                          }
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'get') {
                  for (let i = 0; i < length; i++) {
                      const reportId = this.getNodeParameter('reportId', i);
                      const tableId = this.getNodeParameter('tableId', i);
                      qs.tableId = tableId;
                      responseData = await GenericFunctions_1.quickbaseApiRequest.call(this, 'GET', `/reports/${reportId}`, {}, qs);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
          }
          return [returnData];
      }
  }
  exports.QuickBase = QuickBase;
  //# sourceMappingURL=QuickBase.node.js.map

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

  # Quick Base credentials

  You can use these credentials to authenticate the following nodes:

  - [Quick Base](/integrations/builtin/app-nodes/n8n-nodes-base.quickbase.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - A **Hostname**: The string of characters located between `https://` and `/db` in your Quick Base URL.
  - A **User Token**: To generate a token, select your **Profile > My preferences > My User Information > Manage my user tokens**. Refer to [Creating and using user tokens](https://helpv2.quickbase.com/hc/en-us/articles/4570374095124-Creating-and-using-user-tokens){:target=_blank .external-link} for detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"5b953ff5-d9de-41b5-8d84-dd0e8cc1b183","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"671b74aa2fdcca5cf7ca87ec3515d074507588f93024efec7b1337659c1f4049"}}


node_type: n8n-nodes-base.QuickBooks
name: QuickBooks
display_name: QuickBooks Online
description: Consume the QuickBooks Online API
category: Other
code_hash: fec11a5217d27572bb5cc124a06c9011a104bab890905afe4e7c04e3abf95f7f
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/quickbooks
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
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.QuickBooks = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const change_case_1 = require("change-case");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  class QuickBooks {
      constructor() {
          this.description = {
              displayName: 'QuickBooks Online',
              name: 'quickbooks',
              icon: 'file:quickbooks.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the QuickBooks Online API',
              defaults: {
                  name: 'QuickBooks Online',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'quickBooksOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Bill',
                              value: 'bill',
                          },
                          {
                              name: 'Customer',
                              value: 'customer',
                          },
                          {
                              name: 'Employee',
                              value: 'employee',
                          },
                          {
                              name: 'Estimate',
                              value: 'estimate',
                          },
                          {
                              name: 'Invoice',
                              value: 'invoice',
                          },
                          {
                              name: 'Item',
                              value: 'item',
                          },
                          {
                              name: 'Payment',
                              value: 'payment',
                          },
                          {
                              name: 'Purchase',
                              value: 'purchase',
                          },
                          {
                              name: 'Transaction',
                              value: 'transaction',
                          },
                          {
                              name: 'Vendor',
                              value: 'vendor',
                          },
                      ],
                      default: 'customer',
                  },
                  ...descriptions_1.billOperations,
                  ...descriptions_1.billFields,
                  ...descriptions_1.customerOperations,
                  ...descriptions_1.customerFields,
                  ...descriptions_1.employeeOperations,
                  ...descriptions_1.employeeFields,
                  ...descriptions_1.estimateOperations,
                  ...descriptions_1.estimateFields,
                  ...descriptions_1.invoiceOperations,
                  ...descriptions_1.invoiceFields,
                  ...descriptions_1.itemOperations,
                  ...descriptions_1.itemFields,
                  ...descriptions_1.paymentOperations,
                  ...descriptions_1.paymentFields,
                  ...descriptions_1.purchaseOperations,
                  ...descriptions_1.purchaseFields,
                  ...descriptions_1.transactionOperations,
                  ...descriptions_1.transactionFields,
                  ...descriptions_1.vendorOperations,
                  ...descriptions_1.vendorFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCustomers() {
                      return GenericFunctions_1.loadResource.call(this, 'customer');
                  },
                  async getCustomFields() {
                      return GenericFunctions_1.loadResource.call(this, 'preferences');
                  },
                  async getDepartments() {
                      return GenericFunctions_1.loadResource.call(this, 'department');
                  },
                  async getItems() {
                      return GenericFunctions_1.loadResource.call(this, 'item');
                  },
                  async getMemos() {
                      return GenericFunctions_1.loadResource.call(this, 'CreditMemo');
                  },
                  async getPurchases() {
                      return GenericFunctions_1.loadResource.call(this, 'purchase');
                  },
                  async getTaxCodeRefs() {
                      return GenericFunctions_1.loadResource.call(this, 'TaxCode');
                  },
                  async getTerms() {
                      return GenericFunctions_1.loadResource.call(this, 'Term');
                  },
                  async getVendors() {
                      return GenericFunctions_1.loadResource.call(this, 'vendor');
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          const { oauthTokenData } = (await this.getCredentials('quickBooksOAuth2Api'));
          const companyId = oauthTokenData.callbackQueryString.realmId;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'bill') {
                      if (operation === 'create') {
                          const lines = this.getNodeParameter('Line', i);
                          if (!lines.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one line for the ${resource}.`, { itemIndex: i });
                          }
                          if (lines.some((line) => line.DetailType === undefined ||
                              line.Amount === undefined ||
                              line.Description === undefined)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter detail type, amount and description for every line.', { itemIndex: i });
                          }
                          lines.forEach((line) => {
                              if (line.DetailType === 'AccountBasedExpenseLineDetail' &&
                                  line.accountId === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter an account ID for the associated line.', { itemIndex: i });
                              }
                              else if (line.DetailType === 'ItemBasedExpenseLineDetail' &&
                                  line.itemId === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter an item ID for the associated line.', { itemIndex: i });
                              }
                          });
                          let body = {
                              VendorRef: {
                                  value: this.getNodeParameter('VendorRef', i),
                              },
                          };
                          body.Line = GenericFunctions_1.processLines.call(this, body, lines, resource);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'delete') {
                          const qs = {
                              operation: 'delete',
                          };
                          const body = {
                              Id: this.getNodeParameter('billId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const billId = this.getNodeParameter('billId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${billId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'update') {
                          const { ref, syncToken } = await GenericFunctions_1.getRefAndSyncToken.call(this, i, companyId, resource, 'VendorRef');
                          let body = {
                              Id: this.getNodeParameter('billId', i),
                              SyncToken: syncToken,
                              sparse: true,
                              VendorRef: {
                                  name: ref.name,
                                  value: ref.value,
                              },
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'customer') {
                      if (operation === 'create') {
                          let body = {
                              DisplayName: this.getNodeParameter('displayName', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${customerId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'update') {
                          let body = {
                              Id: this.getNodeParameter('customerId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              sparse: true,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'employee') {
                      if (operation === 'create') {
                          let body = {
                              FamilyName: this.getNodeParameter('FamilyName', i),
                              GivenName: this.getNodeParameter('GivenName', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const employeeId = this.getNodeParameter('employeeId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${employeeId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'update') {
                          let body = {
                              Id: this.getNodeParameter('employeeId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              sparse: true,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'estimate') {
                      if (operation === 'create') {
                          const lines = this.getNodeParameter('Line', i);
                          if (!lines.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one line for the ${resource}.`, { itemIndex: i });
                          }
                          if (lines.some((line) => line.DetailType === undefined ||
                              line.Amount === undefined ||
                              line.Description === undefined)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter detail type, amount and description for every line.', { itemIndex: i });
                          }
                          lines.forEach((line) => {
                              if (line.DetailType === 'SalesItemLineDetail' && line.itemId === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter an item ID for the associated line.', { itemIndex: i });
                              }
                          });
                          let body = {
                              CustomerRef: {
                                  value: this.getNodeParameter('CustomerRef', i),
                              },
                          };
                          body.Line = GenericFunctions_1.processLines.call(this, body, lines, resource);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'delete') {
                          const qs = {
                              operation: 'delete',
                          };
                          const body = {
                              Id: this.getNodeParameter('estimateId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const estimateId = this.getNodeParameter('estimateId', i);
                          const download = this.getNodeParameter('download', i);
                          if (download) {
                              responseData = await GenericFunctions_1.handleBinaryData.call(this, items, i, companyId, resource, estimateId);
                          }
                          else {
                              const endpoint = `/v3/company/${companyId}/${resource}/${estimateId}`;
                              responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                              responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                          }
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'send') {
                          const estimateId = this.getNodeParameter('estimateId', i);
                          const qs = {
                              sendTo: this.getNodeParameter('email', i),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}/${estimateId}/send`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'update') {
                          const { ref, syncToken } = await GenericFunctions_1.getRefAndSyncToken.call(this, i, companyId, resource, 'CustomerRef');
                          let body = {
                              Id: this.getNodeParameter('estimateId', i),
                              SyncToken: syncToken,
                              sparse: true,
                              CustomerRef: {
                                  name: ref.name,
                                  value: ref.value,
                              },
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'invoice') {
                      if (operation === 'create') {
                          const lines = this.getNodeParameter('Line', i);
                          if (!lines.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one line for the ${resource}.`, { itemIndex: i });
                          }
                          if (lines.some((line) => line.DetailType === undefined ||
                              line.Amount === undefined ||
                              line.Description === undefined)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter detail type, amount and description for every line.', { itemIndex: i });
                          }
                          lines.forEach((line) => {
                              if (line.DetailType === 'SalesItemLineDetail' && line.itemId === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter an item ID for the associated line.', { itemIndex: i });
                              }
                          });
                          let body = {
                              CustomerRef: {
                                  value: this.getNodeParameter('CustomerRef', i),
                              },
                          };
                          body.Line = GenericFunctions_1.processLines.call(this, body, lines, resource);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'delete') {
                          const qs = {
                              operation: 'delete',
                          };
                          const body = {
                              Id: this.getNodeParameter('invoiceId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          const download = this.getNodeParameter('download', i);
                          if (download) {
                              responseData = await GenericFunctions_1.handleBinaryData.call(this, items, i, companyId, resource, invoiceId);
                          }
                          else {
                              const endpoint = `/v3/company/${companyId}/${resource}/${invoiceId}`;
                              responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                              responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                          }
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'send') {
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          const qs = {
                              sendTo: this.getNodeParameter('email', i),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}/${invoiceId}/send`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'update') {
                          const { ref, syncToken } = await GenericFunctions_1.getRefAndSyncToken.call(this, i, companyId, resource, 'CustomerRef');
                          let body = {
                              Id: this.getNodeParameter('invoiceId', i),
                              SyncToken: syncToken,
                              sparse: true,
                              CustomerRef: {
                                  name: ref.name,
                                  value: ref.value,
                              },
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'void') {
                          const qs = {
                              Id: this.getNodeParameter('invoiceId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              operation: 'void',
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'item') {
                      if (operation === 'get') {
                          const item = this.getNodeParameter('itemId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${item}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                  }
                  else if (resource === 'payment') {
                      if (operation === 'create') {
                          let body = {
                              CustomerRef: {
                                  value: this.getNodeParameter('CustomerRef', i),
                              },
                              TotalAmt: this.getNodeParameter('TotalAmt', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'delete') {
                          const qs = {
                              operation: 'delete',
                          };
                          const body = {
                              Id: this.getNodeParameter('paymentId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const paymentId = this.getNodeParameter('paymentId', i);
                          const download = this.getNodeParameter('download', i);
                          if (download) {
                              responseData = await GenericFunctions_1.handleBinaryData.call(this, items, i, companyId, resource, paymentId);
                          }
                          else {
                              const endpoint = `/v3/company/${companyId}/${resource}/${paymentId}`;
                              responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                              responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                          }
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'send') {
                          const paymentId = this.getNodeParameter('paymentId', i);
                          const qs = {
                              sendTo: this.getNodeParameter('email', i),
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}/${paymentId}/send`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'update') {
                          const { ref, syncToken } = await GenericFunctions_1.getRefAndSyncToken.call(this, i, companyId, resource, 'CustomerRef');
                          let body = {
                              Id: this.getNodeParameter('paymentId', i),
                              SyncToken: syncToken,
                              sparse: true,
                              CustomerRef: {
                                  name: ref.name,
                                  value: ref.value,
                              },
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'void') {
                          const qs = {
                              Id: this.getNodeParameter('paymentId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              operation: 'void',
                          };
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
                  else if (resource === 'purchase') {
                      if (operation === 'get') {
                          const purchaseId = this.getNodeParameter('purchaseId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${purchaseId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                  }
                  else if (resource === 'transaction') {
                      if (operation === 'getReport') {
                          const { columns, memo, term, customer, vendor, ...rest } = this.getNodeParameter('filters', i);
                          let qs = { ...rest };
                          if (columns === null || columns === void 0 ? void 0 : columns.length) {
                              qs.columns = columns.join(',');
                          }
                          if (memo === null || memo === void 0 ? void 0 : memo.length) {
                              qs.memo = memo.join(',');
                          }
                          if (term === null || term === void 0 ? void 0 : term.length) {
                              qs.term = term.join(',');
                          }
                          if (customer === null || customer === void 0 ? void 0 : customer.length) {
                              qs.customer = customer.join(',');
                          }
                          if (vendor === null || vendor === void 0 ? void 0 : vendor.length) {
                              qs.vendor = vendor.join(',');
                          }
                          qs = (0, GenericFunctions_1.adjustTransactionDates)(qs);
                          const endpoint = `/v3/company/${companyId}/reports/TransactionList`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, qs, {});
                          const simplifyResponse = this.getNodeParameter('simple', i, true);
                          if (!Object.keys(responseData === null || responseData === void 0 ? void 0 : responseData.Rows).length) {
                              responseData = [];
                          }
                          if (simplifyResponse && !Array.isArray(responseData)) {
                              responseData = (0, GenericFunctions_1.simplifyTransactionReport)(responseData);
                          }
                      }
                  }
                  else if (resource === 'vendor') {
                      if (operation === 'create') {
                          let body = {
                              DisplayName: this.getNodeParameter('displayName', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          body = GenericFunctions_1.populateFields.call(this, body, additionalFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'get') {
                          const vendorId = this.getNodeParameter('vendorId', i);
                          const endpoint = `/v3/company/${companyId}/${resource}/${vendorId}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                      else if (operation === 'getAll') {
                          const endpoint = `/v3/company/${companyId}/query`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, resource);
                      }
                      else if (operation === 'update') {
                          let body = {
                              Id: this.getNodeParameter('vendorId', i),
                              SyncToken: await GenericFunctions_1.getSyncToken.call(this, i, companyId, resource),
                              sparse: true,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          body = GenericFunctions_1.populateFields.call(this, body, updateFields, resource);
                          const endpoint = `/v3/company/${companyId}/${resource}`;
                          responseData = await GenericFunctions_1.quickBooksApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData[(0, change_case_1.capitalCase)(resource)];
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const download = this.getNodeParameter('download', 0, false);
                      if (['invoice', 'estimate', 'payment'].includes(resource) &&
                          ['get'].includes(operation) &&
                          download) {
                          if (!responseData) {
                              items[i].json = { error: error.message };
                              responseData = items;
                          }
                          else {
                              responseData[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;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          const download = this.getNodeParameter('download', 0, false);
          if (['invoice', 'estimate', 'payment'].includes(resource) &&
              ['get'].includes(operation) &&
              download) {
              return [responseData];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.QuickBooks = QuickBooks;
  //# sourceMappingURL=QuickBooks.node.js.map

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

  # QuickBooks credentials

  You can use these credentials to authenticate the following nodes:

  - [QuickBooks](/integrations/builtin/app-nodes/n8n-nodes-base.quickbooks.md)

  ## Prerequisites

  Create an [Intuit developer](https://developer.intuit.com/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - OAuth2

  ## Related resources

  Refer to [Intuit's API documentation](https://developer.intuit.com/app/developer/qbo/docs/develop){:target=_blank .external-link} for more information about the service.

  ## Using OAuth2

  To configure this credential, you'll need:

  - A **Client ID**: Generated when you create an app.
  - A **Client Secret**: Generated when you create an app.
  - An **Environment**: Select whether this credential should access your **Production** or **Sandbox** environment. 

  To generate your **Client ID** and **Client Secret**, [create an app](https://developer.intuit.com/app/developer/qbo/docs/get-started/start-developing-your-app#create-an-app){:target=_blank .external-link}.

  Use these settings when creating your app:

  - Select appropriate scopes for your app. Refer to [Learn about scopes](https://developer.intuit.com/app/developer/qbo/docs/learn/scopes){:target=_blank .external-link} for more information.
  - Enter the **OAuth Redirect URL** from n8n as a **Redirect URI** in the app's **Development > Keys & OAuth** section.
  - Copy the **Client ID** and **Client Secret** from the app's **Development > Keys & OAuth** section to enter in n8n. Refer to [Get the Client ID and Client Secret for your app](https://developer.intuit.com/app/developer/qbo/docs/get-started/get-client-id-and-client-secret){:target=_blank .external-link} for more information.

  Refer to Intuit's [Set up OAuth 2.0 documentation](https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/oauth-2.0){:target=_blank .external-link} for more information on the entire process.

  /// note | Environment selection
  If you're creating a new app from scratch, start with the **Sandbox** environment. Production apps need to fulfill all Intuit's requirements. Refer to Intuit's [Publish your app documentation](https://developer.intuit.com/app/developer/qbo/docs/go-live/publish-app){:target=_blank .external-link} for more information.
  ///

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"fa12916a-47e2-4a29-a49e-ec38dbb12594","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"f961c69e0f8c9a90b5c35a4ec6c7789ba54a369ee95eb27d7c2fe99e0130ea8a"}}


node_type: n8n-nodes-base.RabbitMQ
name: RabbitMQ
display_name: RabbitMQ
description: Sends messages to a RabbitMQ topic
category: Other
code_hash: 1dda2f41631a54acedfd4cc856f7f2f752f0ea13171eb2040ae37520390a0f5d
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/rabbitmq
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
      }
      Object.defineProperty(o, k2, desc);
  }) : (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      o[k2] = m[k];
  }));
  var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
  }) : function(o, v) {
      o["default"] = v;
  });
  var __importStar = (this && this.__importStar) || function (mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      __setModuleDefault(result, mod);
      return result;
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.RabbitMQ = void 0;
  const amqplib = __importStar(require("amqplib"));
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utilities_1 = require("../../utils/utilities");
  class RabbitMQ {
      constructor() {
          this.description = {
              displayName: 'RabbitMQ',
              name: 'rabbitmq',
              icon: 'file:rabbitmq.png',
              group: ['transform'],
              version: [1, 1.1],
              description: 'Sends messages to a RabbitMQ topic',
              defaults: {
                  name: 'RabbitMQ',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'rabbitmq',
                      required: true,
                      testedBy: 'rabbitmqConnectionTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'hidden',
                      noDataExpression: true,
                      default: 'sendMessage',
                      displayOptions: {
                          show: {
                              '@version': [1],
                          },
                      },
                      options: [
                          {
                              name: 'Send a Message to RabbitMQ',
                              value: 'sendMessage',
                              action: 'Send a Message to RabbitMQ',
                          },
                          {
                              name: 'Delete From Queue',
                              value: 'deleteMessage',
                              action: 'Delete From Queue',
                          },
                      ],
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      default: 'sendMessage',
                      displayOptions: {
                          show: {
                              '@version': [1.1],
                          },
                      },
                      options: [
                          {
                              name: 'Send a Message to RabbitMQ',
                              value: 'sendMessage',
                              action: 'Send a Message to RabbitMQ',
                          },
                          {
                              name: 'Delete From Queue',
                              value: 'deleteMessage',
                              action: 'Delete From Queue',
                          },
                      ],
                  },
                  {
                      displayName: 'Will delete an item from the queue triggered earlier in the workflow by a RabbitMQ Trigger node',
                      name: 'deleteMessage',
                      type: 'notice',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['deleteMessage'],
                          },
                      },
                  },
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      displayOptions: {
                          hide: {
                              operation: ['deleteMessage'],
                          },
                      },
                      options: [
                          {
                              name: 'Queue',
                              value: 'queue',
                              description: 'Publish data to queue',
                          },
                          {
                              name: 'Exchange',
                              value: 'exchange',
                              description: 'Publish data to exchange',
                          },
                      ],
                      default: 'queue',
                      description: 'To where data should be moved',
                  },
                  {
                      displayName: 'Queue / Topic',
                      name: 'queue',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['queue'],
                          },
                          hide: {
                              operation: ['deleteMessage'],
                          },
                      },
                      default: '',
                      placeholder: 'queue-name',
                      description: 'Name of the queue to publish to',
                  },
                  {
                      displayName: 'Exchange',
                      name: 'exchange',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['exchange'],
                          },
                      },
                      default: '',
                      placeholder: 'exchange-name',
                      description: 'Name of the exchange to publish to',
                  },
                  {
                      displayName: 'Type',
                      name: 'exchangeType',
                      type: 'options',
                      displayOptions: {
                          show: {
                              mode: ['exchange'],
                          },
                      },
                      options: [
                          {
                              name: 'Direct',
                              value: 'direct',
                              description: 'Direct exchange type',
                          },
                          {
                              name: 'Topic',
                              value: 'topic',
                              description: 'Topic exchange type',
                          },
                          {
                              name: 'Headers',
                              value: 'headers',
                              description: 'Headers exchange type',
                          },
                          {
                              name: 'Fanout',
                              value: 'fanout',
                              description: 'Fanout exchange type',
                          },
                      ],
                      default: 'fanout',
                      description: 'Type of exchange',
                  },
                  {
                      displayName: 'Routing Key',
                      name: 'routingKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['exchange'],
                          },
                      },
                      default: '',
                      placeholder: 'routing-key',
                      description: 'The routing key for the message',
                  },
                  {
                      displayName: 'Send Input Data',
                      name: 'sendInputData',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['sendMessage'],
                          },
                      },
                      default: true,
                      description: 'Whether to send the the data the node receives as JSON',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      displayOptions: {
                          show: {
                              sendInputData: [false],
                          },
                      },
                      default: '',
                      description: 'The message to be sent',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['sendMessage'],
                          },
                      },
                      placeholder: 'Add Option',
                      options: [
                          {
                              displayName: 'Alternate Exchange',
                              name: 'alternateExchange',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/mode': ['exchange'],
                                  },
                              },
                              default: '',
                              description: 'An exchange to send messages to if this exchange can’t route them to any queues',
                          },
                          {
                              displayName: 'Arguments',
                              name: 'arguments',
                              placeholder: 'Add Argument',
                              description: 'Arguments to add',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'argument',
                                      displayName: 'Argument',
                                      values: [
                                          {
                                              displayName: 'Key',
                                              name: 'key',
                                              type: 'string',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Auto Delete Queue',
                              name: 'autoDelete',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the queue will be deleted when the number of consumers drops to zero',
                          },
                          {
                              displayName: 'Durable',
                              name: 'durable',
                              type: 'boolean',
                              default: true,
                              description: 'Whether the queue will survive broker restarts',
                          },
                          {
                              displayName: 'Exclusive',
                              name: 'exclusive',
                              type: 'boolean',
                              displayOptions: {
                                  show: {
                                      '/mode': ['queue'],
                                  },
                              },
                              default: false,
                              description: 'Whether to scope the queue to the connection',
                          },
                          {
                              displayName: 'Headers',
                              name: 'headers',
                              placeholder: 'Add Header',
                              description: 'Headers to add',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'header',
                                      displayName: 'Header',
                                      values: [
                                          {
                                              displayName: 'Key',
                                              name: 'key',
                                              type: 'string',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async rabbitmqConnectionTest(credential) {
                      const credentials = credential.data;
                      try {
                          const credentialKeys = ['hostname', 'port', 'username', 'password', 'vhost'];
                          const credentialData = {};
                          credentialKeys.forEach((key) => {
                              credentialData[key] = credentials[key] === '' ? undefined : credentials[key];
                          });
                          const optsData = {};
                          if (credentials.ssl === true) {
                              credentialData.protocol = 'amqps';
                              optsData.ca =
                                  credentials.ca === ''
                                      ? undefined
                                      : [Buffer.from((0, utilities_1.formatPrivateKey)(credentials.ca))];
                              if (credentials.passwordless === true) {
                                  optsData.cert =
                                      credentials.cert === ''
                                          ? undefined
                                          : Buffer.from((0, utilities_1.formatPrivateKey)(credentials.cert));
                                  optsData.key =
                                      credentials.key === ''
                                          ? undefined
                                          : Buffer.from((0, utilities_1.formatPrivateKey)(credentials.key));
                                  optsData.passphrase =
                                      credentials.passphrase === '' ? undefined : credentials.passphrase;
                                  optsData.credentials = amqplib.credentials.external();
                              }
                          }
                          const connection = await amqplib.connect(credentialData, optsData);
                          await connection.close();
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          let channel, options;
          try {
              const items = this.getInputData();
              const operation = this.getNodeParameter('operation', 0);
              if (operation === 'deleteMessage') {
                  this.sendResponse(items[0].json);
                  return [items];
              }
              const mode = this.getNodeParameter('mode', 0) || 'queue';
              const returnItems = [];
              if (mode === 'queue') {
                  const queue = this.getNodeParameter('queue', 0);
                  options = this.getNodeParameter('options', 0, {});
                  channel = await GenericFunctions_1.rabbitmqConnectQueue.call(this, queue, options);
                  const sendInputData = this.getNodeParameter('sendInputData', 0);
                  let message;
                  const queuePromises = [];
                  for (let i = 0; i < items.length; i++) {
                      if (sendInputData) {
                          message = JSON.stringify(items[i].json);
                      }
                      else {
                          message = this.getNodeParameter('message', i);
                      }
                      let headers = {};
                      if (options.headers &&
                          options.headers.header.length) {
                          const itemOptions = this.getNodeParameter('options', i, {});
                          const additionalHeaders = {};
                          itemOptions.headers.header.forEach((header) => {
                              additionalHeaders[header.key] = header.value;
                          });
                          headers = additionalHeaders;
                      }
                      queuePromises.push(channel.sendToQueue(queue, Buffer.from(message), { headers }));
                  }
                  const promisesResponses = await Promise.allSettled(queuePromises);
                  promisesResponses.forEach((response) => {
                      if (response.status !== 'fulfilled') {
                          if (!this.continueOnFail()) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), response);
                          }
                          else {
                              returnItems.push({
                                  json: {
                                      error: response.reason,
                                  },
                              });
                              return;
                          }
                      }
                      returnItems.push({
                          json: {
                              success: response.value,
                          },
                      });
                  });
                  await channel.close();
                  await channel.connection.close();
              }
              else if (mode === 'exchange') {
                  const exchange = this.getNodeParameter('exchange', 0);
                  const type = this.getNodeParameter('exchangeType', 0);
                  const routingKey = this.getNodeParameter('routingKey', 0);
                  options = this.getNodeParameter('options', 0, {});
                  channel = await GenericFunctions_1.rabbitmqConnectExchange.call(this, exchange, type, options);
                  const sendInputData = this.getNodeParameter('sendInputData', 0);
                  let message;
                  const exchangePromises = [];
                  for (let i = 0; i < items.length; i++) {
                      if (sendInputData) {
                          message = JSON.stringify(items[i].json);
                      }
                      else {
                          message = this.getNodeParameter('message', i);
                      }
                      let headers = {};
                      if (options.headers &&
                          options.headers.header.length) {
                          const itemOptions = this.getNodeParameter('options', i, {});
                          const additionalHeaders = {};
                          itemOptions.headers.header.forEach((header) => {
                              additionalHeaders[header.key] = header.value;
                          });
                          headers = additionalHeaders;
                      }
                      exchangePromises.push(channel.publish(exchange, routingKey, Buffer.from(message), { headers }));
                  }
                  const promisesResponses = await Promise.allSettled(exchangePromises);
                  promisesResponses.forEach((response) => {
                      if (response.status !== 'fulfilled') {
                          if (!this.continueOnFail()) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), response);
                          }
                          else {
                              returnItems.push({
                                  json: {
                                      error: response.reason,
                                  },
                              });
                              return;
                          }
                      }
                      returnItems.push({
                          json: {
                              success: response.value,
                          },
                      });
                  });
                  await channel.close();
                  await channel.connection.close();
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${mode}" is not known!`);
              }
              return [returnItems];
          }
          catch (error) {
              if (channel) {
                  await channel.close();
                  await channel.connection.close();
              }
              throw error;
          }
      }
  }
  exports.RabbitMQ = RabbitMQ;
  //# sourceMappingURL=RabbitMQ.node.js.map

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

  # RabbitMQ credentials

  You can use these credentials to authenticate the following nodes:

  - [RabbitMQ](/integrations/builtin/app-nodes/n8n-nodes-base.rabbitmq.md)
  - [RabbitMQ Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.rabbitmqtrigger.md)

  ## Supported authentication methods

  - User connection

  ## Related resources

  Refer to [RabbitMQ's Connections documentation](https://www.rabbitmq.com/docs/connections){:target=_blank .external-link} for more information about the service.

  ## Using user connection

  To configure this credential, you'll need to have a [RabbitMQ broker](https://www.rabbitmq.com/){:target=_blank .external-link} installed and:

  1. Enter the **Hostname** for the RabbitMQ broker.
  2. Enter the **Port** the connection should use.
  3. Enter a **User** the connection should use to log in as.
      - The default is `guest`. RabbitMQ recommends using a different user in production environments. Refer to [Access Control | The Basics](https://www.rabbitmq.com/docs/access-control#basics){:target=_blank .external-link} for more information. If you're using the `guest` account with a non-localhost connection, refer to [`guest` user issues](#guest-user-issues) below for troubleshooting tips.
  4. Enter the user's **Password**.
      - The default password for the `guest` user is `guest`.
  5. Enter the [virtual host](https://www.rabbitmq.com/docs/vhosts){:target=_blank .external-link} the connection should use as the **Vhost**. The default virtual host is `/`.
  6. Select whether the connection should use **SSL**. If turned on, also set:
      - **Passwordless**: Select whether the SSL certificate connection users SASL mechanism EXTERNAL (turned off) or doesn't use a password (turned on). If turned on, you'll also need to enter:
          - The **Client Certificate**: Paste the text of the SSL client certificate to use.
          - The **Client Key**: Paste the SSL client key to use.
          - The **Passphrase**: Paste the SSL passphrase to use.
      - **CA Certificates**: Paste the text of the SSL CA certificates to use.

  ## guest user issues

  If you use the `guest` user for the credential and you try to access a remote host, you may see a connection error. The RabbitMQ logs show an error like this:

      [error] <0.918.0> PLAIN login refused: user 'guest' can only connect via localhost

  This happens because RabbitMQ prohibits the default `guest` user from connecting from remote hosts. It can only connect over the `localhost`.

  To resolve this error, you can:

  - Update the `guest` user to allow it remote host access.
  - Create or use a different user to connect to the remote host. The `guest` user is the only user limited by default.

  Refer to ["guest" user can only connect from localhost](https://www.rabbitmq.com/docs/access-control#loopback-users){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"2573397a-38dc-4dc0-ab44-a82d6be3130b","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"641aa4baf2fd778def99cca26ebc69d760fc10ebcbab2d3bd2a0e8836adc8cf4"}}


node_type: n8n-nodes-base.Raindrop
name: Raindrop
display_name: Raindrop
description: Consume the Raindrop API
category: Other
code_hash: 2ffff5f78e6186206cef24c5dd2e380afdbdc2f5402ccc15b45f49cb45ac263e
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/raindrop
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
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.Raindrop = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  const omit_1 = __importDefault(require("lodash/omit"));
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Raindrop {
      constructor() {
          this.description = {
              displayName: 'Raindrop',
              name: 'raindrop',
              icon: 'file:raindrop.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Raindrop API',
              defaults: {
                  name: 'Raindrop',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'raindropOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Bookmark',
                              value: 'bookmark',
                          },
                          {
                              name: 'Collection',
                              value: 'collection',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'collection',
                  },
                  ...descriptions_1.bookmarkOperations,
                  ...descriptions_1.bookmarkFields,
                  ...descriptions_1.collectionOperations,
                  ...descriptions_1.collectionFields,
                  ...descriptions_1.tagOperations,
                  ...descriptions_1.tagFields,
                  ...descriptions_1.userOperations,
                  ...descriptions_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCollections() {
                      const responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', '/collections', {}, {});
                      return responseData.items.map((item) => ({
                          name: item.title,
                          value: item._id,
                      }));
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'bookmark') {
                      if (operation === 'create') {
                          const body = {
                              link: this.getNodeParameter('link', i),
                              collection: {
                                  $id: this.getNodeParameter('collectionId', i),
                              },
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          if (additionalFields.pleaseParse === true) {
                              body.pleaseParse = {};
                              delete additionalFields.pleaseParse;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags.split(',').map((tag) => tag.trim());
                          }
                          const endpoint = '/raindrop';
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'POST', endpoint, {}, body);
                          responseData = responseData.item;
                      }
                      else if (operation === 'delete') {
                          const bookmarkId = this.getNodeParameter('bookmarkId', i);
                          const endpoint = `/raindrop/${bookmarkId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      }
                      else if (operation === 'get') {
                          const bookmarkId = this.getNodeParameter('bookmarkId', i);
                          const endpoint = `/raindrop/${bookmarkId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.item;
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const endpoint = `/raindrops/${collectionId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.items;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      else if (operation === 'update') {
                          const bookmarkId = this.getNodeParameter('bookmarkId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          Object.assign(body, updateFields);
                          if (updateFields.collectionId) {
                              body.collection = {
                                  $id: updateFields.collectionId,
                              };
                              delete updateFields.collectionId;
                          }
                          if (updateFields.pleaseParse === true) {
                              body.pleaseParse = {};
                              delete updateFields.pleaseParse;
                          }
                          if (updateFields.tags) {
                              body.tags = updateFields.tags.split(',').map((tag) => tag.trim());
                          }
                          const endpoint = `/raindrop/${bookmarkId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'PUT', endpoint, {}, body);
                          responseData = responseData.item;
                      }
                  }
                  else if (resource === 'collection') {
                      if (operation === 'create') {
                          const body = {
                              title: this.getNodeParameter('title', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          if (additionalFields.cover) {
                              body.cover = [body.cover];
                          }
                          if (additionalFields.parentId) {
                              body['parent.$id'] = parseInt(additionalFields.parentId, 10);
                              delete additionalFields.parentId;
                          }
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'POST', '/collection', {}, body);
                          responseData = responseData.item;
                      }
                      else if (operation === 'delete') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const endpoint = `/collection/${collectionId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      }
                      else if (operation === 'get') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const endpoint = `/collection/${collectionId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.item;
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const endpoint = this.getNodeParameter('type', i) === 'parent'
                              ? '/collections'
                              : '/collections/childrens';
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.items;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      else if (operation === 'update') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          if (updateFields.parentId) {
                              body['parent.$id'] = parseInt(updateFields.parentId, 10);
                              delete updateFields.parentId;
                          }
                          Object.assign(body, (0, omit_1.default)(updateFields, 'binaryPropertyName'));
                          const endpoint = `/collection/${collectionId}`;
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'PUT', endpoint, {}, body);
                          responseData = responseData.item;
                          if (updateFields.cover) {
                              const binaryPropertyName = updateFields.cover;
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              const formData = {
                                  cover: {
                                      value: dataBuffer,
                                      options: {
                                          filename: binaryData.fileName,
                                          contentType: binaryData.mimeType,
                                      },
                                  },
                              };
                              const requestEndpoint = `/collection/${collectionId}/cover`;
                              responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'PUT', requestEndpoint, {}, {}, { 'Content-Type': 'multipart/form-data', formData });
                              responseData = responseData.item;
                          }
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'get') {
                          const self = this.getNodeParameter('self', i);
                          let endpoint = '/user';
                          if (self === false) {
                              const userId = this.getNodeParameter('userId', i);
                              endpoint += `/${userId}`;
                          }
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.user;
                      }
                  }
                  else if (resource === 'tag') {
                      if (operation === 'delete') {
                          let endpoint = '/tags';
                          const body = {
                              tags: this.getNodeParameter('tags', i).split(','),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.collectionId) {
                              endpoint += `/${additionalFields.collectionId}`;
                          }
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'DELETE', endpoint, {}, body);
                      }
                      else if (operation === 'getAll') {
                          let endpoint = '/tags';
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filter = this.getNodeParameter('filters', i);
                          if (filter.collectionId) {
                              endpoint += `/${filter.collectionId}`;
                          }
                          responseData = await GenericFunctions_1.raindropApiRequest.call(this, 'GET', endpoint, {}, {});
                          responseData = responseData.items;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  Array.isArray(responseData)
                      ? returnData.push(...responseData)
                      : returnData.push(responseData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Raindrop = Raindrop;
  //# sourceMappingURL=Raindrop.node.js.map

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

  # Raindrop credentials

  You can use these credentials to authenticate the following nodes:

  - [Raindrop](/integrations/builtin/app-nodes/n8n-nodes-base.raindrop.md)

  ## Prerequisites

  Create a [Raindrop](https://raindrop.io/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - OAuth2

  ## Related resources

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

  ## Using OAuth

  To configure this credential, you'll need:

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

  Generate both by creating a Raindrop app.

  To create an app, go to **Settings >** [**Integrations**](https://app.raindrop.io/settings/integrations){:target=_blank .external-link} and select **+ Create new app** in the **For Developers** section.

  Use these settings for your app:

  - Copy the **OAuth Redirect URL** from n8n and add it as a **Redirect URI** in your app.
  - Copy the **Client ID** and **Client Secret** from the Raindrop app and enter them in your n8n credential.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"c727f9e3-5a4f-4bd2-b1bd-0a63c8355547","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"4feb71dc9edd60f4003758678c7dd3483caa761edcf91869072b805a9380c90e"}}


node_type: n8n-nodes-base.ReadBinaryFiles
name: ReadBinaryFiles
display_name: Read Binary Files
description: Reads binary files from disk
category: Other
code_hash: b4e758feeb596d9a366840a789ede02f9592fdf23b6da29d0e7fe3a49053ac85
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
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.ReadBinaryFiles = void 0;
  const fast_glob_1 = __importDefault(require("fast-glob"));
  const utilities_1 = require("../../utils/utilities");
  class ReadBinaryFiles {
      constructor() {
          this.description = {
              displayName: 'Read Binary Files',
              name: 'readBinaryFiles',
              icon: 'fa:file-import',
              group: ['input'],
              version: 1,
              description: 'Reads binary files from disk',
              defaults: {
                  name: 'Read Binary Files',
                  color: '#44AA44',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'File Selector',
                      name: 'fileSelector',
                      type: 'string',
                      default: '',
                      required: true,
                      placeholder: '*.jpg',
                      description: 'Pattern for files to read',
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      description: 'Name of the binary property to which to write the data of the read files',
                  },
              ],
          };
      }
      async execute() {
          const fileSelector = this.getNodeParameter('fileSelector', 0);
          const dataPropertyName = this.getNodeParameter('dataPropertyName', 0);
          const pairedItem = (0, utilities_1.generatePairedItemData)(this.getInputData().length);
          const files = await (0, fast_glob_1.default)(fileSelector);
          const items = [];
          for (const filePath of files) {
              const stream = await this.helpers.createReadStream(filePath);
              items.push({
                  binary: {
                      [dataPropertyName]: await this.helpers.prepareBinaryData(stream, filePath),
                  },
                  json: {},
                  pairedItem,
              });
          }
          return [items];
      }
  }
  exports.ReadBinaryFiles = ReadBinaryFiles;
  //# sourceMappingURL=ReadBinaryFiles.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"a809ecdd-583b-42b8-ae3a-c377075ba564","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"bda1a442edadacbc3ba0415a746fb5ffd15e0a35f9e420fec3a7e93dc683260a"}}


node_type: n8n-nodes-base.Reddit
name: Reddit
display_name: Reddit
description: Consume the Reddit API
category: Other
code_hash: 14ac2bd275d17b8cf9b5ac74cb57392dbf4f15c37e180153e8f3be4a55aedd77
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/reddit
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Reddit = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const PostCommentDescription_1 = require("./PostCommentDescription");
  const PostDescription_1 = require("./PostDescription");
  const ProfileDescription_1 = require("./ProfileDescription");
  const SubredditDescription_1 = require("./SubredditDescription");
  const UserDescription_1 = require("./UserDescription");
  class Reddit {
      constructor() {
          this.description = {
              displayName: 'Reddit',
              name: 'reddit',
              icon: 'file:reddit.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Reddit API',
              defaults: {
                  name: 'Reddit',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'redditOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['postComment', 'post', 'profile'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Post',
                              value: 'post',
                          },
                          {
                              name: 'Post Comment',
                              value: 'postComment',
                          },
                          {
                              name: 'Profile',
                              value: 'profile',
                          },
                          {
                              name: 'Subreddit',
                              value: 'subreddit',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'post',
                  },
                  ...PostCommentDescription_1.postCommentOperations,
                  ...PostCommentDescription_1.postCommentFields,
                  ...ProfileDescription_1.profileOperations,
                  ...ProfileDescription_1.profileFields,
                  ...SubredditDescription_1.subredditOperations,
                  ...SubredditDescription_1.subredditFields,
                  ...PostDescription_1.postOperations,
                  ...PostDescription_1.postFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'post') {
                      if (operation === 'create') {
                          const qs = {
                              title: this.getNodeParameter('title', i),
                              sr: this.getNodeParameter('subreddit', i),
                              kind: this.getNodeParameter('kind', i),
                          };
                          qs.kind === 'self'
                              ? (qs.text = this.getNodeParameter('text', i))
                              : (qs.url = this.getNodeParameter('url', i));
                          if (qs.url) {
                              qs.resubmit = this.getNodeParameter('resubmit', i);
                          }
                          responseData = await GenericFunctions_1.redditApiRequest.call(this, 'POST', 'api/submit', qs);
                          responseData = responseData.json.data;
                      }
                      else if (operation === 'delete') {
                          const postTypePrefix = 't3_';
                          const qs = {
                              id: postTypePrefix + this.getNodeParameter('postId', i),
                          };
                          await GenericFunctions_1.redditApiRequest.call(this, 'POST', 'api/del', qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const subreddit = this.getNodeParameter('subreddit', i);
                          const postId = this.getNodeParameter('postId', i);
                          const endpoint = `r/${subreddit}/comments/${postId}.json`;
                          responseData = await GenericFunctions_1.redditApiRequest.call(this, 'GET', endpoint, {});
                          responseData = responseData[0].data.children[0].data;
                      }
                      else if (operation === 'getAll') {
                          const subreddit = this.getNodeParameter('subreddit', i);
                          let endpoint = `r/${subreddit}.json`;
                          const { category } = this.getNodeParameter('filters', i);
                          if (category) {
                              endpoint = `r/${subreddit}/${category}.json`;
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint);
                      }
                      else if (operation === 'search') {
                          const location = this.getNodeParameter('location', i);
                          const qs = {
                              q: this.getNodeParameter('keyword', i),
                              restrict_sr: location === 'subreddit',
                          };
                          const { sort } = this.getNodeParameter('additionalFields', i);
                          if (sort) {
                              qs.sort = sort;
                          }
                          let endpoint = '';
                          if (location === 'allReddit') {
                              endpoint = 'search.json';
                          }
                          else {
                              const subreddit = this.getNodeParameter('subreddit', i);
                              endpoint = `r/${subreddit}/search.json`;
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint, qs);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  else if (resource === 'postComment') {
                      if (operation === 'create') {
                          const postTypePrefix = 't3_';
                          const qs = {
                              text: this.getNodeParameter('commentText', i),
                              thing_id: postTypePrefix + this.getNodeParameter('postId', i),
                          };
                          responseData = await GenericFunctions_1.redditApiRequest.call(this, 'POST', 'api/comment', qs);
                          responseData = responseData.json.data.things[0].data;
                      }
                      else if (operation === 'getAll') {
                          const subreddit = this.getNodeParameter('subreddit', i);
                          const postId = this.getNodeParameter('postId', i);
                          const endpoint = `r/${subreddit}/comments/${postId}.json`;
                          responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint);
                      }
                      else if (operation === 'delete') {
                          const commentTypePrefix = 't1_';
                          const qs = {
                              id: commentTypePrefix + this.getNodeParameter('commentId', i),
                          };
                          await GenericFunctions_1.redditApiRequest.call(this, 'POST', 'api/del', qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'reply') {
                          const commentTypePrefix = 't1_';
                          const qs = {
                              text: this.getNodeParameter('replyText', i),
                              thing_id: commentTypePrefix + this.getNodeParameter('commentId', i),
                          };
                          responseData = await GenericFunctions_1.redditApiRequest.call(this, 'POST', 'api/comment', qs);
                          responseData = responseData.json.data.things[0].data;
                      }
                  }
                  else if (resource === 'profile') {
                      if (operation === 'get') {
                          const endpoints = {
                              identity: 'me',
                              blockedUsers: 'me/blocked',
                              friends: 'me/friends',
                              karma: 'me/karma',
                              prefs: 'me/prefs',
                              trophies: 'me/trophies',
                          };
                          const details = this.getNodeParameter('details', i);
                          const endpoint = `api/v1/${endpoints[details]}`;
                          let username;
                          if (details === 'saved') {
                              ({ name: username } = await GenericFunctions_1.redditApiRequest.call(this, 'GET', 'api/v1/me', {}));
                          }
                          responseData =
                              details === 'saved'
                                  ? await GenericFunctions_1.handleListing.call(this, i, `user/${username}/saved.json`)
                                  : await GenericFunctions_1.redditApiRequest.call(this, 'GET', endpoint, {});
                          if (details === 'identity') {
                              responseData = responseData.features;
                          }
                          else if (details === 'friends') {
                              responseData = responseData.data.children;
                              if (!responseData.length) {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData);
                              }
                          }
                          else if (details === 'karma') {
                              responseData = responseData.data;
                              if (!responseData.length) {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData);
                              }
                          }
                          else if (details === 'trophies') {
                              responseData = responseData.data.trophies.map((trophy) => trophy.data);
                          }
                      }
                  }
                  else if (resource === 'subreddit') {
                      if (operation === 'get') {
                          const subreddit = this.getNodeParameter('subreddit', i);
                          const content = this.getNodeParameter('content', i);
                          const endpoint = `r/${subreddit}/about/${content}.json`;
                          responseData = await GenericFunctions_1.redditApiRequest.call(this, 'GET', endpoint, {});
                          if (content === 'rules') {
                              responseData = responseData.rules;
                          }
                          else if (content === 'about') {
                              responseData = responseData.data;
                          }
                      }
                      else if (operation === 'getAll') {
                          const filters = this.getNodeParameter('filters', i);
                          if (filters.trending) {
                              const returnAll = this.getNodeParameter('returnAll', 0);
                              const endpoint = 'api/trending_subreddits.json';
                              responseData = await GenericFunctions_1.redditApiRequest.call(this, 'GET', endpoint, {});
                              responseData = responseData.subreddit_names.map((name) => ({ name }));
                              if (!returnAll) {
                                  const limit = this.getNodeParameter('limit', 0);
                                  responseData = responseData.splice(0, limit);
                              }
                          }
                          else if (filters.keyword) {
                              const qs = {};
                              qs.query = filters.keyword;
                              const endpoint = 'api/search_subreddits.json';
                              responseData = await GenericFunctions_1.redditApiRequest.call(this, 'POST', endpoint, qs);
                              const returnAll = this.getNodeParameter('returnAll', 0);
                              if (!returnAll) {
                                  const limit = this.getNodeParameter('limit', 0);
                                  responseData = responseData.subreddits.splice(0, limit);
                              }
                          }
                          else {
                              const endpoint = 'r/subreddits.json';
                              responseData = await GenericFunctions_1.handleListing.call(this, i, endpoint);
                          }
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'get') {
                          const username = this.getNodeParameter('username', i);
                          const details = this.getNodeParameter('details', i);
                          const endpoint = `user/${username}/${details}.json`;
                          responseData =
                              details === 'about'
                                  ? await GenericFunctions_1.redditApiRequest.call(this, 'GET', endpoint, {})
                                  : await GenericFunctions_1.handleListing.call(this, i, endpoint);
                          if (details === 'about') {
                              responseData = responseData.data;
                          }
                      }
                  }
                  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.Reddit = Reddit;
  //# sourceMappingURL=Reddit.node.js.map

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

  # Reddit credentials

  You can use these credentials to authenticate the following nodes:

  - [Reddit](/integrations/builtin/app-nodes/n8n-nodes-base.reddit.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - OAuth2

  ## Related resources

  Refer to [Reddit's developer documentation](https://support.reddithelp.com/hc/en-us/articles/14945211791892-Developer-Platform-Accessing-Reddit-Data){:target=_blank .external-link} for more information about the service.

  ## Using OAuth2

  To configure this credential, you'll need:

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

  /// note | Developer program
  Reddit's developer program is in a closed beta. The instructions below are for regular Reddit users, not members of the developer platform.
  ///

  Generate both by creating a [third-party app](https://www.reddit.com/prefs/apps){:target=_blank .external-link}. Visit the previous link or go to your **profile > Settings > Safety & Privacy > Manage third-party app authorization > are you a developer? create an app**.

  Use these settings for your app:

  - Copy the **OAuth Callback URL** from n8n and use it as your app's **redirect uri**.
  - The app's client ID displays underneath your app name. Copy that and add it as your n8n **Client ID**.
  - Copy the app's **secret** and add it as your n8n **Client Secret**.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"6ecc7603-7d2c-4a1c-9f25-ebf41fce3771","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"058fc8c0120a796facb2e5733f278cebcd5b597be2115f640a0837ba821db99f"}}


node_type: n8n-nodes-base.Redis
name: Redis
display_name: Redis
description: Get, send and update data in Redis
category: Other
code_hash: facd578480f0b4acbbb4acf818dd36df1b1e4881ba29a0ed7eb649e08c5205d7
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/redis
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
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.Redis = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const set_1 = __importDefault(require("lodash/set"));
  const redis_1 = __importDefault(require("redis"));
  const util_1 = __importDefault(require("util"));
  class Redis {
      constructor() {
          this.description = {
              displayName: 'Redis',
              name: 'redis',
              icon: 'file:redis.svg',
              group: ['input'],
              version: 1,
              description: 'Get, send and update data in Redis',
              defaults: {
                  name: 'Redis',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'redis',
                      required: true,
                      testedBy: 'redisConnectionTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a key from Redis',
                              action: 'Delete a key from Redis',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the value of a key from Redis',
                              action: 'Get the value of a key from Redis',
                          },
                          {
                              name: 'Increment',
                              value: 'incr',
                              description: 'Atomically increments a key by 1. Creates the key if it does not exist.',
                              action: 'Atomically increment a key by 1. Creates the key if it does not exist.',
                          },
                          {
                              name: 'Info',
                              value: 'info',
                              description: 'Returns generic information about the Redis instance',
                              action: 'Return generic information about the Redis instance',
                          },
                          {
                              name: 'Keys',
                              value: 'keys',
                              description: 'Returns all the keys matching a pattern',
                              action: 'Return all keys matching a pattern',
                          },
                          {
                              name: 'Pop',
                              value: 'pop',
                              description: 'Pop data from a redis list',
                              action: 'Pop data from a redis list',
                          },
                          {
                              name: 'Publish',
                              value: 'publish',
                              description: 'Publish message to redis channel',
                              action: 'Publish message to redis channel',
                          },
                          {
                              name: 'Push',
                              value: 'push',
                              description: 'Push data to a redis list',
                              action: 'Push data to a redis list',
                          },
                          {
                              name: 'Set',
                              value: 'set',
                              description: 'Set the value of a key in redis',
                              action: 'Set the value of a key in redis',
                          },
                      ],
                      default: 'info',
                  },
                  {
                      displayName: 'Name',
                      name: 'propertyName',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                          },
                      },
                      default: 'propertyName',
                      required: true,
                      description: 'Name of the property to write received data to. Supports dot-notation. Example: "data.person[0].name".',
                  },
                  {
                      displayName: 'Key',
                      name: 'key',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the key to delete from Redis',
                  },
                  {
                      displayName: 'Key',
                      name: 'key',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the key to get from Redis',
                  },
                  {
                      displayName: 'Key Type',
                      name: 'keyType',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              name: 'Automatic',
                              value: 'automatic',
                              description: 'Requests the type before requesting the data (slower)',
                          },
                          {
                              name: 'Hash',
                              value: 'hash',
                              description: "Data in key is of type 'hash'",
                          },
                          {
                              name: 'List',
                              value: 'list',
                              description: "Data in key is of type 'lists'",
                          },
                          {
                              name: 'Sets',
                              value: 'sets',
                              description: "Data in key is of type 'sets'",
                          },
                          {
                              name: 'String',
                              value: 'string',
                              description: "Data in key is of type 'string'",
                          },
                      ],
                      default: 'automatic',
                      description: 'The type of the key to get',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                          },
                      },
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Dot Notation',
                              name: 'dotNotation',
                              type: 'boolean',
                              default: true,
                              description: '<p>By default, dot-notation is used in property names. This means that "a.b" will set the property "b" underneath "a" so { "a": { "b": value} }.<p></p>If that is not intended this can be deactivated, it will then set { "a.b": value } instead.</p>.',
                          },
                      ],
                  },
                  {
                      displayName: 'Key',
                      name: 'key',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['incr'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the key to increment',
                  },
                  {
                      displayName: 'Expire',
                      name: 'expire',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['incr'],
                          },
                      },
                      default: false,
                      description: 'Whether to set a timeout on key',
                  },
                  {
                      displayName: 'TTL',
                      name: 'ttl',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      displayOptions: {
                          show: {
                              operation: ['incr'],
                              expire: [true],
                          },
                      },
                      default: 60,
                      description: 'Number of seconds before key expiration',
                  },
                  {
                      displayName: 'Key Pattern',
                      name: 'keyPattern',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['keys'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'The key pattern for the keys to return',
                  },
                  {
                      displayName: 'Get Values',
                      name: 'getValues',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['keys'],
                          },
                      },
                      default: true,
                      description: 'Whether to get the value of matching keys',
                  },
                  {
                      displayName: 'Key',
                      name: 'key',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['set'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the key to set in Redis',
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['set'],
                          },
                      },
                      default: '',
                      description: 'The value to write in Redis',
                  },
                  {
                      displayName: 'Key Type',
                      name: 'keyType',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['set'],
                          },
                      },
                      options: [
                          {
                              name: 'Automatic',
                              value: 'automatic',
                              description: 'Tries to figure out the type automatically depending on the data',
                          },
                          {
                              name: 'Hash',
                              value: 'hash',
                              description: "Data in key is of type 'hash'",
                          },
                          {
                              name: 'List',
                              value: 'list',
                              description: "Data in key is of type 'lists'",
                          },
                          {
                              name: 'Sets',
                              value: 'sets',
                              description: "Data in key is of type 'sets'",
                          },
                          {
                              name: 'String',
                              value: 'string',
                              description: "Data in key is of type 'string'",
                          },
                      ],
                      default: 'automatic',
                      description: 'The type of the key to set',
                  },
                  {
                      displayName: 'Value Is JSON',
                      name: 'valueIsJSON',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              keyType: ['hash'],
                          },
                      },
                      default: true,
                      description: 'Whether the value is JSON or key value pairs',
                  },
                  {
                      displayName: 'Expire',
                      name: 'expire',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['set'],
                          },
                      },
                      default: false,
                      description: 'Whether to set a timeout on key',
                  },
                  {
                      displayName: 'TTL',
                      name: 'ttl',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      displayOptions: {
                          show: {
                              operation: ['set'],
                              expire: [true],
                          },
                      },
                      default: 60,
                      description: 'Number of seconds before key expiration',
                  },
                  {
                      displayName: 'Channel',
                      name: 'channel',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['publish'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Channel name',
                  },
                  {
                      displayName: 'Data',
                      name: 'messageData',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['publish'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Data to publish',
                  },
                  {
                      displayName: 'List',
                      name: 'list',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['push', 'pop'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the list in Redis',
                  },
                  {
                      displayName: 'Data',
                      name: 'messageData',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['push'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Data to push',
                  },
                  {
                      displayName: 'Tail',
                      name: 'tail',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['push', 'pop'],
                          },
                      },
                      default: false,
                      description: 'Whether to push or pop data from the end of the list',
                  },
                  {
                      displayName: 'Name',
                      name: 'propertyName',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['pop'],
                          },
                      },
                      default: 'propertyName',
                      description: 'Optional name of the property to write received data to. Supports dot-notation. Example: "data.person[0].name".',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      displayOptions: {
                          show: {
                              operation: ['pop'],
                          },
                      },
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Dot Notation',
                              name: 'dotNotation',
                              type: 'boolean',
                              default: true,
                              description: '<p>By default, dot-notation is used in property names. This means that "a.b" will set the property "b" underneath "a" so { "a": { "b": value} }.<p></p>If that is not intended this can be deactivated, it will then set { "a.b": value } instead.</p>.',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async redisConnectionTest(credential) {
                      const credentials = credential.data;
                      const redisOptions = {
                          host: credentials.host,
                          port: credentials.port,
                          db: credentials.database,
                      };
                      if (credentials.password) {
                          redisOptions.password = credentials.password;
                      }
                      try {
                          const client = redis_1.default.createClient(redisOptions);
                          await new Promise((resolve, reject) => {
                              client.on('connect', async () => {
                                  client.ping('ping', (error, pong) => {
                                      if (error)
                                          reject(error);
                                      resolve(pong);
                                      client.quit();
                                  });
                              });
                              client.on('error', async (err) => {
                                  client.quit();
                                  reject(err);
                              });
                          });
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          function getParsedValue(value) {
              if (value.match(/^[\d\.]+$/) === null) {
                  return value;
              }
              else {
                  return parseFloat(value);
              }
          }
          function convertInfoToObject(stringData) {
              const returnData = {};
              let key, value;
              for (const line of stringData.split('\n')) {
                  if (['#', ''].includes(line.charAt(0))) {
                      continue;
                  }
                  [key, value] = line.split(':');
                  if (key === undefined || value === undefined) {
                      continue;
                  }
                  value = value.trim();
                  if (value.includes('=')) {
                      returnData[key] = {};
                      let key2, value2;
                      for (const keyValuePair of value.split(',')) {
                          [key2, value2] = keyValuePair.split('=');
                          returnData[key][key2] = getParsedValue(value2);
                      }
                  }
                  else {
                      returnData[key] = getParsedValue(value);
                  }
              }
              return returnData;
          }
          async function getValue(client, keyName, type) {
              if (type === undefined || type === 'automatic') {
                  const clientType = util_1.default.promisify(client.type).bind(client);
                  type = await clientType(keyName);
              }
              if (type === 'string') {
                  const clientGet = util_1.default.promisify(client.get).bind(client);
                  return clientGet(keyName);
              }
              else if (type === 'hash') {
                  const clientHGetAll = util_1.default.promisify(client.hgetall).bind(client);
                  return clientHGetAll(keyName);
              }
              else if (type === 'list') {
                  const clientLRange = util_1.default.promisify(client.lrange).bind(client);
                  return clientLRange(keyName, 0, -1);
              }
              else if (type === 'sets') {
                  const clientSMembers = util_1.default.promisify(client.smembers).bind(client);
                  return clientSMembers(keyName);
              }
          }
          const setValue = async (client, keyName, value, expire, ttl, type, valueIsJSON) => {
              if (type === undefined || type === 'automatic') {
                  if (typeof value === 'string') {
                      type = 'string';
                  }
                  else if (Array.isArray(value)) {
                      type = 'list';
                  }
                  else if (typeof value === 'object') {
                      type = 'hash';
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Could not identify the type to set. Please set it manually!');
                  }
              }
              if (type === 'string') {
                  const clientSet = util_1.default.promisify(client.set).bind(client);
                  await clientSet(keyName, value.toString());
              }
              else if (type === 'hash') {
                  const clientHset = util_1.default.promisify(client.hset).bind(client);
                  if (valueIsJSON) {
                      let values;
                      if (typeof value === 'string') {
                          try {
                              values = JSON.parse(value);
                          }
                          catch {
                              values = value;
                          }
                      }
                      else {
                          values = value;
                      }
                      for (const key of Object.keys(values)) {
                          await clientHset(keyName, key, values[key].toString());
                      }
                  }
                  else {
                      const values = value.toString().split(' ');
                      await clientHset(keyName, values);
                  }
              }
              else if (type === 'list') {
                  const clientLset = util_1.default.promisify(client.lset).bind(client);
                  for (let index = 0; index < value.length; index++) {
                      await clientLset(keyName, index, value[index].toString());
                  }
              }
              else if (type === 'sets') {
                  const clientSadd = util_1.default.promisify(client.sadd).bind(client);
                  await clientSadd(keyName, value);
              }
              if (expire) {
                  const clientExpire = util_1.default.promisify(client.expire).bind(client);
                  await clientExpire(keyName, ttl);
              }
              return;
          };
          return new Promise(async (resolve, reject) => {
              const credentials = await this.getCredentials('redis');
              const redisOptions = {
                  host: credentials.host,
                  port: credentials.port,
                  db: credentials.database,
              };
              if (credentials.password) {
                  redisOptions.password = credentials.password;
              }
              const client = redis_1.default.createClient(redisOptions);
              const operation = this.getNodeParameter('operation', 0);
              client.on('error', (err) => {
                  client.quit();
                  reject(err);
              });
              client.on('ready', async (_err) => {
                  client.select(credentials.database);
                  try {
                      if (operation === 'info') {
                          const clientInfo = util_1.default.promisify(client.info).bind(client);
                          const result = await clientInfo();
                          resolve([[{ json: convertInfoToObject(result) }]]);
                          client.quit();
                      }
                      else if (['delete', 'get', 'keys', 'set', 'incr', 'publish', 'push', 'pop'].includes(operation)) {
                          const items = this.getInputData();
                          const returnItems = [];
                          let item;
                          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
                              item = { json: {} };
                              if (operation === 'delete') {
                                  const keyDelete = this.getNodeParameter('key', itemIndex);
                                  const clientDel = util_1.default.promisify(client.del).bind(client);
                                  await clientDel(keyDelete);
                                  returnItems.push(items[itemIndex]);
                              }
                              else if (operation === 'get') {
                                  const propertyName = this.getNodeParameter('propertyName', itemIndex);
                                  const keyGet = this.getNodeParameter('key', itemIndex);
                                  const keyType = this.getNodeParameter('keyType', itemIndex);
                                  const value = (await getValue(client, keyGet, keyType)) || null;
                                  const options = this.getNodeParameter('options', itemIndex, {});
                                  if (options.dotNotation === false) {
                                      item.json[propertyName] = value;
                                  }
                                  else {
                                      (0, set_1.default)(item.json, propertyName, value);
                                  }
                                  returnItems.push(item);
                              }
                              else if (operation === 'keys') {
                                  const keyPattern = this.getNodeParameter('keyPattern', itemIndex);
                                  const getValues = this.getNodeParameter('getValues', itemIndex, true);
                                  const clientKeys = util_1.default.promisify(client.keys).bind(client);
                                  const keys = await clientKeys(keyPattern);
                                  if (!getValues) {
                                      returnItems.push({ json: { keys } });
                                      continue;
                                  }
                                  const promises = {};
                                  for (const keyName of keys) {
                                      promises[keyName] = await getValue(client, keyName);
                                  }
                                  for (const keyName of keys) {
                                      item.json[keyName] = await promises[keyName];
                                  }
                                  returnItems.push(item);
                              }
                              else if (operation === 'set') {
                                  const keySet = this.getNodeParameter('key', itemIndex);
                                  const value = this.getNodeParameter('value', itemIndex);
                                  const keyType = this.getNodeParameter('keyType', itemIndex);
                                  const valueIsJSON = this.getNodeParameter('valueIsJSON', itemIndex, true);
                                  const expire = this.getNodeParameter('expire', itemIndex, false);
                                  const ttl = this.getNodeParameter('ttl', itemIndex, -1);
                                  await setValue(client, keySet, value, expire, ttl, keyType, valueIsJSON);
                                  returnItems.push(items[itemIndex]);
                              }
                              else if (operation === 'incr') {
                                  const keyIncr = this.getNodeParameter('key', itemIndex);
                                  const expire = this.getNodeParameter('expire', itemIndex, false);
                                  const ttl = this.getNodeParameter('ttl', itemIndex, -1);
                                  const clientIncr = util_1.default.promisify(client.incr).bind(client);
                                  const incrementVal = await clientIncr(keyIncr);
                                  if (expire && ttl > 0) {
                                      const clientExpire = util_1.default.promisify(client.expire).bind(client);
                                      await clientExpire(keyIncr, ttl);
                                  }
                                  returnItems.push({ json: { [keyIncr]: incrementVal } });
                              }
                              else if (operation === 'publish') {
                                  const channel = this.getNodeParameter('channel', itemIndex);
                                  const messageData = this.getNodeParameter('messageData', itemIndex);
                                  const clientPublish = util_1.default.promisify(client.publish).bind(client);
                                  await clientPublish(channel, messageData);
                                  returnItems.push(items[itemIndex]);
                              }
                              else if (operation === 'push') {
                                  const redisList = this.getNodeParameter('list', itemIndex);
                                  const messageData = this.getNodeParameter('messageData', itemIndex);
                                  const tail = this.getNodeParameter('tail', itemIndex, false);
                                  const action = tail ? client.RPUSH : client.LPUSH;
                                  const clientPush = util_1.default.promisify(action).bind(client);
                                  await clientPush(redisList, messageData);
                                  returnItems.push(items[itemIndex]);
                              }
                              else if (operation === 'pop') {
                                  const redisList = this.getNodeParameter('list', itemIndex);
                                  const tail = this.getNodeParameter('tail', itemIndex, false);
                                  const propertyName = this.getNodeParameter('propertyName', itemIndex, 'propertyName');
                                  const action = tail ? client.rpop : client.lpop;
                                  const clientPop = util_1.default.promisify(action).bind(client);
                                  const value = await clientPop(redisList);
                                  let outputValue;
                                  try {
                                      outputValue = JSON.parse(value);
                                  }
                                  catch {
                                      outputValue = value;
                                  }
                                  const options = this.getNodeParameter('options', itemIndex, {});
                                  if (options.dotNotation === false) {
                                      item.json[propertyName] = outputValue;
                                  }
                                  else {
                                      (0, set_1.default)(item.json, propertyName, outputValue);
                                  }
                                  returnItems.push(item);
                              }
                          }
                          client.quit();
                          resolve([returnItems]);
                      }
                  }
                  catch (error) {
                      reject(error);
                  }
              });
          });
      }
  }
  exports.Redis = Redis;
  //# sourceMappingURL=Redis.node.js.map

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

  # Redis credentials

  You can use these credentials to authenticate the following nodes:

  - [Redis](/integrations/builtin/app-nodes/n8n-nodes-base.redis.md)
  - [Redis Chat Memory](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memoryredischat.md)

  ## Supported authentication methods

  - Database connection

  ## Related resources

  Refer to [Redis's developer documentation](https://redis.readthedocs.io/en/stable/index.html){:target=_blank .external-link} for more information about the service.

  ## Using database connection

  You'll need a user account on a [Redis](https://redis.io/){:target=_blank .external-link} server and:

  - A **Password**
  - The **Host** name
  - The **Port** number
  - A **Database Number**
  - **SSL**

  To configure this credential:

  1. Enter your user account **Password**.
  2. Enter the **Host** name of the Redis server. The default is `localhost`.
  3. Enter the **Port** number the connection should use. The default is `6379`.
      - This number should match the `tcp_port` listed when you run the `INFO` command.
  4. Enter the **Database Number**. The default is `0`.
  5. If the connection should use SSL, turn on the **SSL** toggle. If this toggle is off, the connection uses TCP only.

  Refer to [Connecting to Redis | Generic client](https://redis.readthedocs.io/en/stable/connections.html){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"a0d9ea29-19af-4749-937d-e08941447072","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"62924cd5f45dee21c42c35a1e87eaaa7ee54a5bbc58bd70a9d89eaa17b239d40"}}


node_type: n8n-nodes-base.RenameKeys
name: RenameKeys
display_name: Rename Keys
description: Renames keys
category: Other
code_hash: 0708fae996ab278764a6b7528a635e8ce4b932769bffade386bf72d7d3ebeadd
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.renamekeys
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
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.RenameKeys = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const get_1 = __importDefault(require("lodash/get"));
  const set_1 = __importDefault(require("lodash/set"));
  const unset_1 = __importDefault(require("lodash/unset"));
  class RenameKeys {
      constructor() {
          this.description = {
              displayName: 'Rename Keys',
              name: 'renameKeys',
              icon: 'fa:edit',
              group: ['transform'],
              version: 1,
              description: 'Renames keys',
              defaults: {
                  name: 'Rename Keys',
                  color: '#772244',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Keys',
                      name: 'keys',
                      placeholder: 'Add new key',
                      description: 'Adds a key which should be renamed',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                          sortable: true,
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Key',
                              name: 'key',
                              values: [
                                  {
                                      displayName: 'Current Key Name',
                                      name: 'currentKey',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'currentKey',
                                      requiresDataPath: 'single',
                                      description: 'The current name of the key. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.currentKey".',
                                  },
                                  {
                                      displayName: 'New Key Name',
                                      name: 'newKey',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'newKey',
                                      description: 'The name the key should be renamed to. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.newKey".',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Options',
                      name: 'additionalOptions',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add Option',
                      options: [
                          {
                              displayName: 'Regex',
                              name: 'regexReplacement',
                              placeholder: 'Add new regular expression',
                              description: 'Adds a regular expressiond',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                                  sortable: true,
                              },
                              default: {},
                              options: [
                                  {
                                      displayName: 'Replacement',
                                      name: 'replacements',
                                      values: [
                                          {
                                              displayName: 'Be aware that by using regular expression previously renamed keys can be affected',
                                              name: 'regExNotice',
                                              type: 'notice',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Regular Expression',
                                              name: 'searchRegex',
                                              type: 'string',
                                              default: '',
                                              placeholder: 'e.g. [N-n]ame',
                                              description: 'Regex to match the key name',
                                              hint: 'Learn more and test RegEx <a href="https://regex101.com/">here</a>',
                                          },
                                          {
                                              displayName: 'Replace With',
                                              name: 'replaceRegex',
                                              type: 'string',
                                              default: '',
                                              placeholder: 'replacedName',
                                              description: "The name the key/s should be renamed to. It's possible to use regex captures e.g. $1, $2, ...",
                                          },
                                          {
                                              displayName: 'Options',
                                              name: 'options',
                                              type: 'collection',
                                              default: {},
                                              placeholder: 'Add Regex Option',
                                              options: [
                                                  {
                                                      displayName: 'Case Insensitive',
                                                      name: 'caseInsensitive',
                                                      type: 'boolean',
                                                      description: 'Whether to use case insensitive match',
                                                      default: false,
                                                  },
                                                  {
                                                      displayName: 'Max Depth',
                                                      name: 'depth',
                                                      type: 'number',
                                                      default: -1,
                                                      description: 'Maximum depth to replace keys',
                                                      hint: 'Specify number for depth level (-1 for unlimited, 0 for top level only)',
                                                  },
                                              ],
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let item;
          let newItem;
          let renameKeys;
          let value;
          const renameKey = (key) => {
              if (key.currentKey === '' || key.newKey === '' || key.currentKey === key.newKey) {
                  return;
              }
              value = (0, get_1.default)(item.json, key.currentKey);
              if (value === undefined) {
                  return;
              }
              (0, set_1.default)(newItem.json, key.newKey, value);
              (0, unset_1.default)(newItem.json, key.currentKey);
          };
          const regexReplaceKey = (replacement) => {
              const { searchRegex, replaceRegex, options } = replacement;
              const { depth, caseInsensitive } = options;
              const flags = caseInsensitive ? 'i' : undefined;
              const regex = new RegExp(searchRegex, flags);
              const renameObjectKeys = (obj, objDepth) => {
                  for (const key in obj) {
                      if (Array.isArray(obj)) {
                          if (objDepth !== 0) {
                              renameObjectKeys(obj[key], objDepth - 1);
                          }
                      }
                      else if (obj.hasOwnProperty(key)) {
                          if (typeof obj[key] === 'object' && objDepth !== 0) {
                              renameObjectKeys(obj[key], objDepth - 1);
                          }
                          if (key.match(regex)) {
                              const newKey = key.replace(regex, replaceRegex);
                              if (newKey !== key) {
                                  obj[newKey] = obj[key];
                                  delete obj[key];
                              }
                          }
                      }
                  }
                  return obj;
              };
              newItem.json = renameObjectKeys(newItem.json, depth);
          };
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              renameKeys = this.getNodeParameter('keys.key', itemIndex, []);
              const regexReplacements = this.getNodeParameter('additionalOptions.regexReplacement.replacements', itemIndex, []);
              item = items[itemIndex];
              newItem = {
                  json: (0, n8n_workflow_1.deepCopy)(item.json),
                  pairedItem: {
                      item: itemIndex,
                  },
              };
              if (item.binary !== undefined) {
                  newItem.binary = item.binary;
              }
              renameKeys.forEach(renameKey);
              regexReplacements.forEach(regexReplaceKey);
              returnData.push(newItem);
          }
          return [returnData];
      }
  }
  exports.RenameKeys = RenameKeys;
  //# sourceMappingURL=RenameKeys.node.js.map

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

  # Rename Keys

  Use the Rename Keys node to rename the keys of a key-value pair in n8n.

  ## Node parameters

  You can rename one or multiple keys using the Rename Keys node. Select the **Add new key** button to rename a key.

  For each key, enter the:

  - **Current Key Name**: The current name of the key you want to rename.
  - **New Key Name**: The new name you want to assign to the key.

  ## Node options

  Choose whether to use a **Regex** regular expression to identify keys to rename. To use this option, you must also enter:

  * The **Regular Expression** you'd like to use.
  * **Replace With**: Enter the new name you want to assign to the key(s) that match the **Regular Expression**.
  * You can also choose these Regex-specific options:
      * **Case Insensitive**: Set whether the regular expression should match case (turned off) or be case insensitive (turned on).
      * **Max Depth**: Enter the maximum depth to replace keys, using `-1` for unlimited and `0` for top-level only.

  /// warning | Regex impacts
  Using a regular expression can affect any keys that match the expression, including keys you've already renamed.
  ///

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"738638fc-32f8-45ad-9640-b03c90902c98","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"d540cc23279acd40d2e0d95d1f1bebde14460702095b1d0697a46650ea63c156"}}


node_type: n8n-nodes-base.RespondToWebhook
name: RespondToWebhook
display_name: Respond to Webhook
description: Returns data for Webhook
category: Other
code_hash: 95d3ea6eec3f2182949cb94764aaafedbf727bc3b52e721ca5e1f7f81734501b
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.respondtowebhook
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.RespondToWebhook = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class RespondToWebhook {
      constructor() {
          this.description = {
              displayName: 'Respond to Webhook',
              icon: 'file:webhook.svg',
              name: 'respondToWebhook',
              group: ['transform'],
              version: 1,
              description: 'Returns data for Webhook',
              defaults: {
                  name: 'Respond to Webhook',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [],
              properties: [
                  {
                      displayName: 'Respond With',
                      name: 'respondWith',
                      type: 'options',
                      options: [
                          {
                              name: 'Binary',
                              value: 'binary',
                          },
                          {
                              name: 'First Incoming Item',
                              value: 'firstIncomingItem',
                          },
                          {
                              name: 'JSON',
                              value: 'json',
                          },
                          {
                              name: 'No Data',
                              value: 'noData',
                          },
                          {
                              name: 'Text',
                              value: 'text',
                          },
                      ],
                      default: 'firstIncomingItem',
                      description: 'The data that should be returned',
                  },
                  {
                      displayName: 'When using expressions, note that this node will only run for the first item in the input data.',
                      name: 'webhookNotice',
                      type: 'notice',
                      displayOptions: {
                          show: {
                              respondWith: ['json', 'text'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Response Body',
                      name: 'responseBody',
                      type: 'json',
                      displayOptions: {
                          show: {
                              respondWith: ['json'],
                          },
                      },
                      default: '',
                      placeholder: '{ "key": "value" }',
                      description: 'The HTTP Response JSON data',
                  },
                  {
                      displayName: 'Response Body',
                      name: 'responseBody',
                      type: 'string',
                      displayOptions: {
                          show: {
                              respondWith: ['text'],
                          },
                      },
                      default: '',
                      placeholder: 'e.g. Workflow started',
                      description: 'The HTTP Response text data',
                  },
                  {
                      displayName: 'Response Data Source',
                      name: 'responseDataSource',
                      type: 'options',
                      displayOptions: {
                          show: {
                              respondWith: ['binary'],
                          },
                      },
                      options: [
                          {
                              name: 'Choose Automatically From Input',
                              value: 'automatically',
                              description: 'Use if input data will contain a single piece of binary data',
                          },
                          {
                              name: 'Specify Myself',
                              value: 'set',
                              description: 'Enter the name of the input field the binary data will be in',
                          },
                      ],
                      default: 'automatically',
                  },
                  {
                      displayName: 'Input Field Name',
                      name: 'inputFieldName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              respondWith: ['binary'],
                              responseDataSource: ['set'],
                          },
                      },
                      description: 'The name of the node input field with the binary data',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Response Code',
                              name: 'responseCode',
                              type: 'number',
                              typeOptions: {
                                  minValue: 100,
                                  maxValue: 599,
                              },
                              default: 200,
                              description: 'The HTTP Response code to return. Defaults to 200.',
                          },
                          {
                              displayName: 'Response Headers',
                              name: 'responseHeaders',
                              placeholder: 'Add Response Header',
                              description: 'Add headers to the webhook response',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'entries',
                                      displayName: 'Entries',
                                      values: [
                                          {
                                              displayName: 'Name',
                                              name: 'name',
                                              type: 'string',
                                              default: '',
                                              description: 'Name of the header',
                                          },
                                          {
                                              displayName: 'Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the header',
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          var _a, _b, _c;
          const items = this.getInputData();
          const respondWith = this.getNodeParameter('respondWith', 0);
          const options = this.getNodeParameter('options', 0, {});
          const headers = {};
          if (options.responseHeaders) {
              for (const header of options.responseHeaders.entries) {
                  if (typeof header.name !== 'string') {
                      header.name = (_a = header.name) === null || _a === void 0 ? void 0 : _a.toString();
                  }
                  headers[(_b = header.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()] = (_c = header.value) === null || _c === void 0 ? void 0 : _c.toString();
              }
          }
          let responseBody;
          if (respondWith === 'json') {
              const responseBodyParameter = this.getNodeParameter('responseBody', 0);
              if (responseBodyParameter) {
                  if (typeof responseBodyParameter === 'object') {
                      responseBody = responseBodyParameter;
                  }
                  else {
                      responseBody = (0, n8n_workflow_1.jsonParse)(responseBodyParameter, {
                          errorMessage: "Invalid JSON in 'Response Body' field",
                      });
                  }
              }
          }
          else if (respondWith === 'firstIncomingItem') {
              responseBody = items[0].json;
          }
          else if (respondWith === 'text') {
              responseBody = this.getNodeParameter('responseBody', 0);
          }
          else if (respondWith === 'binary') {
              const item = items[0];
              if (item.binary === undefined) {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No binary data exists on the first item!');
              }
              let responseBinaryPropertyName;
              const responseDataSource = this.getNodeParameter('responseDataSource', 0);
              if (responseDataSource === 'set') {
                  responseBinaryPropertyName = this.getNodeParameter('inputFieldName', 0);
              }
              else {
                  const binaryKeys = Object.keys(item.binary);
                  if (binaryKeys.length === 0) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No binary data exists on the first item!');
                  }
                  responseBinaryPropertyName = binaryKeys[0];
              }
              const binaryData = this.helpers.assertBinaryData(0, responseBinaryPropertyName);
              if (binaryData.id) {
                  responseBody = { binaryData };
              }
              else {
                  responseBody = Buffer.from(binaryData.data, n8n_workflow_1.BINARY_ENCODING);
                  headers['content-length'] = responseBody.length;
              }
              if (!headers['content-type']) {
                  headers['content-type'] = binaryData.mimeType;
              }
          }
          else if (respondWith !== 'noData') {
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The Response Data option "${respondWith}" is not supported!`);
          }
          const response = {
              body: responseBody,
              headers,
              statusCode: options.responseCode || 200,
          };
          this.sendResponse(response);
          return [items];
      }
  }
  exports.RespondToWebhook = RespondToWebhook;
  //# sourceMappingURL=RespondToWebhook.node.js.map

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

  # Respond to Webhook

  Use the Respond to Webhook node to control the response to incoming webhooks. This node works with the [Webhook](/integrations/builtin/core-nodes/n8n-nodes-base.webhook/index.md) node.

  /// note | Runs once for the first data item
  The Respond to Webhook node runs once, using the first incoming data item. Refer to [Return more than one data item](#return-more-than-one-data-item-deprecated) for more information.
  ///

  ## How to use Respond to Webhook

  To use the Respond to Webhook node:

  1. Add a [Webhook](/integrations/builtin/core-nodes/n8n-nodes-base.webhook/index.md) node as the trigger node for the workflow.
  1. In the Webhook node, set **Respond** to **Using 'Respond to Webhook' node**.
  1. Add the Respond to Webhook node anywhere in your workflow. If you want it to return data from other nodes, place it after those nodes.

  ## Node parameters

  Configure the node behavior using these parameters.

  ### Respond With

  Choose what data to send in the webhook response.

  - **All Incoming Items**: Respond with all the JSON items from the input.
  - **Binary**: Respond with a binary file defined in **Response Data Source**.
  - **First Incoming Item**: Respond with the first incoming item's JSON.
  - **JSON**: Respond with a JSON object defined in **Response Body**.
  - **No Data**: No response payload.
  - **Redirect**: Redirect to a URL set in **Redirect URL**.
  - **Text**: Respond with text set in **Response Body**.

  ## Node options

  Select **Add Option** to view and set the options.

  - **Response Code**: Set the [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status){:target=_blank .external-link} to use.
  - **Response Headers**: Define the response headers to send.
  - **Put Response in Field**: Available when you respond with **All Incoming Items** or **First Incoming Item**. Set the field name for the field containing the response data.

  ## Templates and examples

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

  ## Workflow behavior

  When using the Respond to Webhook node, workflows behave as follows:

  - The workflow finishes without executing the Respond to Webhook node: it returns a standard message with a 200 status.
  - The workflow errors before the first Respond to Webhook node executes: the workflow returns an error message with a 500 status.
  - A second Respond to Webhook node executes after the first one: the workflow ignores it.
  - A Respond to Webhook node executes but there was no webhook: the workflow ignores the Respond to Webhook node.

  ## Return more than one data item (deprecated)

  /// note | Deprecated in 1.22.0
  n8n 1.22.0 added support for returning all data items using the **All Incoming Items** option. n8n recommends upgrading to the latest version of n8n, instead of using the workarounds described in this section.
  ///

  The Respond to Webhook node runs once, using the first incoming data item. This includes when using [expressions](/code/expressions.md). You can't force looping using the Loop node: the workflow will run, but the webhook response will still only contain the results of the first execution. 

  If you need to return more than one data item, choose one of these options:

  - Instead of using the Respond to Webhook node, use the **When Last Node Finishes** option in **Respond** in the Webhook node. Use this when you want to return the final data that the workflow outputs.
  - Use the [Aggregate](/integrations/builtin/core-nodes/n8n-nodes-base.aggregate.md) node to turn multiple items into a single item before passing the data to the Respond to Webhook node. Set **Aggregate** to **All Item Data (Into a Single List)**.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"909fb916-762c-4299-9d53-703a6b9a3136","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"615704bca4fdd5536bd6e7cd0bf9a92f248a9d8a74123136c73de803d0d0d6e6"}}


node_type: n8n-nodes-base.Rocketchat
name: Rocketchat
display_name: RocketChat
description: Consume RocketChat API
category: Other
code_hash: df9e3192d2c8442bd08a2c62870bb8d2e83a38680502727e204def8a46a2d453
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/rocketchat
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Rocketchat = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Rocketchat {
      constructor() {
          this.description = {
              displayName: 'RocketChat',
              name: 'rocketchat',
              icon: 'file:rocketchat.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
              description: 'Consume RocketChat API',
              defaults: {
                  name: 'RocketChat',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'rocketchatApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Chat',
                              value: 'chat',
                          },
                      ],
                      default: 'chat',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['chat'],
                          },
                      },
                      options: [
                          {
                              name: 'Post Message',
                              value: 'postMessage',
                              description: 'Post a message to a channel or a direct message',
                              action: 'Post a message',
                          },
                      ],
                      default: 'postMessage',
                  },
                  {
                      displayName: 'Channel',
                      name: 'channel',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['chat'],
                              operation: ['postMessage'],
                          },
                      },
                      default: '',
                      description: 'The channel name with the prefix in front of it',
                  },
                  {
                      displayName: 'Text',
                      name: 'text',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['chat'],
                              operation: ['postMessage'],
                          },
                      },
                      default: '',
                      description: 'The text of the message to send, is optional because of attachments',
                  },
                  {
                      displayName: 'JSON Parameters',
                      name: 'jsonParameters',
                      type: 'boolean',
                      default: false,
                      displayOptions: {
                          show: {
                              resource: ['chat'],
                              operation: ['postMessage'],
                          },
                      },
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['chat'],
                              operation: ['postMessage'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Alias',
                              name: 'alias',
                              type: 'string',
                              default: '',
                              description: 'This will cause the message’s name to appear as the given alias, but your username will still display',
                          },
                          {
                              displayName: 'Avatar',
                              name: 'avatar',
                              type: 'string',
                              default: '',
                              description: 'If provided, this will make the avatar use the provided image URL',
                          },
                          {
                              displayName: 'Emoji',
                              name: 'emoji',
                              type: 'string',
                              default: '',
                              description: 'This will cause the message’s name to appear as the given alias, but your username will still display',
                          },
                      ],
                  },
                  {
                      displayName: 'Attachments',
                      name: 'attachments',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add Attachment Item',
                      typeOptions: {
                          multipleValues: true,
                          multipleValueButtonText: 'Add Attachment',
                      },
                      displayOptions: {
                          show: {
                              resource: ['chat'],
                              operation: ['postMessage'],
                              jsonParameters: [false],
                          },
                      },
                      options: [
                          {
                              displayName: 'Color',
                              name: 'color',
                              type: 'color',
                              default: '#ff0000',
                              description: 'The color you want the order on the left side to be, any value background-css supports',
                          },
                          {
                              displayName: 'Text',
                              name: 'text',
                              type: 'string',
                              default: '',
                              description: 'The text to display for this attachment, it is different than the message’s text',
                          },
                          {
                              displayName: 'Timestamp',
                              name: 'ts',
                              type: 'dateTime',
                              default: '',
                              description: 'Displays the time next to the text portion',
                          },
                          {
                              displayName: 'Thumb URL',
                              name: 'thumbUrl',
                              type: 'string',
                              default: '',
                              description: 'An image that displays to the left of the text, looks better when this is relatively small',
                          },
                          {
                              displayName: 'Message Link',
                              name: 'messageLink',
                              type: 'string',
                              default: '',
                              description: 'Only applicable if the timestamp is provided, as it makes the time clickable to this link',
                          },
                          {
                              displayName: 'Collapsed',
                              name: 'collapsed',
                              type: 'boolean',
                              default: false,
                              description: 'Causes the image, audio, and video sections to be hiding when collapsed is true',
                          },
                          {
                              displayName: 'Author Name',
                              name: 'authorName',
                              type: 'string',
                              default: '',
                              description: 'Name of the author',
                          },
                          {
                              displayName: 'Author Link',
                              name: 'authorLink',
                              type: 'string',
                              default: '',
                              description: 'Providing this makes the author name clickable and points to this link',
                          },
                          {
                              displayName: 'Author Icon',
                              name: 'authorIcon',
                              type: 'string',
                              default: '',
                              placeholder: 'https://site.com/img.png',
                              description: 'Displays a tiny icon to the left of the Author’s name',
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'Title to display for this attachment, displays under the author',
                          },
                          {
                              displayName: 'Title Link',
                              name: 'titleLink',
                              type: 'string',
                              default: '',
                              description: 'Providing this makes the title clickable, pointing to this link',
                          },
                          {
                              displayName: 'Title Link Download',
                              name: 'titleLinkDownload',
                              type: 'boolean',
                              default: false,
                              description: 'When this is true, a download icon appears and clicking this saves the link to file',
                          },
                          {
                              displayName: 'Image URL',
                              name: 'imageUrl',
                              type: 'string',
                              default: '',
                              description: 'The image to display, will be “big” and easy to see',
                          },
                          {
                              displayName: 'Audio URL',
                              name: 'audioUrl',
                              type: 'string',
                              default: '',
                              placeholder: 'https://site.com/aud.mp3',
                              description: 'Audio file to play, only supports what html audio does',
                          },
                          {
                              displayName: 'Video URL',
                              name: 'videoUrl',
                              type: 'string',
                              default: '',
                              placeholder: 'https://site.com/vid.mp4',
                              description: 'Video file to play, only supports what html video does',
                          },
                          {
                              displayName: 'Fields',
                              name: 'fields',
                              type: 'fixedCollection',
                              placeholder: 'Add Field Item',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'fieldsValues',
                                      displayName: 'Fields',
                                      values: [
                                          {
                                              displayName: 'Short',
                                              name: 'short',
                                              type: 'boolean',
                                              default: false,
                                              description: 'Whether this field should be a short field',
                                          },
                                          {
                                              displayName: 'Title',
                                              name: 'title',
                                              type: 'string',
                                              default: '',
                                              description: 'The title of this field',
                                          },
                                          {
                                              displayName: 'Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'The value of this field, displayed underneath the title value',
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Attachments',
                      name: 'attachmentsJson',
                      type: 'json',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      displayOptions: {
                          show: {
                              resource: ['chat'],
                              operation: ['postMessage'],
                              jsonParameters: [true],
                          },
                      },
                      default: '',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          let responseData;
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'chat') {
                      if (operation === 'postMessage') {
                          const channel = this.getNodeParameter('channel', i);
                          const text = this.getNodeParameter('text', i);
                          const options = this.getNodeParameter('options', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const body = {
                              channel,
                              text,
                          };
                          if (options.alias) {
                              body.alias = options.alias;
                          }
                          if (options.avatar) {
                              body.avatar = options.avatar;
                          }
                          if (options.emoji) {
                              body.emoji = options.emoji;
                          }
                          if (!jsonActive) {
                              const optionsAttachments = this.getNodeParameter('attachments', i);
                              if (optionsAttachments.length > 0) {
                                  const attachments = [];
                                  for (let index = 0; index < optionsAttachments.length; index++) {
                                      const attachment = {};
                                      for (const option of Object.keys(optionsAttachments[index])) {
                                          if (option === 'color') {
                                              attachment.color = optionsAttachments[index][option];
                                          }
                                          else if (option === 'text') {
                                              attachment.text = optionsAttachments[index][option];
                                          }
                                          else if (option === 'ts') {
                                              attachment.ts = optionsAttachments[index][option];
                                          }
                                          else if (option === 'messageLinks') {
                                              attachment.message_link = optionsAttachments[index][option];
                                          }
                                          else if (option === 'thumbUrl') {
                                              attachment.thumb_url = optionsAttachments[index][option];
                                          }
                                          else if (option === 'collapsed') {
                                              attachment.collapsed = optionsAttachments[index][option];
                                          }
                                          else if (option === 'authorName') {
                                              attachment.author_name = optionsAttachments[index][option];
                                          }
                                          else if (option === 'authorLink') {
                                              attachment.author_link = optionsAttachments[index][option];
                                          }
                                          else if (option === 'authorIcon') {
                                              attachment.author_icon = optionsAttachments[index][option];
                                          }
                                          else if (option === 'title') {
                                              attachment.title = optionsAttachments[index][option];
                                          }
                                          else if (option === 'titleLink') {
                                              attachment.title_link = optionsAttachments[index][option];
                                          }
                                          else if (option === 'titleLinkDownload') {
                                              attachment.title_link_download = optionsAttachments[index][option];
                                          }
                                          else if (option === 'imageUrl') {
                                              attachment.image_url = optionsAttachments[index][option];
                                          }
                                          else if (option === 'audioUrl') {
                                              attachment.audio_url = optionsAttachments[index][option];
                                          }
                                          else if (option === 'videoUrl') {
                                              attachment.video_url = optionsAttachments[index][option];
                                          }
                                          else if (option === 'fields') {
                                              const fieldsValues = optionsAttachments[index][option]
                                                  .fieldsValues;
                                              if (fieldsValues.length > 0) {
                                                  const fields = [];
                                                  for (let j = 0; j < fieldsValues.length; j++) {
                                                      const field = {};
                                                      for (const key of Object.keys(fieldsValues[j])) {
                                                          if (key === 'short') {
                                                              field.short = fieldsValues[j][key];
                                                          }
                                                          else if (key === 'title') {
                                                              field.title = fieldsValues[j][key];
                                                          }
                                                          else if (key === 'value') {
                                                              field.value = fieldsValues[j][key];
                                                          }
                                                      }
                                                      fields.push(field);
                                                      attachment.fields = fields;
                                                  }
                                              }
                                          }
                                      }
                                      attachments.push(attachment);
                                  }
                                  body.attachments = attachments;
                              }
                          }
                          else {
                              body.attachments = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('attachmentsJson', i));
                          }
                          responseData = await GenericFunctions_1.rocketchatApiRequest.call(this, '/chat', 'POST', 'postMessage', body);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Rocketchat = Rocketchat;
  //# sourceMappingURL=Rocketchat.node.js.map

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

  # Rocket.Chat credentials

  You can use these credentials to authenticate the following nodes:

  - [Rocket.Chat](/integrations/builtin/app-nodes/n8n-nodes-base.rocketchat.md)

  ## Prerequisites

  - Create a [Rocket.Chat](https://rocket.chat/){:target=_blank .external-link} account.
  - Your account must have the `create-personal-access-tokens` permission to generate personal access tokens.

  ## Supported authentication methods

  - API access token

  ## Related resources

  <!--vale off-->
  Refer to [Rocket.Chat's API documentation](https://developer.rocket.chat/reference/api/rest-api){:target=_blank .external-link} for more information about the service.
  <!--vale on-->

  ## Using API access token

  To configure this credential, you'll need:

  - Your **User ID**: Displayed when you generate an access token.
  - An **Auth Key**: Your personal access token. To generate an access token, go to your **avatar > Account > Personal Access Tokens**. Copy the token and add it as the n8n **Auth Key**.
  - Your Rocket.Chat **Domain**: Also known as your default URL or workspace URL.

  Refer to [Personal Access Tokens](https://docs.rocket.chat/docs/manage-your-account-settings#personal-access-tokens){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"0fe21370-6353-482c-bcc2-7d36604dee61","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"49c15ad1880ee408adddf27ddf8b627d1a37a30bce18175135d640d2e0084f49"}}


node_type: n8n-nodes-base.RssFeedRead
name: RssFeedRead
display_name: RSS Read
description: Reads data from an RSS Feed
category: Other
code_hash: 8fbc9da500347175bdd7371dfcc8ae68cb21a1fb3e39ded017aa4eff48724580
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.rssfeedreadtrigger
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
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.RssFeedRead = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const rss_parser_1 = __importDefault(require("rss-parser"));
  const url_1 = require("url");
  const utilities_1 = require("../../utils/utilities");
  function validateURL(url) {
      try {
          new url_1.URL(url);
          return true;
      }
      catch (err) {
          return false;
      }
  }
  class RssFeedRead {
      constructor() {
          this.description = {
              displayName: 'RSS Read',
              name: 'rssFeedRead',
              icon: 'fa:rss',
              group: ['input'],
              version: 1,
              description: 'Reads data from an RSS Feed',
              defaults: {
                  name: 'RSS Read',
                  color: '#b02020',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'URL',
                      name: 'url',
                      type: 'string',
                      default: '',
                      required: true,
                      description: 'URL of the RSS feed',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Ignore SSL Issues',
                              name: 'ignoreSSL',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to ignore SSL/TLS certificate issues or not',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const pairedItem = (0, utilities_1.generatePairedItemData)(this.getInputData().length);
          try {
              const url = this.getNodeParameter('url', 0);
              const options = this.getNodeParameter('options', 0);
              const ignoreSSL = Boolean(options.ignoreSSL);
              if (!url) {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The parameter "URL" has to be set!');
              }
              if (!validateURL(url)) {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The provided "URL" is not valid!');
              }
              const parser = new rss_parser_1.default({
                  requestOptions: {
                      rejectUnauthorized: !ignoreSSL,
                  },
              });
              let feed;
              try {
                  feed = await parser.parseURL(url);
              }
              catch (error) {
                  if (error.code === 'ECONNREFUSED') {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `It was not possible to connect to the URL. Please make sure the URL "${url}" it is valid!`);
                  }
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
              }
              const returnData = [];
              if (feed.items) {
                  feed.items.forEach((item) => {
                      returnData.push({
                          json: item,
                          pairedItem,
                      });
                  });
              }
              return [returnData];
          }
          catch (error) {
              if (this.continueOnFail()) {
                  return [[{ json: { error: error.message }, pairedItem }]];
              }
              throw error;
          }
      }
  }
  exports.RssFeedRead = RssFeedRead;
  //# sourceMappingURL=RssFeedRead.node.js.map

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

  # RSS Feed Trigger node

  The RSS Feed Trigger node allows you to start an n8n workflow when a new RSS feed item has been published.

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

  ## Node parameters

  * **Poll Times**: Select a poll **Mode** to set how often to trigger the poll. Your **Mode** selection will add or remove relevant fields. Refer to the sections below to configure the parameters for each mode type.
  * **Feed URL**: Enter the URL of the RSS feed to poll.

  --8<-- "_snippets/integrations/builtin/poll-modes.md"

  ## Templates and examples

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

  ## Related resources

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"7b290dec-c0f6-49b4-ba5f-95aaaa01e975","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"37a3609fb456c506a305d059f34d061593fe62635620a59e070fa1eb0aa0632c"}}


node_type: n8n-nodes-base.Rundeck
name: Rundeck
display_name: Rundeck
description: Manage Rundeck API
category: Other
code_hash: 0aa78fa1476a33315899eb61c27e295d593c94d115557ab432a7b1b98023786e
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/rundeck
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Rundeck = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const RundeckApi_1 = require("./RundeckApi");
  class Rundeck {
      constructor() {
          this.description = {
              displayName: 'Rundeck',
              name: 'rundeck',
              icon: 'file:rundeck.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Manage Rundeck API',
              defaults: {
                  name: 'Rundeck',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'rundeckApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Job',
                              value: 'job',
                          },
                      ],
                      default: 'job',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Execute',
                              value: 'execute',
                              description: 'Execute a job',
                              action: 'Execute a job',
                          },
                          {
                              name: 'Get Metadata',
                              value: 'getMetadata',
                              description: 'Get metadata of a job',
                              action: 'Get metadata of a job',
                          },
                      ],
                      default: 'execute',
                  },
                  {
                      displayName: 'Job ID',
                      name: 'jobid',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['execute'],
                              resource: ['job'],
                          },
                      },
                      default: '',
                      placeholder: 'Rundeck Job ID',
                      required: true,
                      description: 'The job ID to execute',
                  },
                  {
                      displayName: 'Arguments',
                      name: 'arguments',
                      placeholder: 'Add Argument',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              operation: ['execute'],
                              resource: ['job'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              name: 'arguments',
                              displayName: 'Arguments',
                              values: [
                                  {
                                      displayName: 'Name',
                                      name: 'name',
                                      type: 'string',
                                      default: '',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Filter',
                      name: 'filter',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['execute'],
                              resource: ['job'],
                          },
                      },
                      default: '',
                      placeholder: 'Add Filters',
                      description: 'Filter Rundeck nodes by name',
                  },
                  {
                      displayName: 'Job ID',
                      name: 'jobid',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['getMetadata'],
                              resource: ['job'],
                          },
                      },
                      default: '',
                      placeholder: 'Rundeck Job ID',
                      required: true,
                      description: 'The job ID to get metadata off',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          const rundeckApi = new RundeckApi_1.RundeckApi(this);
          await rundeckApi.init();
          for (let i = 0; i < length; i++) {
              if (resource === 'job') {
                  if (operation === 'execute') {
                      const jobid = this.getNodeParameter('jobid', i);
                      const rundeckArguments = this.getNodeParameter('arguments', i)
                          .arguments;
                      const filter = this.getNodeParameter('filter', i);
                      const response = await rundeckApi.executeJob(jobid, rundeckArguments, filter);
                      returnData.push(response);
                  }
                  else if (operation === 'getMetadata') {
                      const jobid = this.getNodeParameter('jobid', i);
                      const response = await rundeckApi.getJobMetadata(jobid);
                      returnData.push(response);
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`, { itemIndex: i });
                  }
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not supported!`, { itemIndex: i });
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Rundeck = Rundeck;
  //# sourceMappingURL=Rundeck.node.js.map

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

  # Rundeck credentials

  You can use these credentials to authenticate the following nodes:

  - [Rundeck](/integrations/builtin/app-nodes/n8n-nodes-base.rundeck.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API token

  ## Related resources

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

  ## Using API token

  To configure this credential, you'll need:

  - Your **URL**: Enter the base URL of your Rundeck server, for example `http://myserver:4440`. Refer to [URLs](https://docs.rundeck.com/docs/api/#urls) for more information.
  - A user API **Token**: To generate a user API token, go to your **Profile > User API Tokens**. Refer to [User API tokens](https://docs.rundeck.com/docs/manual/10-user.html#user-api-tokens){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"9a88d918-3bfe-4fc2-a964-f479de2107b2","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"7f499d36da581816aec9ea7d00f6585019d19d7d14dc050e169173f2084a07c5"}}


node_type: n8n-nodes-base.Salesmate
name: Salesmate
display_name: Salesmate
description: Consume Salesmate API
category: Other
code_hash: ac0be2ad778e6daabce9912980fc92e4f611c33f6c7b4e7ba0ee80316f412075
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/salesmate
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:28
updated_at: 2025-06-08 08:05:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Salesmate = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const CompanyDescription_1 = require("./CompanyDescription");
  const ActivityDescription_1 = require("./ActivityDescription");
  const DealDescription_1 = require("./DealDescription");
  class Salesmate {
      constructor() {
          this.description = {
              displayName: 'Salesmate',
              name: 'salesmate',
              icon: 'file:salesmate.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}',
              description: 'Consume Salesmate API',
              defaults: {
                  name: 'Salesmate',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'salesmateApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                          {
                              name: 'Company',
                              value: 'company',
                          },
                          {
                              name: 'Deal',
                              value: 'deal',
                          },
                      ],
                      default: 'activity',
                  },
                  ...CompanyDescription_1.companyOperations,
                  ...ActivityDescription_1.activityOperations,
                  ...DealDescription_1.dealOperations,
                  ...CompanyDescription_1.companyFields,
                  ...ActivityDescription_1.activityFields,
                  ...DealDescription_1.dealFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getUsers() {
                      const returnData = [];
                      const users = await GenericFunctions_1.salesmateApiRequest.call(this, 'GET', '/v1/users/active');
                      for (const user of users.Data) {
                          const userName = user.nickname;
                          const userId = user.id;
                          returnData.push({
                              name: userName,
                              value: userId,
                          });
                      }
                      return returnData;
                  },
                  async getContacts() {
                      const returnData = [];
                      const qs = {
                          fields: ['name', 'id'],
                          query: {},
                      };
                      const contacts = await GenericFunctions_1.salesmateApiRequest.call(this, 'POST', '/v2/contacts/search', qs);
                      for (const contact of contacts.Data.data) {
                          const contactName = contact.name;
                          const contactId = contact.id;
                          returnData.push({
                              name: contactName,
                              value: contactId,
                          });
                      }
                      return returnData;
                  },
                  async getCompanies() {
                      const returnData = [];
                      const qs = {
                          fields: ['name', 'id'],
                          query: {},
                      };
                      const companies = await GenericFunctions_1.salesmateApiRequest.call(this, 'POST', '/v2/companies/search', qs);
                      for (const company of companies.Data.data) {
                          const companyName = company.name;
                          const companyId = company.id;
                          returnData.push({
                              name: companyName,
                              value: companyId,
                          });
                      }
                      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++) {
              if (resource === 'company') {
                  if (operation === 'create') {
                      const owner = this.getNodeParameter('owner', i);
                      const name = this.getNodeParameter('name', i);
                      const rawData = this.getNodeParameter('rawData', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          name,
                          owner,
                      };
                      if (additionalFields.website) {
                          body.website = additionalFields.website;
                      }
                      if (additionalFields.phone) {
                          body.phone = additionalFields.phone;
                      }
                      if (additionalFields.otherPhone) {
                          body.otherPhone = additionalFields.otherPhone;
                      }
                      if (additionalFields.facebookHandle) {
                          body.facebookHandle = additionalFields.facebookHandle;
                      }
                      if (additionalFields.googlePlusHandle) {
                          body.googlePlusHandle = additionalFields.googlePlusHandle;
                      }
                      if (additionalFields.linkedInHandle) {
                          body.linkedInHandle = additionalFields.linkedInHandle;
                      }
                      if (additionalFields.skypeId) {
                          body.skypeId = additionalFields.skypeId;
                      }
                      if (additionalFields.twitterHandle) {
                          body.twitterHandle = additionalFields.twitterHandle;
                      }
                      if (additionalFields.currency) {
                          body.currency = additionalFields.currency;
                      }
                      if (additionalFields.billingAddressLine1) {
                          body.billingAddressLine1 = additionalFields.billingAddressLine1;
                      }
                      if (additionalFields.billingAddressLine2) {
                          body.billingAddressLine2 = additionalFields.billingAddressLine2;
                      }
                      if (additionalFields.billingCity) {
                          body.billingCity = additionalFields.billingCity;
                      }
                      if (additionalFields.billingZipCode) {
                          body.billingZipCode = additionalFields.billingZipCode;
                      }
                      if (additionalFields.billingState) {
                          body.billingState = additionalFields.billingState;
                      }
                      if (additionalFields.description) {
                          body.description = additionalFields.description;
                      }
                      if (additionalFields.tags) {
                          body.tags = additionalFields.tags;
                      }
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'POST', '/v1/companies', body);
                      responseData = responseData.Data;
                      if (!rawData) {
                          delete responseData.detail;
                      }
                  }
                  if (operation === 'update') {
                      const companyId = this.getNodeParameter('id', i);
                      const updateFields = this.getNodeParameter('updateFields', i);
                      const rawData = this.getNodeParameter('rawData', i);
                      const body = {};
                      if (updateFields.owner) {
                          body.owner = updateFields.owner;
                      }
                      if (updateFields.name) {
                          body.name = updateFields.name;
                      }
                      if (updateFields.website) {
                          body.website = updateFields.website;
                      }
                      if (updateFields.phone) {
                          body.phone = updateFields.phone;
                      }
                      if (updateFields.otherPhone) {
                          body.otherPhone = updateFields.otherPhone;
                      }
                      if (updateFields.facebookHandle) {
                          body.facebookHandle = updateFields.facebookHandle;
                      }
                      if (updateFields.googlePlusHandle) {
                          body.googlePlusHandle = updateFields.googlePlusHandle;
                      }
                      if (updateFields.linkedInHandle) {
                          body.linkedInHandle = updateFields.linkedInHandle;
                      }
                      if (updateFields.skypeId) {
                          body.skypeId = updateFields.skypeId;
                      }
                      if (updateFields.twitterHandle) {
                          body.twitterHandle = updateFields.twitterHandle;
                      }
                      if (updateFields.currency) {
                          body.currency = updateFields.currency;
                      }
                      if (updateFields.billingAddressLine1) {
                          body.billingAddressLine1 = updateFields.billingAddressLine1;
                      }
                      if (updateFields.billingAddressLine2) {
                          body.billingAddressLine2 = updateFields.billingAddressLine2;
                      }
                      if (updateFields.billingCity) {
                          body.billingCity = updateFields.billingCity;
                      }
                      if (updateFields.billingZipCode) {
                          body.billingZipCode = updateFields.billingZipCode;
                      }
                      if (updateFields.billingState) {
                          body.billingState = updateFields.billingState;
                      }
                      if (updateFields.description) {
                          body.description = updateFields.description;
                      }
                      if (updateFields.tags) {
                          body.tags = updateFields.tags;
                      }
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'PUT', `/v1/companies/${companyId}`, body);
                      responseData = responseData.Data;
                      if (!rawData) {
                          delete responseData.detail;
                      }
                  }
                  if (operation === 'get') {
                      const companyId = this.getNodeParameter('id', i);
                      const rawData = this.getNodeParameter('rawData', i);
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'GET', `/v1/companies/${companyId}`);
                      responseData = responseData.Data;
                      if (!rawData) {
                          responseData = (0, GenericFunctions_1.simplifySalesmateData)(responseData);
                      }
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      const jsonActive = this.getNodeParameter('jsonParameters', i);
                      let body = {
                          query: {
                              group: {},
                          },
                      };
                      if (options.sortBy) {
                          qs.sortBy = options.sortBy;
                      }
                      if (options.sortOrder) {
                          qs.sortOrder = options.sortOrder;
                      }
                      if (options.fields) {
                          if (options.fields.trim() === '') {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'You have to add at least one field', {
                                  itemIndex: i,
                              });
                          }
                          body.fields = options.fields.split(',');
                      }
                      else {
                          body.fields = [
                              'name',
                              'description',
                              'billingAddressLine1',
                              'billingAddressLine2',
                              'billingCity',
                              'billingZipCode',
                              'billingState',
                              'billingCountry',
                              'website',
                              'owner',
                              'tags',
                              'photo',
                              'createdAt',
                          ];
                      }
                      if (!jsonActive) {
                          const filters = [];
                          const filtersUi = this.getNodeParameter('filters', i).filtersUi;
                          if (filtersUi === null || filtersUi === void 0 ? void 0 : filtersUi.conditions) {
                              const conditions = filtersUi.conditions;
                              if (conditions.conditionsUi) {
                                  for (const condition of conditions.conditionsUi) {
                                      const filter = {};
                                      filter.moduleName = 'Company';
                                      filter.field = {
                                          fieldName: condition.field,
                                      };
                                      filter.condition = condition.condition;
                                      filter.data = condition.value;
                                      filters.push(filter);
                                  }
                              }
                          }
                          if (filtersUi === null || filtersUi === void 0 ? void 0 : filtersUi.operator) {
                              body.query.group = {
                                  operator: filtersUi.operator,
                                  rules: filters,
                              };
                          }
                      }
                      else {
                          const json = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('filtersJson', i));
                          body = json;
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.salesmateApiRequestAllItems.call(this, 'Data', 'POST', '/v2/companies/search', body, qs);
                      }
                      else {
                          const limit = this.getNodeParameter('limit', i);
                          qs.rows = limit;
                          responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'POST', '/v2/companies/search', body, qs);
                          responseData = responseData.Data.data;
                      }
                  }
                  if (operation === 'delete') {
                      const companyId = parseInt(this.getNodeParameter('id', i), 10);
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'DELETE', `/v1/companies/${companyId}`);
                  }
              }
              if (resource === 'activity') {
                  if (operation === 'create') {
                      const owner = this.getNodeParameter('owner', i);
                      const title = this.getNodeParameter('title', i);
                      const type = this.getNodeParameter('type', i);
                      const rawData = this.getNodeParameter('rawData', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          title,
                          owner,
                          type,
                      };
                      if (additionalFields.dueDate) {
                          body.dueDate = new Date(additionalFields.dueDate).getTime();
                      }
                      if (additionalFields.duration) {
                          body.duration = additionalFields.duration;
                      }
                      if (additionalFields.isCalendarInvite) {
                          body.isCalendarInvite = additionalFields.isCalendarInvite;
                      }
                      if (additionalFields.isCompleted) {
                          body.isCompleted = additionalFields.isCompleted;
                      }
                      if (additionalFields.description) {
                          body.description = additionalFields.description;
                      }
                      if (additionalFields.tags) {
                          body.tags = additionalFields.tags;
                      }
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'POST', '/v1/activities', body);
                      responseData = responseData.Data;
                      if (!rawData) {
                          delete responseData.detail;
                      }
                  }
                  if (operation === 'update') {
                      const activityId = this.getNodeParameter('id', i);
                      const rawData = this.getNodeParameter('rawData', i);
                      const updateFields = this.getNodeParameter('updateFields', i);
                      const body = {};
                      if (updateFields.title) {
                          body.title = updateFields.title;
                      }
                      if (updateFields.type) {
                          body.type = updateFields.type;
                      }
                      if (updateFields.owner) {
                          body.owner = updateFields.owner;
                      }
                      if (updateFields.dueDate) {
                          body.dueDate = new Date(updateFields.dueDate).getTime();
                      }
                      if (updateFields.duration) {
                          body.duration = updateFields.duration;
                      }
                      if (updateFields.isCalendarInvite) {
                          body.isCalendarInvite = updateFields.isCalendarInvite;
                      }
                      if (updateFields.isCompleted) {
                          body.isCompleted = updateFields.isCompleted;
                      }
                      if (updateFields.description) {
                          body.description = updateFields.description;
                      }
                      if (updateFields.tags) {
                          body.tags = updateFields.tags;
                      }
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'PUT', `/v1/activities/${activityId}`, body);
                      responseData = responseData.Data;
                      if (!rawData) {
                          delete responseData.detail;
                      }
                  }
                  if (operation === 'get') {
                      const activityId = this.getNodeParameter('id', i);
                      const rawData = this.getNodeParameter('rawData', i);
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'GET', `/v1/activities/${activityId}`);
                      responseData = responseData.Data;
                      if (!rawData) {
                          responseData = (0, GenericFunctions_1.simplifySalesmateData)(responseData);
                      }
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      const jsonActive = this.getNodeParameter('jsonParameters', i);
                      let body = {
                          query: {
                              group: {},
                          },
                      };
                      if (options.sortBy) {
                          qs.sortBy = options.sortBy;
                      }
                      if (options.sortOrder) {
                          qs.sortOrder = options.sortOrder;
                      }
                      if (options.fields) {
                          if (options.fields.trim() === '') {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'You have to add at least one field', {
                                  itemIndex: i,
                              });
                          }
                          body.fields = options.fields.split(',');
                      }
                      else {
                          body.fields = [
                              'title',
                              'dueDate',
                              'description',
                              'duration',
                              'owner',
                              'Deal.title',
                              'PrimaryContact.name',
                              'PrimaryContact.email',
                              'PrimaryCompany.name',
                              'PrimaryCompany.email',
                              'tags',
                              'type',
                              'createdAt',
                              'isCompleted',
                          ];
                      }
                      if (!jsonActive) {
                          const filters = [];
                          const filtersUi = this.getNodeParameter('filters', i).filtersUi;
                          if (filtersUi === null || filtersUi === void 0 ? void 0 : filtersUi.conditions) {
                              const conditions = filtersUi.conditions;
                              if (conditions.conditionsUi) {
                                  for (const condition of conditions.conditionsUi) {
                                      const filter = {};
                                      filter.moduleName = 'Task';
                                      filter.field = {
                                          fieldName: condition.field,
                                      };
                                      filter.condition = condition.condition;
                                      filter.data = condition.value;
                                      filters.push(filter);
                                  }
                              }
                          }
                          if (filtersUi === null || filtersUi === void 0 ? void 0 : filtersUi.operator) {
                              body.query.group = {
                                  operator: filtersUi.operator,
                                  rules: filters,
                              };
                          }
                      }
                      else {
                          const json = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('filtersJson', i));
                          body = json;
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.salesmateApiRequestAllItems.call(this, 'Data', 'POST', '/v2/activities/search', body, qs);
                      }
                      else {
                          const limit = this.getNodeParameter('limit', i);
                          qs.rows = limit;
                          responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'POST', '/v2/activities/search', body, qs);
                          responseData = responseData.Data.data;
                      }
                  }
                  if (operation === 'delete') {
                      const activityId = this.getNodeParameter('id', i);
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'DELETE', `/v1/activities/${activityId}`);
                  }
              }
              if (resource === 'deal') {
                  if (operation === 'create') {
                      const title = this.getNodeParameter('title', i);
                      const owner = this.getNodeParameter('owner', i);
                      const primaryContact = this.getNodeParameter('primaryContact', i);
                      const pipeline = this.getNodeParameter('pipeline', i);
                      const status = this.getNodeParameter('status', i);
                      const stage = this.getNodeParameter('stage', i);
                      const currency = this.getNodeParameter('currency', i);
                      const rawData = this.getNodeParameter('rawData', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          title,
                          owner,
                          primaryContact,
                          pipeline,
                          status,
                          stage,
                          currency,
                      };
                      if (additionalFields.description) {
                          body.description = additionalFields.description;
                      }
                      if (additionalFields.tags) {
                          body.tags = additionalFields.tags;
                      }
                      if (additionalFields.primaryCompany) {
                          body.primaryCompany = additionalFields.primaryCompany;
                      }
                      if (additionalFields.source) {
                          body.source = additionalFields.source;
                      }
                      if (additionalFields.estimatedCloseDate) {
                          body.estimatedCloseDate = additionalFields.estimatedCloseDate;
                      }
                      if (additionalFields.dealValue) {
                          body.dealValue = additionalFields.dealValue;
                      }
                      if (additionalFields.priority) {
                          body.priority = additionalFields.priority;
                      }
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'POST', '/v1/deals', body);
                      responseData = responseData.Data;
                      if (!rawData) {
                          delete responseData.detail;
                      }
                  }
                  if (operation === 'update') {
                      const dealId = this.getNodeParameter('id', i);
                      const rawData = this.getNodeParameter('rawData', i);
                      const updateFields = this.getNodeParameter('updateFields', i);
                      const body = {};
                      if (updateFields.title) {
                          body.title = updateFields.title;
                      }
                      if (updateFields.owner) {
                          body.owner = updateFields.owner;
                      }
                      if (updateFields.primaryContact) {
                          body.primaryContact = updateFields.primaryContact;
                      }
                      if (updateFields.status) {
                          body.status = updateFields.status;
                      }
                      if (updateFields.currency) {
                          body.currency = updateFields.currency;
                      }
                      if (updateFields.stage) {
                          body.stage = updateFields.stage;
                      }
                      if (updateFields.pipeline) {
                          body.pipeline = updateFields.pipeline;
                      }
                      if (updateFields.description) {
                          body.description = updateFields.description;
                      }
                      if (updateFields.tags) {
                          body.tags = updateFields.tags;
                      }
                      if (updateFields.primaryCompany) {
                          body.primaryCompany = updateFields.primaryCompany;
                      }
                      if (updateFields.source) {
                          body.source = updateFields.source;
                      }
                      if (updateFields.estimatedCloseDate) {
                          body.estimatedCloseDate = updateFields.estimatedCloseDate;
                      }
                      if (updateFields.dealValue) {
                          body.dealValue = updateFields.dealValue;
                      }
                      if (updateFields.priority) {
                          body.priority = updateFields.priority;
                      }
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'PUT', `/v1/deals/${dealId}`, body);
                      responseData = responseData.Data;
                      if (!rawData) {
                          delete responseData.detail;
                      }
                  }
                  if (operation === 'get') {
                      const dealId = this.getNodeParameter('id', i);
                      const rawData = this.getNodeParameter('rawData', i);
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'GET', `/v1/deals/${dealId}`);
                      responseData = responseData.Data;
                      if (!rawData) {
                          responseData = (0, GenericFunctions_1.simplifySalesmateData)(responseData);
                      }
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      const jsonActive = this.getNodeParameter('jsonParameters', i);
                      let body = {
                          query: {
                              group: {},
                          },
                      };
                      if (options.sortBy) {
                          qs.sortBy = options.sortBy;
                      }
                      if (options.sortOrder) {
                          qs.sortOrder = options.sortOrder;
                      }
                      if (options.fields !== undefined) {
                          if (options.fields.trim() === '') {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'You have to add at least one field', {
                                  itemIndex: i,
                              });
                          }
                          body.fields = options.fields.split(',');
                      }
                      else {
                          body.fields = [
                              'title',
                              'PrimaryContact.name',
                              'PrimaryContact.email',
                              'PrimaryCompany.name',
                              'PrimaryCompany.email',
                              'dealValue',
                              'priority',
                              'stage',
                              'status',
                              'owner',
                              'tags',
                              'createdAt',
                          ];
                      }
                      if (!jsonActive) {
                          const filters = [];
                          const filtersUi = this.getNodeParameter('filters', i).filtersUi;
                          if (filtersUi === null || filtersUi === void 0 ? void 0 : filtersUi.conditions) {
                              const conditions = filtersUi.conditions;
                              if (conditions.conditionsUi) {
                                  for (const condition of conditions.conditionsUi) {
                                      const filter = {};
                                      filter.moduleName = 'Task';
                                      filter.field = {
                                          fieldName: condition.field,
                                      };
                                      filter.condition = condition.condition;
                                      filter.data = condition.value;
                                      filters.push(filter);
                                  }
                              }
                          }
                          if (filtersUi === null || filtersUi === void 0 ? void 0 : filtersUi.operator) {
                              body.query.group = {
                                  operator: filtersUi.operator,
                                  rules: filters,
                              };
                          }
                      }
                      else {
                          const json = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('filtersJson', i));
                          body = json;
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.salesmateApiRequestAllItems.call(this, 'Data', 'POST', '/v2/deals/search', body, qs);
                      }
                      else {
                          const limit = this.getNodeParameter('limit', i);
                          qs.rows = limit;
                          responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'POST', '/v2/deals/search', body, qs);
                          responseData = responseData.Data.data;
                      }
                  }
                  if (operation === 'delete') {
                      const dealId = this.getNodeParameter('id', i);
                      responseData = await GenericFunctions_1.salesmateApiRequest.call(this, 'DELETE', `/v1/deals/${dealId}`);
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Salesmate = Salesmate;
  //# sourceMappingURL=Salesmate.node.js.map

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

  # Salesmate credentials

  You can use these credentials to authenticate the following nodes:

  - [Salesmate](/integrations/builtin/app-nodes/n8n-nodes-base.salesmate.md)

  ## Prerequisites

  Create a [Salesmate](https://salesmate.io/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API token

  ## Related resources

  Refer to [Salesmate's API documentation](https://apidocs.salesmate.io/?version=latest){:target=_blank .external-link} for more information about the service.


  ## Using API token

  To configure this credential, you'll need:

  - A **Session Token**: An **Access Key**. Generate an access key in **My Account > Access Key**. Refer to [Access Rights and Keys](https://apidocs.salesmate.io/?version=latest#ac8296ec-cb44-4937-a860-5ae032397ca0){:target=_blank .external-link} for more information.
  - A **URL**: Your Salesmate domain name/base URL, for example `n8n.salesmate.io`.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"1c33acfd-a7eb-4a18-a6da-da492dddea36","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"bd26c6e1aa27c2396384e4ab98624af4987148a845eab21c243d55ad093d2580"}}


