# nodes

node_type: n8n-nodes-base.Slack
name: Slack
display_name: Slack
description: Consume Slack API
category: output
icon: file:slack.svg
code_hash: 0ed10d0646f3c595406359edfa2c293dac41991cee59ad4fb3ccf2bb70eca6fc
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Slack
documentation_title: Slack node documentation
documentation_examples: []
templates: [{"name":"slack","description":"Templates for slack"}]
related_resources: [{"title":"Slack's documentation","url":"https://api.slack.com/","type":"api"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 18:34:27
updated_at: 2025-06-08 18:34:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Slack = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const SlackV1_node_1 = require("./V1/SlackV1.node");
  const SlackV2_node_1 = require("./V2/SlackV2.node");
  class Slack extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Slack',
              name: 'slack',
              icon: 'file:slack.svg',
              group: ['output'],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Slack API',
              defaultVersion: 2.1,
          };
          const nodeVersions = {
              1: new SlackV1_node_1.SlackV1(baseDescription),
              2: new SlackV2_node_1.SlackV2(baseDescription),
              2.1: new SlackV2_node_1.SlackV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Slack = Slack;
  //# sourceMappingURL=Slack.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SlackApi = void 0;
  class SlackApi {
      constructor() {
          this.name = 'slackApi';
          this.displayName = 'Slack API';
          this.documentationUrl = 'slack';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  required: true,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.accessToken}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://slack.com',
                  url: '/api/users.profile.get',
              },
              rules: [
                  {
                      type: 'responseSuccessBody',
                      properties: {
                          key: 'error',
                          value: 'invalid_auth',
                          message: 'Invalid access token',
                      },
                  },
              ],
          };
      }
  }
  exports.SlackApi = SlackApi;
  //# sourceMappingURL=SlackApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SlackOAuth2Api = void 0;
  const userScopes = [
      'channels:read',
      'channels:write',
      'chat:write',
      'files:read',
      'files:write',
      'groups:read',
      'im:read',
      'mpim:read',
      'reactions:read',
      'reactions:write',
      'stars:read',
      'stars:write',
      'usergroups:write',
      'usergroups:read',
      'users.profile:read',
      'users.profile:write',
      'users:read',
  ];
  class SlackOAuth2Api {
      constructor() {
          this.name = 'slackOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Slack OAuth2 API';
          this.documentationUrl = 'slack';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://slack.com/oauth/v2/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://slack.com/api/oauth.v2.access',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'chat:write',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: `user_scope=${userScopes.join(' ')}`,
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
              {
                  displayName: 'If you get an Invalid Scopes error, make sure you add the correct one <a target="_blank" href="https://docs.n8n.io/integrations/builtin/credentials/slack/#using-oauth">here</a> to your Slack integration',
                  name: 'notice',
                  type: 'notice',
                  default: '',
              },
          ];
      }
  }
  exports.SlackOAuth2Api = SlackOAuth2Api;
  //# sourceMappingURL=SlackOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SlackApi = void 0;
  class SlackApi {
      constructor() {
          this.name = 'slackApi';
          this.displayName = 'Slack API';
          this.documentationUrl = 'slack';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  required: true,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.accessToken}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://slack.com',
                  url: '/api/users.profile.get',
              },
              rules: [
                  {
                      type: 'responseSuccessBody',
                      properties: {
                          key: 'error',
                          value: 'invalid_auth',
                          message: 'Invalid access token',
                      },
                  },
              ],
          };
      }
  }
  exports.SlackApi = SlackApi;
  //# sourceMappingURL=SlackApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SlackOAuth2Api = void 0;
  const userScopes = [
      'channels:read',
      'channels:write',
      'chat:write',
      'files:read',
      'files:write',
      'groups:read',
      'im:read',
      'mpim:read',
      'reactions:read',
      'reactions:write',
      'stars:read',
      'stars:write',
      'usergroups:write',
      'usergroups:read',
      'users.profile:read',
      'users.profile:write',
      'users:read',
  ];
  class SlackOAuth2Api {
      constructor() {
          this.name = 'slackOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Slack OAuth2 API';
          this.documentationUrl = 'slack';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://slack.com/oauth/v2/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://slack.com/api/oauth.v2.access',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'chat:write',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: `user_scope=${userScopes.join(' ')}`,
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
              {
                  displayName: 'If you get an Invalid Scopes error, make sure you add the correct one <a target="_blank" href="https://docs.n8n.io/integrations/builtin/credentials/slack/#using-oauth">here</a> to your Slack integration',
                  name: 'notice',
                  type: 'notice',
                  default: '',
              },
          ];
      }
  }
  exports.SlackOAuth2Api = SlackOAuth2Api;
  //# sourceMappingURL=SlackOAuth2Api.credentials.js.map

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

  # Slack node

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

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

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

  ## Operations

  * **Channel**
      * **Archive** a channel.
      * **Close** a direct message or multi-person direct message.
      * **Create** a public or private channel-based conversation.
      * **Get** information about a channel.
      * **Get Many**: Get a list of channels in Slack.
      * **History**: Get a channel's history of messages and events.
      * **Invite** a user to a channel.
      * **Join** an existing channel.
      * **Kick**: Remove a user from a channel.
      * **Leave** a channel.
      * **Member**: List the members of a channel.
      * **Open** or resume a direct message or multi-person direct message.
      * **Rename** a channel.
      * **Replies**: Get a thread of messages posted to a channel.
      * **Sets purpose** of a channel.
      * **Sets topic** of a channel.
      * **Unarchive** a channel.
  * **File**
      * **Get** a file.
      * **Get Many**: Get and filter team files.
      * **Upload**: Create or upload an existing file.
  * **Message**
      * **Delete** a message
      * **Get permalink**: Get a message's permalink.
      * **Search** for messages
      * **Send** a message
      * **Send and Wait for Approval**: Send a message and wait for approval from the recipient before continuing.
      * **Update** a message
  * **Reaction**
      * **Add** a reaction to a message.
      * **Get** a message's reactions.
      * **Remove** a reaction from a message.
  * **Star**
      * **Add** a star to an item.
      * **Delete** a star from an item.
      * **Get Many**: Get a list of an authenticated user's stars.
  * **User**
      * **Get** information about a user.
  	* **Get Many**: Get a list of users.
      * **Get User's Profile**.
      * **Get User's Status**.
  	* **Update User's Profile**.
  * **User Group**
      * **Create** a user group.
      * **Disable** a user group.
      * **Enable** a user group.
      * **Get Many**: Get a list of user groups.
      * **Update** a user group.

  ## Templates and examples

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

  ## Related resources

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

  ## Required scopes

  Once you create a Slack app for your [Slack credentials](/integrations/builtin/credentials/slack.md), you must add the appropriate scopes to your Slack app for this node to work. Start with the scopes listed in the [Scopes | Slack credentials](/integrations/builtin/credentials/slack.md#scopes) page.

  If those aren't enough, use the table below to look up the resource and operation you want to use, then follow the link to Slack's API documentation to find the correct scopes.

  <!-- vale off -->

  | **Resource** | **Operation** | **Slack API method** |
  | --- | --- | --- |
  | Channel | Archive | [conversations.archive](https://api.slack.com/methods/conversations.archive){:target=blank .external-link} |
  | Channel | Close | [conversations.close](https://api.slack.com/methods/conversations.close){:target=blank .external-link} |
  | Channel | Create | [conversations.create](https://api.slack.com/methods/conversations.create){:target=blank .external-link} |
  | Channel | Get | [conversations.info](https://api.slack.com/methods/conversations.info){:target=blank .external-link} |
  | Channel | Get Many | [conversations.list](https://api.slack.com/methods/conversations.list){:target=blank .external-link} |
  | Channel | History | [conversations.history](https://api.slack.com/methods/conversations.history){:target=blank .external-link} |
  | Channel | Invite | [conversations.invite](https://api.slack.com/methods/conversations.invite){:target=blank .external-link} |
  | Channel | Join | [conversations.join](https://api.slack.com/methods/conversations.join){:target=blank .external-link} |
  | Channel | Kick | [conversations.kick](https://api.slack.com/methods/conversations.kick){:target=blank .external-link} |
  | Channel | Leave | [conversations.leave](https://api.slack.com/methods/conversations.leave){:target=blank .external-link} |
  | Channel | Member | [conversations.members](https://api.slack.com/methods/conversations.members){:target=blank .external-link} |
  | Channel | Open | [conversations.open](https://api.slack.com/methods/conversations.open){:target=blank .external-link} |
  | Channel | Rename | [conversations.rename](https://api.slack.com/methods/conversations.rename){:target=blank .external-link} |
  | Channel | Replies | [conversations.replies](https://api.slack.com/methods/conversations.replies){:target=blank .external-link} |
  | Channel | Set Purpose | [conversations.setPurpose](https://api.slack.com/methods/conversations.setPurpose){:target=blank .external-link} |
  | Channel | Set Topic | [conversations.setTopic](https://api.slack.com/methods/conversations.setTopic){:target=blank .external-link} |
  | Channel | Unarchive | [conversations.unarchive](https://api.slack.com/methods/conversations.unarchive){:target=blank .external-link} |
  | File | Get | [files.info](https://api.slack.com/methods/files.info){:target=blank .external-link} |
  | File | Get Many | [files.list](https://api.slack.com/methods/files.list){:target=blank .external-link} |
  | File | Upload | [files.upload](https://api.slack.com/methods/files.upload){:target=blank .external-link} |
  | Message | Delete | [chat.delete](https://api.slack.com/methods/chat.delete){:target=blank .external-link} |
  | Message | Get Permalink | [chat.getPermalink](https://api.slack.com/methods/chat.getPermalink){:target=blank .external-link} |
  | Message | Search | [search.messages](https://api.slack.com/methods/search.messages){:target=blank .external-link} |
  | Message | Send | [chat.postMessage](https://api.slack.com/methods/chat.postMessage){:target=blank .external-link} |
  | Message | Send and Wait for Approval | [chat.postMessage](https://api.slack.com/methods/chat.postMessage){:target=blank .external-link} |
  | Message | Update | [chat.update](https://api.slack.com/methods/chat.update){:target=blank .external-link} |
  | Reaction | Add | [reactions.add](https://api.slack.com/methods/reactions.add){:target=blank .external-link} |
  | Reaction | Get | [reactions.get](https://api.slack.com/methods/reactions.get){:target=blank .external-link} |
  | Reaction | Remove | [reactions.remove](https://api.slack.com/methods/reactions.remove){:target=blank .external-link} |
  | Star | Add | [stars.add](https://api.slack.com/methods/stars.add){:target=blank .external-link} |
  | Star | Delete | [stars.remove](https://api.slack.com/methods/stars.remove){:target=blank .external-link} |
  | Star | Get Many | [stars.list](https://api.slack.com/methods/stars.list){:target=blank .external-link} |
  | User | Get | [users.info](https://api.slack.com/methods/users.info){:target=blank .external-link} |
  | User | Get Many | [users.list](https://api.slack.com/methods/users.list){:target=blank .external-link} |
  | User | Get User's Profile | [users.profile.get](https://api.slack.com/methods/users.profile.get){:target=blank .external-link} |
  | User | Get User's Status | [users.getPresence](https://api.slack.com/methods/users.getPresence){:target=blank .external-link} |
  | User | Update User's Profile | [users.profile.set](https://api.slack.com/methods/users.profile.set){:target=blank .external-link} |
  | User Group | Create | [usergroups.create](https://api.slack.com/methods/usergroups.create){:target=blank .external-link} |
  | User Group | Disable | [usergroups.disable](https://api.slack.com/methods/usergroups.disable){:target=blank .external-link} |
  | User Group | Enable | [usergroups.enable](https://api.slack.com/methods/usergroups.enable){:target=blank .external-link} |
  | User Group | Get Many | [usergroups.list](https://api.slack.com/methods/usergroups.list){:target=blank .external-link} |
  | User Group | Update | [usergroups.update](https://api.slack.com/methods/usergroups.update){:target=blank .external-link} |

  <!-- vale on -->

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

operations:
  [{"resource":"Channel","operation":"Archive","description":"a channel"},{"resource":"Channel","operation":"Close","description":"a direct message or multi-person direct message"},{"resource":"Channel","operation":"Create","description":"a public or private channel-based conversation"},{"resource":"Channel","operation":"Get","description":"information about a channel"},{"resource":"Channel","operation":"Get Many","description":"Get a list of channels in Slack"},{"resource":"Channel","operation":"History","description":"Get a channel's history of messages and events"},{"resource":"Channel","operation":"Invite","description":"a user to a channel"},{"resource":"Channel","operation":"Join","description":"an existing channel"},{"resource":"Channel","operation":"Kick","description":"Remove a user from a channel"},{"resource":"Channel","operation":"Leave","description":"a channel"},{"resource":"Channel","operation":"Member","description":"List the members of a channel"},{"resource":"Channel","operation":"Open","description":"or resume a direct message or multi-person direct message"},{"resource":"Channel","operation":"Rename","description":"a channel"},{"resource":"Channel","operation":"Replies","description":"Get a thread of messages posted to a channel"},{"resource":"Channel","operation":"Sets purpose","description":"of a channel"},{"resource":"Channel","operation":"Sets topic","description":"of a channel"},{"resource":"Channel","operation":"Unarchive","description":"a channel"},{"resource":"File","operation":"Get","description":"a file"},{"resource":"File","operation":"Get Many","description":"Get and filter team files"},{"resource":"File","operation":"Upload","description":"Create or upload an existing file"},{"resource":"Message","operation":"Delete","description":"a message"},{"resource":"Message","operation":"Get permalink","description":"Get a message's permalink"},{"resource":"Message","operation":"Search","description":"for messages"},{"resource":"Message","operation":"Send","description":"a message"},{"resource":"Message","operation":"Send and Wait for Approval","description":"Send a message and wait for approval from the recipient before continuing"},{"resource":"Message","operation":"Update","description":"a message"},{"resource":"Reaction","operation":"Add","description":"a reaction to a message"},{"resource":"Reaction","operation":"Get","description":"a message's reactions"},{"resource":"Reaction","operation":"Remove","description":"a reaction from a message"},{"resource":"Star","operation":"Add","description":"a star to an item"},{"resource":"Star","operation":"Delete","description":"a star from an item"},{"resource":"Star","operation":"Get Many","description":"Get a list of an authenticated user's stars"},{"resource":"User","operation":"Get","description":"information about a user"},{"resource":"User","operation":"Get Many","description":"Get a list of users"},{"resource":"User","operation":"Get User's Profile","description":"Get User's Profile"},{"resource":"User","operation":"Get User's Status","description":"Get User's Status"},{"resource":"User","operation":"Update User's Profile","description":"Update User's Profile"},{"resource":"User Group","operation":"Create","description":"a user group"},{"resource":"User Group","operation":"Disable","description":"a user group"},{"resource":"User Group","operation":"Enable","description":"a user group"},{"resource":"User Group","operation":"Get Many","description":"Get a list of user groups"},{"resource":"User Group","operation":"Update","description":"a user group"}]

api_methods:
  [{"resource":"Channel","operation":"Archive","apiMethod":"conversations.archive","apiUrl":"https://api.slack.com/methods/conversations.archive"},{"resource":"Channel","operation":"Close","apiMethod":"conversations.close","apiUrl":"https://api.slack.com/methods/conversations.close"},{"resource":"Channel","operation":"Create","apiMethod":"conversations.create","apiUrl":"https://api.slack.com/methods/conversations.create"},{"resource":"Channel","operation":"Get","apiMethod":"conversations.info","apiUrl":"https://api.slack.com/methods/conversations.info"},{"resource":"Channel","operation":"Get Many","apiMethod":"conversations.list","apiUrl":"https://api.slack.com/methods/conversations.list"},{"resource":"Channel","operation":"History","apiMethod":"conversations.history","apiUrl":"https://api.slack.com/methods/conversations.history"},{"resource":"Channel","operation":"Invite","apiMethod":"conversations.invite","apiUrl":"https://api.slack.com/methods/conversations.invite"},{"resource":"Channel","operation":"Join","apiMethod":"conversations.join","apiUrl":"https://api.slack.com/methods/conversations.join"},{"resource":"Channel","operation":"Kick","apiMethod":"conversations.kick","apiUrl":"https://api.slack.com/methods/conversations.kick"},{"resource":"Channel","operation":"Leave","apiMethod":"conversations.leave","apiUrl":"https://api.slack.com/methods/conversations.leave"},{"resource":"Channel","operation":"Member","apiMethod":"conversations.members","apiUrl":"https://api.slack.com/methods/conversations.members"},{"resource":"Channel","operation":"Open","apiMethod":"conversations.open","apiUrl":"https://api.slack.com/methods/conversations.open"},{"resource":"Channel","operation":"Rename","apiMethod":"conversations.rename","apiUrl":"https://api.slack.com/methods/conversations.rename"},{"resource":"Channel","operation":"Replies","apiMethod":"conversations.replies","apiUrl":"https://api.slack.com/methods/conversations.replies"},{"resource":"Channel","operation":"Set Purpose","apiMethod":"conversations.setPurpose","apiUrl":"https://api.slack.com/methods/conversations.setPurpose"},{"resource":"Channel","operation":"Set Topic","apiMethod":"conversations.setTopic","apiUrl":"https://api.slack.com/methods/conversations.setTopic"},{"resource":"Channel","operation":"Unarchive","apiMethod":"conversations.unarchive","apiUrl":"https://api.slack.com/methods/conversations.unarchive"},{"resource":"File","operation":"Get","apiMethod":"files.info","apiUrl":"https://api.slack.com/methods/files.info"},{"resource":"File","operation":"Get Many","apiMethod":"files.list","apiUrl":"https://api.slack.com/methods/files.list"},{"resource":"File","operation":"Upload","apiMethod":"files.upload","apiUrl":"https://api.slack.com/methods/files.upload"},{"resource":"Message","operation":"Delete","apiMethod":"chat.delete","apiUrl":"https://api.slack.com/methods/chat.delete"},{"resource":"Message","operation":"Get Permalink","apiMethod":"chat.getPermalink","apiUrl":"https://api.slack.com/methods/chat.getPermalink"},{"resource":"Message","operation":"Search","apiMethod":"search.messages","apiUrl":"https://api.slack.com/methods/search.messages"},{"resource":"Message","operation":"Send","apiMethod":"chat.postMessage","apiUrl":"https://api.slack.com/methods/chat.postMessage"},{"resource":"Message","operation":"Send and Wait for Approval","apiMethod":"chat.postMessage","apiUrl":"https://api.slack.com/methods/chat.postMessage"},{"resource":"Message","operation":"Update","apiMethod":"chat.update","apiUrl":"https://api.slack.com/methods/chat.update"},{"resource":"Reaction","operation":"Add","apiMethod":"reactions.add","apiUrl":"https://api.slack.com/methods/reactions.add"},{"resource":"Reaction","operation":"Get","apiMethod":"reactions.get","apiUrl":"https://api.slack.com/methods/reactions.get"},{"resource":"Reaction","operation":"Remove","apiMethod":"reactions.remove","apiUrl":"https://api.slack.com/methods/reactions.remove"},{"resource":"Star","operation":"Add","apiMethod":"stars.add","apiUrl":"https://api.slack.com/methods/stars.add"},{"resource":"Star","operation":"Delete","apiMethod":"stars.remove","apiUrl":"https://api.slack.com/methods/stars.remove"},{"resource":"Star","operation":"Get Many","apiMethod":"stars.list","apiUrl":"https://api.slack.com/methods/stars.list"},{"resource":"User","operation":"Get","apiMethod":"users.info","apiUrl":"https://api.slack.com/methods/users.info"},{"resource":"User","operation":"Get Many","apiMethod":"users.list","apiUrl":"https://api.slack.com/methods/users.list"},{"resource":"User","operation":"Get User's Profile","apiMethod":"users.profile.get","apiUrl":"https://api.slack.com/methods/users.profile.get"},{"resource":"User","operation":"Get User's Status","apiMethod":"users.getPresence","apiUrl":"https://api.slack.com/methods/users.getPresence"},{"resource":"User","operation":"Update User's Profile","apiMethod":"users.profile.set","apiUrl":"https://api.slack.com/methods/users.profile.set"},{"resource":"User Group","operation":"Create","apiMethod":"usergroups.create","apiUrl":"https://api.slack.com/methods/usergroups.create"},{"resource":"User Group","operation":"Disable","apiMethod":"usergroups.disable","apiUrl":"https://api.slack.com/methods/usergroups.disable"},{"resource":"User Group","operation":"Enable","apiMethod":"usergroups.enable","apiUrl":"https://api.slack.com/methods/usergroups.enable"},{"resource":"User Group","operation":"Get Many","apiMethod":"usergroups.list","apiUrl":"https://api.slack.com/methods/usergroups.list"},{"resource":"User Group","operation":"Update","apiMethod":"usergroups.update","apiUrl":"https://api.slack.com/methods/usergroups.update"}]

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


node_type: n8n-nodes-base.SplitInBatches
name: SplitInBatches
display_name: Split In Batches
description: Split data into batches and iterate over each batch
category: organization
icon: fa:th-large
code_hash: c751422a11e30bf361a6c4803376289740a40434aeb77f90e18cd4dd7ba5c019
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.SplitInBatches
documentation_title: Loop Over Items (Split in Batches)
operations: []
api_methods: []
templates: [{"name":"split-in-batches","description":"Templates for split-in-batches"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 18:34:28
updated_at: 2025-06-08 18:34:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SplitInBatches = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const SplitInBatchesV1_node_1 = require("./v1/SplitInBatchesV1.node");
  const SplitInBatchesV2_node_1 = require("./v2/SplitInBatchesV2.node");
  const SplitInBatchesV3_node_1 = require("./v3/SplitInBatchesV3.node");
  class SplitInBatches extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Split In Batches',
              name: 'splitInBatches',
              icon: 'fa:th-large',
              group: ['organization'],
              description: 'Split data into batches and iterate over each batch',
              defaultVersion: 3,
          };
          const nodeVersions = {
              1: new SplitInBatchesV1_node_1.SplitInBatchesV1(),
              2: new SplitInBatchesV2_node_1.SplitInBatchesV2(),
              3: new SplitInBatchesV3_node_1.SplitInBatchesV3(),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.SplitInBatches = SplitInBatches;
  //# sourceMappingURL=SplitInBatches.node.js.map

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

  # Loop Over Items

  The Loop Over Items node helps you loop through data when needed.

  The node saves the original incoming data, and with each iteration, returns a predefined amount of data through the **loop** output.

  When the node execution completes, it combines all of the processed data and returns it through the **done** output.

  ## When to use the Loop Over Items node

  By default, n8n nodes are designed to process a list of input items (with some exceptions, detailed below). Depending on what you're trying to achieve, you often don't need the Loop Over Items node in your workflow. You can learn more about how n8n processes multiple items on the [looping in n8n](/flow-logic/looping.md) page.

  These links highlight some of the cases where the Loop Over Items node can be useful:

  * [Loop until all items are processed](/flow-logic/looping.md#loop-until-all-items-are-processed): describes how the Loop Over Items node differs from normal item processing and when you might want to incorporate this node.
  * [Node exceptions](/flow-logic/looping.md#node-exceptions): outlines specific cases and nodes where you may need to use the Loop Over Items node to manually build looping logic.
  * [Avoiding rate limiting](/integrations/builtin/rate-limits.md): demonstrates how to batch API requests to avoid rate limits from other services.

  ## Node parameters

  ### Batch Size

  Enter the number of items to return with each call.

  ## Node options

  ### Reset

  If turned on, the node will reset with the current input-data newly initialized with each loop. Use this when you want the Loop Over Items node to treat incoming data as a new set of data instead of a continuation of previous items.

  For example, you can use the Loop Over Items node with the reset option and an [If node](/integrations/builtin/core-nodes/n8n-nodes-base.if.md) to query a paginated service when you don't know how many pages you need in advance. The loop queries pages one at a time, performs any processing, and increments the page number. The loop reset ensures the loop recognizes each iteration as a new set of data. The If node evaluates an exit condition to decide whether to perform another iteration or not.

  /// warning | Include a valid termination condition
  For workflows like the example described above, it's critical to include a valid termination condition for the loop. If your termination condition never matches, your workflow execution will get stuck in an infinite loop.
  ///

  When enabled, you can adjust the reset conditions by switching the parameter representation from **Fixed** to **Expression**. The results of your expression evaluation determine when the node will reset item processing.

  ## Templates and examples

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

  ### Read RSS feed from two different sources

  This workflow allows you to read an RSS feed from two different sources using the Loop Over Items node. You need the Loop Over Items node in the workflow as the RSS Feed Read node only processes the first item it receives. You can also find the [workflow](https://n8n.io/workflows/687-read-rss-feed-from-two-different-sources/){:target=_blank .external-link} on n8n.io.

  The example walks through building the workflow, but assumes you are already familiar with n8n. To build your first workflow, including learning how to add nodes to a workflow, refer to [Try it out](/try-it-out/index.md).

  The final workflow looks like this:

  [[ workflowDemo("file:///integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/rss-feed-example.json") ]]

  Copy the workflow file above and paste into your instance, or manually build it by following these steps:

  1. Add the manual trigger.
  2. Add the Code node.
  3. Copy this code into the Code node:
  	```js
  	return [
  		{
  			json: {
  				url: 'https://medium.com/feed/n8n-io',
  			}
  		},
  		{
  			json: {
  				url: 'https://dev.to/feed/n8n',
  			}
  		}
  	];
  	```
  4. Add the Loop Over Items node.
  5. Configure Loop Over Items: set the batch size to `1` in the **Batch Size** field.
  6. Add the RSS Feed Read node.
  7. Select **Test Workflow**. This runs the workflow to load data into the RSS Feed Read node.
  8. Configure RSS Feed Read: map `url` from the input to the **URL** field. You can do this by dragging and dropping from the **INPUT** panel, or using this expression: `{{ $json.url }}`.
  9. Select **Test Workflow** to run the workflow and see the resulting data.

  ### Check that the node has processed all items

  To check if the node still has items to process, use the following expression: `{{$node["Loop Over Items"].context["noItemsLeft"]}}`. This expression returns a boolean value. If the node still has data to process, the expression returns `false`, otherwise it returns `true`.

  ### Get the current running index of the node

  To get the current running index of the node, use the following expression: `{{$node["Loop Over Items"].context["currentRunIndex"];}}`.

documentation_examples:
  [{"type":"javascript","language":"js","code":"return [\n\t\t{\n\t\t\tjson: {\n\t\t\t\turl: 'https://medium.com/feed/n8n-io',\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tjson: {\n\t\t\t\turl: 'https://dev.to/feed/n8n',\n\t\t\t}\n\t\t}\n\t];"}]

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


node_type: n8n-nodes-base.Snowflake
name: Snowflake
display_name: Snowflake
description: Get, add and update data in Snowflake
category: input
icon: file:snowflake.svg
code_hash: 500143dab0de2d112b6848ed3cc32c7b191fca0b0aa4323cb3c8b7da66b93cc4
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Snowflake
documentation_title: Snowflake node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"snowflake","description":"Templates for snowflake"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:28
updated_at: 2025-06-08 18:34: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.Snowflake = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const snowflake_sdk_1 = __importDefault(require("snowflake-sdk"));
  const utilities_1 = require("../../utils/utilities");
  class Snowflake {
      constructor() {
          this.description = {
              displayName: 'Snowflake',
              name: 'snowflake',
              icon: 'file:snowflake.svg',
              group: ['input'],
              version: 1,
              description: 'Get, add and update data in Snowflake',
              defaults: {
                  name: 'Snowflake',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'snowflake',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Execute Query',
                              value: 'executeQuery',
                              description: 'Execute an SQL query',
                              action: 'Execute a SQL query',
                          },
                          {
                              name: 'Insert',
                              value: 'insert',
                              description: 'Insert rows in database',
                              action: 'Insert rows in database',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update rows in database',
                              action: 'Update rows in database',
                          },
                      ],
                      default: 'insert',
                  },
                  {
                      displayName: 'Query',
                      name: 'query',
                      type: 'string',
                      noDataExpression: true,
                      typeOptions: {
                          editor: 'sqlEditor',
                          rows: 5,
                      },
                      displayOptions: {
                          show: {
                              operation: ['executeQuery'],
                          },
                      },
                      default: '',
                      placeholder: 'SELECT id, name FROM product WHERE id < 40',
                      required: true,
                      description: 'The SQL query to execute',
                  },
                  {
                      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: 'Table',
                      name: 'table',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the table in which to update data in',
                  },
                  {
                      displayName: 'Update Key',
                      name: 'updateKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: 'id',
                      required: true,
                      description: 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".',
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: '',
                      placeholder: 'name,description',
                      description: 'Comma-separated list of the properties which should used as columns for rows to update',
                  },
              ],
          };
      }
      async execute() {
          const credentials = (await this.getCredentials('snowflake'));
          const returnData = [];
          let responseData;
          const connection = snowflake_sdk_1.default.createConnection(credentials);
          await (0, GenericFunctions_1.connect)(connection);
          const items = this.getInputData();
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'executeQuery') {
              for (let i = 0; i < items.length; i++) {
                  let query = this.getNodeParameter('query', i);
                  for (const resolvable of (0, utilities_1.getResolvables)(query)) {
                      query = query.replace(resolvable, this.evaluateExpression(resolvable, i));
                  }
                  responseData = await (0, GenericFunctions_1.execute)(connection, query, []);
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
          }
          if (operation === 'insert') {
              const table = this.getNodeParameter('table', 0);
              const columnString = this.getNodeParameter('columns', 0);
              const columns = columnString.split(',').map((column) => column.trim());
              const query = `INSERT INTO ${table}(${columns.join(',')}) VALUES (${columns
                  .map((_column) => '?')
                  .join(',')})`;
              const data = this.helpers.copyInputItems(items, columns);
              const binds = data.map((element) => Object.values(element));
              await (0, GenericFunctions_1.execute)(connection, query, binds);
              data.forEach((d, i) => {
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(d), { itemData: { item: i } });
                  returnData.push(...executionData);
              });
          }
          if (operation === 'update') {
              const table = this.getNodeParameter('table', 0);
              const updateKey = this.getNodeParameter('updateKey', 0);
              const columnString = this.getNodeParameter('columns', 0);
              const columns = columnString.split(',').map((column) => column.trim());
              if (!columns.includes(updateKey)) {
                  columns.unshift(updateKey);
              }
              const query = `UPDATE ${table} SET ${columns
                  .map((column) => `${column} = ?`)
                  .join(',')} WHERE ${updateKey} = ?;`;
              const data = this.helpers.copyInputItems(items, columns);
              const binds = data.map((element) => Object.values(element).concat(element[updateKey]));
              for (let i = 0; i < binds.length; i++) {
                  await (0, GenericFunctions_1.execute)(connection, query, binds[i]);
              }
              data.forEach((d, i) => {
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(d), { itemData: { item: i } });
                  returnData.push(...executionData);
              });
          }
          await (0, GenericFunctions_1.destroy)(connection);
          return [returnData];
      }
  }
  exports.Snowflake = Snowflake;
  //# sourceMappingURL=Snowflake.node.js.map

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

  # Snowflake node

  Use the Snowflake node to automate work in Snowflake, and integrate Snowflake with other applications. n8n has built-in support for a wide range of Snowflake features, including executing SQL queries, and inserting rows in a database. 

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

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

  ## Operations

  * Execute an SQL query.
  * Insert rows in database.
  * Update rows in database.

  ## Templates and examples

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

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


node_type: n8n-nodes-base.Sms77
name: Sms77
display_name: seven
description: Send SMS and make text-to-speech calls
category: transform
icon: file:seven.svg
code_hash: aa9de8dde48b46654d68fcb68dc969e66a6ebb93af370b08a8c8919f7d65d0fd
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Sms77
documentation_title: seven node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"sms77","description":"Templates for sms77"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:28
updated_at: 2025-06-08 18:34:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Sms77 = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Sms77 {
      constructor() {
          this.description = {
              displayName: 'seven',
              name: 'sms77',
              icon: 'file:seven.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Send SMS and make text-to-speech calls',
              defaults: {
                  name: 'seven',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'sms77Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                          {
                              name: 'Voice Call',
                              value: 'voice',
                          },
                      ],
                      default: 'sms',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send SMS',
                              action: 'Send an SMS',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['voice'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Converts text to voice and calls a given number',
                              action: 'Convert text to voice',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'From',
                      name: 'from',
                      type: 'string',
                      default: '',
                      placeholder: '+4901234567890',
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The caller ID displayed in the receivers display. Max 16 numeric or 11 alphanumeric characters.',
                  },
                  {
                      displayName: 'To',
                      name: 'to',
                      type: 'string',
                      default: '',
                      placeholder: '+49876543210, MyGroup',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms', 'voice'],
                          },
                      },
                      description: 'The number of your recipient(s) separated by comma. Can be regular numbers or contact/groups from seven.',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms', 'voice'],
                          },
                      },
                      description: 'The message to send. Max. 1520 characters',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Opton',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Debug',
                              name: 'debug',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the API returns fake responses like in a sandbox',
                          },
                          {
                              displayName: 'Delay',
                              name: 'delay',
                              type: 'dateTime',
                              default: '',
                              description: 'Pick a date for time delayed dispatch',
                          },
                          {
                              displayName: 'Foreign ID',
                              name: 'foreign_id',
                              type: 'string',
                              default: '',
                              placeholder: 'MyCustomForeignID',
                              description: 'Custom foreign ID returned in DLR callbacks',
                          },
                          {
                              displayName: 'Flash',
                              name: 'flash',
                              type: 'boolean',
                              default: false,
                              description: "Send as flash message being displayed directly the receiver's display",
                          },
                          {
                              displayName: 'Label',
                              name: 'label',
                              type: 'string',
                              default: '',
                              placeholder: 'MyCustomLabel',
                              description: 'Custom label used to group analytics',
                          },
                          {
                              displayName: 'No Reload',
                              name: 'no_reload',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to disable reload lock to allow sending duplicate messages',
                          },
                          {
                              displayName: 'Performance Tracking',
                              name: 'performance_tracking',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable performance tracking for URLs found in the message text',
                          },
                          {
                              displayName: 'TTL',
                              name: 'ttl',
                              type: 'number',
                              default: 2880,
                              typeOptions: {
                                  minValue: 1,
                              },
                              description: 'Custom time to live specifying the validity period of a message in minutes',
                          },
                      ],
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Opton',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['voice'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Debug',
                              name: 'debug',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the API returns fake responses like in a sandbox',
                          },
                          {
                              displayName: 'From',
                              name: 'from',
                              type: 'string',
                              default: '',
                              placeholder: '+4901234567890',
                              description: 'The caller ID. Please use only verified sender IDs, one of your virtual inbound numbers or one of our shared virtual numbers.',
                          },
                          {
                              displayName: 'XML',
                              name: 'xml',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the text is in XML format',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const returnData = [];
          for (let i = 0; i < this.getInputData().length; i++) {
              const resource = this.getNodeParameter('resource', i);
              const operation = this.getNodeParameter('operation', i);
              let responseData;
              try {
                  if (resource === 'sms') {
                      if (operation === 'send') {
                          const from = this.getNodeParameter('from', i);
                          const to = this.getNodeParameter('to', i);
                          const text = this.getNodeParameter('message', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              from,
                              to,
                              text,
                              ...options,
                          };
                          responseData = await GenericFunctions_1.sms77ApiRequest.call(this, 'POST', '/sms', body);
                      }
                  }
                  if (resource === 'voice') {
                      if (operation === 'send') {
                          const to = this.getNodeParameter('to', i);
                          const text = this.getNodeParameter('message', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              to,
                              text,
                              ...options,
                          };
                          responseData = await GenericFunctions_1.sms77ApiRequest.call(this, 'POST', '/voice', body);
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else if (responseData !== undefined) {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Sms77 = Sms77;
  //# sourceMappingURL=Sms77.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Sms77Api = void 0;
  class Sms77Api {
      constructor() {
          this.name = 'sms77Api';
          this.displayName = 'seven API';
          this.documentationUrl = 'sms77';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      'X-Api-Key': '={{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://gateway.seven.io/api',
                  url: '/hooks',
                  qs: {
                      action: 'read',
                  },
              },
              rules: [
                  {
                      type: 'responseSuccessBody',
                      properties: {
                          key: 'success',
                          message: 'Invalid API Key',
                          value: undefined,
                      },
                  },
              ],
          };
      }
  }
  exports.Sms77Api = Sms77Api;
  //# sourceMappingURL=Sms77Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Sms77Api = void 0;
  class Sms77Api {
      constructor() {
          this.name = 'sms77Api';
          this.displayName = 'seven API';
          this.documentationUrl = 'sms77';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      'X-Api-Key': '={{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://gateway.seven.io/api',
                  url: '/hooks',
                  qs: {
                      action: 'read',
                  },
              },
              rules: [
                  {
                      type: 'responseSuccessBody',
                      properties: {
                          key: 'success',
                          message: 'Invalid API Key',
                          value: undefined,
                      },
                  },
              ],
          };
      }
  }
  exports.Sms77Api = Sms77Api;
  //# sourceMappingURL=Sms77Api.credentials.js.map

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

  # seven node

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

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

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

  ## Operations

  * SMS
      * Send SMS
  * Voice Call
      * Converts text to voice and calls a given number

  ## Templates and examples

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

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


node_type: n8n-nodes-base.Splunk
name: Splunk
display_name: Splunk
description: Consume the Splunk Enterprise API
category: transform
icon: file:splunk.svg
code_hash: 8970779a0ac1a63e37de3d5c596afa6149c66570fc8fc6f0f3a952c70a600f74
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Splunk
documentation_title: Splunk node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"splunk","description":"Templates for splunk"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:28
updated_at: 2025-06-08 18:34:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Splunk = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Splunk {
      constructor() {
          this.description = {
              displayName: 'Splunk',
              name: 'splunk',
              icon: 'file:splunk.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Splunk Enterprise API',
              defaults: {
                  name: 'Splunk',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'splunkApi',
                      required: true,
                      testedBy: 'splunkApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Fired Alert',
                              value: 'firedAlert',
                          },
                          {
                              name: 'Search Configuration',
                              value: 'searchConfiguration',
                          },
                          {
                              name: 'Search Job',
                              value: 'searchJob',
                          },
                          {
                              name: 'Search Result',
                              value: 'searchResult',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'searchJob',
                  },
                  ...descriptions_1.firedAlertOperations,
                  ...descriptions_1.searchConfigurationOperations,
                  ...descriptions_1.searchConfigurationFields,
                  ...descriptions_1.searchJobOperations,
                  ...descriptions_1.searchJobFields,
                  ...descriptions_1.searchResultOperations,
                  ...descriptions_1.searchResultFields,
                  ...descriptions_1.userOperations,
                  ...descriptions_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getRoles() {
                      const endpoint = '/services/authorization/roles';
                      const responseData = (await GenericFunctions_1.splunkApiRequest.call(this, 'GET', endpoint));
                      const { entry: entries } = responseData.feed;
                      return Array.isArray(entries)
                          ? entries.map((entry) => ({ name: entry.title, value: entry.title }))
                          : [{ name: entries.title, value: entries.title }];
                  },
              },
              credentialTest: {
                  async splunkApiTest(credential) {
                      const { authToken, baseUrl, allowUnauthorizedCerts } = credential.data;
                      const endpoint = '/services/alerts/fired_alerts';
                      const options = {
                          headers: {
                              Authorization: `Bearer ${authToken}`,
                              'Content-Type': 'application/x-www-form-urlencoded',
                          },
                          method: 'GET',
                          form: {},
                          qs: {},
                          uri: `${baseUrl}${endpoint}`,
                          json: true,
                          rejectUnauthorized: !allowUnauthorizedCerts,
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          var _a;
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'firedAlert') {
                      if (operation === 'getReport') {
                          const endpoint = '/services/alerts/fired_alerts';
                          responseData = await GenericFunctions_1.splunkApiRequest.call(this, 'GET', endpoint).then(GenericFunctions_1.formatFeed);
                      }
                  }
                  else if (resource === 'searchConfiguration') {
                      if (operation === 'delete') {
                          const partialEndpoint = '/services/saved/searches/';
                          const searchConfigurationId = GenericFunctions_1.getId.call(this, i, 'searchConfigurationId', '/search/saved/searches/');
                          const endpoint = `${partialEndpoint}/${searchConfigurationId}`;
                          responseData = await GenericFunctions_1.splunkApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const partialEndpoint = '/services/saved/searches/';
                          const searchConfigurationId = GenericFunctions_1.getId.call(this, i, 'searchConfigurationId', '/search/saved/searches/');
                          const endpoint = `${partialEndpoint}/${searchConfigurationId}`;
                          responseData = await GenericFunctions_1.splunkApiRequest.call(this, 'GET', endpoint).then(GenericFunctions_1.formatFeed);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const options = this.getNodeParameter('options', i);
                          (0, GenericFunctions_1.populate)(options, qs);
                          GenericFunctions_1.setCount.call(this, qs);
                          const endpoint = '/services/saved/searches';
                          responseData = await GenericFunctions_1.splunkApiRequest
                              .call(this, 'GET', endpoint, {}, qs)
                              .then(GenericFunctions_1.formatFeed);
                      }
                  }
                  else if (resource === 'searchJob') {
                      if (operation === 'create') {
                          const body = {
                              search: this.getNodeParameter('search', i),
                          };
                          const { earliest_time, latest_time, index_earliest, index_latest, ...rest } = this.getNodeParameter('additionalFields', i);
                          (0, GenericFunctions_1.populate)({
                              ...(earliest_time && { earliest_time: (0, GenericFunctions_1.toUnixEpoch)(earliest_time) }),
                              ...(latest_time && { latest_time: (0, GenericFunctions_1.toUnixEpoch)(latest_time) }),
                              ...(index_earliest && { index_earliest: (0, GenericFunctions_1.toUnixEpoch)(index_earliest) }),
                              ...(index_latest && { index_latest: (0, GenericFunctions_1.toUnixEpoch)(index_latest) }),
                              ...rest,
                          }, body);
                          const endpoint = '/services/search/jobs';
                          responseData = await GenericFunctions_1.splunkApiRequest.call(this, 'POST', endpoint, body);
                          const getEndpoint = `/services/search/jobs/${responseData.response.sid}`;
                          responseData = await GenericFunctions_1.splunkApiRequest.call(this, 'GET', getEndpoint).then(GenericFunctions_1.formatSearch);
                      }
                      else if (operation === 'delete') {
                          const partialEndpoint = '/services/search/jobs/';
                          const searchJobId = GenericFunctions_1.getId.call(this, i, 'searchJobId', partialEndpoint);
                          const endpoint = `${partialEndpoint}/${searchJobId}`;
                          responseData = await GenericFunctions_1.splunkApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const partialEndpoint = '/services/search/jobs/';
                          const searchJobId = GenericFunctions_1.getId.call(this, i, 'searchJobId', partialEndpoint);
                          const endpoint = `${partialEndpoint}/${searchJobId}`;
                          responseData = await GenericFunctions_1.splunkApiRequest.call(this, 'GET', endpoint).then(GenericFunctions_1.formatSearch);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const options = this.getNodeParameter('options', i);
                          (0, GenericFunctions_1.populate)(options, qs);
                          GenericFunctions_1.setCount.call(this, qs);
                          const endpoint = '/services/search/jobs';
                          responseData = (await GenericFunctions_1.splunkApiRequest.call(this, 'GET', endpoint, {}, qs));
                          responseData = (0, GenericFunctions_1.formatFeed)(responseData);
                      }
                  }
                  else if (resource === 'searchResult') {
                      if (operation === 'getAll') {
                          const searchJobId = this.getNodeParameter('searchJobId', i);
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          const options = this.getNodeParameter('options', i);
                          const keyValuePair = (_a = filters === null || filters === void 0 ? void 0 : filters.keyValueMatch) === null || _a === void 0 ? void 0 : _a.keyValuePair;
                          if ((keyValuePair === null || keyValuePair === void 0 ? void 0 : keyValuePair.key) && (keyValuePair === null || keyValuePair === void 0 ? void 0 : keyValuePair.value)) {
                              qs.search = `search ${keyValuePair.key}=${keyValuePair.value}`;
                          }
                          (0, GenericFunctions_1.populate)(options, qs);
                          GenericFunctions_1.setCount.call(this, qs);
                          const endpoint = `/services/search/jobs/${searchJobId}/results`;
                          responseData = await GenericFunctions_1.splunkApiRequest
                              .call(this, 'GET', endpoint, {}, qs)
                              .then(GenericFunctions_1.formatResults);
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'create') {
                          const roles = this.getNodeParameter('roles', i);
                          const body = {
                              name: this.getNodeParameter('name', i),
                              roles,
                              password: this.getNodeParameter('password', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          (0, GenericFunctions_1.populate)(additionalFields, body);
                          const endpoint = '/services/authentication/users';
                          responseData = (await GenericFunctions_1.splunkApiRequest.call(this, 'POST', endpoint, body));
                          responseData = (0, GenericFunctions_1.formatFeed)(responseData);
                      }
                      else if (operation === 'delete') {
                          const partialEndpoint = '/services/authentication/users';
                          const userId = GenericFunctions_1.getId.call(this, i, 'userId', partialEndpoint);
                          const endpoint = `${partialEndpoint}/${userId}`;
                          await GenericFunctions_1.splunkApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const partialEndpoint = '/services/authentication/users/';
                          const userId = GenericFunctions_1.getId.call(this, i, 'userId', '/services/authentication/users/');
                          const endpoint = `${partialEndpoint}/${userId}`;
                          responseData = await GenericFunctions_1.splunkApiRequest.call(this, 'GET', endpoint).then(GenericFunctions_1.formatFeed);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          GenericFunctions_1.setCount.call(this, qs);
                          const endpoint = '/services/authentication/users';
                          responseData = await GenericFunctions_1.splunkApiRequest
                              .call(this, 'GET', endpoint, {}, qs)
                              .then(GenericFunctions_1.formatFeed);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const { roles, ...rest } = this.getNodeParameter('updateFields', i);
                          (0, GenericFunctions_1.populate)({
                              ...(roles && { roles }),
                              ...rest,
                          }, body);
                          const partialEndpoint = '/services/authentication/users/';
                          const userId = GenericFunctions_1.getId.call(this, i, 'userId', partialEndpoint);
                          const endpoint = `${partialEndpoint}/${userId}`;
                          responseData = await GenericFunctions_1.splunkApiRequest
                              .call(this, 'POST', endpoint, body)
                              .then(GenericFunctions_1.formatFeed);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.cause.error });
                      continue;
                  }
                  throw error;
              }
              Array.isArray(responseData)
                  ? returnData.push(...responseData)
                  : returnData.push(responseData);
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Splunk = Splunk;
  //# sourceMappingURL=Splunk.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SplunkApi = void 0;
  class SplunkApi {
      constructor() {
          this.name = 'splunkApi';
          this.displayName = 'Splunk API';
          this.documentationUrl = 'splunk';
          this.properties = [
              {
                  displayName: 'Auth Token',
                  name: 'authToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Base URL',
                  name: 'baseUrl',
                  type: 'string',
                  description: 'Protocol, domain and port',
                  placeholder: 'e.g. https://localhost:8089',
                  default: '',
              },
              {
                  displayName: 'Allow Self-Signed Certificates',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
      }
  }
  exports.SplunkApi = SplunkApi;
  //# sourceMappingURL=SplunkApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SplunkApi = void 0;
  class SplunkApi {
      constructor() {
          this.name = 'splunkApi';
          this.displayName = 'Splunk API';
          this.documentationUrl = 'splunk';
          this.properties = [
              {
                  displayName: 'Auth Token',
                  name: 'authToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Base URL',
                  name: 'baseUrl',
                  type: 'string',
                  description: 'Protocol, domain and port',
                  placeholder: 'e.g. https://localhost:8089',
                  default: '',
              },
              {
                  displayName: 'Allow Self-Signed Certificates',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
      }
  }
  exports.SplunkApi = SplunkApi;
  //# sourceMappingURL=SplunkApi.credentials.js.map

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

  # Splunk node

  Use the Splunk node to automate work in Splunk, and integrate Splunk with other applications. n8n has built-in support for a wide range of Splunk features, including getting fired alerts reports, as well as deleting and getting search configuration. 

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

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

  ## Operations

  * Fired Alert
      * Get a fired alerts report
  * Search Configuration
      * Delete a search configuration
      * Get a search configuration
      * Get many search configurations
  * Search Job
      * Create a search job
      * Delete a search job
      * Get a search job
      * Get many search jobs
  * Search Result
      * Get many search results
  * User
      * Create a user
      * Delete a user
      * Get a user
      * Get many users
      * Update a user

  ## Templates and examples

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

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


node_type: n8n-nodes-base.Spontit
name: Spontit
display_name: Spontit
description: Consume Spontit API
category: output
icon: file:spontit.png
code_hash: 33769d94fd78408d188102c331b5795082646047dcc5544e182e4f3a11529f4d
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Spontit
documentation_title: Spontit node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"spontit","description":"Templates for spontit"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:28
updated_at: 2025-06-08 18:34: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.Spontit = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const PushDescription_1 = require("./PushDescription");
  const moment_1 = __importDefault(require("moment"));
  class Spontit {
      constructor() {
          this.description = {
              displayName: 'Spontit',
              name: 'spontit',
              icon: 'file:spontit.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Spontit API',
              defaults: {
                  name: 'Spontit',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'spontitApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Push',
                              value: 'push',
                          },
                      ],
                      default: 'push',
                  },
                  ...PushDescription_1.pushOperations,
                  ...PushDescription_1.pushFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const timezone = this.getTimezone();
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'push') {
                      if (operation === 'create') {
                          const content = this.getNodeParameter('content', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              content,
                          };
                          Object.assign(body, additionalFields);
                          if (body.pushToFollowers) {
                              body.pushToFollowers = body.pushToFollowers.split(',');
                          }
                          if (body.pushToPhoneNumbers) {
                              body.pushToPhoneNumbers = body.pushToPhoneNumbers.split(',');
                          }
                          if (body.pushToEmails) {
                              body.pushToEmails = body.pushToEmails.split(',');
                          }
                          if (body.schedule) {
                              body.scheduled = moment_1.default.tz(body.schedule, timezone).unix();
                          }
                          if (body.expirationStamp) {
                              body.expirationStamp = moment_1.default.tz(body.expirationStamp, timezone).unix();
                          }
                          responseData = await GenericFunctions_1.spontitApiRequest.call(this, 'POST', '/push', body);
                          responseData = responseData.data;
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else if (responseData !== undefined) {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Spontit = Spontit;
  //# sourceMappingURL=Spontit.node.js.map

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

  // --- Next Credential File ---

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

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

  # Spontit node

  Use the Spontit node to automate work in Spontit, and integrate Spontit with other applications. n8n supports creating push notifications with Spontit. 

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

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

  ## Operations

  * Push
      * Create a push notification

  ## Templates and examples

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

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


node_type: n8n-nodes-base.Storyblok
name: Storyblok
display_name: Storyblok
description: Consume Storyblok API
category: output
icon: file:storyblok.svg
code_hash: 883eea1ccd320f86c2501929a0fa7ef6e0721ae17abc05a8e5c65d7b16983f24
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Storyblok
documentation_title: Storyblok node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"storyblok","description":"Templates for storyblok"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Storyblok = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const StoryContentDescription_1 = require("./StoryContentDescription");
  const StoryManagementDescription_1 = require("./StoryManagementDescription");
  class Storyblok {
      constructor() {
          this.description = {
              displayName: 'Storyblok',
              name: 'storyblok',
              icon: 'file:storyblok.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Storyblok API',
              defaults: {
                  name: 'Storyblok',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'storyblokContentApi',
                      required: true,
                      displayOptions: {
                          show: {
                              source: ['contentApi'],
                          },
                      },
                  },
                  {
                      name: 'storyblokManagementApi',
                      required: true,
                      displayOptions: {
                          show: {
                              source: ['managementApi'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Source',
                      name: 'source',
                      type: 'options',
                      default: 'contentApi',
                      description: 'Pick where your data comes from, Content or Management API',
                      options: [
                          {
                              name: 'Content API',
                              value: 'contentApi',
                          },
                          {
                              name: 'Management API',
                              value: 'managementApi',
                          },
                      ],
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Story',
                              value: 'story',
                          },
                      ],
                      default: 'story',
                      displayOptions: {
                          show: {
                              source: ['contentApi'],
                          },
                      },
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Story',
                              value: 'story',
                          },
                      ],
                      default: 'story',
                      displayOptions: {
                          show: {
                              source: ['managementApi'],
                          },
                      },
                  },
                  ...StoryContentDescription_1.storyContentOperations,
                  ...StoryContentDescription_1.storyContentFields,
                  ...StoryManagementDescription_1.storyManagementOperations,
                  ...StoryManagementDescription_1.storyManagementFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getSpaces() {
                      const returnData = [];
                      const { spaces } = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', '/v1/spaces');
                      for (const space of spaces) {
                          returnData.push({
                              name: space.name,
                              value: space.id,
                          });
                      }
                      return returnData;
                  },
                  async getComponents() {
                      const returnData = [];
                      const space = this.getCurrentNodeParameter('space');
                      const { components } = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/components`);
                      for (const component of components) {
                          returnData.push({
                              name: `${component.name} ${component.is_root ? '(root)' : ''}`,
                              value: component.name,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const source = this.getNodeParameter('source', 0);
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (source === 'contentApi') {
                      if (resource === 'story') {
                          if (operation === 'get') {
                              const identifier = this.getNodeParameter('identifier', i);
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/cdn/stories/${identifier}`);
                              responseData = responseData.story;
                          }
                          if (operation === 'getAll') {
                              const filters = this.getNodeParameter('filters', i);
                              const returnAll = this.getNodeParameter('returnAll', i);
                              Object.assign(qs, filters);
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.storyblokApiRequestAllItems.call(this, 'stories', 'GET', '/v1/cdn/stories', {}, qs);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.per_page = limit;
                                  responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', '/v1/cdn/stories', {}, qs);
                                  responseData = responseData.stories;
                              }
                          }
                      }
                  }
                  if (source === 'managementApi') {
                      if (resource === 'story') {
                          if (operation === 'delete') {
                              const space = this.getNodeParameter('space', i);
                              const storyId = this.getNodeParameter('storyId', i);
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'DELETE', `/v1/spaces/${space}/stories/${storyId}`);
                              responseData = responseData.story;
                          }
                          if (operation === 'get') {
                              const space = this.getNodeParameter('space', i);
                              const storyId = this.getNodeParameter('storyId', i);
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/stories/${storyId}`);
                              responseData = responseData.story;
                          }
                          if (operation === 'getAll') {
                              const space = this.getNodeParameter('space', i);
                              const filters = this.getNodeParameter('filters', i);
                              const returnAll = this.getNodeParameter('returnAll', i);
                              Object.assign(qs, filters);
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.storyblokApiRequestAllItems.call(this, 'stories', 'GET', `/v1/spaces/${space}/stories`, {}, qs);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.per_page = limit;
                                  responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/stories`, {}, qs);
                                  responseData = responseData.stories;
                              }
                          }
                          if (operation === 'publish') {
                              const space = this.getNodeParameter('space', i);
                              const storyId = this.getNodeParameter('storyId', i);
                              const options = this.getNodeParameter('options', i);
                              const query = {};
                              if (options.releaseId) {
                                  query.release_id = options.releaseId;
                              }
                              if (options.language) {
                                  query.lang = options.language;
                              }
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/stories/${storyId}/publish`, {}, query);
                              responseData = responseData.story;
                          }
                          if (operation === 'unpublish') {
                              const space = this.getNodeParameter('space', i);
                              const storyId = this.getNodeParameter('storyId', i);
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/stories/${storyId}/unpublish`);
                              responseData = responseData.story;
                          }
                      }
                  }
                  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.Storyblok = Storyblok;
  //# sourceMappingURL=Storyblok.node.js.map

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

  # Storyblok node

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

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

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

  ## Operations

  ### Content API

  - **Story**
      - Get a story
      - Get all stories


  ### Management API

  - **Story**
      - Delete a story
      - Get a story
      - Get all stories
      - Publish a story
      - Unpublish a story

  ## Templates and examples

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

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


node_type: n8n-nodes-base.SseTrigger
name: SseTrigger
display_name: SSE Trigger
description: Triggers the workflow when Server-Sent Events occur
category: trigger
icon: fa:cloud-download-alt
code_hash: 05f0871eb011af3c8b264d9249c442aca37fbbc12533aca5e843312cf67942fb
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.SseTrigger
documentation_title: SSE Trigger node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"sse-trigger","description":"Templates for sse-trigger"}]
related_resources: []
required_scopes: []
example_parameters: {"pollTimes":{"item":[{"mode":"everyMinute"}]}}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
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.SseTrigger = void 0;
  const eventsource_1 = __importDefault(require("eventsource"));
  const n8n_workflow_1 = require("n8n-workflow");
  class SseTrigger {
      constructor() {
          this.description = {
              displayName: 'SSE Trigger',
              name: 'sseTrigger',
              icon: 'fa:cloud-download-alt',
              group: ['trigger'],
              version: 1,
              description: 'Triggers the workflow when Server-Sent Events occur',
              eventTriggerDescription: '',
              activationMessage: 'You can now make calls to your SSE URL to trigger executions.',
              defaults: {
                  name: 'SSE Trigger',
                  color: '#225577',
              },
              triggerPanel: {
                  header: '',
                  executionsHelp: {
                      inactive: "<b>While building your workflow</b>, click the 'listen' button, then trigger an SSE event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time a change is detected, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
                      active: "<b>While building your workflow</b>, click the 'listen' button, then trigger an SSE event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time a change is detected, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
                  },
                  activationHint: "Once you’ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won’t see those executions here).",
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'URL',
                      name: 'url',
                      type: 'string',
                      default: '',
                      placeholder: 'http://example.com',
                      description: 'The URL to receive the SSE from',
                      required: true,
                  },
              ],
          };
      }
      async trigger() {
          const url = this.getNodeParameter('url');
          const eventSource = new eventsource_1.default(url);
          eventSource.onmessage = (event) => {
              const eventData = (0, n8n_workflow_1.jsonParse)(event.data, {
                  errorMessage: 'Invalid JSON for event data',
              });
              this.emit([this.helpers.returnJsonArray([eventData])]);
          };
          async function closeFunction() {
              eventSource.close();
          }
          return {
              closeFunction,
          };
      }
  }
  exports.SseTrigger = SseTrigger;
  //# sourceMappingURL=SseTrigger.node.js.map

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

  # SSE Trigger node

  Server-Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server using HTTP connection. The SSE Trigger node is used to receive server-sent events.

  ## Node parameters

  The SSE Trigger node has one parameter, the **URL**. Enter the URL from which to receive the server-sent events (SSE).


  ## Templates and examples

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

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


node_type: n8n-nodes-base.StickyNote
name: StickyNote
display_name: Sticky Note
description: Make your workflow easier to understand
category: input
icon: fa:sticky-note
code_hash: 71536993abcfd47e981e96d368c60bcc43b74fc57c1cb59cf8688071356f8bf0
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StickyNote = void 0;
  class StickyNote {
      constructor() {
          this.description = {
              displayName: 'Sticky Note',
              name: 'stickyNote',
              icon: 'fa:sticky-note',
              group: ['input'],
              version: 1,
              description: 'Make your workflow easier to understand',
              defaults: {
                  name: 'Sticky Note',
                  color: '#FFD233',
              },
              inputs: [],
              outputs: [],
              properties: [
                  {
                      displayName: 'Content',
                      name: 'content',
                      type: 'string',
                      required: true,
                      default: "## I'm a note \n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)",
                  },
                  {
                      displayName: 'Height',
                      name: 'height',
                      type: 'number',
                      required: true,
                      default: 160,
                  },
                  {
                      displayName: 'Width',
                      name: 'width',
                      type: 'number',
                      required: true,
                      default: 240,
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          return [items];
      }
  }
  exports.StickyNote = StickyNote;
  //# sourceMappingURL=StickyNote.node.js.map

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


node_type: n8n-nodes-base.SpreadsheetFile
name: SpreadsheetFile
display_name: Spreadsheet File
description: Reads and writes data from a spreadsheet file like CSV, XLS, ODS, etc
category: transform
icon: fa:table
code_hash: 6e655ee1172b11636b5c4634ce0a591a107d5056c258f5cdf9cda099aa7973ea
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SpreadsheetFile = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const SpreadsheetFileV1_node_1 = require("./v1/SpreadsheetFileV1.node");
  const SpreadsheetFileV2_node_1 = require("./v2/SpreadsheetFileV2.node");
  class SpreadsheetFile extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Spreadsheet File',
              name: 'spreadsheetFile',
              icon: 'fa:table',
              group: ['transform'],
              description: 'Reads and writes data from a spreadsheet file like CSV, XLS, ODS, etc',
              defaultVersion: 2,
          };
          const nodeVersions = {
              1: new SpreadsheetFileV1_node_1.SpreadsheetFileV1(baseDescription),
              2: new SpreadsheetFileV2_node_1.SpreadsheetFileV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.SpreadsheetFile = SpreadsheetFile;
  //# sourceMappingURL=SpreadsheetFile.node.js.map

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


node_type: n8n-nodes-base.Ssh
name: Ssh
display_name: SSH
description: Execute commands via SSH
category: input
icon: fa:terminal
code_hash: 6cd745a1e989a5652e95fb4e93213461aba20bf8defb942f71286257ab9372eb
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.Ssh
documentation_title: SSH
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"ssh","description":"Templates for ssh"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Ssh = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const utilities_1 = require("../../utils/utilities");
  const promises_1 = require("fs/promises");
  const tmp_promise_1 = require("tmp-promise");
  const node_ssh_1 = require("node-ssh");
  async function resolveHomeDir(path, ssh, itemIndex) {
      if (path.startsWith('~/')) {
          let homeDir = (await ssh.execCommand('echo $HOME')).stdout;
          if (homeDir.charAt(homeDir.length - 1) !== '/') {
              homeDir += '/';
          }
          return path.replace('~/', homeDir);
      }
      if (path.startsWith('~')) {
          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid path. Replace "~" with home directory or "~/"', {
              itemIndex,
          });
      }
      return path;
  }
  class Ssh {
      constructor() {
          this.description = {
              displayName: 'SSH',
              name: 'ssh',
              icon: 'fa:terminal',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Execute commands via SSH',
              defaults: {
                  name: 'SSH',
                  color: '#000000',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'sshPassword',
                      required: true,
                      testedBy: 'sshConnectionTest',
                      displayOptions: {
                          show: {
                              authentication: ['password'],
                          },
                      },
                  },
                  {
                      name: 'sshPrivateKey',
                      required: true,
                      testedBy: 'sshConnectionTest',
                      displayOptions: {
                          show: {
                              authentication: ['privateKey'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Password',
                              value: 'password',
                          },
                          {
                              name: 'Private Key',
                              value: 'privateKey',
                          },
                      ],
                      default: 'password',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Command',
                              value: 'command',
                          },
                          {
                              name: 'File',
                              value: 'file',
                          },
                      ],
                      default: 'command',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['command'],
                          },
                      },
                      options: [
                          {
                              name: 'Execute',
                              value: 'execute',
                              description: 'Execute a command',
                              action: 'Execute a command',
                          },
                      ],
                      default: 'execute',
                  },
                  {
                      displayName: 'Command',
                      name: 'command',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['command'],
                              operation: ['execute'],
                          },
                      },
                      default: '',
                      description: 'The command to be executed on a remote device',
                  },
                  {
                      displayName: 'Working Directory',
                      name: 'cwd',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['command'],
                              operation: ['execute'],
                          },
                      },
                      default: '/',
                      required: true,
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Download',
                              value: 'download',
                              description: 'Download a file',
                              action: 'Download a file',
                          },
                          {
                              name: 'Upload',
                              value: 'upload',
                              description: 'Upload a file',
                              action: 'Upload a file',
                          },
                      ],
                      default: 'upload',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file to be uploaded',
                  },
                  {
                      displayName: 'Target Directory',
                      name: 'path',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['file'],
                              operation: ['upload'],
                          },
                      },
                      default: '',
                      required: true,
                      placeholder: '/home/user',
                      description: 'The directory to upload the file to. The name of the file does not need to be specified, it\'s taken from the binary data file name. To override this behavior, set the parameter "File Name" under options.',
                  },
                  {
                      displayName: 'Path',
                      displayOptions: {
                          show: {
                              resource: ['file'],
                              operation: ['download'],
                          },
                      },
                      name: 'path',
                      type: 'string',
                      default: '',
                      placeholder: '/home/user/invoice.txt',
                      description: 'The file path of the file to download. Has to contain the full path including file name.',
                      required: true,
                  },
                  {
                      displayName: 'Binary Property',
                      displayOptions: {
                          show: {
                              resource: ['file'],
                              operation: ['download'],
                          },
                      },
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      description: 'Object property name which holds binary data',
                      required: true,
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      displayOptions: {
                          show: {
                              resource: ['file'],
                              operation: ['upload', 'download'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'File Name',
                              name: 'fileName',
                              type: 'string',
                              default: '',
                              description: 'Overrides the binary data file name',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async sshConnectionTest(credential) {
                      const credentials = credential.data;
                      const ssh = new node_ssh_1.NodeSSH();
                      const temporaryFiles = [];
                      try {
                          if (!credentials.privateKey) {
                              await ssh.connect({
                                  host: credentials.host,
                                  username: credentials.username,
                                  port: credentials.port,
                                  password: credentials.password,
                              });
                          }
                          else {
                              const options = {
                                  host: credentials.host,
                                  username: credentials.username,
                                  port: credentials.port,
                                  privateKey: (0, utilities_1.formatPrivateKey)(credentials.privateKey),
                              };
                              if (credentials.passphrase) {
                                  options.passphrase = credentials.passphrase;
                              }
                              await ssh.connect(options);
                          }
                      }
                      catch (error) {
                          const message = `SSH connection failed: ${error.message}`;
                          return {
                              status: 'Error',
                              message,
                          };
                      }
                      finally {
                          ssh.dispose();
                          for (const tempFile of temporaryFiles)
                              await (0, promises_1.rm)(tempFile);
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnItems = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const authentication = this.getNodeParameter('authentication', 0);
          const temporaryFiles = [];
          const ssh = new node_ssh_1.NodeSSH();
          try {
              if (authentication === 'password') {
                  const credentials = await this.getCredentials('sshPassword');
                  await ssh.connect({
                      host: credentials.host,
                      username: credentials.username,
                      port: credentials.port,
                      password: credentials.password,
                  });
              }
              else if (authentication === 'privateKey') {
                  const credentials = await this.getCredentials('sshPrivateKey');
                  const options = {
                      host: credentials.host,
                      username: credentials.username,
                      port: credentials.port,
                      privateKey: (0, utilities_1.formatPrivateKey)(credentials.privateKey),
                  };
                  if (credentials.passphrase) {
                      options.passphrase = credentials.passphrase;
                  }
                  await ssh.connect(options);
              }
              for (let i = 0; i < items.length; i++) {
                  try {
                      if (resource === 'command') {
                          if (operation === 'execute') {
                              const command = this.getNodeParameter('command', i);
                              const cwd = await resolveHomeDir.call(this, this.getNodeParameter('cwd', i), ssh, i);
                              returnItems.push({
                                  json: (await ssh.execCommand(command, { cwd })),
                                  pairedItem: {
                                      item: i,
                                  },
                              });
                          }
                      }
                      if (resource === 'file') {
                          if (operation === 'download') {
                              const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i);
                              const parameterPath = await resolveHomeDir.call(this, this.getNodeParameter('path', i), ssh, i);
                              const { path } = await (0, tmp_promise_1.file)({ prefix: 'n8n-ssh-' });
                              temporaryFiles.push(path);
                              await ssh.getFile(path, parameterPath);
                              const newItem = {
                                  json: items[i].json,
                                  binary: {},
                                  pairedItem: {
                                      item: i,
                                  },
                              };
                              if (items[i].binary !== undefined && newItem.binary) {
                                  Object.assign(newItem.binary, items[i].binary);
                              }
                              items[i] = newItem;
                              const fileName = this.getNodeParameter('options.fileName', i, '');
                              items[i].binary[dataPropertyNameDownload] = await this.nodeHelpers.copyBinaryFile(path, fileName || parameterPath);
                          }
                          if (operation === 'upload') {
                              const parameterPath = await resolveHomeDir.call(this, this.getNodeParameter('path', i), ssh, i);
                              const fileName = this.getNodeParameter('options.fileName', i, '');
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              let uploadData;
                              if (binaryData.id) {
                                  uploadData = await this.helpers.getBinaryStream(binaryData.id);
                              }
                              else {
                                  uploadData = Buffer.from(binaryData.data, n8n_workflow_1.BINARY_ENCODING);
                              }
                              const { path } = await (0, tmp_promise_1.file)({ prefix: 'n8n-ssh-' });
                              temporaryFiles.push(path);
                              await (0, promises_1.writeFile)(path, uploadData);
                              await ssh.putFile(path, `${parameterPath}${parameterPath.charAt(parameterPath.length - 1) === '/' ? '' : '/'}${fileName || binaryData.fileName}`);
                              returnItems.push({
                                  json: {
                                      success: true,
                                  },
                                  pairedItem: {
                                      item: i,
                                  },
                              });
                          }
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          if (resource === 'file' && operation === 'download') {
                              items[i] = {
                                  json: {
                                      error: error.message,
                                  },
                              };
                          }
                          else {
                              returnItems.push({
                                  json: {
                                      error: error.message,
                                  },
                                  pairedItem: {
                                      item: i,
                                  },
                              });
                          }
                          continue;
                      }
                      throw error;
                  }
              }
          }
          catch (error) {
              ssh.dispose();
              for (const tempFile of temporaryFiles)
                  await (0, promises_1.rm)(tempFile);
              throw error;
          }
          for (const tempFile of temporaryFiles)
              await (0, promises_1.rm)(tempFile);
          ssh.dispose();
          if (resource === 'file' && operation === 'download') {
              return [items];
          }
          else {
              return [returnItems];
          }
      }
  }
  exports.Ssh = Ssh;
  //# sourceMappingURL=Ssh.node.js.map

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

  # SSH

  The SSH node is useful for executing commands using the Secure Shell Protocol.

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

  ## Operations

  - [**Execute** a command](#execute-command)
  - [**Download** a file](#download-file)
  - [**Upload** a file](#upload-file)

  /// note | Uploading files
  To attach a file for upload, you will need to use an extra node such as the [Read/Write Files from Disk](/integrations/builtin/core-nodes/n8n-nodes-base.readwritefile.md) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/index.md) node to pass the file as a data property.
  ///

  ### Execute Command

  Configure this operation with these parameters:

  - **Credential to connect with**: Select an existing or create a new [SSH credential](/integrations/builtin/credentials/ssh.md) to connect with.
  - **Command**: Enter the command to execute on the remote device.
  - **Working Directory**: Enter the directory where n8n should execute the command.

  ### Download File

  - **Credential to connect with**: Select an existing or create a new [SSH credential](/integrations/builtin/credentials/ssh.md) to connect with.
  - **Path**: Enter the path for the file you want to download. This path must include the file name. The downloaded file will use this file name. To use a different name, use the **File Name** option. Refer to [Download File options](#download-file-options) for more information.
  - **File Property**: Enter the name of the object property that holds the binary data you want to download.

  #### Download File options

  You can further configure this operation with the **File Name** option. Use this option to override the binary data file name to a name of your choice.

  ### Upload File

  - **Credential to connect with**: Select an existing or create a new [SSH credential](/integrations/builtin/credentials/ssh.md) to connect with.
  - **Input Binary Field**: Enter the name of the input binary field that contains the file you want to upload.
  - **Target Directory**: The directory to upload the file to. The name of the file is taken from the binary data file name. To enter a different name, use the **File Name** option. Refer to [Upload File options](#upload-file-options) for more information.

  #### Upload File options

  You can further configure this operation with the **File Name** option. Use this option to override the binary data file name to a name of your choice.

  ## Templates and examples

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

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


node_type: n8n-nodes-base.Spotify
name: Spotify
display_name: Spotify
description: Access public song data via the Spotify API
category: input
icon: file:spotify.svg
code_hash: 1a821c70bcb95f1080d2a7f8f2884b566c30771e6de24c0a9a28da9a76c8f677
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Spotify
documentation_title: Spotify node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"spotify","description":"Templates for spotify"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Spotify = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const IsoCountryCodes_1 = require("./IsoCountryCodes");
  class Spotify {
      constructor() {
          this.description = {
              displayName: 'Spotify',
              name: 'spotify',
              icon: 'file:spotify.svg',
              group: ['input'],
              version: 1,
              description: 'Access public song data via the Spotify API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Spotify',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'spotifyOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Album',
                              value: 'album',
                          },
                          {
                              name: 'Artist',
                              value: 'artist',
                          },
                          {
                              name: 'Library',
                              value: 'library',
                          },
                          {
                              name: 'My Data',
                              value: 'myData',
                          },
                          {
                              name: 'Player',
                              value: 'player',
                          },
                          {
                              name: 'Playlist',
                              value: 'playlist',
                          },
                          {
                              name: 'Track',
                              value: 'track',
                          },
                      ],
                      default: 'player',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['player'],
                          },
                      },
                      options: [
                          {
                              name: 'Add Song to Queue',
                              value: 'addSongToQueue',
                              description: 'Add a song to your queue',
                              action: 'Add a song to a queue',
                          },
                          {
                              name: 'Currently Playing',
                              value: 'currentlyPlaying',
                              description: 'Get your currently playing track',
                              action: 'Get the currently playing track',
                          },
                          {
                              name: 'Next Song',
                              value: 'nextSong',
                              description: 'Skip to your next track',
                              action: 'Skip to the next track',
                          },
                          {
                              name: 'Pause',
                              value: 'pause',
                              description: 'Pause your music',
                              action: 'Pause the player',
                          },
                          {
                              name: 'Previous Song',
                              value: 'previousSong',
                              description: 'Skip to your previous song',
                              action: 'Skip to the previous song',
                          },
                          {
                              name: 'Recently Played',
                              value: 'recentlyPlayed',
                              description: 'Get your recently played tracks',
                              action: 'Get the recently played tracks',
                          },
                          {
                              name: 'Resume',
                              value: 'resume',
                              description: 'Resume playback on the current active device',
                              action: 'Resume the player',
                          },
                          {
                              name: 'Set Volume',
                              value: 'volume',
                              description: 'Set volume on the current active device',
                              action: 'Set volume on the player',
                          },
                          {
                              name: 'Start Music',
                              value: 'startMusic',
                              description: 'Start playing a playlist, artist, or album',
                              action: 'Start music on the player',
                          },
                      ],
                      default: 'addSongToQueue',
                  },
                  {
                      displayName: 'Resource ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['player'],
                              operation: ['startMusic'],
                          },
                      },
                      placeholder: 'spotify:album:1YZ3k65Mqw3G8FzYlW1mmp',
                      description: 'Enter a playlist, artist, or album URI or ID',
                  },
                  {
                      displayName: 'Track ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['player'],
                              operation: ['addSongToQueue'],
                          },
                      },
                      placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU',
                      description: 'Enter a track URI or ID',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['album'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get an album by URI or ID',
                              action: 'Get an album',
                          },
                          {
                              name: 'Get New Releases',
                              value: 'getNewReleases',
                              description: 'Get a list of new album releases',
                              action: 'Get new album releases',
                          },
                          {
                              name: 'Get Tracks',
                              value: 'getTracks',
                              description: "Get an album's tracks by URI or ID",
                              action: "Get an album's tracks by URI or ID",
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search albums by keyword',
                              action: 'Search albums by keyword',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Album ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['album'],
                              operation: ['get', 'getTracks'],
                          },
                          hide: {
                              operation: ['search'],
                          },
                      },
                      placeholder: 'spotify:album:1YZ3k65Mqw3G8FzYlW1mmp',
                      description: "The album's Spotify URI or ID",
                  },
                  {
                      displayName: 'Search Keyword',
                      name: 'query',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The keyword term to search for',
                      displayOptions: {
                          show: {
                              resource: ['album'],
                              operation: ['search'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['artist'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get an artist by URI or ID',
                              action: 'Get an artist',
                          },
                          {
                              name: 'Get Albums',
                              value: 'getAlbums',
                              description: "Get an artist's albums by URI or ID",
                              action: "Get an artist's albums by URI or ID",
                          },
                          {
                              name: 'Get Related Artists',
                              value: 'getRelatedArtists',
                              description: "Get an artist's related artists by URI or ID",
                              action: "Get an artist's related artists by URI or ID",
                          },
                          {
                              name: 'Get Top Tracks',
                              value: 'getTopTracks',
                              description: "Get an artist's top tracks by URI or ID",
                              action: "Get an artist's top tracks by URI or ID",
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search artists by keyword',
                              action: 'Search artists by keyword',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Artist ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['artist'],
                          },
                          hide: {
                              operation: ['search'],
                          },
                      },
                      placeholder: 'spotify:artist:4LLpKhyESsyAXpc4laK94U',
                      description: "The artist's Spotify URI or ID",
                  },
                  {
                      displayName: 'Country',
                      name: 'country',
                      type: 'string',
                      default: 'US',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['artist'],
                              operation: ['getTopTracks'],
                          },
                      },
                      placeholder: 'US',
                      description: 'Top tracks in which country? Enter the postal abbreviation',
                  },
                  {
                      displayName: 'Search Keyword',
                      name: 'query',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The keyword term to search for',
                      displayOptions: {
                          show: {
                              resource: ['artist'],
                              operation: ['search'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                          },
                      },
                      options: [
                          {
                              name: 'Add an Item',
                              value: 'add',
                              description: 'Add tracks to a playlist by track and playlist URI or ID',
                              action: 'Add an Item to a playlist',
                          },
                          {
                              name: 'Create a Playlist',
                              value: 'create',
                              description: 'Create a new playlist',
                              action: 'Create a playlist',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a playlist by URI or ID',
                              action: 'Get a playlist',
                          },
                          {
                              name: "Get the User's Playlists",
                              value: 'getUserPlaylists',
                              description: "Get a user's playlists",
                              action: "Get a user's playlists",
                          },
                          {
                              name: 'Get Tracks',
                              value: 'getTracks',
                              description: "Get a playlist's tracks by URI or ID",
                              action: "Get a playlist's tracks by URI or ID",
                          },
                          {
                              name: 'Remove an Item',
                              value: 'delete',
                              description: 'Remove tracks from a playlist by track and playlist URI or ID',
                              action: 'Remove an item from a playlist',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search playlists by keyword',
                              action: 'Search playlists by keyword',
                          },
                      ],
                      default: 'add',
                  },
                  {
                      displayName: 'Playlist ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['add', 'delete', 'get', 'getTracks'],
                          },
                      },
                      placeholder: 'spotify:playlist:37i9dQZF1DWUhI3iC1khPH',
                      description: "The playlist's Spotify URI or its ID",
                  },
                  {
                      displayName: 'Name',
                      name: 'name',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['create'],
                          },
                      },
                      placeholder: 'Favorite Songs',
                      description: 'Name of the playlist to create',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['create'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Description',
                              name: 'description',
                              type: 'string',
                              default: '',
                              placeholder: 'These are all my favorite songs.',
                              description: 'Description for the playlist to create',
                          },
                          {
                              displayName: 'Public',
                              name: 'public',
                              type: 'boolean',
                              default: true,
                              description: 'Whether the playlist is publicly accessible',
                          },
                      ],
                  },
                  {
                      displayName: 'Track ID',
                      name: 'trackID',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['add', 'delete'],
                          },
                      },
                      placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU',
                      description: "The track's Spotify URI or its ID. The track to add/delete from the playlist.",
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['add'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Position',
                              name: 'position',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              default: 0,
                              placeholder: '0',
                              description: "The new track's position in the playlist",
                          },
                      ],
                  },
                  {
                      displayName: 'Search Keyword',
                      name: 'query',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The keyword term to search for',
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['search'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['track'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a track by its URI or ID',
                              action: 'Get a track',
                          },
                          {
                              name: 'Get Audio Features',
                              value: 'getAudioFeatures',
                              description: 'Get audio features for a track by URI or ID',
                              action: 'Get audio features of a track',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search tracks by keyword',
                              action: 'Search tracks by keyword',
                          },
                      ],
                      default: 'track',
                  },
                  {
                      displayName: 'Track ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['track'],
                          },
                          hide: {
                              operation: ['search'],
                          },
                      },
                      placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU',
                      description: "The track's Spotify URI or ID",
                  },
                  {
                      displayName: 'Search Keyword',
                      name: 'query',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The keyword term to search for',
                      displayOptions: {
                          show: {
                              resource: ['track'],
                              operation: ['search'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['library'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Liked Tracks',
                              value: 'getLikedTracks',
                              description: "Get the user's liked tracks",
                              action: 'Get liked tracks',
                          },
                      ],
                      default: 'getLikedTracks',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['myData'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Following Artists',
                              value: 'getFollowingArtists',
                              description: 'Get your followed artists',
                              action: 'Get your followed artists',
                          },
                      ],
                      default: 'getFollowingArtists',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['album', 'artist', 'library', 'myData', 'playlist', 'track', 'player'],
                              operation: [
                                  'getTracks',
                                  'getAlbums',
                                  'getUserPlaylists',
                                  'getNewReleases',
                                  'getLikedTracks',
                                  'getFollowingArtists',
                                  'search',
                                  'recentlyPlayed',
                              ],
                          },
                      },
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      default: 50,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['album', 'artist', 'library', 'playlist', 'track'],
                              operation: [
                                  'getTracks',
                                  'getAlbums',
                                  'getUserPlaylists',
                                  'getNewReleases',
                                  'getLikedTracks',
                                  'search',
                              ],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      default: 50,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['myData', 'player'],
                              operation: ['getFollowingArtists', 'recentlyPlayed'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 50,
                      },
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Volume',
                      name: 'volumePercent',
                      type: 'number',
                      default: 50,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['player'],
                              operation: ['volume'],
                          },
                      },
                      typeOptions: {
                          minValue: 0,
                          maxValue: 100,
                      },
                      description: 'The volume percentage to set',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['album'],
                              operation: ['getNewReleases'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Country',
                              name: 'country',
                              type: 'options',
                              default: 'US',
                              options: IsoCountryCodes_1.isoCountryCodes.map(({ name, alpha2 }) => ({ name, value: alpha2 })),
                              description: 'Country to filter new releases by',
                          },
                      ],
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['playlist', 'artist', 'track', 'album'],
                              operation: ['search'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Country',
                              name: 'market',
                              type: 'options',
                              options: IsoCountryCodes_1.isoCountryCodes.map(({ name, alpha2 }) => ({ name, value: alpha2 })),
                              default: '',
                              description: 'If a country code is specified, only content that is playable in that market is returned',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const body = {};
          let qs;
          let requestMethod;
          let endpoint;
          let returnAll;
          let propertyName = '';
          let responseData;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          requestMethod = 'GET';
          endpoint = '';
          qs = {};
          returnAll = false;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'player') {
                      if (operation === 'pause') {
                          requestMethod = 'PUT';
                          endpoint = '/me/player/pause';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'recentlyPlayed') {
                          requestMethod = 'GET';
                          endpoint = '/me/player/recently-played';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                      else if (operation === 'currentlyPlaying') {
                          requestMethod = 'GET';
                          endpoint = '/me/player/currently-playing';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'nextSong') {
                          requestMethod = 'POST';
                          endpoint = '/me/player/next';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'previousSong') {
                          requestMethod = 'POST';
                          endpoint = '/me/player/previous';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'startMusic') {
                          requestMethod = 'PUT';
                          endpoint = '/me/player/play';
                          const id = this.getNodeParameter('id', i);
                          body.context_uri = id;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'addSongToQueue') {
                          requestMethod = 'POST';
                          endpoint = '/me/player/queue';
                          const id = this.getNodeParameter('id', i);
                          qs = {
                              uri: id,
                          };
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'resume') {
                          requestMethod = 'PUT';
                          endpoint = '/me/player/play';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'volume') {
                          requestMethod = 'PUT';
                          endpoint = '/me/player/volume';
                          const volumePercent = this.getNodeParameter('volumePercent', i);
                          qs = {
                              volume_percent: volumePercent,
                          };
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                  }
                  else if (resource === 'album') {
                      if (operation === 'get') {
                          const uri = this.getNodeParameter('id', i);
                          const id = uri.replace('spotify:album:', '');
                          requestMethod = 'GET';
                          endpoint = `/albums/${id}`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'getNewReleases') {
                          endpoint = '/browse/new-releases';
                          requestMethod = 'GET';
                          propertyName = 'albums.items';
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.albums.items;
                          }
                      }
                      else if (operation === 'getTracks') {
                          const uri = this.getNodeParameter('id', i);
                          const id = uri.replace('spotify:album:', '');
                          requestMethod = 'GET';
                          endpoint = `/albums/${id}/tracks`;
                          propertyName = 'tracks';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          endpoint = '/search';
                          propertyName = 'albums.items';
                          returnAll = this.getNodeParameter('returnAll', i);
                          const q = this.getNodeParameter('query', i);
                          const filters = this.getNodeParameter('filters', i);
                          qs = {
                              q,
                              type: 'album',
                              ...filters,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.albums.items;
                          }
                      }
                  }
                  else if (resource === 'artist') {
                      const uri = this.getNodeParameter('id', i, '');
                      const id = uri.replace('spotify:artist:', '');
                      if (operation === 'getAlbums') {
                          endpoint = `/artists/${id}/albums`;
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                      else if (operation === 'getRelatedArtists') {
                          endpoint = `/artists/${id}/related-artists`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = responseData.artists;
                      }
                      else if (operation === 'getTopTracks') {
                          const country = this.getNodeParameter('country', i);
                          qs = {
                              country,
                          };
                          endpoint = `/artists/${id}/top-tracks`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = responseData.tracks;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          endpoint = `/artists/${id}`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          endpoint = '/search';
                          propertyName = 'artists.items';
                          returnAll = this.getNodeParameter('returnAll', i);
                          const q = this.getNodeParameter('query', i);
                          const filters = this.getNodeParameter('filters', i);
                          qs = {
                              q,
                              limit: 50,
                              type: 'artist',
                              ...filters,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.artists.items;
                          }
                      }
                  }
                  else if (resource === 'playlist') {
                      if (['delete', 'get', 'getTracks', 'add'].includes(operation)) {
                          const uri = this.getNodeParameter('id', i);
                          const id = uri.replace('spotify:playlist:', '');
                          if (operation === 'delete') {
                              requestMethod = 'DELETE';
                              const trackId = this.getNodeParameter('trackID', i);
                              body.tracks = [
                                  {
                                      uri: trackId,
                                  },
                              ];
                              endpoint = `/playlists/${id}/tracks`;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = { success: true };
                          }
                          else if (operation === 'get') {
                              requestMethod = 'GET';
                              endpoint = `/playlists/${id}`;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          }
                          else if (operation === 'getTracks') {
                              requestMethod = 'GET';
                              endpoint = `/playlists/${id}/tracks`;
                              returnAll = this.getNodeParameter('returnAll', i);
                              propertyName = 'items';
                              if (!returnAll) {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs = {
                                      limit,
                                  };
                                  responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                                  responseData = responseData.items;
                              }
                          }
                          else if (operation === 'add') {
                              requestMethod = 'POST';
                              const trackId = this.getNodeParameter('trackID', i);
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              qs = {
                                  uris: trackId,
                              };
                              if (additionalFields.position !== undefined) {
                                  qs.position = additionalFields.position;
                              }
                              endpoint = `/playlists/${id}/tracks`;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          }
                      }
                      else if (operation === 'getUserPlaylists') {
                          requestMethod = 'GET';
                          endpoint = '/me/playlists';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                      else if (operation === 'create') {
                          body.name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, 'POST', '/me/playlists', body, qs);
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          endpoint = '/search';
                          propertyName = 'playlists.items';
                          returnAll = this.getNodeParameter('returnAll', i);
                          const q = this.getNodeParameter('query', i);
                          const filters = this.getNodeParameter('filters', i);
                          qs = {
                              q,
                              type: 'playlist',
                              limit: 50,
                              ...filters,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.playlists.items;
                          }
                      }
                  }
                  else if (resource === 'track') {
                      const uri = this.getNodeParameter('id', i, '');
                      const id = uri.replace('spotify:track:', '');
                      requestMethod = 'GET';
                      if (operation === 'getAudioFeatures') {
                          endpoint = `/audio-features/${id}`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'get') {
                          endpoint = `/tracks/${id}`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          endpoint = '/search';
                          propertyName = 'tracks.items';
                          returnAll = this.getNodeParameter('returnAll', i);
                          const q = this.getNodeParameter('query', i);
                          const filters = this.getNodeParameter('filters', i);
                          qs = {
                              q,
                              type: 'track',
                              limit: 50,
                              ...filters,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.tracks.items;
                          }
                      }
                  }
                  else if (resource === 'library') {
                      if (operation === 'getLikedTracks') {
                          requestMethod = 'GET';
                          endpoint = '/me/tracks';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                  }
                  else if (resource === 'myData') {
                      if (operation === 'getFollowingArtists') {
                          requestMethod = 'GET';
                          endpoint = '/me/following';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'artists.items';
                          qs = {
                              type: 'artist',
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  type: 'artist',
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.artists.items;
                          }
                      }
                  }
                  if (returnAll) {
                      responseData = await GenericFunctions_1.spotifyApiRequestAllItems.call(this, propertyName, requestMethod, endpoint, body, qs);
                  }
                  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.Spotify = Spotify;
  //# sourceMappingURL=Spotify.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SpotifyOAuth2Api = void 0;
  class SpotifyOAuth2Api {
      constructor() {
          this.name = 'spotifyOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Spotify OAuth2 API';
          this.documentationUrl = 'spotify';
          this.properties = [
              {
                  displayName: 'Spotify Server',
                  name: 'server',
                  type: 'hidden',
                  default: 'https://api.spotify.com/',
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://accounts.spotify.com/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://accounts.spotify.com/api/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'user-read-playback-state playlist-read-collaborative user-modify-playback-state playlist-modify-public user-read-currently-playing playlist-read-private user-read-recently-played playlist-modify-private user-library-read user-follow-read',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.SpotifyOAuth2Api = SpotifyOAuth2Api;
  //# sourceMappingURL=SpotifyOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SpotifyOAuth2Api = void 0;
  class SpotifyOAuth2Api {
      constructor() {
          this.name = 'spotifyOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Spotify OAuth2 API';
          this.documentationUrl = 'spotify';
          this.properties = [
              {
                  displayName: 'Spotify Server',
                  name: 'server',
                  type: 'hidden',
                  default: 'https://api.spotify.com/',
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://accounts.spotify.com/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://accounts.spotify.com/api/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'user-read-playback-state playlist-read-collaborative user-modify-playback-state playlist-modify-public user-read-currently-playing playlist-read-private user-read-recently-played playlist-modify-private user-library-read user-follow-read',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.SpotifyOAuth2Api = SpotifyOAuth2Api;
  //# sourceMappingURL=SpotifyOAuth2Api.credentials.js.map

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

  # Spotify node

  Use the Spotify node to automate work in Spotify, and integrate Spotify with other applications. n8n has built-in support for a wide range of Spotify features, including getting album and artist information. 

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

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

  ## Operations

  * Album
      * Get an album by URI or ID.
      * Get a list of new album releases.
      * Get an album's tracks by URI or ID.
      * Search albums by keyword.
  * Artist
      * Get an artist by URI or ID.
      * Get an artist's albums by URI or ID.
      * Get an artist's related artists by URI or ID.
      * Get an artist's top tracks by URI or ID.
      * Search artists by keyword.
  * Library
      * Get the user's liked tracks.
  * My Data
      * Get your followed artists.
  * Player
      * Add a song to your queue.
      * Get your currently playing track.
      * Skip to your next track.
      * Pause your music.
      * Skip to your previous song.
      * Get your recently played tracks.
      * Resume playback on the current active device.
      * Set volume on the current active device.
      * Start playing a playlist, artist, or album.
  * Playlist
      * Add tracks from a playlist by track and playlist URI or ID.
      * Create a new playlist.
      * Get a playlist by URI or ID.
      * Get a playlist's tracks by URI or ID.
      * Get a user's playlists.
      * Remove tracks from a playlist by track and playlist URI or ID.
      * Search playlists by keyword.
  * Track
      * Get a track by its URI or ID.
      * Get audio features for a track by URI or ID.
      * Search tracks by keyword

  ## Templates and examples

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

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

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


node_type: n8n-nodes-base.Strapi
name: Strapi
display_name: Strapi
description: Consume Strapi API
category: input
icon: file:strapi.svg
code_hash: 6d23d2bca4436fba9185d08178d05af5842389779fe3c06be65ca04239b1eaad
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Strapi
documentation_title: Strapi node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"strapi","description":"Templates for strapi"}]
related_resources: [{"title":"Strapi's documentation","url":"https://docs.strapi.io/dev-docs/api/rest","type":"api"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Strapi = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const EntryDescription_1 = require("./EntryDescription");
  class Strapi {
      constructor() {
          this.description = {
              displayName: 'Strapi',
              name: 'strapi',
              icon: 'file:strapi.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Strapi API',
              defaults: {
                  name: 'Strapi',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'strapiApi',
                      required: true,
                      testedBy: 'strapiApiTest',
                      displayOptions: {
                          show: {
                              authentication: ['password'],
                          },
                      },
                  },
                  {
                      name: 'strapiTokenApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['token'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Username & Password',
                              value: 'password',
                          },
                          {
                              name: 'API Token',
                              value: 'token',
                          },
                      ],
                      default: 'password',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'options',
                      options: [
                          {
                              name: 'Entry',
                              value: 'entry',
                          },
                      ],
                      default: 'entry',
                  },
                  ...EntryDescription_1.entryOperations,
                  ...EntryDescription_1.entryFields,
              ],
          };
          this.methods = {
              credentialTest: {
                  async strapiApiTest(credential) {
                      const credentials = credential.data;
                      let options = {};
                      const url = (0, GenericFunctions_1.removeTrailingSlash)(credentials.url);
                      options = {
                          headers: {
                              'content-type': 'application/json',
                          },
                          method: 'POST',
                          body: {
                              identifier: credentials.email,
                              password: credentials.password,
                          },
                          uri: credentials.apiVersion === 'v4' ? `${url}/api/auth/local` : `${url}/auth/local`,
                          json: true,
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: `Auth settings are not valid: ${error}`,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          const headers = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const authenticationMethod = this.getNodeParameter('authentication', 0);
          let apiVersion;
          if (authenticationMethod === 'password') {
              const { jwt } = await GenericFunctions_1.getToken.call(this);
              apiVersion = (await this.getCredentials('strapiApi')).apiVersion;
              headers.Authorization = `Bearer ${jwt}`;
          }
          else {
              apiVersion = (await this.getCredentials('strapiTokenApi')).apiVersion;
          }
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'entry') {
                      if (operation === 'create') {
                          const body = {};
                          const contentType = this.getNodeParameter('contentType', i);
                          const columns = this.getNodeParameter('columns', i);
                          const columnList = columns.split(',').map((column) => column.trim());
                          for (const key of Object.keys(items[i].json)) {
                              if (columnList.includes(key)) {
                                  apiVersion === 'v4'
                                      ? (body.data = items[i].json)
                                      : (body[key] = items[i].json[key]);
                              }
                          }
                          responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'POST', `/${contentType}`, body, qs, undefined, headers);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'delete') {
                          const contentType = this.getNodeParameter('contentType', i);
                          const entryId = this.getNodeParameter('entryId', i);
                          responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'DELETE', `/${contentType}/${entryId}`, {}, qs, undefined, headers);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const contentType = this.getNodeParameter('contentType', i);
                          const options = this.getNodeParameter('options', i);
                          if (apiVersion === 'v4') {
                              if (options.sort && options.sort.length !== 0) {
                                  const sortFields = options.sort;
                                  qs.sort = sortFields.join(',');
                              }
                              if (options.where) {
                                  const query = (0, GenericFunctions_1.validateJSON)(options.where);
                                  if (query !== undefined) {
                                      qs.filters = query;
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Query must be a valid JSON', {
                                          itemIndex: i,
                                      });
                                  }
                              }
                              if (options.publicationState) {
                                  qs.publicationState = options.publicationState;
                              }
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.strapiApiRequestAllItems.call(this, 'GET', `/${contentType}`, {}, qs, headers, apiVersion);
                              }
                              else {
                                  qs['pagination[pageSize]'] = this.getNodeParameter('limit', i);
                                  ({ data: responseData } = await GenericFunctions_1.strapiApiRequest.call(this, 'GET', `/${contentType}`, {}, qs, undefined, headers));
                              }
                          }
                          else {
                              if (options.sort && options.sort.length !== 0) {
                                  const sortFields = options.sort;
                                  qs._sort = sortFields.join(',');
                              }
                              if (options.where) {
                                  const query = (0, GenericFunctions_1.validateJSON)(options.where);
                                  if (query !== undefined) {
                                      qs._where = query;
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Query must be a valid JSON', {
                                          itemIndex: i,
                                      });
                                  }
                              }
                              if (options.publicationState) {
                                  qs._publicationState = options.publicationState;
                              }
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.strapiApiRequestAllItems.call(this, 'GET', `/${contentType}`, {}, qs, headers, apiVersion);
                              }
                              else {
                                  qs._limit = this.getNodeParameter('limit', i);
                                  responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'GET', `/${contentType}`, {}, qs, undefined, headers);
                              }
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'get') {
                          const contentType = this.getNodeParameter('contentType', i);
                          const entryId = this.getNodeParameter('entryId', i);
                          responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'GET', `/${contentType}/${entryId}`, {}, qs, undefined, headers);
                          if (apiVersion === 'v4') {
                              responseData = responseData.data;
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'update') {
                          const body = {};
                          const contentType = this.getNodeParameter('contentType', i);
                          const columns = this.getNodeParameter('columns', i);
                          const updateKey = this.getNodeParameter('updateKey', i);
                          const columnList = columns.split(',').map((column) => column.trim());
                          const entryId = items[i].json[updateKey];
                          for (const key of Object.keys(items[i].json)) {
                              if (columnList.includes(key)) {
                                  apiVersion === 'v4'
                                      ? (body.data = items[i].json)
                                      : (body[key] = items[i].json[key]);
                              }
                          }
                          responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'PUT', `/${contentType}/${entryId}`, body, qs, undefined, headers);
                          if (apiVersion === 'v4') {
                              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.Strapi = Strapi;
  //# sourceMappingURL=Strapi.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StrapiApi = void 0;
  class StrapiApi {
      constructor() {
          this.name = 'strapiApi';
          this.displayName = 'Strapi API';
          this.documentationUrl = 'strapi';
          this.properties = [
              {
                  displayName: 'Make sure you are using a user account not an admin account',
                  name: 'notice',
                  type: 'notice',
                  default: '',
              },
              {
                  displayName: 'Email',
                  name: 'email',
                  type: 'string',
                  placeholder: 'name@email.com',
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://api.example.com',
              },
              {
                  displayName: 'API Version',
                  name: 'apiVersion',
                  default: 'v3',
                  type: 'options',
                  description: 'The version of api to be used',
                  options: [
                      {
                          name: 'Version 4',
                          value: 'v4',
                          description: 'API version supported by Strapi 4',
                      },
                      {
                          name: 'Version 3',
                          value: 'v3',
                          description: 'API version supported by Strapi 3',
                      },
                  ],
              },
          ];
      }
  }
  exports.StrapiApi = StrapiApi;
  //# sourceMappingURL=StrapiApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StrapiApi = void 0;
  class StrapiApi {
      constructor() {
          this.name = 'strapiApi';
          this.displayName = 'Strapi API';
          this.documentationUrl = 'strapi';
          this.properties = [
              {
                  displayName: 'Make sure you are using a user account not an admin account',
                  name: 'notice',
                  type: 'notice',
                  default: '',
              },
              {
                  displayName: 'Email',
                  name: 'email',
                  type: 'string',
                  placeholder: 'name@email.com',
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://api.example.com',
              },
              {
                  displayName: 'API Version',
                  name: 'apiVersion',
                  default: 'v3',
                  type: 'options',
                  description: 'The version of api to be used',
                  options: [
                      {
                          name: 'Version 4',
                          value: 'v4',
                          description: 'API version supported by Strapi 4',
                      },
                      {
                          name: 'Version 3',
                          value: 'v3',
                          description: 'API version supported by Strapi 3',
                      },
                  ],
              },
          ];
      }
  }
  exports.StrapiApi = StrapiApi;
  //# sourceMappingURL=StrapiApi.credentials.js.map

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

  # Strapi node

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

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

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

  ## Operations

  * Entry
      * Create
      * Delete
      * Get
      * Get Many
      * Update

  ## Templates and examples

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

  ## Related resources

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

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

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


node_type: n8n-nodes-base.Start
name: Start
display_name: Start
description: Starts the workflow execution from this node
category: input
icon: fa:play
code_hash: 327ac4d08639ec3324f54dd7f64f0b4df659eb5c371c63fa6ce8c346517717e8
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Start = void 0;
  class Start {
      constructor() {
          this.description = {
              displayName: 'Start',
              name: 'start',
              icon: 'fa:play',
              group: ['input'],
              version: 1,
              description: 'Starts the workflow execution from this node',
              maxNodes: 1,
              hidden: true,
              defaults: {
                  name: 'Start',
                  color: '#00e000',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'This node is where a manual workflow execution starts. To make one, go back to the canvas and click ‘execute workflow’',
                      name: 'notice',
                      type: 'notice',
                      default: '',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          return [items];
      }
  }
  exports.Start = Start;
  //# sourceMappingURL=Start.node.js.map

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


node_type: n8n-nodes-base.StopAndError
name: StopAndError
display_name: Stop and Error
description: Throw an error in the workflow
category: input
icon: fa:exclamation-triangle
code_hash: 79f3b665f4ccdb01a1faacf08233e29fbd6878e69d5d611b5dd2bf0bf9b25308
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.StopAndError
documentation_title: Stop And Error
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"stop-and-error","description":"Templates for stop-and-error"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StopAndError = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const errorObjectPlaceholder = `{
  	"code": "404",
  	"description": "The resource could not be fetched"
  }`;
  class StopAndError {
      constructor() {
          this.description = {
              displayName: 'Stop and Error',
              name: 'stopAndError',
              icon: 'fa:exclamation-triangle',
              group: ['input'],
              version: 1,
              description: 'Throw an error in the workflow',
              defaults: {
                  name: 'Stop and Error',
                  color: '#ff0000',
              },
              inputs: ['main'],
              outputs: [],
              properties: [
                  {
                      displayName: 'Error Type',
                      name: 'errorType',
                      type: 'options',
                      options: [
                          {
                              name: 'Error Message',
                              value: 'errorMessage',
                          },
                          {
                              name: 'Error Object',
                              value: 'errorObject',
                          },
                      ],
                      default: 'errorMessage',
                      description: 'Type of error to throw',
                  },
                  {
                      displayName: 'Error Message',
                      name: 'errorMessage',
                      type: 'string',
                      placeholder: 'An error occurred!',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              errorType: ['errorMessage'],
                          },
                      },
                  },
                  {
                      displayName: 'Error Object',
                      name: 'errorObject',
                      type: 'json',
                      description: 'Object containing error properties',
                      default: '',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      placeholder: errorObjectPlaceholder,
                      required: true,
                      displayOptions: {
                          show: {
                              errorType: ['errorObject'],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const errorType = this.getNodeParameter('errorType', 0);
          const { id: workflowId, name: workflowName } = this.getWorkflow();
          let toThrow;
          if (errorType === 'errorMessage') {
              toThrow = this.getNodeParameter('errorMessage', 0);
          }
          else {
              const json = this.getNodeParameter('errorObject', 0);
              const errorObject = (0, n8n_workflow_1.jsonParse)(json);
              toThrow = {
                  name: 'User-thrown error',
                  message: `Workflow ID ${workflowId} "${workflowName}" has failed`,
                  ...errorObject,
              };
          }
          throw new n8n_workflow_1.NodeOperationError(this.getNode(), toThrow);
      }
  }
  exports.StopAndError = StopAndError;
  //# sourceMappingURL=StopAndError.node.js.map

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

  # Stop And Error

  Use the Stop And Error node to display custom error messages, cause executions to fail under certain conditions, and send custom error information to error workflows.

  ## Operations

  * Error Message
  * Error Object

  ## Node parameters

  Both operations include one node parameter, the **Error Type**. Use this parameter to select the type of error to throw. Choose between the two operations: **Error Message** and **Error Object**.

  The other parameters depend on which operation you select.

  ### Error Message parameters

  The Error Message Error Type adds one parameter, the **Error Message** field. Enter the message you'd like to throw.

  ### Error Object parameters

  The Error Object Error Type adds one parameter, the **Error Object**. Enter a JSON object that contains the error properties you'd like to throw.

  ## Templates and examples

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

  ## Related resources

  You can use the Stop And Error node with the [Error trigger](/integrations/builtin/core-nodes/n8n-nodes-base.errortrigger.md) node.

  Read more about [Error workflows](/flow-logic/error-handling.md) in n8n workflows.

related_resources:
  [{"title":"Error trigger","url":"/integrations/builtin/core-nodes/n8n-nodes-base.errortrigger.md","type":"documentation"},{"title":"Error workflows","url":"/flow-logic/error-handling.md","type":"documentation"}]

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


node_type: n8n-nodes-base.Stackby
name: Stackby
display_name: Stackby
description: Read, write, and delete data in Stackby
category: transform
icon: file:stackby.png
code_hash: 01e67da38c6f9be77eccfb21b9551d9c8fc64893991b678ddd9b4f56e2a8f463
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Stackby
documentation_title: Stackby node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"stackby","description":"Templates for stackby"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:30
updated_at: 2025-06-08 18:34:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Stackby = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunction_1 = require("./GenericFunction");
  const utilities_1 = require("../../utils/utilities");
  class Stackby {
      constructor() {
          this.description = {
              displayName: 'Stackby',
              name: 'stackby',
              icon: 'file:stackby.png',
              group: ['transform'],
              version: 1,
              description: 'Read, write, and delete data in Stackby',
              defaults: {
                  name: 'Stackby',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'stackbyApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Append',
                              value: 'append',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                          },
                          {
                              name: 'List',
                              value: 'list',
                          },
                          {
                              name: 'Read',
                              value: 'read',
                          },
                      ],
                      default: 'append',
                      placeholder: 'Action to perform',
                  },
                  {
                      displayName: 'Stack ID',
                      name: 'stackId',
                      type: 'string',
                      default: '',
                      required: true,
                      description: 'The ID of the stack to access',
                  },
                  {
                      displayName: 'Table',
                      name: 'table',
                      type: 'string',
                      default: '',
                      placeholder: 'Stories',
                      required: true,
                      description: 'Enter Table Name',
                  },
                  {
                      displayName: 'ID',
                      name: 'id',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['read', 'delete'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'ID of the record to return',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                          },
                      },
                      default: true,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 1000,
                      },
                      default: 1000,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                          },
                      },
                      default: {},
                      placeholder: 'Add Field',
                      options: [
                          {
                              displayName: 'View',
                              name: 'view',
                              type: 'string',
                              default: '',
                              placeholder: 'All Stories',
                              description: 'The name or ID of a view in the Stories table. If set, only the records in that view will be returned. The records will be sorted according to the order of the view.',
                          },
                      ],
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['append'],
                          },
                      },
                      default: '',
                      required: true,
                      placeholder: 'id,name,description',
                      description: 'Comma-separated list of the properties which should used as columns for the new rows',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'read') {
              for (let i = 0; i < length; i++) {
                  try {
                      const stackId = this.getNodeParameter('stackId', i);
                      const table = encodeURI(this.getNodeParameter('table', i));
                      const rowIds = this.getNodeParameter('id', i);
                      qs.rowIds = [rowIds];
                      responseData = await GenericFunction_1.apiRequest.call(this, 'GET', `/rowlist/${stackId}/${table}`, {}, qs);
                      returnData.push.apply(returnData, responseData.map((data) => data.field));
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                          returnData.push(...executionErrorData);
                          continue;
                      }
                      throw error;
                  }
              }
          }
          if (operation === 'delete') {
              for (let i = 0; i < length; i++) {
                  try {
                      const stackId = this.getNodeParameter('stackId', i);
                      const table = encodeURI(this.getNodeParameter('table', i));
                      const rowIds = this.getNodeParameter('id', i);
                      qs.rowIds = [rowIds];
                      responseData = await GenericFunction_1.apiRequest.call(this, 'DELETE', `/rowdelete/${stackId}/${table}`, {}, qs);
                      responseData = responseData.records;
                      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;
                  }
              }
          }
          if (operation === 'append') {
              try {
                  const records = {};
                  let key = '';
                  for (let i = 0; i < length; i++) {
                      const stackId = this.getNodeParameter('stackId', i);
                      const table = encodeURI(this.getNodeParameter('table', i));
                      const columns = this.getNodeParameter('columns', i);
                      const columnList = columns.split(',').map((column) => column.trim());
                      const record = {};
                      for (const column of columnList) {
                          if (items[i].json[column] === undefined) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Column ${column} does not exist on input`, { itemIndex: i });
                          }
                          else {
                              record[column] = items[i].json[column];
                          }
                      }
                      key = `${stackId}/${table}`;
                      if (records[key] === undefined) {
                          records[key] = [];
                      }
                      records[key].push({ field: record });
                  }
                  for (const recordKey of Object.keys(records)) {
                      responseData = await GenericFunction_1.apiRequest.call(this, 'POST', `/rowcreate/${recordKey}`, {
                          records: records[recordKey],
                      });
                  }
                  returnData.push.apply(returnData, responseData.map((data) => data.field));
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const itemData = (0, utilities_1.generatePairedItemData)(items.length);
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData });
                      returnData.push(...executionErrorData);
                  }
                  else {
                      throw error;
                  }
              }
          }
          if (operation === 'list') {
              for (let i = 0; i < length; i++) {
                  try {
                      const stackId = this.getNodeParameter('stackId', i);
                      const table = encodeURI(this.getNodeParameter('table', i));
                      const returnAll = this.getNodeParameter('returnAll', 0);
                      const additionalFields = this.getNodeParameter('additionalFields', i, {});
                      if (additionalFields.view) {
                          qs.view = additionalFields.view;
                      }
                      if (returnAll) {
                          responseData = await GenericFunction_1.apiRequestAllItems.call(this, 'GET', `/rowlist/${stackId}/${table}`, {}, qs);
                      }
                      else {
                          qs.maxrecord = this.getNodeParameter('limit', 0);
                          responseData = await GenericFunction_1.apiRequest.call(this, 'GET', `/rowlist/${stackId}/${table}`, {}, qs);
                      }
                      returnData.push.apply(returnData, responseData.map((data) => data.field));
                  }
                  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.Stackby = Stackby;
  //# sourceMappingURL=Stackby.node.js.map

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

  // --- Next Credential File ---

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

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

  # Stackby node

  Use the Stackby node to automate work in Stackby, and integrate Stackby with other applications. n8n has built-in support for a wide range of Stackby features, including appending, deleting, listing and reading. 

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

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

  ## Operations

  - Append
  - Delete
  - List
  - Read

  ## Templates and examples

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

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


node_type: n8n-nodes-base.Switch
name: Switch
display_name: Switch
description: Route items depending on defined expression or rules
category: transform
icon: fa:map-signs
code_hash: c1b9c3794375e6db2acbdf04c54a05bfeec3053a08c530f04f57e173953e77c9
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.Switch
documentation_title: Switch
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"switch","description":"Templates for switch"}]
related_resources: [{"title":"Splitting with conditionals","url":"/flow-logic/splitting.md","type":"documentation"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 18:34:31
updated_at: 2025-06-08 18:34:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Switch = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const SwitchV1_node_1 = require("./V1/SwitchV1.node");
  const SwitchV2_node_1 = require("./V2/SwitchV2.node");
  class Switch extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Switch',
              name: 'switch',
              icon: 'fa:map-signs',
              group: ['transform'],
              description: 'Route items depending on defined expression or rules',
              defaultVersion: 2,
          };
          const nodeVersions = {
              1: new SwitchV1_node_1.SwitchV1(baseDescription),
              2: new SwitchV2_node_1.SwitchV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Switch = Switch;
  //# sourceMappingURL=Switch.node.js.map

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

  # Switch

  Use the Switch node to route a workflow conditionally based on comparison operations. It's similar to the [IF](/integrations/builtin/core-nodes/n8n-nodes-base.if.md) node, but supports multiple output routes.

  ## Node parameters

  Select the **Mode** the node should use:

  * **Rules**: Select this mode to build a matching rule for each output.
  * **Expression**: Select this mode to write an expression to return the output index programmatically.

  Node configuration depends on the **Mode** you select.

  ### Rules

  To configure the node with this operation, use these parameters:

  * Create **Routing Rules** to define comparison conditions.
      * Use the data type dropdown to select the data type and comparison operation type for your condition. For example, to create a rules for dates after a particular date, select **Date & Time > is after**.
      * The fields and values to enter into the condition change based on the data type and comparison you select. Refer to [Available data type comparisons](#available-data-type-comparisons) for a full list of all comparisons by data type.
  * **Rename Output**: Turn this control on to rename the output field to put matching data into. Enter your desired **Output Name**.

  Select **Add Routing Rule** to add more rules.

  #### Rule options

  You can further configure the node with this operation using these **Options**:

  - **Fallback Output**: Choose how to route the workflow when an item doesn't match any of the rules or conditions.
      - **None**: Ignore the item. This is the default behavior.
      - **Extra Output**: Send items to an extra, separate output.
      - **Output 0**: Send items to the same output as those matching the first rule.
  - **Ignore Case**: Set whether to ignore letter case when evaluating conditions (turned on) or enforce letter case (turned off).
  - **Less Strict Type Validation**: Set whether you want n8n to attempt to convert value types based on the operator you choose (turned on) or not (turned off).
  - **Send data to all matching outputs**: Set whether to send data to all outputs meeting conditions (turned on) or whether to send the data to the first output matching the conditions (turned off).

  ### Expression

  To configure the node with this operation, use these parameters:

  - **Number of Outputs**: Set how many outputs the node should have.
  - **Output Index**: Create an expression to calculate which input item should be routed to which output. The expression must return a number.

  ## Templates and examples

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

  ## Related resources

  Refer to [Splitting with conditionals](/flow-logic/splitting.md) for more information on using conditionals to create complex logic in n8n.

  --8<-- "_snippets/integrations/builtin/core-nodes/data-types.md"

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


node_type: n8n-nodes-base.Strava
name: Strava
display_name: Strava
description: Consume Strava API
category: input
icon: file:strava.svg
code_hash: 7a22dfb2e271c2501cb569ed4956c2717f03c82004e50494b33660c19bd5d9a5
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Strava
documentation_title: Strava node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"strava","description":"Templates for strava"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:31
updated_at: 2025-06-08 18:34:31
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.Strava = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ActivityDescription_1 = require("./ActivityDescription");
  const moment_1 = __importDefault(require("moment"));
  class Strava {
      constructor() {
          this.description = {
              displayName: 'Strava',
              name: 'strava',
              icon: 'file:strava.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Strava API',
              defaults: {
                  name: 'Strava',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'stravaOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                      ],
                      default: 'activity',
                  },
                  ...ActivityDescription_1.activityOperations,
                  ...ActivityDescription_1.activityFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'activity') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const type = this.getNodeParameter('type', i);
                          const startDate = this.getNodeParameter('startDate', i);
                          const elapsedTime = this.getNodeParameter('elapsedTime', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.trainer === true) {
                              additionalFields.trainer = 1;
                          }
                          if (additionalFields.commute === true) {
                              additionalFields.commute = 1;
                          }
                          const body = {
                              name,
                              type,
                              start_date_local: (0, moment_1.default)(startDate).toISOString(),
                              elapsed_time: elapsedTime,
                          };
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'POST', '/activities', body);
                      }
                      if (operation === 'get') {
                          const activityId = this.getNodeParameter('activityId', i);
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'GET', `/activities/${activityId}`);
                      }
                      if (['getLaps', 'getZones', 'getKudos', 'getComments'].includes(operation)) {
                          const path = {
                              getComments: 'comments',
                              getZones: 'zones',
                              getKudos: 'kudos',
                              getLaps: 'laps',
                          };
                          const activityId = this.getNodeParameter('activityId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'GET', `/activities/${activityId}/${path[operation]}`);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'getStreams') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const keys = this.getNodeParameter('keys', i);
                          qs.keys = keys.toString();
                          qs.key_by_type = true;
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'GET', `/activities/${activityId}/streams`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.stravaApiRequestAllItems.call(this, 'GET', '/activities', {}, qs);
                          }
                          else {
                              qs.per_page = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'GET', '/activities', {}, qs);
                          }
                      }
                      if (operation === 'update') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'PUT', `/activities/${activityId}`, body);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Strava = Strava;
  //# sourceMappingURL=Strava.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StravaOAuth2Api = void 0;
  class StravaOAuth2Api {
      constructor() {
          this.name = 'stravaOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Strava OAuth2 API';
          this.documentationUrl = 'strava';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://www.strava.com/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://www.strava.com/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'activity:read_all,activity:write',
                  required: true,
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.StravaOAuth2Api = StravaOAuth2Api;
  //# sourceMappingURL=StravaOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StravaOAuth2Api = void 0;
  class StravaOAuth2Api {
      constructor() {
          this.name = 'stravaOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Strava OAuth2 API';
          this.documentationUrl = 'strava';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://www.strava.com/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://www.strava.com/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'activity:read_all,activity:write',
                  required: true,
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.StravaOAuth2Api = StravaOAuth2Api;
  //# sourceMappingURL=StravaOAuth2Api.credentials.js.map

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

  # Strava node

  Use the Strava node to automate work in Strava, and integrate Strava with other applications. n8n has built-in support for a wide range of Strava features, including creating new activities, and getting activity information. 

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

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

  ## Operations

  * Activity
      * Create a new activity
      * Get an activity
      * Get all activities
      * Get all activity comments
      * Get all activity kudos
      * Get all activity laps
      * Get all activity zones
      * Update an activity

  ## Templates and examples

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

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

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


node_type: n8n-nodes-base.SyncroMsp
name: SyncroMsp
display_name: SyncroMSP
description: Manage contacts, tickets and more from Syncro MSP
category: output
icon: file:syncromsp.png
code_hash: c44903a2bc514e7a1c98052f565802f0d82e466c953f0bda06cf0bcaab6f8c89
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.SyncroMsp
documentation_title: SyncroMSP node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"syncromsp","description":"Templates for syncromsp"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 18:34:31
updated_at: 2025-06-08 18:34:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SyncroMsp = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const SyncroMspV1_node_1 = require("./v1/SyncroMspV1.node");
  class SyncroMsp extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'SyncroMSP',
              name: 'syncroMsp',
              icon: 'file:syncromsp.png',
              group: ['output'],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Manage contacts, tickets and more from Syncro MSP',
              defaultVersion: 1,
          };
          const nodeVersions = {
              1: new SyncroMspV1_node_1.SyncroMspV1(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.SyncroMsp = SyncroMsp;
  //# sourceMappingURL=SyncroMsp.node.js.map

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

  // --- Next Credential File ---

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

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

  # SyncroMSP node

  Use the SyncroMSP node to automate work in SyncroMSP, and integrate SyncroMSP with other applications. n8n has built-in support for a wide range of SyncroMSP features, including creating and deleting new customers, tickets, and contacts. 

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

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

  ## Operations

  * Contact
      * Create new contact
      * Delete contact
      * Retrieve contact
      * Retrieve all contacts
      * Update contact
  * Customer
      * Create new customer
      * Delete customer
      * Retrieve customer
      * Retrieve all customers
      * Update customer
  * RMM
      * Create new RMM Alert
      * Delete RMM Alert
      * Retrieve RMM Alert
      * Retrieve all RMM Alerts
      * Mute RMM Alert
  * Ticket
      * Create new ticket
      * Delete ticket
      * Retrieve ticket
      * Retrieve all tickets
      * Update ticket

  ## Templates and examples

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

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


node_type: n8n-nodes-base.Stripe
name: Stripe
display_name: Stripe
description: Consume the Stripe API
category: transform
icon: file:stripe.svg
code_hash: a140efa1ba344639e26ed3feb6d57c8e4e5ed6c063161e3d63c831962c1f45ad
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Stripe
documentation_title: Stripe node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"stripe","description":"Templates for stripe"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:31
updated_at: 2025-06-08 18:34:31
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.Stripe = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  const helpers_1 = require("./helpers");
  const descriptions_1 = require("./descriptions");
  class Stripe {
      constructor() {
          this.description = {
              displayName: 'Stripe',
              name: 'stripe',
              icon: 'file:stripe.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Stripe API',
              defaults: {
                  name: 'Stripe',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'stripeApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Balance',
                              value: 'balance',
                          },
                          {
                              name: 'Charge',
                              value: 'charge',
                          },
                          {
                              name: 'Coupon',
                              value: 'coupon',
                          },
                          {
                              name: 'Customer',
                              value: 'customer',
                          },
                          {
                              name: 'Customer Card',
                              value: 'customerCard',
                          },
                          {
                              name: 'Source',
                              value: 'source',
                          },
                          {
                              name: 'Token',
                              value: 'token',
                          },
                      ],
                      default: 'balance',
                  },
                  ...descriptions_1.balanceOperations,
                  ...descriptions_1.customerCardOperations,
                  ...descriptions_1.customerCardFields,
                  ...descriptions_1.chargeOperations,
                  ...descriptions_1.chargeFields,
                  ...descriptions_1.couponOperations,
                  ...descriptions_1.couponFields,
                  ...descriptions_1.customerOperations,
                  ...descriptions_1.customerFields,
                  ...descriptions_1.sourceOperations,
                  ...descriptions_1.sourceFields,
                  ...descriptions_1.tokenOperations,
                  ...descriptions_1.tokenFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCustomers() {
                      return helpers_1.loadResource.call(this, 'customer');
                  },
                  async getCurrencies() {
                      const returnData = [];
                      const { data } = await helpers_1.stripeApiRequest.call(this, 'GET', '/country_specs', {});
                      for (const currency of data[0].supported_payment_currencies) {
                          returnData.push({
                              name: currency.toUpperCase(),
                              value: currency,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      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 === 'balance') {
                      if (operation === 'get') {
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', '/balance', {}, {});
                      }
                  }
                  else if (resource === 'customerCard') {
                      if (operation === 'add') {
                          const body = {
                              source: this.getNodeParameter('token', i),
                          };
                          const customerId = this.getNodeParameter('customerId', i);
                          const endpoint = `/customers/${customerId}/sources`;
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', endpoint, body, {});
                      }
                      else if (operation === 'remove') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const endpoint = `/customers/${customerId}/sources/${cardId}`;
                          responseData = await helpers_1.stripeApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      }
                      else if (operation === 'get') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const sourceId = this.getNodeParameter('sourceId', i);
                          const endpoint = `/customers/${customerId}/sources/${sourceId}`;
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', endpoint, {}, {});
                      }
                  }
                  else if (resource === 'charge') {
                      if (operation === 'create') {
                          const body = {
                              customer: this.getNodeParameter('customerId', i),
                              currency: this.getNodeParameter('currency', i).toLowerCase(),
                              amount: this.getNodeParameter('amount', i),
                              source: this.getNodeParameter('source', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, (0, helpers_1.adjustChargeFields)(additionalFields));
                          }
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/charges', body, {});
                      }
                      else if (operation === 'get') {
                          const chargeId = this.getNodeParameter('chargeId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', `/charges/${chargeId}`, {}, {});
                      }
                      else if (operation === 'getAll') {
                          responseData = await helpers_1.handleListing.call(this, resource, i);
                      }
                      else if (operation === 'update') {
                          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, (0, helpers_1.adjustChargeFields)(updateFields));
                          const chargeId = this.getNodeParameter('chargeId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', `/charges/${chargeId}`, body, {});
                      }
                  }
                  else if (resource === 'coupon') {
                      if (operation === 'create') {
                          const body = {
                              duration: this.getNodeParameter('duration', i),
                          };
                          const type = this.getNodeParameter('type', i);
                          if (type === 'fixedAmount') {
                              body.amount_off = this.getNodeParameter('amountOff', i);
                              body.currency = this.getNodeParameter('currency', i);
                          }
                          else {
                              body.percent_off = this.getNodeParameter('percentOff', i);
                          }
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/coupons', body, {});
                      }
                      else if (operation === 'getAll') {
                          responseData = await helpers_1.handleListing.call(this, resource, i);
                      }
                  }
                  else if (resource === 'customer') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, (0, helpers_1.adjustCustomerFields)(additionalFields));
                          }
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/customers', body, {});
                      }
                      else if (operation === 'delete') {
                          const customerId = this.getNodeParameter('customerId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'DELETE', `/customers/${customerId}`, {}, {});
                      }
                      else if (operation === 'get') {
                          const customerId = this.getNodeParameter('customerId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', `/customers/${customerId}`, {}, {});
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (!(0, isEmpty_1.default)(filters)) {
                              qs.email = filters.email;
                          }
                          responseData = await helpers_1.handleListing.call(this, resource, i, qs);
                      }
                      else if (operation === 'update') {
                          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, (0, helpers_1.adjustCustomerFields)(updateFields));
                          const customerId = this.getNodeParameter('customerId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', `/customers/${customerId}`, body, {});
                      }
                  }
                  else if (resource === 'source') {
                      if (operation === 'create') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const body = {
                              type: this.getNodeParameter('type', i),
                              amount: this.getNodeParameter('amount', i),
                              currency: this.getNodeParameter('currency', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, (0, helpers_1.adjustMetadata)(additionalFields));
                          }
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/sources', body, {});
                          const endpoint = `/customers/${customerId}/sources`;
                          await helpers_1.stripeApiRequest.call(this, 'POST', endpoint, { source: responseData.id }, {});
                      }
                      else if (operation === 'delete') {
                          const sourceId = this.getNodeParameter('sourceId', i);
                          const customerId = this.getNodeParameter('customerId', i);
                          const endpoint = `/customers/${customerId}/sources/${sourceId}`;
                          responseData = await helpers_1.stripeApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      }
                      else if (operation === 'get') {
                          const sourceId = this.getNodeParameter('sourceId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', `/sources/${sourceId}`, {}, {});
                      }
                  }
                  else if (resource === 'token') {
                      if (operation === 'create') {
                          const type = this.getNodeParameter('type', i);
                          const body = {};
                          if (type !== 'cardToken') {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Only card token creation implemented.', { itemIndex: i });
                          }
                          body.card = {
                              number: this.getNodeParameter('number', i),
                              exp_month: this.getNodeParameter('expirationMonth', i),
                              exp_year: this.getNodeParameter('expirationYear', i),
                              cvc: this.getNodeParameter('cvc', i),
                          };
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/tokens', body, {});
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Stripe = Stripe;
  //# sourceMappingURL=Stripe.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StripeApi = void 0;
  class StripeApi {
      constructor() {
          this.name = 'stripeApi';
          this.displayName = 'Stripe API';
          this.documentationUrl = 'stripe';
          this.properties = [
              {
                  displayName: 'Secret Key',
                  name: 'secretKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.secretKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://api.stripe.com/v1',
                  url: '/charges',
                  json: true,
              },
          };
      }
  }
  exports.StripeApi = StripeApi;
  //# sourceMappingURL=StripeApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StripeApi = void 0;
  class StripeApi {
      constructor() {
          this.name = 'stripeApi';
          this.displayName = 'Stripe API';
          this.documentationUrl = 'stripe';
          this.properties = [
              {
                  displayName: 'Secret Key',
                  name: 'secretKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.secretKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://api.stripe.com/v1',
                  url: '/charges',
                  json: true,
              },
          };
      }
  }
  exports.StripeApi = StripeApi;
  //# sourceMappingURL=StripeApi.credentials.js.map

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

  # Stripe node

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

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

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

  ## Operations

  * Balance
      * Get a balance
  * Charge
      * Create a charge
      * Get a charge
      * Get all charges
      * Update a charge
  * Coupon
      * Create a coupon
      * Get all coupons
  * Customer
      * Create a customer
      * Delete a customer
      * Get a customer
      * Get all customers
      * Update a customer
  * Customer Card
      * Add a customer card
      * Get a customer card
      * Remove a customer card
  * Source
      * Create a source
      * Delete a source
      * Get a source
  * Token
      * Create a token

  ## Templates and examples

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

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

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


node_type: n8n-nodes-base.Supabase
name: Supabase
display_name: Supabase
description: Add, get, delete and update data in a table
category: input
icon: file:supabase.svg
code_hash: 6690085b257b8dfeb9738fd6b9f1ff9c39e50ee8432805b445f1c3c7f934bf41
documentation_title: Supabase Vector Store node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"supabase-vector-store","description":"Templates for supabase-vector-store"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:31
updated_at: 2025-06-08 18:34:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Supabase = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const RowDescription_1 = require("./RowDescription");
  class Supabase {
      constructor() {
          this.description = {
              displayName: 'Supabase',
              name: 'supabase',
              icon: 'file:supabase.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Add, get, delete and update data in a table',
              defaults: {
                  name: 'Supabase',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'supabaseApi',
                      required: true,
                      testedBy: 'supabaseApiCredentialTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Row',
                              value: 'row',
                          },
                      ],
                      default: 'row',
                  },
                  ...RowDescription_1.rowOperations,
                  ...RowDescription_1.rowFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTables() {
                      const returnData = [];
                      const { paths } = await GenericFunctions_1.supabaseApiRequest.call(this, 'GET', '/');
                      for (const path of Object.keys(paths)) {
                          if (path === '/')
                              continue;
                          returnData.push({
                              name: path.replace('/', ''),
                              value: path.replace('/', ''),
                          });
                      }
                      return returnData;
                  },
                  async getTableColumns() {
                      const returnData = [];
                      const tableName = this.getCurrentNodeParameter('tableId');
                      const { definitions } = await GenericFunctions_1.supabaseApiRequest.call(this, 'GET', '/');
                      for (const column of Object.keys(definitions[tableName].properties)) {
                          returnData.push({
                              name: `${column} - (${definitions[tableName].properties[column].type})`,
                              value: column,
                          });
                      }
                      return returnData;
                  },
              },
              credentialTest: {
                  async supabaseApiCredentialTest(credential) {
                      try {
                          await GenericFunctions_1.validateCredentials.call(this, credential.data);
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: 'The Service Key is invalid',
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          if (resource === 'row') {
              if (operation === 'create') {
                  const records = [];
                  const tableId = this.getNodeParameter('tableId', 0);
                  for (let i = 0; i < length; i++) {
                      const record = {};
                      const dataToSend = this.getNodeParameter('dataToSend', 0);
                      if (dataToSend === 'autoMapInputData') {
                          const incomingKeys = Object.keys(items[i].json);
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputDataToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of incomingKeys) {
                              if (inputDataToIgnore.includes(key))
                                  continue;
                              record[key] = items[i].json[key];
                          }
                      }
                      else {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          for (const field of fields) {
                              record[`${field.fieldId}`] = field.fieldValue;
                          }
                      }
                      records.push(record);
                  }
                  const endpoint = `/${tableId}`;
                  try {
                      const createdRows = await GenericFunctions_1.supabaseApiRequest.call(this, 'POST', endpoint, records);
                      createdRows.forEach((row, i) => {
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(row), { itemData: { item: i } });
                          returnData.push(...executionData);
                      });
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.description }), { itemData: (0, GenericFunctions_1.mapPairedItemsFrom)(records) });
                          returnData.push(...executionData);
                      }
                      else {
                          throw error;
                      }
                  }
              }
              if (operation === 'delete') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const filterType = this.getNodeParameter('filterType', 0);
                  let endpoint = `/${tableId}`;
                  for (let i = 0; i < length; i++) {
                      if (filterType === 'manual') {
                          const matchType = this.getNodeParameter('matchType', 0);
                          const keys = this.getNodeParameter('filters.conditions', i, []);
                          if (!keys.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one select condition must be defined', { itemIndex: i });
                          }
                          if (matchType === 'allFilters') {
                              const data = keys.reduce((obj, value) => (0, GenericFunctions_1.buildQuery)(obj, value), {});
                              Object.assign(qs, data);
                          }
                          if (matchType === 'anyFilter') {
                              const data = keys.map((key) => (0, GenericFunctions_1.buildOrQuery)(key));
                              Object.assign(qs, { or: `(${data.join(',')})` });
                          }
                      }
                      if (filterType === 'string') {
                          const filterString = this.getNodeParameter('filterString', i);
                          endpoint = `${endpoint}?${encodeURI(filterString)}`;
                      }
                      let rows;
                      try {
                          rows = await GenericFunctions_1.supabaseApiRequest.call(this, 'DELETE', endpoint, {}, qs);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.description }), { itemData: { item: i } });
                              returnData.push(...executionData);
                              continue;
                          }
                          throw error;
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(rows), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'get') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const endpoint = `/${tableId}`;
                  for (let i = 0; i < length; i++) {
                      const keys = this.getNodeParameter('filters.conditions', i, []);
                      const data = keys.reduce((obj, value) => (0, GenericFunctions_1.buildGetQuery)(obj, value), {});
                      Object.assign(qs, data);
                      let rows;
                      if (!keys.length) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one select condition must be defined', { itemIndex: i });
                      }
                      try {
                          rows = await GenericFunctions_1.supabaseApiRequest.call(this, 'GET', endpoint, {}, qs);
                      }
                      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;
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(rows), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'getAll') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const returnAll = this.getNodeParameter('returnAll', 0);
                  const filterType = this.getNodeParameter('filterType', 0);
                  let endpoint = `/${tableId}`;
                  for (let i = 0; i < length; i++) {
                      if (filterType === 'manual') {
                          const matchType = this.getNodeParameter('matchType', 0);
                          const keys = this.getNodeParameter('filters.conditions', i, []);
                          if (keys.length !== 0) {
                              if (matchType === 'allFilters') {
                                  const data = keys.reduce((obj, value) => (0, GenericFunctions_1.buildQuery)(obj, value), {});
                                  Object.assign(qs, data);
                              }
                              if (matchType === 'anyFilter') {
                                  const data = keys.map((key) => (0, GenericFunctions_1.buildOrQuery)(key));
                                  Object.assign(qs, { or: `(${data.join(',')})` });
                              }
                          }
                      }
                      if (filterType === 'string') {
                          const filterString = this.getNodeParameter('filterString', i);
                          endpoint = `${endpoint}?${encodeURI(filterString)}`;
                      }
                      if (!returnAll) {
                          qs.limit = this.getNodeParameter('limit', 0);
                      }
                      let rows;
                      try {
                          rows = await GenericFunctions_1.supabaseApiRequest.call(this, 'GET', endpoint, {}, qs);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(rows), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.description }), { itemData: { item: i } });
                              returnData.push(...executionData);
                              continue;
                          }
                          throw error;
                      }
                  }
              }
              if (operation === 'update') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const filterType = this.getNodeParameter('filterType', 0);
                  let endpoint = `/${tableId}`;
                  for (let i = 0; i < length; i++) {
                      if (filterType === 'manual') {
                          const matchType = this.getNodeParameter('matchType', 0);
                          const keys = this.getNodeParameter('filters.conditions', i, []);
                          if (!keys.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one select condition must be defined', { itemIndex: i });
                          }
                          if (matchType === 'allFilters') {
                              const data = keys.reduce((obj, value) => (0, GenericFunctions_1.buildQuery)(obj, value), {});
                              Object.assign(qs, data);
                          }
                          if (matchType === 'anyFilter') {
                              const data = keys.map((key) => (0, GenericFunctions_1.buildOrQuery)(key));
                              Object.assign(qs, { or: `(${data.join(',')})` });
                          }
                      }
                      if (filterType === 'string') {
                          const filterString = this.getNodeParameter('filterString', i);
                          endpoint = `${endpoint}?${encodeURI(filterString)}`;
                      }
                      const record = {};
                      const dataToSend = this.getNodeParameter('dataToSend', 0);
                      if (dataToSend === 'autoMapInputData') {
                          const incomingKeys = Object.keys(items[i].json);
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputDataToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of incomingKeys) {
                              if (inputDataToIgnore.includes(key))
                                  continue;
                              record[key] = items[i].json[key];
                          }
                      }
                      else {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          for (const field of fields) {
                              record[`${field.fieldId}`] = field.fieldValue;
                          }
                      }
                      let updatedRow;
                      try {
                          updatedRow = await GenericFunctions_1.supabaseApiRequest.call(this, 'PATCH', endpoint, record, qs);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(updatedRow), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.description }), { itemData: { item: i } });
                              returnData.push(...executionData);
                              continue;
                          }
                          throw error;
                      }
                  }
              }
          }
          return [returnData];
      }
  }
  exports.Supabase = Supabase;
  //# sourceMappingURL=Supabase.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SupabaseApi = void 0;
  class SupabaseApi {
      constructor() {
          this.name = 'supabaseApi';
          this.displayName = 'Supabase API';
          this.documentationUrl = 'supabase';
          this.properties = [
              {
                  displayName: 'Host',
                  name: 'host',
                  type: 'string',
                  placeholder: 'https://your_account.supabase.co',
                  default: '',
              },
              {
                  displayName: 'Service Role Secret',
                  name: 'serviceRole',
                  type: 'string',
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      apikey: '={{$credentials.serviceRole}}',
                      Authorization: '=Bearer {{$credentials.serviceRole}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.host}}/rest/v1',
                  headers: {
                      Prefer: 'return=representation',
                  },
                  url: '/',
              },
          };
      }
  }
  exports.SupabaseApi = SupabaseApi;
  //# sourceMappingURL=SupabaseApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SupabaseApi = void 0;
  class SupabaseApi {
      constructor() {
          this.name = 'supabaseApi';
          this.displayName = 'Supabase API';
          this.documentationUrl = 'supabase';
          this.properties = [
              {
                  displayName: 'Host',
                  name: 'host',
                  type: 'string',
                  placeholder: 'https://your_account.supabase.co',
                  default: '',
              },
              {
                  displayName: 'Service Role Secret',
                  name: 'serviceRole',
                  type: 'string',
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      apikey: '={{$credentials.serviceRole}}',
                      Authorization: '=Bearer {{$credentials.serviceRole}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.host}}/rest/v1',
                  headers: {
                      Prefer: 'return=representation',
                  },
                  url: '/',
              },
          };
      }
  }
  exports.SupabaseApi = SupabaseApi;
  //# sourceMappingURL=SupabaseApi.credentials.js.map

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

  # Supabase Vector Store node

  Use the Supabase Vector Store to interact with your Supabase database as [vector store](/glossary.md#ai-vector-store). You can insert documents into a vector database, get documents from a vector database, retrieve documents to provide them to a retriever connected to a [chain](/glossary.md#ai-chain), or connect it directly to an [agent](/glossary.md#ai-agent) to use as a [tool](/glossary.md#ai-tool).

  On this page, you'll find the node parameters for the Supabase node, and links to more resources.

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

  --8<-- "_snippets/integrations/builtin/cluster-nodes/sub-node-expression-resolution.md"
  	
  Supabase provides a [quickstart for setting up your vector store](https://supabase.com/docs/guides/ai/langchain?database-method=sql){:target=_blank .external-link}. If you use settings other than the defaults in the quickstart, this may affect parameter settings in n8n. Make sure you understand what you're doing.

  ## Node usage patterns

  You can use the Supabase Vector Store node in the following patterns.

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

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

  You can see an example of this in scenario 1 of [this template](https://n8n.io/workflows/2621-ai-agent-to-chat-with-files-in-supabase-storage/).

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

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

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

  ### Use a retriever to fetch documents

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

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

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

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

  The [connections flow](https://n8n.io/workflows/2621-ai-agent-to-chat-with-files-in-supabase-storage/) in this case would look like this: AI agent (tools connector) -> Vector Store Question Answer Tool (Vector Store connector) -> Supabase Vector store.

  ## Node parameters

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

  <!-- vale from-write-good.Weasel = NO -->
  ### Get Many parameters
  <!-- vale from-write-good.Weasel = YES -->

  * **Table Name**: Enter the Supabase table to use.
  * **Prompt**: Enter the search query.
  * **Limit**: Enter how many results to retrieve from the vector store. For example, set this to `10` to get the ten best results.

  ### Insert Documents parameters

  * **Table Name**: Enter the Supabase table to use.

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

  * **Table Name**: Enter the Supabase table to use.

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

  * **Name**: The name of the vector store.
  * **Description**: Explain to the LLM what this tool does. A good, specific description allows LLMs to produce expected results more often.
  * **Table Name**: Enter the Supabase table to use.
  * **Limit**: Enter how many results to retrieve from the vector store. For example, set this to `10` to get the ten best results.

  ### Update Documents

  * **Table Name**: Enter the Supabase table to use.
  * **ID**: The ID of an embedding entry.

  ## Node options

  ### Query Name

  The name of the matching function you set up in Supabase. If you follow the [Supabase quickstart](https://supabase.com/docs/guides/ai/langchain?database-method=sql){:target=_blank .external-link}, this will be `match_documents`.

  ### Metadata Filter

  --8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-root-nodes/vector-store-metadata-filter.md"

  ## Templates and examples

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

  ## Related resources

  Refer to [LangChain's Supabase documentation](https://js.langchain.com/docs/integrations/vectorstores/supabase/){:target=_blank .external-link} for more information about the service.

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

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

related_resources:
  [{"title":"LangChain's Supabase documentation","url":"https://js.langchain.com/docs/integrations/vectorstores/supabase/","type":"external"}]

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


node_type: n8n-nodes-base.Taiga
name: Taiga
display_name: Taiga
description: Consume Taiga API
category: transform
icon: file:taiga.svg
code_hash: b5515948bd59b70034e4508dd755ebad7d28139a4db63a8d93f64faf53aaa923
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Taiga
documentation_title: Taiga node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"taiga","description":"Templates for taiga"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:33
updated_at: 2025-06-08 18:34:33
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Taiga = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Taiga {
      constructor() {
          this.description = {
              displayName: 'Taiga',
              name: 'taiga',
              icon: 'file:taiga.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Taiga API',
              defaults: {
                  name: 'Taiga',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'taigaApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Epic',
                              value: 'epic',
                          },
                          {
                              name: 'Issue',
                              value: 'issue',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                          {
                              name: 'User Story',
                              value: 'userStory',
                          },
                      ],
                      default: 'issue',
                  },
                  ...descriptions_1.epicOperations,
                  ...descriptions_1.epicFields,
                  ...descriptions_1.issueOperations,
                  ...descriptions_1.issueFields,
                  ...descriptions_1.taskOperations,
                  ...descriptions_1.taskFields,
                  ...descriptions_1.userStoryOperations,
                  ...descriptions_1.userStoryFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getEpics() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const epics = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/epics', {}, { project }));
                      return epics.map(({ subject, id }) => ({ name: subject, value: id }));
                  },
                  async getMilestones() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const milestones = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/milestones', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(milestones);
                  },
                  async getPriorities() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const priorities = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/priorities', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(priorities);
                  },
                  async getProjects() {
                      const { id } = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/users/me'));
                      const projects = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/projects', {}, { member: id }));
                      return (0, GenericFunctions_1.toOptions)(projects);
                  },
                  async getRoles() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const roles = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/roles', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(roles);
                  },
                  async getSeverities() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const severities = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/severities', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(severities);
                  },
                  async getTags() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const tags = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', `/projects/${project}/tags_colors`));
                      return Object.keys(tags).map((tag) => ({ name: tag, value: tag }));
                  },
                  async getTypes() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const types = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/issue-types', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(types);
                  },
                  async getUsers() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const users = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/users', {}, { project }));
                      return users.map(({ full_name_display, id }) => ({ name: full_name_display, value: id }));
                  },
                  async getUserStories() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const userStories = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/userstories', {}, { project }));
                      return userStories.map(({ subject, id }) => ({ name: subject, value: id }));
                  },
                  async getIssueStatuses() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const statuses = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/issue-statuses', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(statuses);
                  },
                  async getTaskStatuses() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const statuses = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/task-statuses', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(statuses);
                  },
                  async getUserStoryStatuses() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const statuses = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/userstory-statuses', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(statuses);
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'epic') {
                      if (operation === 'create') {
                          const body = {
                              project: this.getNodeParameter('projectId', i),
                              subject: this.getNodeParameter('subject', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'POST', '/epics', body);
                      }
                      else if (operation === 'delete') {
                          const epicId = this.getNodeParameter('epicId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'DELETE', `/epics/${epicId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const epicId = this.getNodeParameter('epicId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'GET', `/epics/${epicId}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/epics', {}, qs, i);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          else {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const epicId = this.getNodeParameter('epicId', i);
                          body.version = await GenericFunctions_1.getVersionForUpdate.call(this, `/epics/${epicId}`);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'PATCH', `/epics/${epicId}`, body);
                      }
                  }
                  else if (resource === 'issue') {
                      if (operation === 'create') {
                          const body = {
                              project: this.getNodeParameter('projectId', i),
                              subject: this.getNodeParameter('subject', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'POST', '/issues', body);
                      }
                      else if (operation === 'delete') {
                          const issueId = this.getNodeParameter('issueId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'DELETE', `/issues/${issueId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const issueId = this.getNodeParameter('issueId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'GET', `/issues/${issueId}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/issues', {}, qs, i);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          else {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const issueId = this.getNodeParameter('issueId', i);
                          body.version = await GenericFunctions_1.getVersionForUpdate.call(this, `/issues/${issueId}`);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'PATCH', `/issues/${issueId}`, body);
                      }
                  }
                  else if (resource === 'task') {
                      if (operation === 'create') {
                          const body = {
                              project: this.getNodeParameter('projectId', i),
                              subject: this.getNodeParameter('subject', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'POST', '/tasks', body);
                      }
                      else if (operation === 'delete') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'DELETE', `/tasks/${taskId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'GET', `/tasks/${taskId}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/tasks', {}, qs, i);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          else {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const taskId = this.getNodeParameter('taskId', i);
                          body.version = await GenericFunctions_1.getVersionForUpdate.call(this, `/tasks/${taskId}`);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'PATCH', `/tasks/${taskId}`, body);
                      }
                  }
                  else if (resource === 'userStory') {
                      if (operation === 'create') {
                          const body = {
                              project: this.getNodeParameter('projectId', i),
                              subject: this.getNodeParameter('subject', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'POST', '/userstories', body);
                      }
                      else if (operation === 'delete') {
                          const userStoryId = this.getNodeParameter('userStoryId', i);
                          const endpoint = `/userstories/${userStoryId}`;
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const userStoryId = this.getNodeParameter('userStoryId', i);
                          const endpoint = `/userstories/${userStoryId}`;
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/userstories', {}, qs, i);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          else {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const userStoryId = this.getNodeParameter('userStoryId', i);
                          body.version = await GenericFunctions_1.getVersionForUpdate.call(this, `/userstories/${userStoryId}`);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'PATCH', `/userstories/${userStoryId}`, body);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Taiga = Taiga;
  //# sourceMappingURL=Taiga.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TaigaApi = void 0;
  class TaigaApi {
      constructor() {
          this.name = 'taigaApi';
          this.displayName = 'Taiga API';
          this.documentationUrl = 'taiga';
          this.properties = [
              {
                  displayName: 'Username',
                  name: 'username',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Environment',
                  name: 'environment',
                  type: 'options',
                  default: 'cloud',
                  options: [
                      {
                          name: 'Cloud',
                          value: 'cloud',
                      },
                      {
                          name: 'Self-Hosted',
                          value: 'selfHosted',
                      },
                  ],
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://taiga.yourdomain.com',
                  displayOptions: {
                      show: {
                          environment: ['selfHosted'],
                      },
                  },
              },
          ];
      }
  }
  exports.TaigaApi = TaigaApi;
  //# sourceMappingURL=TaigaApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TaigaApi = void 0;
  class TaigaApi {
      constructor() {
          this.name = 'taigaApi';
          this.displayName = 'Taiga API';
          this.documentationUrl = 'taiga';
          this.properties = [
              {
                  displayName: 'Username',
                  name: 'username',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Environment',
                  name: 'environment',
                  type: 'options',
                  default: 'cloud',
                  options: [
                      {
                          name: 'Cloud',
                          value: 'cloud',
                      },
                      {
                          name: 'Self-Hosted',
                          value: 'selfHosted',
                      },
                  ],
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://taiga.yourdomain.com',
                  displayOptions: {
                      show: {
                          environment: ['selfHosted'],
                      },
                  },
              },
          ];
      }
  }
  exports.TaigaApi = TaigaApi;
  //# sourceMappingURL=TaigaApi.credentials.js.map

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

  # Taiga node

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

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

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

  ## Operations

  - **Issue**
      - Create an issue
      - Delete an issue
      - Get an issue
      - Get all issues
      - Update an issue

  ## Templates and examples

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

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


node_type: n8n-nodes-base.TheHive
name: TheHive
display_name: TheHive
description: Consume TheHive API
category: transform
icon: file:thehive.svg
code_hash: 4693e13130108cbcdb7b8541cea40e18dff162d3e1cdd41ddc11bb95d829a947
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.TheHive
documentation_title: TheHive node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"thehive","description":"Templates for thehive"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 18:34:33
updated_at: 2025-06-08 18:34:33
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.TheHive = void 0;
  const AlertDescription_1 = require("./descriptions/AlertDescription");
  const ObservableDescription_1 = require("./descriptions/ObservableDescription");
  const CaseDescription_1 = require("./descriptions/CaseDescription");
  const TaskDescription_1 = require("./descriptions/TaskDescription");
  const LogDescription_1 = require("./descriptions/LogDescription");
  const QueryFunctions_1 = require("./QueryFunctions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const set_1 = __importDefault(require("lodash/set"));
  class TheHive {
      constructor() {
          this.description = {
              displayName: 'TheHive',
              name: 'theHive',
              icon: 'file:thehive.svg',
              group: ['transform'],
              subtitle: '={{$parameter["operation"]}} : {{$parameter["resource"]}}',
              version: 1,
              description: 'Consume TheHive API',
              defaults: {
                  name: 'TheHive',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'theHiveApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      options: [
                          {
                              name: 'Alert',
                              value: 'alert',
                          },
                          {
                              name: 'Case',
                              value: 'case',
                          },
                          {
                              name: 'Log',
                              value: 'log',
                          },
                          {
                              name: 'Observable',
                              value: 'observable',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                      ],
                      default: 'alert',
                  },
                  ...AlertDescription_1.alertOperations,
                  ...AlertDescription_1.alertFields,
                  ...ObservableDescription_1.observableOperations,
                  ...ObservableDescription_1.observableFields,
                  ...CaseDescription_1.caseOperations,
                  ...CaseDescription_1.caseFields,
                  ...TaskDescription_1.taskOperations,
                  ...TaskDescription_1.taskFields,
                  ...LogDescription_1.logOperations,
                  ...LogDescription_1.logFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async loadResponders() {
                      const resource = (0, GenericFunctions_1.mapResource)(this.getNodeParameter('resource'));
                      const resourceId = this.getNodeParameter('id');
                      const endpoint = `/connector/cortex/responder/${resource}/${resourceId}`;
                      const responders = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', endpoint);
                      const returnData = [];
                      for (const responder of responders) {
                          returnData.push({
                              name: responder.name,
                              value: responder.id,
                              description: responder.description,
                          });
                      }
                      return returnData;
                  },
                  async loadAnalyzers() {
                      const dataType = this.getNodeParameter('dataType');
                      const endpoint = `/connector/cortex/analyzer/type/${dataType}`;
                      const requestResult = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', endpoint);
                      const returnData = [];
                      for (const analyzer of requestResult) {
                          for (const cortexId of analyzer.cortexIds) {
                              returnData.push({
                                  name: `[${cortexId}] ${analyzer.name}`,
                                  value: `${analyzer.id}::${cortexId}`,
                                  description: analyzer.description,
                              });
                          }
                      }
                      return returnData;
                  },
                  async loadCustomFields() {
                      const credentials = await this.getCredentials('theHiveApi');
                      const version = credentials.apiVersion;
                      const endpoint = version === 'v1' ? '/customField' : '/list/custom_fields';
                      const requestResult = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', endpoint);
                      const returnData = [];
                      const customFields = version === 'v1'
                          ? requestResult
                          : Object.keys(requestResult).map((key) => requestResult[key]);
                      for (const field of customFields) {
                          returnData.push({
                              name: `${field.name}: ${field.reference}`,
                              value: field.reference,
                              description: `${field.type}: ${field.description}`,
                          });
                      }
                      return returnData;
                  },
                  async loadObservableOptions() {
                      const version = (await this.getCredentials('theHiveApi')).apiVersion;
                      const options = [
                          ...(version === 'v1'
                              ? [{ name: 'Count', value: 'count', description: 'Count observables' }]
                              : []),
                          { name: 'Create', value: 'create', description: 'Create observable' },
                          {
                              name: 'Execute Analyzer',
                              value: 'executeAnalyzer',
                              description: 'Execute an responder on selected observable',
                          },
                          {
                              name: 'Execute Responder',
                              value: 'executeResponder',
                              description: 'Execute a responder on selected observable',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get all observables of a specific case',
                          },
                          { name: 'Get', value: 'get', description: 'Get a single observable' },
                          { name: 'Search', value: 'search', description: 'Search observables' },
                          { name: 'Update', value: 'update', description: 'Update observable' },
                      ];
                      return options;
                  },
                  async loadObservableTypes() {
                      const version = (await this.getCredentials('theHiveApi')).apiVersion;
                      const endpoint = version === 'v1' ? '/observable/type?range=all' : '/list/list_artifactDataType';
                      const dataTypes = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', endpoint);
                      let returnData = [];
                      if (version === 'v1') {
                          returnData = dataTypes.map((dataType) => {
                              return {
                                  name: dataType.name,
                                  value: dataType.name,
                              };
                          });
                      }
                      else {
                          returnData = Object.keys(dataTypes).map((key) => {
                              const dataType = dataTypes[key];
                              return {
                                  name: dataType,
                                  value: dataType,
                              };
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
                  async loadTaskOptions() {
                      const credentials = await this.getCredentials('theHiveApi');
                      const version = credentials.apiVersion;
                      const options = [
                          ...(version === 'v1'
                              ? [{ name: 'Count', value: 'count', description: 'Count tasks' }]
                              : []),
                          { name: 'Create', value: 'create', description: 'Create a task' },
                          {
                              name: 'Execute Responder',
                              value: 'executeResponder',
                              description: 'Execute a responder on the specified task',
                          },
                          { name: 'Get Many', value: 'getAll', description: 'Get all asks of a specific case' },
                          { name: 'Get', value: 'get', description: 'Get a single task' },
                          { name: 'Search', value: 'search', description: 'Search tasks' },
                          { name: 'Update', value: 'update', description: 'Update a task' },
                      ];
                      return options;
                  },
                  async loadAlertOptions() {
                      const credentials = await this.getCredentials('theHiveApi');
                      const version = credentials.apiVersion;
                      const options = [
                          ...(version === 'v1'
                              ? [{ name: 'Count', value: 'count', description: 'Count alerts' }]
                              : []),
                          { name: 'Create', value: 'create', description: 'Create alert' },
                          {
                              name: 'Execute Responder',
                              value: 'executeResponder',
                              description: 'Execute a responder on the specified alert',
                          },
                          { name: 'Get', value: 'get', description: 'Get an alert' },
                          { name: 'Get Many', value: 'getAll', description: 'Get all alerts' },
                          { name: 'Mark as Read', value: 'markAsRead', description: 'Mark the alert as read' },
                          {
                              name: 'Mark as Unread',
                              value: 'markAsUnread',
                              description: 'Mark the alert as unread',
                          },
                          { name: 'Merge', value: 'merge', description: 'Merge alert into an existing case' },
                          { name: 'Promote', value: 'promote', description: 'Promote an alert into a case' },
                          { name: 'Update', value: 'update', description: 'Update alert' },
                      ];
                      return options;
                  },
                  async loadCaseOptions() {
                      const credentials = await this.getCredentials('theHiveApi');
                      const version = credentials.apiVersion;
                      const options = [
                          ...(version === 'v1'
                              ? [{ name: 'Count', value: 'count', description: 'Count a case' }]
                              : []),
                          { name: 'Create', value: 'create', description: 'Create a case' },
                          {
                              name: 'Execute Responder',
                              value: 'executeResponder',
                              description: 'Execute a responder on the specified case',
                          },
                          { name: 'Get Many', value: 'getAll', description: 'Get all cases' },
                          { name: 'Get', value: 'get', description: 'Get a single case' },
                          { name: 'Update', value: 'update', description: 'Update a case' },
                      ];
                      return options;
                  },
              },
          };
      }
      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 === 'alert') {
                      if (operation === 'count') {
                          const filters = this.getNodeParameter('filters', i, {});
                          const countQueryAttributs = (0, GenericFunctions_1.prepareOptional)(filters);
                          const _countSearchQuery = (0, QueryFunctions_1.And)();
                          if ('customFieldsUi' in filters) {
                              const customFields = (await GenericFunctions_1.prepareCustomFields.call(this, filters));
                              const searchQueries = (0, GenericFunctions_1.buildCustomFieldSearch)(customFields);
                              _countSearchQuery['_and'].push(...searchQueries);
                          }
                          for (const key of Object.keys(countQueryAttributs)) {
                              if (key === 'tags') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.In)(key, countQueryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'title') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, countQueryAttributs[key]));
                              }
                              else {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, countQueryAttributs[key]));
                              }
                          }
                          const body = {
                              query: [
                                  {
                                      _name: 'listAlert',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: _countSearchQuery['_and'],
                                  },
                              ],
                          };
                          body['query'].push({
                              _name: 'count',
                          });
                          qs.name = 'count-Alert';
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          responseData = { count: responseData };
                      }
                      if (operation === 'create') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const customFields = await GenericFunctions_1.prepareCustomFields.call(this, additionalFields, jsonParameters);
                          const body = {
                              title: this.getNodeParameter('title', i),
                              description: this.getNodeParameter('description', i),
                              severity: this.getNodeParameter('severity', i),
                              date: Date.parse(this.getNodeParameter('date', i)),
                              tags: (0, GenericFunctions_1.splitTags)(this.getNodeParameter('tags', i)),
                              tlp: this.getNodeParameter('tlp', i),
                              status: this.getNodeParameter('status', i),
                              type: this.getNodeParameter('type', i),
                              source: this.getNodeParameter('source', i),
                              sourceRef: this.getNodeParameter('sourceRef', i),
                              follow: this.getNodeParameter('follow', i, true),
                              ...(0, GenericFunctions_1.prepareOptional)(additionalFields),
                          };
                          if (customFields) {
                              Object.keys(customFields).forEach((key) => {
                                  (0, set_1.default)(body, key, customFields[key]);
                              });
                          }
                          const artifactUi = this.getNodeParameter('artifactUi', i);
                          if (artifactUi) {
                              const artifactValues = artifactUi.artifactValues;
                              if (artifactValues) {
                                  const artifactData = [];
                                  for (const artifactvalue of artifactValues) {
                                      const element = {};
                                      element.message = artifactvalue.message;
                                      element.tags = artifactvalue.tags.split(',');
                                      element.dataType = artifactvalue.dataType;
                                      element.data = artifactvalue.data;
                                      if (artifactvalue.dataType === 'file') {
                                          const binaryPropertyName = artifactvalue.binaryProperty;
                                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                          element.data = `${binaryData.fileName};${binaryData.mimeType};${binaryData.data}`;
                                      }
                                      artifactData.push(element);
                                  }
                                  body.artifacts = artifactData;
                              }
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/alert', body);
                      }
                      if (operation === 'executeResponder') {
                          const alertId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: alertId,
                              objectType: 'alert',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'log-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'get') {
                          const alertId = this.getNodeParameter('id', i);
                          const includeSimilar = this.getNodeParameter('options.includeSimilar', i, false);
                          if (includeSimilar) {
                              qs.similarity = true;
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', `/alert/${alertId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const filters = this.getNodeParameter('filters', i, {});
                          const queryAttributs = (0, GenericFunctions_1.prepareOptional)(filters);
                          const options = this.getNodeParameter('options', i);
                          const _searchQuery = (0, QueryFunctions_1.And)();
                          if ('customFieldsUi' in filters) {
                              const customFields = (await GenericFunctions_1.prepareCustomFields.call(this, filters));
                              const searchQueries = (0, GenericFunctions_1.buildCustomFieldSearch)(customFields);
                              _searchQuery['_and'].push(...searchQueries);
                          }
                          for (const key of Object.keys(queryAttributs)) {
                              if (key === 'tags') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.In)(key, queryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'title') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, queryAttributs[key]));
                              }
                              else {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, queryAttributs[key]));
                              }
                          }
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'listAlert',
                                      },
                                      {
                                          _name: 'filter',
                                          _and: _searchQuery['_and'],
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'alerts';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/alert/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = _searchQuery;
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'markAsRead') {
                          const alertId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/alert/${alertId}/markAsRead`);
                      }
                      if (operation === 'markAsUnread') {
                          const alertId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/alert/${alertId}/markAsUnread`);
                      }
                      if (operation === 'merge') {
                          const alertId = this.getNodeParameter('id', i);
                          const caseId = this.getNodeParameter('caseId', i);
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/alert/${alertId}/merge/${caseId}`, {});
                      }
                      if (operation === 'promote') {
                          const alertId = this.getNodeParameter('id', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {};
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/alert/${alertId}/createCase`, body);
                      }
                      if (operation === 'update') {
                          const alertId = this.getNodeParameter('id', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const customFields = await GenericFunctions_1.prepareCustomFields.call(this, updateFields, jsonParameters);
                          const artifactUi = updateFields.artifactUi;
                          delete updateFields.artifactUi;
                          const body = {
                              ...customFields,
                          };
                          Object.assign(body, updateFields);
                          if (artifactUi) {
                              const artifactValues = artifactUi.artifactValues;
                              if (artifactValues) {
                                  const artifactData = [];
                                  for (const artifactvalue of artifactValues) {
                                      const element = {};
                                      element.message = artifactvalue.message;
                                      element.tags = artifactvalue.tags.split(',');
                                      element.dataType = artifactvalue.dataType;
                                      element.data = artifactvalue.data;
                                      if (artifactvalue.dataType === 'file') {
                                          const binaryPropertyName = artifactvalue.binaryProperty;
                                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                          element.data = `${binaryData.fileName};${binaryData.mimeType};${binaryData.data}`;
                                      }
                                      artifactData.push(element);
                                  }
                                  body.artifacts = artifactData;
                              }
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'PATCH', `/alert/${alertId}`, body);
                      }
                  }
                  if (resource === 'observable') {
                      if (operation === 'count') {
                          const countQueryAttributs = (0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('filters', i, {}));
                          const _countSearchQuery = (0, QueryFunctions_1.And)();
                          for (const key of Object.keys(countQueryAttributs)) {
                              if (key === 'dataType' || key === 'tags') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.In)(key, countQueryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'keywork' || key === 'message') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, countQueryAttributs[key]));
                              }
                              else if (key === 'range') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Between)('startDate', countQueryAttributs['range']['dateRange']['fromDate'], countQueryAttributs['range']['dateRange']['toDate']));
                              }
                              else {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, countQueryAttributs[key]));
                              }
                          }
                          const body = {
                              query: [
                                  {
                                      _name: 'listObservable',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: _countSearchQuery['_and'],
                                  },
                              ],
                          };
                          body['query'].push({
                              _name: 'count',
                          });
                          qs.name = 'count-observables';
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          responseData = { count: responseData };
                      }
                      if (operation === 'executeAnalyzer') {
                          const observableId = this.getNodeParameter('id', i);
                          const analyzers = this.getNodeParameter('analyzers', i).map((analyzer) => {
                              const parts = analyzer.split('::');
                              return {
                                  analyzerId: parts[0],
                                  cortexId: parts[1],
                              };
                          });
                          let response;
                          let body;
                          responseData = [];
                          for (const analyzer of analyzers) {
                              body = {
                                  ...analyzer,
                                  artifactId: observableId,
                              };
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/job', body, qs);
                              const jobId = response.id;
                              qs.name = 'observable-jobs';
                              do {
                                  responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', `/connector/cortex/job/${jobId}`, body, qs);
                              } while (responseData.status === 'Waiting' || responseData.status === 'InProgress');
                          }
                      }
                      if (operation === 'executeResponder') {
                          const observableId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: observableId,
                              objectType: 'case_artifact',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'log-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'create') {
                          const caseId = this.getNodeParameter('caseId', i);
                          let body = {
                              dataType: this.getNodeParameter('dataType', i),
                              message: this.getNodeParameter('message', i),
                              startDate: Date.parse(this.getNodeParameter('startDate', i)),
                              tlp: this.getNodeParameter('tlp', i),
                              ioc: this.getNodeParameter('ioc', i),
                              sighted: this.getNodeParameter('sighted', i),
                              status: this.getNodeParameter('status', i),
                              ...(0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('options', i, {})),
                          };
                          let options = {};
                          if (body.dataType === 'file') {
                              const binaryPropertyName = this.getNodeParameter('binaryProperty', i);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              options = {
                                  formData: {
                                      attachment: {
                                          value: dataBuffer,
                                          options: {
                                              contentType: binaryData.mimeType,
                                              filename: binaryData.fileName,
                                          },
                                      },
                                      _json: JSON.stringify(body),
                                  },
                              };
                              body = {};
                          }
                          else {
                              body.data = this.getNodeParameter('data', i);
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/case/${caseId}/artifact`, body, qs, '', options);
                      }
                      if (operation === 'get') {
                          const observableId = this.getNodeParameter('id', i);
                          const credentials = await this.getCredentials('theHiveApi');
                          const version = credentials.apiVersion;
                          let endpoint;
                          let method;
                          let body = {};
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getObservable',
                                          idOrName: observableId,
                                      },
                                  ],
                              };
                              qs.name = `get-observable-${observableId}`;
                          }
                          else {
                              method = 'GET';
                              endpoint = `/case/artifact/${observableId}`;
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const options = this.getNodeParameter('options', i);
                          const caseId = this.getNodeParameter('caseId', i);
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getCase',
                                          idOrName: caseId,
                                      },
                                      {
                                          _name: 'observables',
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'observables';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/artifact/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = (0, QueryFunctions_1.Parent)('case', (0, QueryFunctions_1.Id)(caseId));
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'search') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const queryAttributs = (0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('filters', i, {}));
                          const _searchQuery = (0, QueryFunctions_1.And)();
                          const options = this.getNodeParameter('options', i);
                          for (const key of Object.keys(queryAttributs)) {
                              if (key === 'dataType' || key === 'tags') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.In)(key, queryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'keywork' || key === 'message') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, queryAttributs[key]));
                              }
                              else if (key === 'range') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Between)('startDate', queryAttributs['range']['dateRange']['fromDate'], queryAttributs['range']['dateRange']['toDate']));
                              }
                              else {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, queryAttributs[key]));
                              }
                          }
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'listObservable',
                                      },
                                      {
                                          _name: 'filter',
                                          _and: _searchQuery['_and'],
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'observables';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/artifact/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = _searchQuery;
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {
                              ...(0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('updateFields', i, {})),
                          };
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'PATCH', `/case/artifact/${id}`, body, qs);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'case') {
                      if (operation === 'count') {
                          const filters = this.getNodeParameter('filters', i, {});
                          const countQueryAttributs = (0, GenericFunctions_1.prepareOptional)(filters);
                          const _countSearchQuery = (0, QueryFunctions_1.And)();
                          if ('customFieldsUi' in filters) {
                              const customFields = (await GenericFunctions_1.prepareCustomFields.call(this, filters));
                              const searchQueries = (0, GenericFunctions_1.buildCustomFieldSearch)(customFields);
                              _countSearchQuery['_and'].push(...searchQueries);
                          }
                          for (const key of Object.keys(countQueryAttributs)) {
                              if (key === 'tags') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.In)(key, countQueryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'summary' || key === 'title') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, countQueryAttributs[key]));
                              }
                              else {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, countQueryAttributs[key]));
                              }
                          }
                          const body = {
                              query: [
                                  {
                                      _name: 'listCase',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: _countSearchQuery['_and'],
                                  },
                              ],
                          };
                          body['query'].push({
                              _name: 'count',
                          });
                          qs.name = 'count-cases';
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          responseData = { count: responseData };
                      }
                      if (operation === 'executeResponder') {
                          const caseId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: caseId,
                              objectType: 'case',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'log-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'create') {
                          const options = this.getNodeParameter('options', i, {});
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const customFields = await GenericFunctions_1.prepareCustomFields.call(this, options, jsonParameters);
                          const body = {
                              title: this.getNodeParameter('title', i),
                              description: this.getNodeParameter('description', i),
                              severity: this.getNodeParameter('severity', i),
                              startDate: Date.parse(this.getNodeParameter('startDate', i)),
                              owner: this.getNodeParameter('owner', i),
                              flag: this.getNodeParameter('flag', i),
                              tlp: this.getNodeParameter('tlp', i),
                              tags: (0, GenericFunctions_1.splitTags)(this.getNodeParameter('tags', i)),
                              ...(0, GenericFunctions_1.prepareOptional)(options),
                          };
                          if (customFields) {
                              Object.keys(customFields).forEach((key) => {
                                  (0, set_1.default)(body, key, customFields[key]);
                              });
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/case', body);
                      }
                      if (operation === 'get') {
                          const caseId = this.getNodeParameter('id', i);
                          const credentials = await this.getCredentials('theHiveApi');
                          const version = credentials.apiVersion;
                          let endpoint;
                          let method;
                          let body = {};
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getCase',
                                          idOrName: caseId,
                                      },
                                  ],
                              };
                              qs.name = `get-case-${caseId}`;
                          }
                          else {
                              method = 'GET';
                              endpoint = `/case/${caseId}`;
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const filters = this.getNodeParameter('filters', i, {});
                          const queryAttributs = (0, GenericFunctions_1.prepareOptional)(filters);
                          const _searchQuery = (0, QueryFunctions_1.And)();
                          const options = this.getNodeParameter('options', i);
                          if ('customFieldsUi' in filters) {
                              const customFields = (await GenericFunctions_1.prepareCustomFields.call(this, filters));
                              const searchQueries = (0, GenericFunctions_1.buildCustomFieldSearch)(customFields);
                              _searchQuery['_and'].push(...searchQueries);
                          }
                          for (const key of Object.keys(queryAttributs)) {
                              if (key === 'tags') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.In)(key, queryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'summary' || key === 'title') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, queryAttributs[key]));
                              }
                              else {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, queryAttributs[key]));
                              }
                          }
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'listCase',
                                      },
                                      {
                                          _name: 'filter',
                                          _and: _searchQuery['_and'],
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'cases';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = _searchQuery;
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const updateFields = this.getNodeParameter('updateFields', i, {});
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const customFields = await GenericFunctions_1.prepareCustomFields.call(this, updateFields, jsonParameters);
                          const body = {
                              ...customFields,
                              ...(0, GenericFunctions_1.prepareOptional)(updateFields),
                          };
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'PATCH', `/case/${id}`, body);
                      }
                  }
                  if (resource === 'task') {
                      if (operation === 'count') {
                          const countQueryAttributs = (0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('filters', i, {}));
                          const _countSearchQuery = (0, QueryFunctions_1.And)();
                          for (const key of Object.keys(countQueryAttributs)) {
                              if (key === 'title' || key === 'description') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, countQueryAttributs[key]));
                              }
                              else {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, countQueryAttributs[key]));
                              }
                          }
                          const body = {
                              query: [
                                  {
                                      _name: 'listTask',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: _countSearchQuery['_and'],
                                  },
                              ],
                          };
                          body['query'].push({
                              _name: 'count',
                          });
                          qs.name = 'count-tasks';
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          responseData = { count: responseData };
                      }
                      if (operation === 'create') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const body = {
                              title: this.getNodeParameter('title', i),
                              status: this.getNodeParameter('status', i),
                              flag: this.getNodeParameter('flag', i),
                              ...(0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('options', i, {})),
                          };
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/case/${caseId}/task`, body);
                      }
                      if (operation === 'executeResponder') {
                          const taskId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: taskId,
                              objectType: 'case_task',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'task-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'get') {
                          const taskId = this.getNodeParameter('id', i);
                          const credentials = await this.getCredentials('theHiveApi');
                          const version = credentials.apiVersion;
                          let endpoint;
                          let method;
                          let body = {};
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getTask',
                                          idOrName: taskId,
                                      },
                                  ],
                              };
                              qs.name = `get-task-${taskId}`;
                          }
                          else {
                              method = 'GET';
                              endpoint = `/case/task/${taskId}`;
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const caseId = this.getNodeParameter('caseId', i);
                          const options = this.getNodeParameter('options', i);
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getCase',
                                          idOrName: caseId,
                                      },
                                      {
                                          _name: 'tasks',
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'case-tasks';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/task/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = (0, QueryFunctions_1.And)((0, QueryFunctions_1.Parent)('case', (0, QueryFunctions_1.Id)(caseId)));
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'search') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const queryAttributs = (0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('filters', i, {}));
                          const _searchQuery = (0, QueryFunctions_1.And)();
                          const options = this.getNodeParameter('options', i);
                          for (const key of Object.keys(queryAttributs)) {
                              if (key === 'title' || key === 'description') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, queryAttributs[key]));
                              }
                              else {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, queryAttributs[key]));
                              }
                          }
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'listTask',
                                      },
                                      {
                                          _name: 'filter',
                                          _and: _searchQuery['_and'],
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'tasks';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/task/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = _searchQuery;
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {
                              ...(0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('updateFields', i, {})),
                          };
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'PATCH', `/case/task/${id}`, body);
                      }
                  }
                  if (resource === 'log') {
                      if (operation === 'create') {
                          const taskId = this.getNodeParameter('taskId', i);
                          let body = {
                              message: this.getNodeParameter('message', i),
                              startDate: Date.parse(this.getNodeParameter('startDate', i)),
                              status: this.getNodeParameter('status', i),
                          };
                          const optionals = this.getNodeParameter('options', i);
                          let options = {};
                          if (optionals.attachementUi) {
                              const attachmentValues = optionals.attachementUi
                                  .attachmentValues;
                              if (attachmentValues) {
                                  const binaryPropertyName = attachmentValues.binaryProperty;
                                  const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                  const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                                  options = {
                                      formData: {
                                          attachment: {
                                              value: dataBuffer,
                                              options: {
                                                  contentType: binaryData.mimeType,
                                                  filename: binaryData.fileName,
                                              },
                                          },
                                          _json: JSON.stringify(body),
                                      },
                                  };
                                  body = {};
                              }
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/case/task/${taskId}/log`, body, qs, '', options);
                      }
                      if (operation === 'executeResponder') {
                          const logId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: logId,
                              objectType: 'case_task_log',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'log-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'get') {
                          const logId = this.getNodeParameter('id', i);
                          const credentials = await this.getCredentials('theHiveApi');
                          const version = credentials.apiVersion;
                          let endpoint;
                          let method;
                          let body = {};
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getLog',
                                          idOrName: logId,
                                      },
                                  ],
                              };
                              qs.name = `get-log-${logId}`;
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/task/log/_search';
                              body.query = { _id: logId };
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const taskId = this.getNodeParameter('taskId', i);
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getTask',
                                          idOrName: taskId,
                                      },
                                      {
                                          _name: 'logs',
                                      },
                                  ],
                              };
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'case-task-logs';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/task/log/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = (0, QueryFunctions_1.And)((0, QueryFunctions_1.Parent)('task', (0, QueryFunctions_1.Id)(taskId)));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                  }
                  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.TheHive = TheHive;
  //# sourceMappingURL=TheHive.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TheHiveApi = void 0;
  class TheHiveApi {
      constructor() {
          this.name = 'theHiveApi';
          this.displayName = 'The Hive API';
          this.documentationUrl = 'theHive';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'ApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  default: '',
                  type: 'string',
                  description: 'The URL of TheHive instance',
                  placeholder: 'https://localhost:9000',
              },
              {
                  displayName: 'API Version',
                  name: 'apiVersion',
                  default: '',
                  type: 'options',
                  description: 'The version of api to be used',
                  options: [
                      {
                          name: 'TheHive 4+ (api v1)',
                          value: 'v1',
                          description: 'API version with TheHive 4 support, also works with TheHive 5 but not all features are supported',
                      },
                      {
                          name: 'TheHive 3 (api v0)',
                          value: '',
                          description: 'API version with TheHive 3 support',
                      },
                  ],
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials?.ApiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials?.url}}',
                  url: '/api/case',
              },
          };
      }
  }
  exports.TheHiveApi = TheHiveApi;
  //# sourceMappingURL=TheHiveApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TheHiveApi = void 0;
  class TheHiveApi {
      constructor() {
          this.name = 'theHiveApi';
          this.displayName = 'The Hive API';
          this.documentationUrl = 'theHive';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'ApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  default: '',
                  type: 'string',
                  description: 'The URL of TheHive instance',
                  placeholder: 'https://localhost:9000',
              },
              {
                  displayName: 'API Version',
                  name: 'apiVersion',
                  default: '',
                  type: 'options',
                  description: 'The version of api to be used',
                  options: [
                      {
                          name: 'TheHive 4+ (api v1)',
                          value: 'v1',
                          description: 'API version with TheHive 4 support, also works with TheHive 5 but not all features are supported',
                      },
                      {
                          name: 'TheHive 3 (api v0)',
                          value: '',
                          description: 'API version with TheHive 3 support',
                      },
                  ],
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials?.ApiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials?.url}}',
                  url: '/api/case',
              },
          };
      }
  }
  exports.TheHiveApi = TheHiveApi;
  //# sourceMappingURL=TheHiveApi.credentials.js.map

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

  # TheHive node

  Use the TheHive node to automate work in TheHive, and integrate TheHive with other applications. n8n has built-in support for a wide range of TheHive features, including creating alerts, counting tasks logs, cases, and observables. 

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

  /// note | TheHive and TheHive 5
  n8n provides two nodes for TheHive. Use this node (TheHive) if you want to use TheHive's version 3 or 4 API. If you want to use version 5, use [TheHive 5](/integrations/builtin/app-nodes/n8n-nodes-base.thehive5.md).
  ///
  /// note | Credentials
  Refer to [TheHive credentials](/integrations/builtin/credentials/thehive.md) for guidance on setting up authentication. 
  ///

  ## Operations

  The available operations depend on your API version. To see the operations list, create your credentials, including selecting your API version. Then return to the node, select the resource you want to use, and n8n displays the available operations for your API version. 

  * Alert
  * Case
  * Log
  * Observable
  * Task

  ## Templates and examples

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

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

  ## Related resources

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

  Refer to TheHive's documentation for more information about the service:

  * [Version 3](https://docs.thehive-project.org/thehive/legacy/thehive3/api/){:target=_blank .external-link}
  * [Version 4](https://docs.thehive-project.org/cortex/api/api-guide/){:target=_blank .external-link}

related_resources:
  [{"title":"here","url":"/integrations/builtin/trigger-nodes/n8n-nodes-base.thehivetrigger.md","type":"documentation"},{"title":"Version 3","url":"https://docs.thehive-project.org/thehive/legacy/thehive3/api/","type":"external"},{"title":"Version 4","url":"https://docs.thehive-project.org/cortex/api/api-guide/","type":"external"}]

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


