# nodes

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-12 08:59:16
updated_at: 2025-06-12 08:59:16
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":"e3jbea1843lnyprew5kbe","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.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: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:16
updated_at: 2025-06-12 08:59:16
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":{"operation":"append","stackId":"example-value","table":"example-value","id":"example-value","returnAll":true,"limit":1000,"additionalFields":{},"columns":"example-value"},"id":"08oiaed72cksfg33n0rkr7b","name":"Stackby","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"operation":"append","stackId":"example-value","table":"example-value","id":"example-value","returnAll":true,"limit":1000,"additionalFields":{},"columns":"example-value"}

properties_schema:
  [{"displayName":"Operation","name":"operation","type":"options","default":"append","placeholder":"Action to perform","options":[{"name":"Append","value":"append"},{"name":"Delete","value":"delete"},{"name":"List","value":"list"},{"name":"Read","value":"read"}]},{"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":"","required":true,"description":"Enter Table Name","placeholder":"Stories"},{"displayName":"ID","name":"id","type":"string","default":"","required":true,"description":"ID of the record to return"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":true,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":1000,"description":"Max number of results to return"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","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.","placeholder":"Add Field"},{"displayName":"Columns","name":"columns","type":"string","default":"","required":true,"description":"Comma-separated list of the properties which should used as columns for the new rows","placeholder":"id,name,description"}]


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: []
parameter_schemas: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:16
updated_at: 2025-06-12 08:59:16
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') ]]

troubleshooting_info:
  [{"issue":"Execute Command","solution":"Configure this operation with these parameters:"},{"issue":"Download File","solution":"- **Credential to connect with**: Select an existing or create a new [SSH credential](/integrations/builtin/credentials/ssh.md) to connect with.\n- **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.\n- **File Property**: Enter the name of the object property that holds the binary data you want to download."},{"issue":"Download File options","solution":"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."},{"issue":"Upload File","solution":"- **Credential to connect with**: Select an existing or create a new [SSH credential](/integrations/builtin/credentials/ssh.md) to connect with.\n- **Input Binary Field**: Enter the name of the input binary field that contains the file you want to upload.\n- **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."},{"issue":"Upload File options","solution":"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."}]

example_workflow:
  {"name":"SSH Example Workflow","nodes":[{"parameters":{"authentication":"password","resource":"command","operation":"download","command":"example-value","cwd":"/","binaryPropertyName":"Example Name","path":"example-value","options":{}},"id":"55alb1n7dc3txdpymdhbgf","name":"SSH","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"authentication":"password","resource":"command","operation":"download","command":"example-value","cwd":"/","binaryPropertyName":"Example Name","path":"example-value","options":{}}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"password","options":[{"name":"Password","value":"password"},{"name":"Private Key","value":"privateKey"}]},{"displayName":"Resource","name":"resource","type":"options","default":"command","options":[{"name":"Command","value":"command"},{"name":"File","value":"file"}]},{"displayName":"Operation","name":"operation","type":"options","default":"execute","description":"Execute a command","options":[{"name":"Execute","value":"execute","description":"Execute a command"}]},{"displayName":"Command","name":"command","type":"string","default":"","description":"The command to be executed on a remote device"},{"displayName":"Working Directory","name":"cwd","type":"string","default":"/","required":true},{"displayName":"Operation","name":"operation","type":"options","default":"upload","description":"Download a file","options":[{"name":"Download","value":"download","description":"Download a file"},{"name":"Upload","value":"upload","description":"Upload a file"}]},{"displayName":"Binary Property","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Name of the binary property which contains the data for the file to be uploaded"},{"displayName":"Target Directory","name":"path","type":"string","default":"","required":true,"description":"The directory to upload the file to. The name of the file does not need to be specified, it\\","placeholder":"/home/user"},{"displayName":"Path","name":"path","type":"string","default":"","required":true,"description":"The file path of the file to download. Has to contain the full path including file name.","placeholder":"/home/user/invoice.txt"},{"displayName":"Binary Property","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Object property name which holds binary data"},{"displayName":"Options","name":"options","type":"collection","default":"{","description":"Overrides the binary data file name","placeholder":"Add Option"}]


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: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"authentication":"password","resource":"entry","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:16
updated_at: 2025-06-12 08:59:16
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":{"authentication":"password","resource":"entry","dynamic_property":null},"id":"tt3pkdqgxath2nh7e72m","name":"Strapi","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"password","options":[{"name":"Username & Password","value":"password"},{"name":"API Token","value":"token"}]},{"displayName":"Resource","name":"resource","type":"options","default":"entry","options":[{"name":"Entry","value":"entry"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EntryDescription_1.entryOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...EntryDescription_1.entryFields"}]


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: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:16
updated_at: 2025-06-12 08:59:16
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":{"resource":"album","operation":"getFollowingArtists","id":"example-value","query":"example-value","country":"US","name":"Example Name","additionalFields":{},"trackID":"example-value","returnAll":false,"limit":50,"volumePercent":50,"filters":{}},"id":"mtdf5detrwf9pmtpnpxep","name":"Spotify","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"resource":"album","operation":"getFollowingArtists","id":"example-value","query":"example-value","country":"US","name":"Example Name","additionalFields":{},"trackID":"example-value","returnAll":false,"limit":50,"volumePercent":50,"filters":{}}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"player","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"}]},{"displayName":"Operation","name":"operation","type":"options","default":"addSongToQueue","description":"Add a song to your queue","options":[{"name":"Add Song to Queue","value":"addSongToQueue","description":"Add a song to your queue"},{"name":"Currently Playing","value":"currentlyPlaying","description":"Get your currently playing track"},{"name":"Next Song","value":"nextSong","description":"Skip to your next track"},{"name":"Pause","value":"pause","description":"Pause your music"},{"name":"Previous Song","value":"previousSong","description":"Skip to your previous song"},{"name":"Recently Played","value":"recentlyPlayed","description":"Get your recently played tracks"},{"name":"Resume","value":"resume","description":"Resume playback on the current active device"},{"name":"Set Volume","value":"volume","description":"Set volume on the current active device"},{"name":"Start Music","value":"startMusic","description":"Start playing a playlist, artist, or album"}]},{"displayName":"Resource ID","name":"id","type":"string","default":"","required":true,"description":"Enter a playlist, artist, or album URI or ID","placeholder":"spotify:album:1YZ3k65Mqw3G8FzYlW1mmp"},{"displayName":"Track ID","name":"id","type":"string","default":"","required":true,"description":"Enter a track URI or ID","placeholder":"spotify:track:0xE4LEFzSNGsz1F6kvXsHU"},{"displayName":"Operation","name":"operation","type":"options","default":"get","description":"Get an album by URI or ID","options":[{"name":"Get","value":"get","description":"Get an album by URI or ID"},{"name":"Get New Releases","value":"getNewReleases","description":"Get a list of new album releases"},{"name":"Get Tracks","value":"getTracks","description":"Get an album"},{"name":"Search","value":"search","description":"Search albums by keyword"}]},{"displayName":"Album ID","name":"id","type":"string","default":"","required":true,"description":"The album","placeholder":"spotify:album:1YZ3k65Mqw3G8FzYlW1mmp"},{"displayName":"Search Keyword","name":"query","type":"string","default":"","required":true,"description":"The keyword term to search for"},{"displayName":"Operation","name":"operation","type":"options","default":"get","description":"Get an artist by URI or ID","options":[{"name":"Get","value":"get","description":"Get an artist by URI or ID"},{"name":"Get Albums","value":"getAlbums","description":"Get an artist"},{"name":"Get Related Artists","value":"getRelatedArtists","description":"Get an artist"},{"name":"Get Top Tracks","value":"getTopTracks","description":"Get an artist"},{"name":"Search","value":"search","description":"Search artists by keyword"}]},{"displayName":"Artist ID","name":"id","type":"string","default":"","required":true,"description":"The artist","placeholder":"spotify:artist:4LLpKhyESsyAXpc4laK94U"},{"displayName":"Country","name":"country","type":"string","default":"US","required":true,"description":"Top tracks in which country? Enter the postal abbreviation","placeholder":"US"},{"displayName":"Search Keyword","name":"query","type":"string","default":"","required":true,"description":"The keyword term to search for"},{"displayName":"Operation","name":"operation","type":"options","default":"add","description":"Add tracks to a playlist by track and playlist URI or ID","options":[{"name":"Add an Item","value":"add","description":"Add tracks to a playlist by track and playlist URI or ID"},{"name":"Create a Playlist","value":"create","description":"Create a new playlist"},{"name":"Get","value":"get","description":"Get a playlist by URI or ID"},{"name":"Get the User","value":"getUserPlaylists","description":"Get a user"},{"name":"Get Tracks","value":"getTracks","description":"Get a playlist"},{"name":"Remove an Item","value":"delete","description":"Remove tracks from a playlist by track and playlist URI or ID"},{"name":"Search","value":"search","description":"Search playlists by keyword"}]},{"displayName":"Playlist ID","name":"id","type":"string","default":"","required":true,"description":"The playlist","placeholder":"spotify:playlist:37i9dQZF1DWUhI3iC1khPH"},{"displayName":"Name","name":"name","type":"string","default":"","required":true,"description":"Name of the playlist to create","placeholder":"Favorite Songs"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Description for the playlist to create","placeholder":"Add Field"},{"displayName":"Track ID","name":"trackID","type":"string","default":"","required":true,"description":"The track","placeholder":"spotify:track:0xE4LEFzSNGsz1F6kvXsHU"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The new track","placeholder":"Add Field"},{"displayName":"Search Keyword","name":"query","type":"string","default":"","required":true,"description":"The keyword term to search for"},{"displayName":"Operation","name":"operation","type":"options","default":"track","description":"Get a track by its URI or ID","options":[{"name":"Get","value":"get","description":"Get a track by its URI or ID"},{"name":"Get Audio Features","value":"getAudioFeatures","description":"Get audio features for a track by URI or ID"},{"name":"Search","value":"search","description":"Search tracks by keyword"}]},{"displayName":"Track ID","name":"id","type":"string","default":"","required":true,"description":"The track","placeholder":"spotify:track:0xE4LEFzSNGsz1F6kvXsHU"},{"displayName":"Search Keyword","name":"query","type":"string","default":"","required":true,"description":"The keyword term to search for"},{"displayName":"Operation","name":"operation","type":"options","default":"getLikedTracks","description":"Get the user","options":[{"name":"Get Liked Tracks","value":"getLikedTracks","description":"Get the user"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getFollowingArtists","description":"Get your followed artists","options":[{"name":"Get Following Artists","value":"getFollowingArtists","description":"Get your followed artists"}]},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"required":true,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":50,"required":true,"description":"Max number of results to return"},{"displayName":"Limit","name":"limit","type":"number","default":50,"required":true,"description":"Max number of results to return"},{"displayName":"Volume","name":"volumePercent","type":"number","default":50,"required":true,"description":"The volume percentage to set"},{"displayName":"Filters","name":"filters","type":"collection","default":"{","description":"Country to filter new releases by","placeholder":"Add Filter"},{"displayName":"Filters","name":"filters","type":"collection","default":"{","description":"If a country code is specified, only content that is playable in that market is returned","placeholder":"Add Filter"}]


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: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"balance","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:17
updated_at: 2025-06-12 08:59:17
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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":{"resource":"balance","dynamic_property":null},"id":"csnybdgp95dgjqiacwgjy","name":"Stripe","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"balance","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"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.balanceOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.customerCardOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.customerCardFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.chargeOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.chargeFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.couponOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.couponFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.customerOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.customerFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.sourceOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.sourceFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.tokenOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.tokenFields"}]


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: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-12 08:59:17
updated_at: 2025-06-12 08:59:17
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":"ievuoyd23bdvna2c196","name":"SyncroMSP","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: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"activity","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:17
updated_at: 2025-06-12 08:59:17
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.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":{"resource":"activity","dynamic_property":null},"id":"j9et9ebjgo870xjw0vya47","name":"Strava","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"activity","options":[{"name":"Activity","value":"activity"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ActivityDescription_1.activityOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ActivityDescription_1.activityFields"}]


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: []
parameter_schemas: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-12 08:59:17
updated_at: 2025-06-12 08:59:17
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"

workflow_examples:
  [{"name":"agents_vs_chains","workflow":{"name":"Agents vs chains","nodes":[{"parameters":{},"id":"9e1d8f35-e1ba-4600-977d-e54a919c2c62","name":"Chat Trigger","type":"@n8n/n8n-nodes-langchain.chatTrigger","typeVersion":1,"position":[520,420],"webhookId":"84bfdbd0-e2ce-4bfa-b746-985e64a14484"},{"parameters":{"options":{}},"id":"4b89df4b-4f78-4f52-a51d-eeb66a7948e5","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","typeVersion":1,"position":[1020,420],"credentials":{"openAiApi":{"id":"tW3bkXa0SAK0OzvR","name":"OpenAi account Debs"}}},{"parameters":{"options":{}},"id":"a0045df2-d212-4e6a-a2d4-722136dcb8b5","name":"OpenAI Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","typeVersion":1,"position":[980,880],"credentials":{"openAiApi":{"id":"tW3bkXa0SAK0OzvR","name":"OpenAi account Debs"}}},{"parameters":{},"id":"d702f647-1fa7-4b4f-91b1-e0152326ea11","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","typeVersion":1.2,"position":[1280,460]},{"parameters":{},"id":"76cc359a-5ec8-446a-a8e0-9035d18247cb","name":"Wikipedia","type":"@n8n/n8n-nodes-langchain.toolWikipedia","typeVersion":1,"position":[1540,340]},{"parameters":{"options":{}},"id":"01d1785f-f7c4-47d2-97b7-76eeff68002d","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","typeVersion":1.5,"position":[1060,140]},{"parameters":{"messages":{"messageValues":[{"message":"Every time you respond, start your response with the sentence: \"This message came from the chain\"."}]}},"id":"bcdcd704-13f5-4906-b337-7ec4629b9781","name":"Basic LLM Chain","type":"@n8n/n8n-nodes-langchain.chainLlm","typeVersion":1.4,"position":[1040,680]},{"parameters":{"content":"## Try it out\n\nSelect **Chat**, and try out these queries:\n\n- Please show me a Wikipedia article about cats (agent)\n- Please show me a Wikipedia article about cats (chain)\n- What was my last question? (chain)\n- What was my last question? (agent)\n","height":343.8587887368956,"color":4},"id":"f08e231b-739a-4b9d-b738-139b7e3bd60b","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[240,420]},{"parameters":{"content":"**Set your credentials**","height":193,"width":167,"color":2},"id":"5421fd4d-c82f-483a-8238-869b9a10000d","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[980,360]},{"parameters":{"content":"**Set your credentials**","height":193,"width":167,"color":2},"id":"23fac3a8-a220-40a5-8d3d-4a3013b0f1da","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[940,820]},{"parameters":{"content":"**Memory allows the agent to access previous parts of the chat**\n","height":244,"color":5},"id":"08397bde-06e4-4bff-b130-cbc4408a0ecc","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1200,360]},{"parameters":{"content":"**The agent can use the Wikipedia tool to access articles from Wikipedia**","height":238,"color":5},"id":"a53ff4f2-9d06-4166-9ad6-760cd8fe4a54","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1460,240]},{"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":false,"leftValue":"","typeValidation":"strict"},"conditions":[{"leftValue":"={{ $json.chatInput }}","rightValue":"agent","operator":{"type":"string","operation":"contains"}}],"combinator":"and"}},{"conditions":{"options":{"caseSensitive":false,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"248f4a34-89c1-4d1e-867a-daa024c8635a","leftValue":"={{ $json.chatInput }}","rightValue":"chain","operator":{"type":"string","operation":"contains"}}],"combinator":"and"}}]},"options":{"ignoreCase":true}},"id":"ab2bff8d-e914-421d-9aa3-9d0ad815cea6","name":"Check user input for \"chain\" or \"agent\"","type":"n8n-nodes-base.switch","typeVersion":3,"position":[740,420]},{"parameters":{"content":"## Next steps\n\nLearn more about [Advanced AI in n8n](https://docs.n8n.io/advanced-ai/)"},"id":"f077f8e6-789a-4db1-8402-fb173c296017","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1560,840]}],"pinData":{},"connections":{"Chat Trigger":{"main":[[{"node":"Check user input for \"chain\" or \"agent\"","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"OpenAI Chat Model1":{"ai_languageModel":[[{"node":"Basic LLM Chain","type":"ai_languageModel","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Wikipedia":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Check user input for \"chain\" or \"agent\"":{"main":[[{"node":"AI Agent","type":"main","index":0}],[{"node":"Basic LLM Chain","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"59784a0f-0601-4456-b48d-9a191e203461","meta":{"templateCredsSetupCompleted":true,"instanceId":"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"},"id":"qK43vJw6dRZkXo6h","tags":[{"createdAt":"2021-06-25T07:47:07.640Z","updatedAt":"2021-06-25T07:47:07.640Z","id":"1","name":"docs"},{"createdAt":"2023-02-22T12:06:03.372Z","updatedAt":"2023-02-22T12:06:03.372Z","id":"63","name":"createdBy:Debs"}]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.switch","version":3,"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":false,"leftValue":"","typeValidation":"strict"},"conditions":[{"leftValue":"={{ $json.chatInput }}","rightValue":"agent","operator":{"type":"string","operation":"contains"}}],"combinator":"and"}},{"conditions":{"options":{"caseSensitive":false,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"248f4a34-89c1-4d1e-867a-daa024c8635a","leftValue":"={{ $json.chatInput }}","rightValue":"chain","operator":{"type":"string","operation":"contains"}}],"combinator":"and"}}]},"options":{"ignoreCase":true}},"position":[740,420]}],"connections":{"Chat Trigger":{"main":[[{"node":"Check user input for \"chain\" or \"agent\"","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"OpenAI Chat Model1":{"ai_languageModel":[[{"node":"Basic LLM Chain","type":"ai_languageModel","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Wikipedia":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Check user input for \"chain\" or \"agent\"":{"main":[[{"node":"AI Agent","type":"main","index":0}],[{"node":"Basic LLM Chain","type":"main","index":0}]]}},"source":"docs/_workflows/advanced-ai/examples/agents_vs_chains.json","description":"Workflow example from docs/_workflows/advanced-ai/examples/agents_vs_chains.json"},{"name":"chat_with_google_sheets_docs_version","workflow":{"name":"Chat with Google Sheets (docs version)","nodes":[{"parameters":{},"id":"e96a5e41-f0d6-49c1-977e-ff724a857212","name":"Execute Workflow Trigger","type":"n8n-nodes-base.executeWorkflowTrigger","position":[540,1240],"typeVersion":1},{"parameters":{"content":"### Sub-workflow: Custom tool\nThe agent above can call this workflow. It returns three different types of data from the Google Sheet, which can be used together for more complex queries without returning the whole sheet (which might be too big for GPT to handle).","height":612.0936015224503,"width":1449.2963504228514,"color":7},"id":"67facef0-e9c6-4280-8232-78f654b420d5","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[461.9740563285368,970.616715060075],"typeVersion":1},{"parameters":{"content":"### Main workflow: AI agent using custom tool","height":486.5625,"width":927.5,"color":7},"id":"bc448102-954b-451e-9bf7-bcadbc53bdbc","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[460,460],"typeVersion":1},{"parameters":{"content":"## Try it out\n\nSelect **Chat** at the bottom and enter:\n\n_Which is our biggest customer?_","height":183.85014518022527,"width":185.9375,"color":4},"id":"afb2da2f-8da2-4ee8-bff9-55a99eeecc5c","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[300,540],"typeVersion":1},{"parameters":{},"id":"5d56d128-9a83-45ee-a34c-bc1190d59322","name":"Chat Trigger","type":"@n8n/n8n-nodes-langchain.chatTrigger","position":[600,560],"webhookId":"e3f23177-c7c1-417b-a513-1c1090dda0a2","typeVersion":1},{"parameters":{"authentication":"serviceAccount","documentId":{"__rl":true,"mode":"url","value":"={{ $json.sheetUrl }}"},"sheetName":{"__rl":true,"mode":"url","value":"={{ $json.sheetUrl }}"},"options":{}},"id":"3c0e4b48-a27b-472f-948e-9aa001c49149","name":"Get Google sheet contents","type":"n8n-nodes-base.googleSheets","position":[980,1240],"typeVersion":4.2},{"parameters":{"fields":{"values":[{"name":"sheetUrl"}]},"options":{}},"id":"67f9c172-e70f-4a0f-afd3-513cfeae09db","name":"Set Google Sheet URL","type":"n8n-nodes-base.set","position":[760,1240],"typeVersion":3.2},{"parameters":{"fields":{"values":[{"name":"response","stringValue":"={{ Object.keys($json) }}"}]},"include":"none","options":{}},"id":"d49223eb-2927-4ddd-bd2c-cd439f927341","name":"Get column names","type":"n8n-nodes-base.set","position":[1440,1060],"executeOnce":true,"typeVersion":3.2},{"parameters":{"jsCode":"return {\n  'response': JSON.stringify($input.all().map(x => x.json))\n}"},"id":"37ceba7a-1f0b-4de7-ae4a-d29a18dabaf6","name":"Prepare output","type":"n8n-nodes-base.code","position":[1720,1240],"typeVersion":2},{"parameters":{"name":"list_columns_tool","description":"=### List all column names in customer data\nThis is useful to find out what data is available for each customer. Returns a JSON array containing all the column names.","workflowId":"={{ $workflow.id }}","fields":{"values":[{"name":"operation","stringValue":"column_names"}]}},"id":"94516eb1-89fc-4d3f-8000-d0fa43cd71cd","name":"List columns tool","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[940,780],"typeVersion":1},{"parameters":{"name":"get_customer_tool","description":"=### Get all columns for a given customer\nTo use this mode, pass the row number of the customer. Returns a JSON object with all the column names and their values.","workflowId":"={{ $workflow.id }}","fields":{"values":[{"name":"operation","stringValue":"row"}]}},"id":"006745a1-3df7-4de9-9483-c6e133272c55","name":"Get customer tool","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[1220,780],"typeVersion":1},{"parameters":{},"id":"c3d20569-1374-4f8d-8779-23b98952d124","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[800,780],"typeVersion":1.1},{"parameters":{"name":"column_values_tool","description":"=### Get the specified column value for all customers\nThis is useful if you want to find out which customers have a certain value for a given column. Returns an array of JSON objects, one per customer. Each JSON object includes the column being requested, plus the row_number column. (The row_number column can be used to request the full customer data in a second step.). To use this mode, pass the name of the column to fetch.\n\nYou may want to call the 'list columns' tool first to find out which columns you could be fetching.","workflowId":"={{ $workflow.id }}","fields":{"values":[{"name":"operation","stringValue":"column_values"}]}},"id":"3a370ae9-eaf8-4e84-948b-848c461ac9eb","name":"Get column values tool","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[1080,780],"typeVersion":1},{"parameters":{"text":"={{ $json.chatInput }}","options":{"maxIterations":10}},"id":"8f2a4854-2177-4ac8-9501-fa36cf2a3d73","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[820,560],"typeVersion":1.1},{"parameters":{"content":"**These tools all call the sub-workflow below**","height":179.21380662202682,"width":432.3271051132649,"color":5},"id":"2576563b-a104-4d99-b3c8-b53bff4c740c","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[900,740.8693557231958],"typeVersion":1},{"parameters":{"content":"**Change the URL of the Google Sheet**","height":226.64416053838073,"width":179.99762227826224,"color":2},"id":"5b623d9e-e188-403d-a702-9ece6172a487","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[723,1172],"typeVersion":1},{"parameters":{"model":"gpt-4","options":{"temperature":0}},"id":"2b8c8a67-a4df-4f5c-8c13-3cb2d25d2c5f","name":"GPT4 Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[660,780],"typeVersion":1},{"parameters":{"content":"**Set your credentials**","height":171,"width":150,"color":2},"id":"f39d0c9b-4055-4331-83c8-3dbffb43478e","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[620,720]},{"parameters":{"content":"**Set your credentials**","height":237,"width":176,"color":2},"id":"a8e09ef8-4dc6-4918-9194-047de402a8fa","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[940,1172]},{"parameters":{"content":"## Next steps\n\nLearn more about [Advanced AI in n8n](https://docs.n8n.io/advanced-ai/)","height":126.0084096222716,"width":291.1204551358572},"id":"a391dfb1-f408-4498-99cd-d35a258d6c9a","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1740,1540]},{"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"leftValue":"={{ $('Execute Workflow Trigger').item.json.operation }}","rightValue":"column_names","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"col names"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"9fe58592-72e2-4379-9bdb-10da19c8218b","leftValue":"={{ $('Execute Workflow Trigger').item.json.operation }}","rightValue":"column_values","operator":{"type":"string","operation":"equals","name":"filter.operator.equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"col values"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"c1836f93-7874-43a4-98ff-cc487b276600","leftValue":"={{ $('Execute Workflow Trigger').item.json.operation }}","rightValue":"row","operator":{"type":"string","operation":"equals","name":"filter.operator.equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"rows"}]},"options":{}},"id":"907deea9-26cc-427e-93fc-52ce6b67e5e1","name":"Check operations","type":"n8n-nodes-base.switch","typeVersion":3,"position":[1220,1240]},{"parameters":{"fields":{"values":[{"name":"={{ $('Execute Workflow Trigger').item.json.query }}","stringValue":"={{ $json[$('Execute Workflow Trigger').item.json.query] }}"},{"name":"row_number","stringValue":"={{ $json.row_number }}"}]},"include":"none","options":{}},"id":"f2ebcae6-3cfb-4862-a927-dc66bd24f197","name":"Prepare column data","type":"n8n-nodes-base.set","position":[1440,1240],"typeVersion":3.2},{"parameters":{"conditions":{"options":{"leftValue":"","caseSensitive":true,"typeValidation":"loose"},"combinator":"and","conditions":[{"id":"bf712098-97e4-42cb-8e08-2ee32d19d3e7","operator":{"type":"number","operation":"equals"},"leftValue":"={{ $json.row_number }}","rightValue":"={{ $('Execute Workflow Trigger').item.json.query }}"}]},"options":{"looseTypeValidation":true}},"id":"f40acb04-ef06-4670-b8b1-86b04f066af8","name":"Filter out other rows","type":"n8n-nodes-base.filter","position":[1440,1420],"typeVersion":2}],"pinData":{},"connections":{"GPT4 Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Chat Trigger":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Get column names":{"main":[[{"node":"Prepare output","type":"main","index":0}]]},"Get customer tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"List columns tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Set Google Sheet URL":{"main":[[{"node":"Get Google sheet contents","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Get column values tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Execute Workflow Trigger":{"main":[[{"node":"Set Google Sheet URL","type":"main","index":0}]]},"Get Google sheet contents":{"main":[[{"node":"Check operations","type":"main","index":0}]]},"Check operations":{"main":[[{"node":"Get column names","type":"main","index":0}],[{"node":"Prepare column data","type":"main","index":0}],[{"node":"Filter out other rows","type":"main","index":0}]]},"Prepare column data":{"main":[[{"node":"Prepare output","type":"main","index":0}]]},"Filter out other rows":{"main":[[{"node":"Prepare output","type":"main","index":0}]]}}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.switch","version":3,"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"leftValue":"={{ $('Execute Workflow Trigger').item.json.operation }}","rightValue":"column_names","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"col names"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"9fe58592-72e2-4379-9bdb-10da19c8218b","leftValue":"={{ $('Execute Workflow Trigger').item.json.operation }}","rightValue":"column_values","operator":{"type":"string","operation":"equals","name":"filter.operator.equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"col values"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"c1836f93-7874-43a4-98ff-cc487b276600","leftValue":"={{ $('Execute Workflow Trigger').item.json.operation }}","rightValue":"row","operator":{"type":"string","operation":"equals","name":"filter.operator.equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"rows"}]},"options":{}},"position":[1220,1240]}],"connections":{"GPT4 Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Chat Trigger":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Get column names":{"main":[[{"node":"Prepare output","type":"main","index":0}]]},"Get customer tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"List columns tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Set Google Sheet URL":{"main":[[{"node":"Get Google sheet contents","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Get column values tool":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Execute Workflow Trigger":{"main":[[{"node":"Set Google Sheet URL","type":"main","index":0}]]},"Get Google sheet contents":{"main":[[{"node":"Check operations","type":"main","index":0}]]},"Check operations":{"main":[[{"node":"Get column names","type":"main","index":0}],[{"node":"Prepare column data","type":"main","index":0}],[{"node":"Filter out other rows","type":"main","index":0}]]},"Prepare column data":{"main":[[{"node":"Prepare output","type":"main","index":0}]]},"Filter out other rows":{"main":[[{"node":"Prepare output","type":"main","index":0}]]}},"source":"docs/_workflows/advanced-ai/examples/chat_with_google_sheets_docs_version.json"},{"name":"multiple-branch-execution","workflow":{"name":"Form that can execute multiple branches","nodes":[{"parameters":{"formTitle":"Form that may execute multiple branches","formDescription":"This form contains multiple branches. Depending on the user's responses, more than one branch may execute sequentially.","formFields":{"values":[{"fieldLabel":"What are your favorite film genres","fieldType":"dropdown","fieldOptions":{"values":[{"option":"Documentary"},{"option":"Action"},{"option":"Romance"},{"option":"Comedy"},{"option":"Drama"}]},"multiselect":true,"requiredField":true}]},"options":{}},"type":"n8n-nodes-base.formTrigger","typeVersion":2.2,"position":[-300,60],"id":"ad3f0e0a-a1e9-4504-8711-508bd29bd745","name":"On form submission","webhookId":"b3e1c86f-ae45-421e-9045-f19873b7a73e"},{"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"e3d995dd-d555-4e7a-b744-a3434ed602ad","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Documentary","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Documentary"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"ae94981b-1273-4830-ac2a-991bb25f41d8","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Action","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Action"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"b9545089-4054-484d-9e6c-98f4872e7e9e","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Romance","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Romance"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"71ae5a41-0927-40e3-a583-e569bcebfd1f","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Comedy","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Comedy"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"5bfe5981-203a-457a-bfaa-36846d7b79a8","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Drama","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Drama"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"adb1bfc5-08fd-4653-abe0-6f12aedda16a","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":1,"operator":{"type":"array","operation":"lengthGt","rightType":"number"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Final page"}]},"options":{"allMatchingOutputs":true}},"type":"n8n-nodes-base.switch","typeVersion":3.2,"position":[100,0],"id":"df96da7b-c7dc-43c6-8941-973842603e0c","name":"Switch"},{"parameters":{"content":"## Form that may execute multiple branches\nThis form contains branching where more than one path may execute, depending on the user's selections.","width":380},"type":"n8n-nodes-base.stickyNote","position":[-160,-260],"typeVersion":1,"id":"c51af5ad-8f6c-4f2a-8974-65c4abc4fcbf","name":"Sticky Note"},{"parameters":{"content":"This Switch node determines which branches will execute.\n\nMultiple conditions may be true, resulting in more than one branch being executed. When this happens, n8n executes the first branch completely before returning to execute the next branch.","height":220,"width":260,"color":5},"type":"n8n-nodes-base.stickyNote","position":[20,320],"typeVersion":1,"id":"eab3ff17-5030-4556-a0c7-2571345e8cdf","name":"Sticky Note1"},{"parameters":{"formFields":{"values":[{"fieldLabel":"What is your favorite documentary?"}]},"options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[700,-500],"id":"dc55c82f-7d4f-4368-8ab5-69a673e92027","name":"Documentary questions","webhookId":"0c72f06e-4cc0-41eb-931c-7bf82bb1927e"},{"parameters":{"formFields":{"values":[{"fieldLabel":"What is your favorite action film?"}]},"options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[700,-280],"id":"3f76b5df-561b-4159-9e14-33a43d8c45a8","name":"Action questions","webhookId":"bea04786-25cc-477e-aaf1-ab68159cbe28"},{"parameters":{"operation":"completion","completionTitle":"Thank you for answering our documentary questions!","options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[920,-500],"id":"16660e2e-a047-45d2-ba54-12d573633ece","name":"Documentary thanks","webhookId":"0238f2c2-8984-4adc-aade-308bb458c16e"},{"parameters":{"operation":"completion","completionTitle":"Thank you for answering our action film questions!","options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[920,-280],"id":"1853276a-3ba6-4315-b772-fbeb0c68a477","name":"Action thanks","webhookId":"2e47b563-bd17-466c-86b7-9237be55d226"},{"parameters":{"formFields":{"values":[{"fieldLabel":"What is your favorite romance film?"}]},"options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[700,-20],"id":"cd7bc8d0-a143-4733-be84-320c88ef241b","name":"Romance questions","webhookId":"3f77a665-fc03-46ba-a58f-6d9bd7099028"},{"parameters":{"operation":"completion","completionTitle":"Thank you for answering our romance film questions!","options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[920,-20],"id":"42d7c8b5-f66f-4b34-821c-0df91bbaa9ea","name":"Romance thanks","webhookId":"eee896c5-d116-4586-972d-3fe02073ed11"},{"parameters":{"formFields":{"values":[{"fieldLabel":"What is your favorite comedy film?"}]},"options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[700,220],"id":"b9422abf-1ad5-44e4-941d-692f72bc2fef","name":"Comedy questions","webhookId":"97b56894-28fb-47d1-b729-754e43f1ac09"},{"parameters":{"operation":"completion","completionTitle":"Thank you for answering our comedy film questions!","options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[920,220],"id":"1db70bda-0752-41b7-a930-b90f6e64b3e7","name":"Comedy thanks","webhookId":"b021494a-5a35-4ade-b7c0-ca43a309268d"},{"parameters":{"formFields":{"values":[{"fieldLabel":"What is your favorite drama film?"}]},"options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[700,480],"id":"2bef931a-12d2-4873-ad19-9bdb0b5fe78f","name":"Drama questions","webhookId":"8d801d97-1103-42ee-a0c1-c1f1153727d9"},{"parameters":{"operation":"completion","completionTitle":"Thank you for answering our drama film questions!","options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[920,480],"id":"1fd7fa2f-d1be-430a-bb98-ded89ad8fca0","name":"Drama thanks","webhookId":"46a782bc-21b2-4fcd-9c52-82a7bb20ec2c"},{"parameters":{"operation":"completion","completionTitle":"Thank you for answering our film questions!","options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[700,720],"id":"7b0aeed0-0e13-4fcb-a3e9-c5ff4d6a77ca","name":"Multi-selection thank you","webhookId":"67fcd1f3-e5a6-4bf6-b17e-37b2a87f4c3d"},{"parameters":{"content":"n8n Form nodes using the **Form Ending** page type are only executed if they are the last node in the execution path.\n\nThese endings specific to a genre are only executed if this is the only valid branch.","height":1400,"width":280,"color":5},"type":"n8n-nodes-base.stickyNote","position":[840,-740],"typeVersion":1,"id":"7bda913a-d75c-4b20-8be6-a767c008a8f6","name":"Sticky Note2"},{"parameters":{"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nThe switch includes this **Form Ending** node whenever more than one branch is executed.\n\nBecause this is the [final branch](https://docs.n8n.io/flow-logic/execution-order/) that will be executed, this is the final display whenever multiple branches are executed.","height":400,"width":300,"color":5},"type":"n8n-nodes-base.stickyNote","position":[740,800],"typeVersion":1,"id":"9c3f93a5-5248-4ba1-99b5-9df6d21416c2","name":"Sticky Note3"}],"pinData":{},"connections":{"On form submission":{"main":[[{"node":"Switch","type":"main","index":0}]]},"Switch":{"main":[[{"node":"Documentary questions","type":"main","index":0}],[{"node":"Action questions","type":"main","index":0}],[{"node":"Romance questions","type":"main","index":0}],[{"node":"Comedy questions","type":"main","index":0}],[{"node":"Drama questions","type":"main","index":0}],[{"node":"Multi-selection thank you","type":"main","index":0}]]},"Documentary questions":{"main":[[{"node":"Documentary thanks","type":"main","index":0}]]},"Action questions":{"main":[[{"node":"Action thanks","type":"main","index":0}]]},"Romance questions":{"main":[[{"node":"Romance thanks","type":"main","index":0}]]},"Comedy questions":{"main":[[{"node":"Comedy thanks","type":"main","index":0}]]},"Drama questions":{"main":[[{"node":"Drama thanks","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"b1d38757-38ea-4ee8-a352-990185b17e31","meta":{"instanceId":"1f94e052868811125a74dc63385a38f60e7a14ab6e00497af83e8b68412ec251"},"id":"kl3goXzWrfrWHpYv","tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.switch","version":3.2,"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"e3d995dd-d555-4e7a-b744-a3434ed602ad","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Documentary","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Documentary"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"ae94981b-1273-4830-ac2a-991bb25f41d8","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Action","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Action"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"b9545089-4054-484d-9e6c-98f4872e7e9e","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Romance","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Romance"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"71ae5a41-0927-40e3-a583-e569bcebfd1f","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Comedy","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Comedy"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"5bfe5981-203a-457a-bfaa-36846d7b79a8","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":"Drama","operator":{"type":"array","operation":"contains","rightType":"any"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Drama"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"adb1bfc5-08fd-4653-abe0-6f12aedda16a","leftValue":"={{ $json['What are your favorite film genres'] }}","rightValue":1,"operator":{"type":"array","operation":"lengthGt","rightType":"number"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Final page"}]},"options":{"allMatchingOutputs":true}},"position":[100,0]}],"connections":{"On form submission":{"main":[[{"node":"Switch","type":"main","index":0}]]},"Switch":{"main":[[{"node":"Documentary questions","type":"main","index":0}],[{"node":"Action questions","type":"main","index":0}],[{"node":"Romance questions","type":"main","index":0}],[{"node":"Comedy questions","type":"main","index":0}],[{"node":"Drama questions","type":"main","index":0}],[{"node":"Multi-selection thank you","type":"main","index":0}]]},"Documentary questions":{"main":[[{"node":"Documentary thanks","type":"main","index":0}]]},"Action questions":{"main":[[{"node":"Action thanks","type":"main","index":0}]]},"Romance questions":{"main":[[{"node":"Romance thanks","type":"main","index":0}]]},"Comedy questions":{"main":[[{"node":"Comedy thanks","type":"main","index":0}]]},"Drama questions":{"main":[[{"node":"Drama thanks","type":"main","index":0}]]}},"source":"docs/_workflows/integrations/builtin/core-nodes/n8n-nodes-base.form/multiple-branch-execution.json","description":"Workflow example from docs/_workflows/integrations/builtin/core-nodes/n8n-nodes-base.form/multiple-branch-execution.json"},{"name":"mutually-exclusive-branching","workflow":{"name":"Form with mutually exclusive branching","nodes":[{"parameters":{"formTitle":"Form with mutually exclusive branching","formDescription":"This form contains branches, but only one branch will ever be executed.","formFields":{"values":[{"fieldLabel":"Would you recommend this site?","fieldType":"dropdown","fieldOptions":{"values":[{"option":"Yes"},{"option":"No"}]},"requiredField":true}]},"options":{}},"type":"n8n-nodes-base.formTrigger","typeVersion":2.2,"position":[0,0],"id":"1adce353-28c9-48b8-8326-c1f41d9311fd","name":"On form submission","webhookId":"d869b846-111d-4f53-96e4-2c4a533d9ed6"},{"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"leftValue":"={{ $json['Would you recommend this site?'] }}","rightValue":"Yes","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Yes"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"1dd9b1f5-6f48-4182-ae04-f47c37e3fa98","leftValue":"={{ $json['Would you recommend this site?'] }}","rightValue":"No","operator":{"type":"string","operation":"equals","name":"filter.operator.equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"No"}]},"options":{}},"type":"n8n-nodes-base.switch","typeVersion":3.2,"position":[220,0],"id":"c0d3e3f1-76c5-4bac-8382-c3d70a57ee8a","name":"Switch"},{"parameters":{"formFields":{"values":[{"fieldLabel":"What can we do to improve?","fieldType":"textarea"}]},"options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[440,200],"id":"615cf27a-658c-43be-aff9-c5fda8a04c51","name":"If not recommended","webhookId":"3579ba77-7ba2-4a97-8a29-a228aac297d5"},{"parameters":{"operation":"completion","completionTitle":"Thank you for your review!","options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[660,-200],"id":"13423b3f-0380-429d-92bf-460cc8b409a3","name":"Thanks for the review","webhookId":"bce3f77b-3005-4989-bd61-b9c5ff19e59e"},{"parameters":{"operation":"completion","completionTitle":"Thank you for your feedback","options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[660,200],"id":"0848a392-41f2-47e8-be17-124fef3d9a63","name":"Thanks for the feedback","webhookId":"8b1a34e2-aa24-4c12-841c-79f6491cb779"},{"parameters":{"content":"## Form with mutually exclusive branching\nThis form contains a branch where only one of the two paths will execute, depending on your selections.","width":380},"type":"n8n-nodes-base.stickyNote","position":[-160,-260],"typeVersion":1,"id":"57c5e1cd-7dda-4bfb-8bfa-8c9f91110249","name":"Sticky Note"},{"parameters":{"content":"This Switch node determines which branch will execute.\n\nThe switch uses data from a dropdown field with single selection enforced, so only one path will execute.","color":5},"type":"n8n-nodes-base.stickyNote","position":[440,0],"typeVersion":1,"id":"9bde0398-7021-4ec6-b950-d836979c973b","name":"Sticky Note1"},{"parameters":{"formFields":{"values":[{"fieldLabel":"Leave your review below","fieldType":"textarea"}]},"options":{}},"type":"n8n-nodes-base.form","typeVersion":1,"position":[440,-200],"id":"9956a49e-964d-4269-910f-28ad8393548e","name":"If recommended","webhookId":"f8298b40-1f61-465b-b228-30a659075f30"}],"pinData":{},"connections":{"On form submission":{"main":[[{"node":"Switch","type":"main","index":0}]]},"Switch":{"main":[[{"node":"If recommended","type":"main","index":0}],[{"node":"If not recommended","type":"main","index":0}]]},"If not recommended":{"main":[[{"node":"Thanks for the feedback","type":"main","index":0}]]},"If recommended":{"main":[[{"node":"Thanks for the review","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1"},"versionId":"6797e22c-1b2b-421a-b16d-869f636d0790","meta":{"instanceId":"1f94e052868811125a74dc63385a38f60e7a14ab6e00497af83e8b68412ec251"},"id":"DCotkGqkv0VfT6QT","tags":[]},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.switch","version":3.2,"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"leftValue":"={{ $json['Would you recommend this site?'] }}","rightValue":"Yes","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"Yes"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"1dd9b1f5-6f48-4182-ae04-f47c37e3fa98","leftValue":"={{ $json['Would you recommend this site?'] }}","rightValue":"No","operator":{"type":"string","operation":"equals","name":"filter.operator.equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"No"}]},"options":{}},"position":[220,0]}],"connections":{"On form submission":{"main":[[{"node":"Switch","type":"main","index":0}]]},"Switch":{"main":[[{"node":"If recommended","type":"main","index":0}],[{"node":"If not recommended","type":"main","index":0}]]},"If not recommended":{"main":[[{"node":"Thanks for the feedback","type":"main","index":0}]]},"If recommended":{"main":[[{"node":"Thanks for the review","type":"main","index":0}]]}},"source":"docs/_workflows/integrations/builtin/core-nodes/n8n-nodes-base.form/mutually-exclusive-branching.json","description":"Workflow example from docs/_workflows/integrations/builtin/core-nodes/n8n-nodes-base.form/mutually-exclusive-branching.json"}]

troubleshooting_info:
  [{"issue":"Node parameters","solution":"Select the **Mode** the node should use:"},{"issue":"Rules","solution":"To configure the node with this operation, use these parameters:"},{"issue":"Rule options","solution":"You can further configure the node with this operation using these **Options**:"},{"issue":"Expression","solution":"To configure the node with this operation, use these parameters:"}]

node_connections:
  [{"fromNode":"Chat Trigger","toNode":"Check user input for \"chain\" or \"agent\"","connectionType":"main"},{"fromNode":"OpenAI Chat Model","toNode":"AI Agent","connectionType":"ai_languageModel"},{"fromNode":"OpenAI Chat Model1","toNode":"Basic LLM Chain","connectionType":"ai_languageModel"},{"fromNode":"Simple Memory","toNode":"AI Agent","connectionType":"ai_memory"},{"fromNode":"Wikipedia","toNode":"AI Agent","connectionType":"ai_tool"},{"fromNode":"Check user input for \"chain\" or \"agent\"","toNode":"AI Agent","connectionType":"main"},{"fromNode":"Check user input for \"chain\" or \"agent\"","toNode":"Basic LLM Chain","connectionType":"main"},{"fromNode":"GPT4 Model","toNode":"AI Agent","connectionType":"ai_languageModel"},{"fromNode":"Chat Trigger","toNode":"AI Agent","connectionType":"main"},{"fromNode":"Get column names","toNode":"Prepare output","connectionType":"main"},{"fromNode":"Get customer tool","toNode":"AI Agent","connectionType":"ai_tool"},{"fromNode":"List columns tool","toNode":"AI Agent","connectionType":"ai_tool"},{"fromNode":"Set Google Sheet URL","toNode":"Get Google sheet contents","connectionType":"main"},{"fromNode":"Get column values tool","toNode":"AI Agent","connectionType":"ai_tool"},{"fromNode":"Execute Workflow Trigger","toNode":"Set Google Sheet URL","connectionType":"main"},{"fromNode":"Get Google sheet contents","toNode":"Check operations","connectionType":"main"},{"fromNode":"Check operations","toNode":"Get column names","connectionType":"main"},{"fromNode":"Check operations","toNode":"Prepare column data","connectionType":"main"},{"fromNode":"Check operations","toNode":"Filter out other rows","connectionType":"main"},{"fromNode":"Prepare column data","toNode":"Prepare output","connectionType":"main"},{"fromNode":"Filter out other rows","toNode":"Prepare output","connectionType":"main"},{"fromNode":"On form submission","toNode":"Switch","connectionType":"main"},{"fromNode":"Switch","toNode":"Documentary questions","connectionType":"main"},{"fromNode":"Switch","toNode":"Action questions","connectionType":"main"},{"fromNode":"Switch","toNode":"Romance questions","connectionType":"main"},{"fromNode":"Switch","toNode":"Comedy questions","connectionType":"main"},{"fromNode":"Switch","toNode":"Drama questions","connectionType":"main"},{"fromNode":"Switch","toNode":"Multi-selection thank you","connectionType":"main"},{"fromNode":"Documentary questions","toNode":"Documentary thanks","connectionType":"main"},{"fromNode":"Action questions","toNode":"Action thanks","connectionType":"main"},{"fromNode":"Romance questions","toNode":"Romance thanks","connectionType":"main"},{"fromNode":"Comedy questions","toNode":"Comedy thanks","connectionType":"main"},{"fromNode":"Drama questions","toNode":"Drama thanks","connectionType":"main"},{"fromNode":"Switch","toNode":"If recommended","connectionType":"main"},{"fromNode":"Switch","toNode":"If not recommended","connectionType":"main"},{"fromNode":"If not recommended","toNode":"Thanks for the feedback","connectionType":"main"},{"fromNode":"If recommended","toNode":"Thanks for the review","connectionType":"main"}]

example_workflow:
  {"name":"Switch Example Workflow","nodes":[{"parameters":{},"id":"tb7kww0x18n7g18k60dfqu","name":"Switch","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: []
parameter_schemas: []
example_parameters: {"resource":"row","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:17
updated_at: 2025-06-12 08:59:17
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"

  --8<-- "_snippets/integrations/builtin/cluster-nodes/vector-store-rerank-results.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"}]

troubleshooting_info:
  [{"issue":"Node usage patterns","solution":"You can use the Supabase Vector Store node in the following patterns."},{"issue":"Use as a regular node to insert, update, and retrieve documents","solution":"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."},{"issue":"Connect directly to an AI agent as a tool","solution":"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."},{"issue":"Use a retriever to fetch documents","solution":"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."},{"issue":"Use the Vector Store Question Answer Tool to answer questions","solution":"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."},{"issue":"Node parameters","solution":"--8<-- \"_snippets/integrations/builtin/cluster-nodes/vector-store-mode-with-update.md\""},{"issue":"Get Many parameters","solution":"<!-- vale from-write-good.Weasel = YES -->"},{"issue":"Retrieve Documents (As Tool for AI Agent) parameters","solution":"* **Name**: The name of the vector store.\n* **Description**: Explain to the LLM what this tool does. A good, specific description allows LLMs to produce expected results more often.\n* **Table Name**: Enter the Supabase table to use.\n* **Limit**: Enter how many results to retrieve from the vector store. For example, set this to `10` to get the ten best results."},{"issue":"Update Documents","solution":"* **Table Name**: Enter the Supabase table to use.\n* **ID**: The ID of an embedding entry."},{"issue":"Query Name","solution":"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`."},{"issue":"Metadata Filter","solution":"--8<-- \"_snippets/integrations/builtin/cluster-nodes/langchain-root-nodes/vector-store-metadata-filter.md\""}]

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"row","options":[{"name":"Row","value":"row"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...RowDescription_1.rowOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...RowDescription_1.rowFields"}]


node_type: n8n-nodes-base.TimescaleDb
name: TimescaleDb
display_name: TimescaleDB
description: Add and update data in TimescaleDB
category: input
icon: file:timescale.svg
code_hash: 713e4569856e0462795d8d821badaf29b960c59683cb71520ce0d1e709b5c921
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.TimescaleDb
documentation_title: TimescaleDB node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"timescaledb","description":"Templates for timescaledb"}]
related_resources: []
required_scopes: []
parameter_schemas: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:19
updated_at: 2025-06-12 08:59:19
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.TimescaleDb = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const genericFunctions_1 = require("../Postgres/v1/genericFunctions");
  const pg_promise_1 = __importDefault(require("pg-promise"));
  class TimescaleDb {
      constructor() {
          this.description = {
              displayName: 'TimescaleDB',
              name: 'timescaleDb',
              icon: 'file:timescale.svg',
              group: ['input'],
              version: 1,
              description: 'Add and update data in TimescaleDB',
              defaults: {
                  name: 'TimescaleDB',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'timescaleDb',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      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,
                          sqlDialect: 'PostgreSQL',
                      },
                      displayOptions: {
                          show: {
                              operation: ['executeQuery'],
                          },
                      },
                      default: '',
                      placeholder: 'SELECT id, name FROM product WHERE quantity > $1 AND price <= $2',
                      required: true,
                      description: 'The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.',
                  },
                  {
                      displayName: 'Schema',
                      name: 'schema',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: 'public',
                      required: true,
                      description: 'Name of the schema the table belongs to',
                  },
                  {
                      displayName: 'Table',
                      name: 'table',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the table in which to insert data to',
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      placeholder: 'id,name,description',
                      description: 'Comma-separated list of the properties which should used as columns for the new rows',
                  },
                  {
                      displayName: 'Schema',
                      name: 'schema',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: 'public',
                      required: true,
                      description: 'Name of the schema the table belongs to',
                  },
                  {
                      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',
                  },
                  {
                      displayName: 'Return Fields',
                      name: 'returnFields',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert', 'update'],
                          },
                      },
                      default: '*',
                      description: 'Comma-separated list of the fields that the operation will return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      options: [
                          {
                              displayName: 'Mode',
                              name: 'mode',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Independently',
                                      value: 'independently',
                                      description: 'Execute each query independently',
                                  },
                                  {
                                      name: 'Multiple Queries',
                                      value: 'multiple',
                                      description: '<b>Default</b>. Sends multiple queries at once to database.',
                                  },
                                  {
                                      name: 'Transaction',
                                      value: 'transaction',
                                      description: 'Executes all queries in a single transaction',
                                  },
                              ],
                              default: 'multiple',
                              description: 'The way queries should be sent to database. Can be used in conjunction with <b>Continue on Fail</b>. See <a href="https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.timescaledb/">the docs</a> for more examples',
                          },
                          {
                              displayName: 'Query Parameters',
                              name: 'queryParams',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['executeQuery'],
                                  },
                              },
                              default: '',
                              placeholder: 'quantity,price',
                              description: 'Comma-separated list of properties which should be used as query parameters',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const credentials = await this.getCredentials('timescaleDb');
          const pgp = (0, pg_promise_1.default)();
          const config = {
              host: credentials.host,
              port: credentials.port,
              database: credentials.database,
              user: credentials.user,
              password: credentials.password,
              ssl: !['disable', undefined].includes(credentials.ssl),
              sslmode: credentials.ssl || 'disable',
          };
          const db = pgp(config);
          let returnItems = [];
          const items = this.getInputData();
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'executeQuery') {
              const queryResult = await genericFunctions_1.pgQueryV2.call(this, pgp, db, items, this.continueOnFail(), {
                  resolveExpression: true,
              });
              returnItems = this.helpers.returnJsonArray(queryResult);
          }
          else if (operation === 'insert') {
              const insertData = await (0, genericFunctions_1.pgInsert)(this.getNodeParameter, pgp, db, items, this.continueOnFail());
              for (let i = 0; i < insertData.length; i++) {
                  returnItems.push({
                      json: insertData[i],
                  });
              }
          }
          else if (operation === 'update') {
              const updateItems = await (0, genericFunctions_1.pgUpdate)(this.getNodeParameter, pgp, db, items, this.continueOnFail());
              returnItems = this.helpers.returnJsonArray(updateItems);
          }
          else {
              await db.$pool.end();
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`);
          }
          await db.$pool.end();
          return [returnItems];
      }
  }
  exports.TimescaleDb = TimescaleDb;
  //# sourceMappingURL=TimescaleDb.node.js.map

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

  # TimescaleDB node

  Use the TimescaleDB node to automate work in TimescaleDB, and integrate TimescaleDB with other applications. n8n has built-in support for a wide range of TimescaleDB features, including executing an SQL query, as well as inserting and updating rows in a database. 

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

  /// note | Credentials
  Refer to [TimescaleDB credentials](/integrations/builtin/credentials/timescaledb.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, 'timescaledb') ]]

  ## Specify a column's data type

  To specify a column's data type, append the column name with `:type`, where `type` is the data type you want for the column. For example, if you want to specify the type `int` for the column **id** and type `text` for the column **name**, you can use the following snippet in the **Columns** field: `id:int,name:text`.

troubleshooting_info:
  [{"issue":"Specify a column's data type","solution":"To specify a column's data type, append the column name with `:type`, where `type` is the data type you want for the column. For example, if you want to specify the type `int` for the column **id** and type `text` for the column **name**, you can use the following snippet in the **Columns** field: `id:int,name:text`."}]

example_workflow:
  {"name":"TimescaleDB Example Workflow","nodes":[{"parameters":{"operation":"executeQuery","query":"example-value","schema":"public","table":"example-value","columns":"example-value","updateKey":"id","returnFields":"*","additionalFields":{}},"id":"hnohqav28bgfyol4wijwe","name":"TimescaleDB","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"operation":"executeQuery","query":"example-value","schema":"public","table":"example-value","columns":"example-value","updateKey":"id","returnFields":"*","additionalFields":{}}

properties_schema:
  [{"displayName":"Operation","name":"operation","type":"options","default":"insert","description":"Execute an SQL query","options":[{"name":"Execute Query","value":"executeQuery","description":"Execute an SQL query"},{"name":"Insert","value":"insert","description":"Insert rows in database"},{"name":"Update","value":"update","description":"Update rows in database"}]},{"displayName":"Query","name":"query","type":"string","default":"","required":true,"description":"The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.","placeholder":"SELECT id, name FROM product WHERE quantity > $1 AND price <= $2"},{"displayName":"Schema","name":"schema","type":"string","default":"public","required":true,"description":"Name of the schema the table belongs to"},{"displayName":"Table","name":"table","type":"string","default":"","required":true,"description":"Name of the table in which to insert data to"},{"displayName":"Columns","name":"columns","type":"string","default":"","description":"Comma-separated list of the properties which should used as columns for the new rows","placeholder":"id,name,description"},{"displayName":"Schema","name":"schema","type":"string","default":"public","required":true,"description":"Name of the schema the table belongs to"},{"displayName":"Table","name":"table","type":"string","default":"","required":true,"description":"Name of the table in which to update data in"},{"displayName":"Update Key","name":"updateKey","type":"string","default":"id","required":true,"description":"Name of the property which decides which rows in the database should be updated. Normally that would be "},{"displayName":"Columns","name":"columns","type":"string","default":"","description":"Comma-separated list of the properties which should used as columns for rows to update","placeholder":"name,description"},{"displayName":"Return Fields","name":"returnFields","type":"string","default":"*","description":"Comma-separated list of the fields that the operation will return"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Execute each query independently","placeholder":"Add Field"}]


node_type: n8n-nodes-base.Tapfiliate
name: Tapfiliate
display_name: Tapfiliate
description: Consume Tapfiliate API
category: transform
icon: file:tapfiliate.svg
code_hash: 322284a7aa45ad766d6bfbf77223992d532b8fa418f9f4a1c231747871981d2e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Tapfiliate
documentation_title: Tapfiliate node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"tapfiliate","description":"Templates for tapfiliate"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"affiliate","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:19
updated_at: 2025-06-12 08:59:19
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Tapfiliate = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const AffiliateDescription_1 = require("./AffiliateDescription");
  const AffiliateMetadataDescription_1 = require("./AffiliateMetadataDescription");
  const ProgramAffiliateDescription_1 = require("./ProgramAffiliateDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Tapfiliate {
      constructor() {
          this.description = {
              displayName: 'Tapfiliate',
              name: 'tapfiliate',
              icon: 'file:tapfiliate.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}',
              description: 'Consume Tapfiliate API',
              defaults: {
                  name: 'Tapfiliate',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'tapfiliateApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Affiliate',
                              value: 'affiliate',
                          },
                          {
                              name: 'Affiliate Metadata',
                              value: 'affiliateMetadata',
                          },
                          {
                              name: 'Program Affiliate',
                              value: 'programAffiliate',
                          },
                      ],
                      default: 'affiliate',
                      required: true,
                  },
                  ...AffiliateDescription_1.affiliateOperations,
                  ...AffiliateDescription_1.affiliateFields,
                  ...AffiliateMetadataDescription_1.affiliateMetadataOperations,
                  ...AffiliateMetadataDescription_1.affiliateMetadataFields,
                  ...ProgramAffiliateDescription_1.programAffiliateOperations,
                  ...ProgramAffiliateDescription_1.programAffiliateFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getPrograms() {
                      const returnData = [];
                      const programs = await GenericFunctions_1.tapfiliateApiRequestAllItems.call(this, 'GET', '/programs/');
                      for (const program of programs) {
                          returnData.push({
                              name: program.title,
                              value: program.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a;
          const items = this.getInputData();
          const length = items.length;
          const qs = {};
          let responseData;
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'affiliate') {
                      if (operation === 'create') {
                          const firstname = this.getNodeParameter('firstname', i);
                          const lastname = this.getNodeParameter('lastname', i);
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              firstname,
                              lastname,
                              email,
                          };
                          Object.assign(body, additionalFields);
                          if (body.addressUi) {
                              body.address = body.addressUi.addressValues;
                              delete body.addressUi;
                              if (body.address.country) {
                                  body.address.country = {
                                      code: body.address.country,
                                  };
                              }
                          }
                          if (body.companyName) {
                              body.company = {
                                  name: body.companyName,
                              };
                              delete body.companyName;
                          }
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'POST', '/affiliates/', body);
                          returnData.push(responseData);
                      }
                      if (operation === 'delete') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'DELETE', `/affiliates/${affiliateId}/`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'GET', `/affiliates/${affiliateId}/`);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.tapfiliateApiRequestAllItems.call(this, 'GET', '/affiliates/', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'GET', '/affiliates/', {}, qs);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  if (resource === 'affiliateMetadata') {
                      if (operation === 'add') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          const metadata = ((_a = this.getNodeParameter('metadataUi', i)) === null || _a === void 0 ? void 0 : _a.metadataValues) || [];
                          if (metadata.length === 0) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Metadata cannot be empty.', {
                                  itemIndex: i,
                              });
                          }
                          for (const { key, value } of metadata) {
                              await GenericFunctions_1.tapfiliateApiRequest.call(this, 'PUT', `/affiliates/${affiliateId}/meta-data/${key}/`, { value });
                          }
                          responseData = { success: true };
                      }
                      if (operation === 'remove') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          const key = this.getNodeParameter('key', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'DELETE', `/affiliates/${affiliateId}/meta-data/${key}/`);
                          responseData = { success: true };
                      }
                      if (operation === 'update') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          const key = this.getNodeParameter('key', i);
                          const value = this.getNodeParameter('value', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'PUT', `/affiliates/${affiliateId}/meta-data/`, { [key]: value });
                      }
                  }
                  if (resource === 'programAffiliate') {
                      if (operation === 'add') {
                          const programId = this.getNodeParameter('programId', i);
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              affiliate: {
                                  id: affiliateId,
                              },
                          };
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'POST', `/programs/${programId}/affiliates/`, body);
                      }
                      if (operation === 'approve') {
                          const programId = this.getNodeParameter('programId', i);
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'PUT', `/programs/${programId}/affiliates/${affiliateId}/approved/`);
                      }
                      if (operation === 'disapprove') {
                          const programId = this.getNodeParameter('programId', i);
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'DELETE', `/programs/${programId}/affiliates/${affiliateId}/approved/`);
                      }
                      if (operation === 'get') {
                          const programId = this.getNodeParameter('programId', i);
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'GET', `/programs/${programId}/affiliates/${affiliateId}/`);
                      }
                      if (operation === 'getAll') {
                          const programId = this.getNodeParameter('programId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.tapfiliateApiRequestAllItems.call(this, 'GET', `/programs/${programId}/affiliates/`, {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'GET', `/programs/${programId}/affiliates/`, {}, qs);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Tapfiliate = Tapfiliate;
  //# sourceMappingURL=Tapfiliate.node.js.map

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

  // --- Next Credential File ---

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

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

  # Tapfiliate node

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

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

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

  ## Operations

  * Affiliate
      * Create an affiliate
      * Delete an affiliate
      * Get an affiliate by ID
      * Get all affiliates
  * Affiliate Metadata
      * Add metadata to affiliate
      * Remove metadata from affiliate
      * Update affiliate's metadata
  * Program Affiliate
      * Add affiliate to program
      * Approve an affiliate for a program
      * Disapprove an affiliate
      * Get an affiliate in a program
      * Get all affiliates in program

  ## Templates and examples

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"affiliate","required":true,"options":[{"name":"Affiliate","value":"affiliate"},{"name":"Affiliate Metadata","value":"affiliateMetadata"},{"name":"Program Affiliate","value":"programAffiliate"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AffiliateDescription_1.affiliateOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AffiliateDescription_1.affiliateFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AffiliateMetadataDescription_1.affiliateMetadataOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...AffiliateMetadataDescription_1.affiliateMetadataFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ProgramAffiliateDescription_1.programAffiliateOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ProgramAffiliateDescription_1.programAffiliateFields"}]


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: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"epic","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:59:19
updated_at: 2025-06-12 08:59:19
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":{"resource":"epic","dynamic_property":null},"id":"m9cpvkg88dvt52enyxy7e","name":"Taiga","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"issue","options":[{"name":"Epic","value":"epic"},{"name":"Issue","value":"issue"},{"name":"Task","value":"task"},{"name":"User Story","value":"userStory"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.epicOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.epicFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.issueOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.issueFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.taskOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.taskFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.userStoryOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.userStoryFields"}]


node_type: n8n-nodes-base.Telegram
name: Telegram
display_name: Telegram
description: Sends data to Telegram
category: output
icon: file:telegram.svg
code_hash: f3c5a39bf643219deb3a2978b9bea87fc66b9bd893b076fa8339233a39fd38c7
package_name: n8n-nodes-base
extracted_at: 2025-06-12 08:59:19
updated_at: 2025-06-12 08:59:19
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Telegram = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Telegram {
      constructor() {
          this.description = {
              displayName: 'Telegram',
              name: 'telegram',
              icon: 'file:telegram.svg',
              group: ['output'],
              version: [1, 1.1],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends data to Telegram',
              defaults: {
                  name: 'Telegram',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'telegramApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Chat',
                              value: 'chat',
                          },
                          {
                              name: 'Callback',
                              value: 'callback',
                          },
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Message',
                              value: 'message',
                          },
                      ],
                      default: 'message',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['chat'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get up to date information about a chat',
                              action: 'Get a chat',
                          },
                          {
                              name: 'Get Administrators',
                              value: 'administrators',
                              description: 'Get the Administrators of a chat',
                              action: 'Get all administrators in a chat',
                          },
                          {
                              name: 'Get Member',
                              value: 'member',
                              description: 'Get the member of a chat',
                              action: 'Get a member in a chat',
                          },
                          {
                              name: 'Leave',
                              value: 'leave',
                              description: 'Leave a group, supergroup or channel',
                              action: 'Leave a chat',
                          },
                          {
                              name: 'Set Description',
                              value: 'setDescription',
                              description: 'Set the description of a chat',
                              action: 'Set description on a chat',
                          },
                          {
                              name: 'Set Title',
                              value: 'setTitle',
                              description: 'Set the title of a chat',
                              action: 'Set a title on a chat',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['callback'],
                          },
                      },
                      options: [
                          {
                              name: 'Answer Query',
                              value: 'answerQuery',
                              description: 'Send answer to callback query sent from inline keyboard',
                              action: 'Answer Query a callback',
                          },
                          {
                              name: 'Answer Inline Query',
                              value: 'answerInlineQuery',
                              description: 'Send answer to callback query sent from inline bot',
                              action: 'Answer an inline query callback',
                          },
                      ],
                      default: 'answerQuery',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a file',
                              action: 'Get a file',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Delete Chat Message',
                              value: 'deleteMessage',
                              description: 'Delete a chat message',
                              action: 'Delete a chat message',
                          },
                          {
                              name: 'Edit Message Text',
                              value: 'editMessageText',
                              description: 'Edit a text message',
                              action: 'Edit a test message',
                          },
                          {
                              name: 'Pin Chat Message',
                              value: 'pinChatMessage',
                              description: 'Pin a chat message',
                              action: 'Pin a chat message',
                          },
                          {
                              name: 'Send Animation',
                              value: 'sendAnimation',
                              description: 'Send an animated file',
                              action: 'Send an animated file',
                          },
                          {
                              name: 'Send Audio',
                              value: 'sendAudio',
                              description: 'Send a audio file',
                              action: 'Send an audio file',
                          },
                          {
                              name: 'Send Chat Action',
                              value: 'sendChatAction',
                              description: 'Send a chat action',
                              action: 'Send a chat action',
                          },
                          {
                              name: 'Send Document',
                              value: 'sendDocument',
                              description: 'Send a document',
                              action: 'Send a document',
                          },
                          {
                              name: 'Send Location',
                              value: 'sendLocation',
                              description: 'Send a location',
                              action: 'Send a location',
                          },
                          {
                              name: 'Send Media Group',
                              value: 'sendMediaGroup',
                              description: 'Send group of photos or videos to album',
                              action: 'Send a media group message',
                          },
                          {
                              name: 'Send Message',
                              value: 'sendMessage',
                              description: 'Send a text message',
                              action: 'Send a text message',
                          },
                          {
                              name: 'Send Photo',
                              value: 'sendPhoto',
                              description: 'Send a photo',
                              action: 'Send a photo message',
                          },
                          {
                              name: 'Send Sticker',
                              value: 'sendSticker',
                              description: 'Send a sticker',
                              action: 'Send a sticker',
                          },
                          {
                              name: 'Send Video',
                              value: 'sendVideo',
                              description: 'Send a video',
                              action: 'Send a video',
                          },
                          {
                              name: 'Unpin Chat Message',
                              value: 'unpinChatMessage',
                              description: 'Unpin a chat message',
                              action: 'Unpin a chat message',
                          },
                      ],
                      default: 'sendMessage',
                  },
                  {
                      displayName: 'Chat ID',
                      name: 'chatId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: [
                                  'administrators',
                                  'deleteMessage',
                                  'get',
                                  'leave',
                                  'member',
                                  'pinChatMessage',
                                  'setDescription',
                                  'setTitle',
                                  'sendAnimation',
                                  'sendAudio',
                                  'sendChatAction',
                                  'sendDocument',
                                  'sendLocation',
                                  'sendMessage',
                                  'sendMediaGroup',
                                  'sendPhoto',
                                  'sendSticker',
                                  'sendVideo',
                                  'unpinChatMessage',
                              ],
                              resource: ['chat', 'message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier for the target chat or username of the target channel (in the format @channelusername)',
                  },
                  {
                      displayName: 'Message ID',
                      name: 'messageId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['deleteMessage'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the message to delete',
                  },
                  {
                      displayName: 'Message ID',
                      name: 'messageId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['pinChatMessage', 'unpinChatMessage'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the message to pin or unpin',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['pinChatMessage'],
                              resource: ['message'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Disable Notification',
                              name: 'disable_notification',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to send a notification to all chat members about the new pinned message',
                          },
                      ],
                  },
                  {
                      displayName: 'User ID',
                      name: 'userId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['member'],
                              resource: ['chat'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the target user',
                  },
                  {
                      displayName: 'Description',
                      name: 'description',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['setDescription'],
                              resource: ['chat'],
                          },
                      },
                      required: true,
                      description: 'New chat description, 0-255 characters',
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['setTitle'],
                              resource: ['chat'],
                          },
                      },
                      required: true,
                      description: 'New chat title, 1-255 characters',
                  },
                  {
                      displayName: 'Query ID',
                      name: 'queryId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['answerQuery'],
                              resource: ['callback'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier for the query to be answered',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['answerQuery'],
                              resource: ['callback'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Cache Time',
                              name: 'cache_time',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              default: 0,
                              description: 'The maximum amount of time in seconds that the result of the callback query may be cached client-side',
                          },
                          {
                              displayName: 'Show Alert',
                              name: 'show_alert',
                              type: 'boolean',
                              default: false,
                              description: 'Whether an alert will be shown by the client instead of a notification at the top of the chat screen',
                          },
                          {
                              displayName: 'Text',
                              name: 'text',
                              type: 'string',
                              default: '',
                              description: 'Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.',
                          },
                          {
                              displayName: 'URL',
                              name: 'url',
                              type: 'string',
                              default: '',
                              description: "URL that will be opened by the user's client",
                          },
                      ],
                  },
                  {
                      displayName: 'Query ID',
                      name: 'queryId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['answerInlineQuery'],
                              resource: ['callback'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier for the answered query',
                  },
                  {
                      displayName: 'Results',
                      name: 'results',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['answerInlineQuery'],
                              resource: ['callback'],
                          },
                      },
                      required: true,
                      description: 'A JSON-serialized array of results for the inline query',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['answerInlineQuery'],
                              resource: ['callback'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Cache Time',
                              name: 'cache_time',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              default: 0,
                              description: 'The maximum amount of time in seconds that the result of the callback query may be cached client-side',
                          },
                          {
                              displayName: 'Show Alert',
                              name: 'show_alert',
                              type: 'boolean',
                              default: false,
                              description: 'Whether an alert will be shown by the client instead of a notification at the top of the chat screen',
                          },
                          {
                              displayName: 'Text',
                              name: 'text',
                              type: 'string',
                              default: '',
                              description: 'Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.',
                          },
                          {
                              displayName: 'URL',
                              name: 'url',
                              type: 'string',
                              default: '',
                              description: "URL that will be opened by the user's client",
                          },
                      ],
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      required: true,
                      description: 'The ID of the file',
                  },
                  {
                      displayName: 'Download',
                      name: 'download',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      default: true,
                      description: 'Whether to download the file',
                  },
                  {
                      displayName: 'Message Type',
                      name: 'messageType',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Inline Message',
                              value: 'inlineMessage',
                          },
                          {
                              name: 'Message',
                              value: 'message',
                          },
                      ],
                      default: 'message',
                      description: 'The type of the message to edit',
                  },
                  {
                      displayName: 'Chat ID',
                      name: 'chatId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              messageType: ['message'],
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier for the target chat or username of the target channel (in the format @channelusername). To find your chat ID ask @get_id_bot.',
                  },
                  {
                      displayName: 'Binary Data',
                      name: 'binaryData',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: [
                                  'sendAnimation',
                                  'sendAudio',
                                  'sendDocument',
                                  'sendPhoto',
                                  'sendVideo',
                                  'sendSticker',
                              ],
                              resource: ['message'],
                          },
                      },
                      description: 'Whether the data to upload should be taken from binary field',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: [
                                  'sendAnimation',
                                  'sendAudio',
                                  'sendDocument',
                                  'sendPhoto',
                                  'sendVideo',
                                  'sendSticker',
                              ],
                              resource: ['message'],
                              binaryData: [true],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property that contains the data to upload',
                  },
                  {
                      displayName: 'Message ID',
                      name: 'messageId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              messageType: ['message'],
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the message to edit',
                  },
                  {
                      displayName: 'Inline Message ID',
                      name: 'inlineMessageId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              messageType: ['inlineMessage'],
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the inline message to edit',
                  },
                  {
                      displayName: 'Reply Markup',
                      name: 'replyMarkup',
                      displayOptions: {
                          show: {
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'None',
                              value: 'none',
                          },
                          {
                              name: 'Inline Keyboard',
                              value: 'inlineKeyboard',
                          },
                      ],
                      default: 'none',
                      description: 'Additional interface options',
                  },
                  {
                      displayName: 'Animation',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendAnimation'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Animation to send. Pass a file_id to send an animation that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get an animation from the Internet.',
                  },
                  {
                      displayName: 'Audio',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendAudio'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Audio file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
                  },
                  {
                      displayName: 'Action',
                      name: 'action',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['sendChatAction'],
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Find Location',
                              value: 'find_location',
                              action: 'Find location',
                          },
                          {
                              name: 'Record Audio',
                              value: 'record_audio',
                              action: 'Record audio',
                          },
                          {
                              name: 'Record Video',
                              value: 'record_video',
                              action: 'Record video',
                          },
                          {
                              name: 'Record Video Note',
                              value: 'record_video_note',
                              action: 'Record video note',
                          },
                          {
                              name: 'Typing',
                              value: 'typing',
                              action: 'Typing a message',
                          },
                          {
                              name: 'Upload Audio',
                              value: 'upload_audio',
                              action: 'Upload audio',
                          },
                          {
                              name: 'Upload Document',
                              value: 'upload_document',
                              action: 'Upload document',
                          },
                          {
                              name: 'Upload Photo',
                              value: 'upload_photo',
                              action: 'Upload photo',
                          },
                          {
                              name: 'Upload Video',
                              value: 'upload_video',
                              action: 'Upload video',
                          },
                          {
                              name: 'Upload Video Note',
                              value: 'upload_video_note',
                              action: 'Upload video note',
                          },
                      ],
                      default: 'typing',
                      description: 'Type of action to broadcast. Choose one, depending on what the user is about to receive. The status is set for 5 seconds or less (when a message arrives from your bot).',
                  },
                  {
                      displayName: 'Document',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendDocument'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Document to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
                  },
                  {
                      displayName: 'Latitude',
                      name: 'latitude',
                      type: 'number',
                      default: 0.0,
                      typeOptions: {
                          numberPrecision: 10,
                          minValue: -90,
                          maxValue: 90,
                      },
                      displayOptions: {
                          show: {
                              operation: ['sendLocation'],
                              resource: ['message'],
                          },
                      },
                      description: 'Location latitude',
                  },
                  {
                      displayName: 'Longitude',
                      name: 'longitude',
                      type: 'number',
                      typeOptions: {
                          numberPrecision: 10,
                          minValue: -180,
                          maxValue: 180,
                      },
                      default: 0.0,
                      displayOptions: {
                          show: {
                              operation: ['sendLocation'],
                              resource: ['message'],
                          },
                      },
                      description: 'Location longitude',
                  },
                  {
                      displayName: 'Media',
                      name: 'media',
                      type: 'fixedCollection',
                      displayOptions: {
                          show: {
                              operation: ['sendMediaGroup'],
                              resource: ['message'],
                          },
                      },
                      description: 'The media to add',
                      placeholder: 'Add Media',
                      typeOptions: {
                          multipleValues: true,
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Media',
                              name: 'media',
                              values: [
                                  {
                                      displayName: 'Type',
                                      name: 'type',
                                      type: 'options',
                                      options: [
                                          {
                                              name: 'Photo',
                                              value: 'photo',
                                          },
                                          {
                                              name: 'Video',
                                              value: 'video',
                                          },
                                      ],
                                      default: 'photo',
                                      description: 'The type of the media to add',
                                  },
                                  {
                                      displayName: 'Media File',
                                      name: 'media',
                                      type: 'string',
                                      default: '',
                                      description: 'Media to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass an HTTP URL for Telegram to get a file from the Internet.',
                                  },
                                  {
                                      displayName: 'Additional Fields',
                                      name: 'additionalFields',
                                      type: 'collection',
                                      placeholder: 'Add Field',
                                      default: {},
                                      options: [
                                          {
                                              displayName: 'Caption',
                                              name: 'caption',
                                              type: 'string',
                                              default: '',
                                              description: 'Caption text to set, 0-1024 characters',
                                          },
                                          {
                                              displayName: 'Parse Mode',
                                              name: 'parse_mode',
                                              type: 'options',
                                              options: [
                                                  {
                                                      name: 'Markdown',
                                                      value: 'Markdown',
                                                  },
                                                  {
                                                      name: 'HTML',
                                                      value: 'HTML',
                                                  },
                                              ],
                                              default: 'HTML',
                                              description: 'How to parse the text',
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Text',
                      name: 'text',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['editMessageText', 'sendMessage'],
                              resource: ['message'],
                          },
                      },
                      description: 'Text of the message to be sent',
                  },
                  {
                      displayName: 'Photo',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendPhoto'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Photo to send. Pass a file_id to send a photo that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a photo from the Internet.',
                  },
                  {
                      displayName: 'Sticker',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendSticker'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Sticker to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a .webp file from the Internet.',
                  },
                  {
                      displayName: 'Video',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendVideo'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Video file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
                  },
                  {
                      displayName: 'Reply Markup',
                      name: 'replyMarkup',
                      displayOptions: {
                          show: {
                              operation: [
                                  'sendAnimation',
                                  'sendDocument',
                                  'sendMessage',
                                  'sendPhoto',
                                  'sendSticker',
                                  'sendVideo',
                                  'sendAudio',
                                  'sendLocation',
                              ],
                              resource: ['message'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'Force Reply',
                              value: 'forceReply',
                          },
                          {
                              name: 'Inline Keyboard',
                              value: 'inlineKeyboard',
                          },
                          {
                              name: 'None',
                              value: 'none',
                          },
                          {
                              name: 'Reply Keyboard',
                              value: 'replyKeyboard',
                          },
                          {
                              name: 'Reply Keyboard Remove',
                              value: 'replyKeyboardRemove',
                          },
                      ],
                      default: 'none',
                      description: 'Additional interface options',
                  },
                  {
                      displayName: 'Force Reply',
                      name: 'forceReply',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              replyMarkup: ['forceReply'],
                              resource: ['message'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Force Reply',
                              name: 'force_reply',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to show reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply',
                          },
                          {
                              displayName: 'Selective',
                              name: 'selective',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to force reply from specific users only',
                          },
                      ],
                  },
                  {
                      displayName: 'Inline Keyboard',
                      name: 'inlineKeyboard',
                      placeholder: 'Add Keyboard Row',
                      description: 'Adds an inline keyboard that appears right next to the message it belongs to',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              replyMarkup: ['inlineKeyboard'],
                              resource: ['message'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Rows',
                              name: 'rows',
                              values: [
                                  {
                                      displayName: 'Row',
                                      name: 'row',
                                      type: 'fixedCollection',
                                      description: 'The value to set',
                                      placeholder: 'Add Button',
                                      typeOptions: {
                                          multipleValues: true,
                                      },
                                      default: {},
                                      options: [
                                          {
                                              displayName: 'Buttons',
                                              name: 'buttons',
                                              values: [
                                                  {
                                                      displayName: 'Text',
                                                      name: 'text',
                                                      type: 'string',
                                                      default: '',
                                                      description: 'Label text on the button',
                                                  },
                                                  {
                                                      displayName: 'Additional Fields',
                                                      name: 'additionalFields',
                                                      type: 'collection',
                                                      placeholder: 'Add Field',
                                                      default: {},
                                                      options: [
                                                          {
                                                              displayName: 'Callback Data',
                                                              name: 'callback_data',
                                                              type: 'string',
                                                              default: '',
                                                              description: 'Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes',
                                                          },
                                                          {
                                                              displayName: 'Pay',
                                                              name: 'pay',
                                                              type: 'boolean',
                                                              default: false,
                                                              description: 'Whether to send a Pay button',
                                                          },
                                                          {
                                                              displayName: 'Switch Inline Query Current Chat',
                                                              name: 'switch_inline_query_current_chat',
                                                              type: 'string',
                                                              default: '',
                                                              description: "If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field.Can be empty, in which case only the bot’s username will be inserted",
                                                          },
                                                          {
                                                              displayName: 'Switch Inline Query',
                                                              name: 'switch_inline_query',
                                                              type: 'string',
                                                              default: '',
                                                              description: 'If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.',
                                                          },
                                                          {
                                                              displayName: 'URL',
                                                              name: 'url',
                                                              type: 'string',
                                                              default: '',
                                                              description: 'HTTP or tg:// URL to be opened when button is pressed',
                                                          },
                                                      ],
                                                  },
                                              ],
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Reply Keyboard',
                      name: 'replyKeyboard',
                      placeholder: 'Add Reply Keyboard Row',
                      description: 'Adds a custom keyboard with reply options',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              replyMarkup: ['replyKeyboard'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Rows',
                              name: 'rows',
                              values: [
                                  {
                                      displayName: 'Row',
                                      name: 'row',
                                      type: 'fixedCollection',
                                      description: 'The value to set',
                                      placeholder: 'Add Button',
                                      typeOptions: {
                                          multipleValues: true,
                                      },
                                      default: {},
                                      options: [
                                          {
                                              displayName: 'Buttons',
                                              name: 'buttons',
                                              values: [
                                                  {
                                                      displayName: 'Text',
                                                      name: 'text',
                                                      type: 'string',
                                                      default: '',
                                                      description: 'Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed.',
                                                  },
                                                  {
                                                      displayName: 'Additional Fields',
                                                      name: 'additionalFields',
                                                      type: 'collection',
                                                      placeholder: 'Add Field',
                                                      default: {},
                                                      options: [
                                                          {
                                                              displayName: 'Request Contact',
                                                              name: 'request_contact',
                                                              type: 'boolean',
                                                              default: false,
                                                              description: "Whether the user's phone number will be sent as a contact when the button is pressed.Available in private chats only",
                                                          },
                                                          {
                                                              displayName: 'Request Location',
                                                              name: 'request_location',
                                                              type: 'boolean',
                                                              default: false,
                                                              description: "Whether the user's request_location",
                                                          },
                                                      ],
                                                  },
                                              ],
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Reply Keyboard Options',
                      name: 'replyKeyboardOptions',
                      type: 'collection',
                      placeholder: 'Add Option',
                      displayOptions: {
                          show: {
                              replyMarkup: ['replyKeyboard'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Resize Keyboard',
                              name: 'resize_keyboard',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to request clients to resize the keyboard vertically for optimal fit',
                          },
                          {
                              displayName: 'One Time Keyboard',
                              name: 'one_time_keyboard',
                              type: 'boolean',
                              default: false,
                              description: "Whether to request clients to hide the keyboard as soon as it's been used",
                          },
                          {
                              displayName: 'Selective',
                              name: 'selective',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to show the keyboard to specific users only',
                          },
                      ],
                  },
                  {
                      displayName: 'Reply Keyboard Remove',
                      name: 'replyKeyboardRemove',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              replyMarkup: ['replyKeyboardRemove'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Remove Keyboard',
                              name: 'remove_keyboard',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to request clients to remove the custom keyboard',
                          },
                          {
                              displayName: 'Selective',
                              name: 'selective',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to force reply from specific users only',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: [
                                  'editMessageText',
                                  'sendAnimation',
                                  'sendAudio',
                                  'sendDocument',
                                  'sendLocation',
                                  'sendMessage',
                                  'sendMediaGroup',
                                  'sendPhoto',
                                  'sendSticker',
                                  'sendVideo',
                              ],
                              resource: ['message'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Append n8n Attribution',
                              name: 'appendAttribution',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to include the phrase “This message was sent automatically with n8n” to the end of the message',
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendMessage'],
                                  },
                              },
                          },
                          {
                              displayName: 'Caption',
                              name: 'caption',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': [
                                          'sendAnimation',
                                          'sendAudio',
                                          'sendDocument',
                                          'sendPhoto',
                                          'sendVideo',
                                      ],
                                  },
                              },
                              default: '',
                              description: 'Caption text to set, 0-1024 characters',
                          },
                          {
                              displayName: 'Disable Notification',
                              name: 'disable_notification',
                              type: 'boolean',
                              default: false,
                              displayOptions: {
                                  hide: {
                                      '/operation': ['editMessageText'],
                                  },
                              },
                              description: 'Whether to send the message silently. Users will receive a notification with no sound.',
                          },
                          {
                              displayName: 'Disable WebPage Preview',
                              name: 'disable_web_page_preview',
                              type: 'boolean',
                              displayOptions: {
                                  show: {
                                      '/operation': ['editMessageText', 'sendMessage'],
                                  },
                              },
                              default: false,
                              description: 'Whether to disable link previews for links in this message',
                          },
                          {
                              displayName: 'Duration',
                              name: 'duration',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAnimation', 'sendAudio', 'sendVideo'],
                                  },
                              },
                              default: 0,
                              description: 'Duration of clip in seconds',
                          },
                          {
                              displayName: 'File Name',
                              name: 'fileName',
                              type: 'string',
                              default: '',
                              displayOptions: {
                                  show: {
                                      '/operation': [
                                          'sendAnimation',
                                          'sendAudio',
                                          'sendDocument',
                                          'sendPhoto',
                                          'sendVideo',
                                          'sendSticker',
                                      ],
                                      '/resource': ['message'],
                                      '/binaryData': [true],
                                  },
                              },
                              placeholder: 'image.jpeg',
                          },
                          {
                              displayName: 'Height',
                              name: 'height',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAnimation', 'sendVideo'],
                                  },
                              },
                              default: 0,
                              description: 'Height of the video',
                          },
                          {
                              displayName: 'Parse Mode',
                              name: 'parse_mode',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Markdown',
                                      value: 'Markdown',
                                  },
                                  {
                                      name: 'HTML',
                                      value: 'HTML',
                                  },
                              ],
                              displayOptions: {
                                  show: {
                                      '/operation': [
                                          'editMessageText',
                                          'sendAnimation',
                                          'sendAudio',
                                          'sendMessage',
                                          'sendPhoto',
                                          'sendVideo',
                                          'sendDocument',
                                      ],
                                  },
                              },
                              default: 'HTML',
                              description: 'How to parse the text',
                          },
                          {
                              displayName: 'Performer',
                              name: 'performer',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAudio'],
                                  },
                              },
                              default: '',
                              description: 'Name of the performer',
                          },
                          {
                              displayName: 'Reply To Message ID',
                              name: 'reply_to_message_id',
                              type: 'number',
                              displayOptions: {
                                  hide: {
                                      '/operation': ['editMessageText'],
                                  },
                              },
                              default: 0,
                              description: 'If the message is a reply, ID of the original message',
                          },
                          {
                              displayName: 'Message Thread ID',
                              name: 'message_thread_id',
                              type: 'number',
                              displayOptions: {
                                  show: {
                                      '/operation': [
                                          'sendAnimation',
                                          'sendAudio',
                                          'sendChatAction',
                                          'sendDocument',
                                          'sendLocation',
                                          'sendMediaGroup',
                                          'sendMessage',
                                          'sendPhoto',
                                          'sendSticker',
                                          'sendVideo',
                                      ],
                                  },
                              },
                              default: 0,
                              description: 'The unique identifier of the forum topic',
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAudio'],
                                  },
                              },
                              default: '',
                              description: 'Title of the track',
                          },
                          {
                              displayName: 'Thumbnail',
                              name: 'thumb',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAnimation', 'sendAudio', 'sendDocument', 'sendVideo'],
                                  },
                              },
                              default: '',
                              description: 'Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320.',
                          },
                          {
                              displayName: 'Width',
                              name: 'width',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAnimation', 'sendVideo'],
                                  },
                              },
                              default: 0,
                              description: 'Width of the video',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          var _a, _b;
          const items = this.getInputData();
          const returnData = [];
          let body;
          let qs;
          let requestMethod;
          let endpoint;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          const binaryData = this.getNodeParameter('binaryData', 0, false);
          const nodeVersion = this.getNode().typeVersion;
          const instanceId = this.getInstanceId();
          for (let i = 0; i < items.length; i++) {
              try {
                  requestMethod = 'POST';
                  endpoint = '';
                  body = {};
                  qs = {};
                  if (resource === 'callback') {
                      if (operation === 'answerQuery') {
                          endpoint = 'answerCallbackQuery';
                          body.callback_query_id = this.getNodeParameter('queryId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                      }
                      else if (operation === 'answerInlineQuery') {
                          endpoint = 'answerInlineQuery';
                          body.inline_query_id = this.getNodeParameter('queryId', i);
                          body.results = this.getNodeParameter('results', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                      }
                  }
                  else if (resource === 'chat') {
                      if (operation === 'get') {
                          endpoint = 'getChat';
                          body.chat_id = this.getNodeParameter('chatId', i);
                      }
                      else if (operation === 'administrators') {
                          endpoint = 'getChatAdministrators';
                          body.chat_id = this.getNodeParameter('chatId', i);
                      }
                      else if (operation === 'leave') {
                          endpoint = 'leaveChat';
                          body.chat_id = this.getNodeParameter('chatId', i);
                      }
                      else if (operation === 'member') {
                          endpoint = 'getChatMember';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.user_id = this.getNodeParameter('userId', i);
                      }
                      else if (operation === 'setDescription') {
                          endpoint = 'setChatDescription';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.description = this.getNodeParameter('description', i);
                      }
                      else if (operation === 'setTitle') {
                          endpoint = 'setChatTitle';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.title = this.getNodeParameter('title', i);
                      }
                  }
                  else if (resource === 'file') {
                      if (operation === 'get') {
                          endpoint = 'getFile';
                          body.file_id = this.getNodeParameter('fileId', i);
                      }
                  }
                  else if (resource === 'message') {
                      if (operation === 'editMessageText') {
                          endpoint = 'editMessageText';
                          const messageType = this.getNodeParameter('messageType', i);
                          if (messageType === 'inlineMessage') {
                              body.inline_message_id = this.getNodeParameter('inlineMessageId', i);
                          }
                          else {
                              body.chat_id = this.getNodeParameter('chatId', i);
                              body.message_id = this.getNodeParameter('messageId', i);
                          }
                          body.text = this.getNodeParameter('text', i);
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'deleteMessage') {
                          endpoint = 'deleteMessage';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.message_id = this.getNodeParameter('messageId', i);
                      }
                      else if (operation === 'pinChatMessage') {
                          endpoint = 'pinChatMessage';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.message_id = this.getNodeParameter('messageId', i);
                          const { disable_notification } = this.getNodeParameter('additionalFields', i);
                          if (disable_notification) {
                              body.disable_notification = true;
                          }
                      }
                      else if (operation === 'unpinChatMessage') {
                          endpoint = 'unpinChatMessage';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.message_id = this.getNodeParameter('messageId', i);
                      }
                      else if (operation === 'sendAnimation') {
                          endpoint = 'sendAnimation';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.animation = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendAudio') {
                          endpoint = 'sendAudio';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.audio = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendChatAction') {
                          endpoint = 'sendChatAction';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.action = this.getNodeParameter('action', i);
                      }
                      else if (operation === 'sendDocument') {
                          endpoint = 'sendDocument';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.document = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendLocation') {
                          endpoint = 'sendLocation';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.latitude = this.getNodeParameter('latitude', i);
                          body.longitude = this.getNodeParameter('longitude', i);
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendMessage') {
                          endpoint = 'sendMessage';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.text = this.getNodeParameter('text', i);
                          GenericFunctions_1.addAdditionalFields.call(this, body, i, nodeVersion, instanceId);
                      }
                      else if (operation === 'sendMediaGroup') {
                          endpoint = 'sendMediaGroup';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                          const mediaItems = this.getNodeParameter('media', i);
                          body.media = [];
                          for (const mediaItem of mediaItems.media) {
                              if (mediaItem.additionalFields !== undefined) {
                                  Object.assign(mediaItem, mediaItem.additionalFields);
                                  delete mediaItem.additionalFields;
                              }
                              body.media.push(mediaItem);
                          }
                      }
                      else if (operation === 'sendPhoto') {
                          endpoint = 'sendPhoto';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.photo = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendSticker') {
                          endpoint = 'sendSticker';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.sticker = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendVideo') {
                          endpoint = 'sendVideo';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.video = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  let responseData;
                  if (binaryData) {
                      const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0);
                      const itemBinaryData = items[i].binary[binaryPropertyName];
                      const propertyName = (0, GenericFunctions_1.getPropertyName)(operation);
                      const fileName = this.getNodeParameter('additionalFields.fileName', 0, '');
                      const filename = fileName || ((_a = itemBinaryData.fileName) === null || _a === void 0 ? void 0 : _a.toString());
                      if (!fileName && !itemBinaryData.fileName) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `File name is needed to ${operation}. Make sure the property that holds the binary data
  						has the file name property set or set it manually in the node using the File Name parameter under
  						Additional Fields.`);
                      }
                      body.disable_notification = ((_b = body.disable_notification) === null || _b === void 0 ? void 0 : _b.toString()) || 'false';
                      let uploadData;
                      if (itemBinaryData.id) {
                          uploadData = await this.helpers.getBinaryStream(itemBinaryData.id);
                      }
                      else {
                          uploadData = Buffer.from(itemBinaryData.data, n8n_workflow_1.BINARY_ENCODING);
                      }
                      const formData = {
                          ...body,
                          [propertyName]: {
                              value: uploadData,
                              options: {
                                  filename,
                                  contentType: itemBinaryData.mimeType,
                              },
                          },
                      };
                      responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endpoint, {}, qs, { formData });
                  }
                  else {
                      responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endpoint, body, qs);
                  }
                  if (resource === 'file' && operation === 'get') {
                      if (this.getNodeParameter('download', i, false)) {
                          const filePath = responseData.result.file_path;
                          const credentials = await this.getCredentials('telegramApi');
                          const file = await GenericFunctions_1.apiRequest.call(this, 'GET', '', {}, {}, {
                              json: false,
                              encoding: null,
                              uri: `https://api.telegram.org/file/bot${credentials.accessToken}/${filePath}`,
                              resolveWithFullResponse: true,
                              useStream: true,
                          });
                          const fileName = filePath.split('/').pop();
                          const data = await this.helpers.prepareBinaryData(file.body, fileName);
                          returnData.push({
                              json: responseData,
                              binary: { data },
                              pairedItem: { item: i },
                          });
                          continue;
                      }
                  }
                  else if (resource === 'chat' && operation === 'administrators') {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.result), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: {}, error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Telegram = Telegram;
  //# sourceMappingURL=Telegram.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TelegramApi = void 0;
  class TelegramApi {
      constructor() {
          this.name = 'telegramApi';
          this.displayName = 'Telegram API';
          this.documentationUrl = 'telegram';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Chat with the <a href="https://telegram.me/botfather">bot father</a> to obtain the access token',
              },
          ];
          this.test = {
              request: {
                  baseURL: '=https://api.telegram.org/bot{{$credentials.accessToken}}',
                  url: '/getMe',
              },
          };
      }
  }
  exports.TelegramApi = TelegramApi;
  //# sourceMappingURL=TelegramApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TelegramApi = void 0;
  class TelegramApi {
      constructor() {
          this.name = 'telegramApi';
          this.displayName = 'Telegram API';
          this.documentationUrl = 'telegram';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Chat with the <a href="https://telegram.me/botfather">bot father</a> to obtain the access token',
              },
          ];
          this.test = {
              request: {
                  baseURL: '=https://api.telegram.org/bot{{$credentials.accessToken}}',
                  url: '/getMe',
              },
          };
      }
  }
  exports.TelegramApi = TelegramApi;
  //# sourceMappingURL=TelegramApi.credentials.js.map

example_workflow:
  {"name":"Telegram Example Workflow","nodes":[{"parameters":{"resource":"chat","operation":"deleteMessage","chatId":"example-value","messageId":"example-value","additionalFields":{},"userId":"example-value","description":"example-value","title":"example-value","queryId":"example-value","results":"example-value","fileId":"example-value","download":true,"messageType":"inlineMessage","binaryData":false,"binaryPropertyName":"Example Name","inlineMessageId":"example-value","replyMarkup":"forceReply","file":"example-value","action":"find_location","latitude":10,"longitude":10,"media":{},"text":"example-value","forceReply":{},"inlineKeyboard":{},"replyKeyboard":{},"replyKeyboardOptions":{},"replyKeyboardRemove":{}},"id":"9pncxpqw9e9eqfci23jus7","name":"Telegram","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"resource":"chat","operation":"deleteMessage","chatId":"example-value","messageId":"example-value","additionalFields":{},"userId":"example-value","description":"example-value","title":"example-value","queryId":"example-value","results":"example-value","fileId":"example-value","download":true,"messageType":"inlineMessage","binaryData":false,"binaryPropertyName":"Example Name","inlineMessageId":"example-value","replyMarkup":"forceReply","file":"example-value","action":"find_location","latitude":10,"longitude":10,"media":{},"text":"example-value","forceReply":{},"inlineKeyboard":{},"replyKeyboard":{},"replyKeyboardOptions":{},"replyKeyboardRemove":{}}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"message","options":[{"name":"Chat","value":"chat"},{"name":"Callback","value":"callback"},{"name":"File","value":"file"},{"name":"Message","value":"message"}]},{"displayName":"Operation","name":"operation","type":"options","default":"get","description":"Get up to date information about a chat","options":[{"name":"Get","value":"get","description":"Get up to date information about a chat"},{"name":"Get Administrators","value":"administrators","description":"Get the Administrators of a chat"},{"name":"Get Member","value":"member","description":"Get the member of a chat"},{"name":"Leave","value":"leave","description":"Leave a group, supergroup or channel"},{"name":"Set Description","value":"setDescription","description":"Set the description of a chat"},{"name":"Set Title","value":"setTitle","description":"Set the title of a chat"}]},{"displayName":"Operation","name":"operation","type":"options","default":"answerQuery","description":"Send answer to callback query sent from inline keyboard","options":[{"name":"Answer Query","value":"answerQuery","description":"Send answer to callback query sent from inline keyboard"},{"name":"Answer Inline Query","value":"answerInlineQuery","description":"Send answer to callback query sent from inline bot"}]},{"displayName":"Operation","name":"operation","type":"options","default":"get","description":"Get a file","options":[{"name":"Get","value":"get","description":"Get a file"}]},{"displayName":"Operation","name":"operation","type":"options","default":"sendMessage","description":"Delete a chat message","options":[{"name":"Delete Chat Message","value":"deleteMessage","description":"Delete a chat message"},{"name":"Edit Message Text","value":"editMessageText","description":"Edit a text message"},{"name":"Pin Chat Message","value":"pinChatMessage","description":"Pin a chat message"},{"name":"Send Animation","value":"sendAnimation","description":"Send an animated file"},{"name":"Send Audio","value":"sendAudio","description":"Send a audio file"},{"name":"Send Chat Action","value":"sendChatAction","description":"Send a chat action"},{"name":"Send Document","value":"sendDocument","description":"Send a document"},{"name":"Send Location","value":"sendLocation","description":"Send a location"},{"name":"Send Media Group","value":"sendMediaGroup","description":"Send group of photos or videos to album"},{"name":"Send Message","value":"sendMessage","description":"Send a text message"},{"name":"Send Photo","value":"sendPhoto","description":"Send a photo"},{"name":"Send Sticker","value":"sendSticker","description":"Send a sticker"},{"name":"Send Video","value":"sendVideo","description":"Send a video"},{"name":"Unpin Chat Message","value":"unpinChatMessage","description":"Unpin a chat message"}]},{"displayName":"Chat ID","name":"chatId","type":"string","default":"","required":true,"description":"Unique identifier for the target chat or username of the target channel (in the format @channelusername)"},{"displayName":"Message ID","name":"messageId","type":"string","default":"","required":true,"description":"Unique identifier of the message to delete"},{"displayName":"Message ID","name":"messageId","type":"string","default":"","required":true,"description":"Unique identifier of the message to pin or unpin"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Whether to send a notification to all chat members about the new pinned message","placeholder":"Add Field"},{"displayName":"User ID","name":"userId","type":"string","default":"","required":true,"description":"Unique identifier of the target user"},{"displayName":"Description","name":"description","type":"string","default":"","required":true,"description":"New chat description, 0-255 characters"},{"displayName":"Title","name":"title","type":"string","default":"","required":true,"description":"New chat title, 1-255 characters"},{"displayName":"Query ID","name":"queryId","type":"string","default":"","required":true,"description":"Unique identifier for the query to be answered"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The maximum amount of time in seconds that the result of the callback query may be cached client-side","placeholder":"Add Field"},{"displayName":"Query ID","name":"queryId","type":"string","default":"","required":true,"description":"Unique identifier for the answered query"},{"displayName":"Results","name":"results","type":"string","default":"","required":true,"description":"A JSON-serialized array of results for the inline query"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The maximum amount of time in seconds that the result of the callback query may be cached client-side","placeholder":"Add Field"},{"displayName":"File ID","name":"fileId","type":"string","default":"","required":true,"description":"The ID of the file"},{"displayName":"Download","name":"download","type":"boolean","default":true,"description":"Whether to download the file"},{"displayName":"Message Type","name":"messageType","type":"options","default":"message","description":"The type of the message to edit","options":[{"name":"Inline Message","value":"inlineMessage"},{"name":"Message","value":"message"}]},{"displayName":"Chat ID","name":"chatId","type":"string","default":"","required":true,"description":"Unique identifier for the target chat or username of the target channel (in the format @channelusername). To find your chat ID ask @get_id_bot."},{"displayName":"Binary Data","name":"binaryData","type":"boolean","default":false,"required":true,"description":"Whether the data to upload should be taken from binary field"},{"displayName":"Binary Property","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Name of the binary property that contains the data to upload"},{"displayName":"Message ID","name":"messageId","type":"string","default":"","required":true,"description":"Unique identifier of the message to edit"},{"displayName":"Inline Message ID","name":"inlineMessageId","type":"string","default":"","required":true,"description":"Unique identifier of the inline message to edit"},{"displayName":"Reply Markup","name":"replyMarkup","type":"options","default":"none","description":"Additional interface options","options":[{"name":"None","value":"none"},{"name":"Inline Keyboard","value":"inlineKeyboard"}]},{"displayName":"Animation","name":"file","type":"string","default":"","description":"Animation to send. Pass a file_id to send an animation that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get an animation from the Internet."},{"displayName":"Audio","name":"file","type":"string","default":"","description":"Audio file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet."},{"displayName":"Action","name":"action","type":"options","default":"typing","description":"Type of action to broadcast. Choose one, depending on what the user is about to receive. The status is set for 5 seconds or less (when a message arrives from your bot).","options":[{"name":"Find Location","value":"find_location"},{"name":"Record Audio","value":"record_audio"},{"name":"Record Video","value":"record_video"},{"name":"Record Video Note","value":"record_video_note"},{"name":"Typing","value":"typing"},{"name":"Upload Audio","value":"upload_audio"},{"name":"Upload Document","value":"upload_document"},{"name":"Upload Photo","value":"upload_photo"},{"name":"Upload Video","value":"upload_video"},{"name":"Upload Video Note","value":"upload_video_note"}]},{"displayName":"Document","name":"file","type":"string","default":"","description":"Document to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet."},{"displayName":"Latitude","name":"latitude","type":"number","default":0,"description":"Location latitude"},{"displayName":"Longitude","name":"longitude","type":"number","default":0,"description":"Location longitude"},{"displayName":"Media","name":"media","type":"fixedCollection","default":"{","description":"The media to add","placeholder":"Add Media"},{"displayName":"Text","name":"text","type":"string","default":"","required":true,"description":"Text of the message to be sent"},{"displayName":"Photo","name":"file","type":"string","default":"","description":"Photo to send. Pass a file_id to send a photo that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a photo from the Internet."},{"displayName":"Sticker","name":"file","type":"string","default":"","description":"Sticker to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a .webp file from the Internet."},{"displayName":"Video","name":"file","type":"string","default":"","description":"Video file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet."},{"displayName":"Reply Markup","name":"replyMarkup","type":"options","default":"none","description":"Additional interface options","options":[{"name":"Force Reply","value":"forceReply"},{"name":"Inline Keyboard","value":"inlineKeyboard"},{"name":"None","value":"none"},{"name":"Reply Keyboard","value":"replyKeyboard"},{"name":"Reply Keyboard Remove","value":"replyKeyboardRemove"}]},{"displayName":"Force Reply","name":"forceReply","type":"collection","default":"{","description":"Whether to show reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply","placeholder":"Add Field"},{"displayName":"Inline Keyboard","name":"inlineKeyboard","type":"fixedCollection","default":"{","description":"Adds an inline keyboard that appears right next to the message it belongs to","placeholder":"Add Keyboard Row"},{"displayName":"Reply Keyboard","name":"replyKeyboard","type":"fixedCollection","default":"{","description":"Adds a custom keyboard with reply options","placeholder":"Add Reply Keyboard Row"},{"displayName":"Reply Keyboard Options","name":"replyKeyboardOptions","type":"collection","default":"{","description":"Whether to request clients to resize the keyboard vertically for optimal fit","placeholder":"Add Option"},{"displayName":"Reply Keyboard Remove","name":"replyKeyboardRemove","type":"collection","default":"{","description":"Whether to request clients to remove the custom keyboard","placeholder":"Add Field"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Whether to include the phrase “This message was sent automatically with n8n” to the end of the message","placeholder":"Add Field"}]


