# nodes

node_type: n8n-nodes-base.Segment
name: Segment
display_name: Segment
description: Consume Segment API
category: output
icon: file:segment.svg
code_hash: 9fc9d8949d7a2d9b8ae94a10b699705756e1f9f2cb2e6a0feeff301b5108b19d
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Segment
documentation_title: Segment node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"segment","description":"Templates for segment"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:32
updated_at: 2025-06-09 15:18:32
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Segment = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const GroupDescription_1 = require("./GroupDescription");
  const IdentifyDescription_1 = require("./IdentifyDescription");
  const TrackDescription_1 = require("./TrackDescription");
  const uuid_1 = require("uuid");
  class Segment {
      constructor() {
          this.description = {
              displayName: 'Segment',
              name: 'segment',
              icon: 'file:segment.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}',
              description: 'Consume Segment API',
              defaults: {
                  name: 'Segment',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'segmentApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Group',
                              value: 'group',
                              description: 'Group lets you associate an identified user with a group',
                          },
                          {
                              name: 'Identify',
                              value: 'identify',
                              description: 'Identify lets you tie a user to their actions',
                          },
                          {
                              name: 'Track',
                              value: 'track',
                              description: 'Track lets you record events',
                          },
                      ],
                      default: 'identify',
                  },
                  ...GroupDescription_1.groupOperations,
                  ...GroupDescription_1.groupFields,
                  ...IdentifyDescription_1.identifyOperations,
                  ...TrackDescription_1.trackOperations,
                  ...IdentifyDescription_1.identifyFields,
                  ...TrackDescription_1.trackFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'group') {
                      if (operation === 'add') {
                          const userId = this.getNodeParameter('userId', i);
                          const groupId = this.getNodeParameter('groupId', i);
                          const traits = this.getNodeParameter('traits', i)
                              .traitsUi;
                          const context = this.getNodeParameter('context', i)
                              .contextUi;
                          const integrations = this.getNodeParameter('integrations', i)
                              .integrationsUi;
                          const body = {
                              groupId,
                              traits: {
                                  company: {},
                                  address: {},
                              },
                              context: {
                                  app: {},
                                  campaign: {},
                                  device: {},
                              },
                              integrations: {},
                          };
                          if (userId) {
                              body.userId = userId;
                          }
                          else {
                              body.anonymousId = (0, uuid_1.v4)();
                          }
                          if (traits) {
                              if (traits && traits.length !== 0) {
                                  for (const trait of traits) {
                                      body.traits[trait.key] = trait.value;
                                  }
                              }
                          }
                          if (context) {
                              if (context.active) {
                                  body.context.active = context.active;
                              }
                              if (context.ip) {
                                  body.context.ip = context.ip;
                              }
                              if (context.locate) {
                                  body.context.locate = context.locate;
                              }
                              if (context.page) {
                                  body.context.page = context.page;
                              }
                              if (context.timezone) {
                                  body.context.timezone = context.timezone;
                              }
                              if (context.timezone) {
                                  body.context.timezone = context.timezone;
                              }
                              if (context.app) {
                                  const app = context.app.appUi;
                                  if (app) {
                                      if (app.name) {
                                          body.context.app.name = app.name;
                                      }
                                      if (app.version) {
                                          body.context.app.version = app.version;
                                      }
                                      if (app.build) {
                                          body.context.app.build = app.build;
                                      }
                                  }
                              }
                              if (context.campaign) {
                                  const campaign = context.campaign.campaignUi;
                                  if (campaign) {
                                      if (campaign.name) {
                                          body.context.campaign.name = campaign.name;
                                      }
                                      if (campaign.source) {
                                          body.context.campaign.source = campaign.source;
                                      }
                                      if (campaign.medium) {
                                          body.context.campaign.medium = campaign.medium;
                                      }
                                      if (campaign.term) {
                                          body.context.campaign.term = campaign.term;
                                      }
                                      if (campaign.content) {
                                          body.context.campaign.content = campaign.content;
                                      }
                                  }
                              }
                              if (context.device) {
                                  const device = context.device.deviceUi;
                                  if (device) {
                                      if (device.id) {
                                          body.context.device.id = device.id;
                                      }
                                      if (device.manufacturer) {
                                          body.context.device.manufacturer = device.manufacturer;
                                      }
                                      if (device.model) {
                                          body.context.device.model = device.model;
                                      }
                                      if (device.type) {
                                          body.context.device.type = device.type;
                                      }
                                      if (device.version) {
                                          body.context.device.version = device.version;
                                      }
                                  }
                              }
                          }
                          if (integrations) {
                              if (integrations.all) {
                                  body.integrations.all = integrations.all;
                              }
                              if (integrations.salesforce) {
                                  body.integrations.salesforce = integrations.salesforce;
                              }
                          }
                          responseData = await GenericFunctions_1.segmentApiRequest.call(this, 'POST', '/group', body);
                      }
                  }
                  if (resource === 'identify') {
                      if (operation === 'create') {
                          const userId = this.getNodeParameter('userId', i);
                          const context = this.getNodeParameter('context', i)
                              .contextUi;
                          const traits = this.getNodeParameter('traits', i)
                              .traitsUi;
                          const integrations = this.getNodeParameter('integrations', i)
                              .integrationsUi;
                          const body = {
                              context: {
                                  app: {},
                                  campaign: {},
                                  device: {},
                              },
                              traits: {},
                              integrations: {},
                          };
                          if (userId) {
                              body.userId = userId;
                          }
                          else {
                              body.anonymousId = (0, uuid_1.v4)();
                          }
                          if (context) {
                              if (context.active) {
                                  body.context.active = context.active;
                              }
                              if (context.ip) {
                                  body.context.ip = context.ip;
                              }
                              if (context.locate) {
                                  body.context.locate = context.locate;
                              }
                              if (context.page) {
                                  body.context.page = context.page;
                              }
                              if (context.timezone) {
                                  body.context.timezone = context.timezone;
                              }
                              if (context.timezone) {
                                  body.context.timezone = context.timezone;
                              }
                              if (context.app) {
                                  const app = context.app.appUi;
                                  if (app) {
                                      if (app.name) {
                                          body.context.app.name = app.name;
                                      }
                                      if (app.version) {
                                          body.context.app.version = app.version;
                                      }
                                      if (app.build) {
                                          body.context.app.build = app.build;
                                      }
                                  }
                              }
                              if (context.campaign) {
                                  const campaign = context.campaign.campaignUi;
                                  if (campaign) {
                                      if (campaign.name) {
                                          body.context.campaign.name = campaign.name;
                                      }
                                      if (campaign.source) {
                                          body.context.campaign.source = campaign.source;
                                      }
                                      if (campaign.medium) {
                                          body.context.campaign.medium = campaign.medium;
                                      }
                                      if (campaign.term) {
                                          body.context.campaign.term = campaign.term;
                                      }
                                      if (campaign.content) {
                                          body.context.campaign.content = campaign.content;
                                      }
                                  }
                              }
                              if (context.device) {
                                  const device = context.device.deviceUi;
                                  if (device) {
                                      if (device.id) {
                                          body.context.device.id = device.id;
                                      }
                                      if (device.manufacturer) {
                                          body.context.device.manufacturer = device.manufacturer;
                                      }
                                      if (device.model) {
                                          body.context.device.model = device.model;
                                      }
                                      if (device.type) {
                                          body.context.device.type = device.type;
                                      }
                                      if (device.version) {
                                          body.context.device.version = device.version;
                                      }
                                  }
                              }
                          }
                          if (integrations) {
                              if (integrations.all) {
                                  body.integrations.all = integrations.all;
                              }
                              if (integrations.salesforce) {
                                  body.integrations.salesforce = integrations.salesforce;
                              }
                          }
                          if (traits) {
                              if (traits && traits.length !== 0) {
                                  for (const trait of traits) {
                                      body.traits[trait.key] = trait.value;
                                  }
                              }
                          }
                          responseData = await GenericFunctions_1.segmentApiRequest.call(this, 'POST', '/identify', body);
                      }
                  }
                  if (resource === 'track') {
                      if (operation === 'event') {
                          const userId = this.getNodeParameter('userId', i);
                          const event = this.getNodeParameter('event', i);
                          const context = this.getNodeParameter('context', i)
                              .contextUi;
                          const integrations = this.getNodeParameter('integrations', i)
                              .integrationsUi;
                          const properties = this.getNodeParameter('properties', i)
                              .propertiesUi;
                          const body = {
                              event,
                              traits: {},
                              context: {
                                  app: {},
                                  campaign: {},
                                  device: {},
                              },
                              integrations: {},
                              properties: {},
                          };
                          if (userId) {
                              body.userId = userId;
                          }
                          else {
                              body.anonymousId = (0, uuid_1.v4)();
                          }
                          if (context) {
                              if (context.active) {
                                  body.context.active = context.active;
                              }
                              if (context.ip) {
                                  body.context.ip = context.ip;
                              }
                              if (context.locate) {
                                  body.context.locate = context.locate;
                              }
                              if (context.page) {
                                  body.context.page = context.page;
                              }
                              if (context.timezone) {
                                  body.context.timezone = context.timezone;
                              }
                              if (context.timezone) {
                                  body.context.timezone = context.timezone;
                              }
                              if (context.app) {
                                  const app = context.app.appUi;
                                  if (app) {
                                      if (app.name) {
                                          body.context.app.name = app.name;
                                      }
                                      if (app.version) {
                                          body.context.app.version = app.version;
                                      }
                                      if (app.build) {
                                          body.context.app.build = app.build;
                                      }
                                  }
                              }
                              if (context.campaign) {
                                  const campaign = context.campaign.campaignUi;
                                  if (campaign) {
                                      if (campaign.name) {
                                          body.context.campaign.name = campaign.name;
                                      }
                                      if (campaign.source) {
                                          body.context.campaign.source = campaign.source;
                                      }
                                      if (campaign.medium) {
                                          body.context.campaign.medium = campaign.medium;
                                      }
                                      if (campaign.term) {
                                          body.context.campaign.term = campaign.term;
                                      }
                                      if (campaign.content) {
                                          body.context.campaign.content = campaign.content;
                                      }
                                  }
                              }
                              if (context.device) {
                                  const device = context.device.deviceUi;
                                  if (device) {
                                      if (device.id) {
                                          body.context.device.id = device.id;
                                      }
                                      if (device.manufacturer) {
                                          body.context.device.manufacturer = device.manufacturer;
                                      }
                                      if (device.model) {
                                          body.context.device.model = device.model;
                                      }
                                      if (device.type) {
                                          body.context.device.type = device.type;
                                      }
                                      if (device.version) {
                                          body.context.device.version = device.version;
                                      }
                                  }
                              }
                          }
                          if (integrations) {
                              if (integrations.all) {
                                  body.integrations.all = integrations.all;
                              }
                              if (integrations.salesforce) {
                                  body.integrations.salesforce = integrations.salesforce;
                              }
                          }
                          if (properties) {
                              if (properties && properties.length !== 0) {
                                  for (const property of properties) {
                                      body.properties[property.key] = property.value;
                                  }
                              }
                          }
                          responseData = await GenericFunctions_1.segmentApiRequest.call(this, 'POST', '/track', body);
                      }
                      if (operation === 'page') {
                          const userId = this.getNodeParameter('userId', i);
                          const name = this.getNodeParameter('name', i);
                          const context = this.getNodeParameter('context', i)
                              .contextUi;
                          const integrations = this.getNodeParameter('integrations', i)
                              .integrationsUi;
                          const properties = this.getNodeParameter('properties', i)
                              .propertiesUi;
                          const body = {
                              name,
                              traits: {},
                              context: {
                                  app: {},
                                  campaign: {},
                                  device: {},
                              },
                              integrations: {},
                              properties: {},
                          };
                          if (userId) {
                              body.userId = userId;
                          }
                          else {
                              body.anonymousId = (0, uuid_1.v4)();
                          }
                          if (context) {
                              if (context.active) {
                                  body.context.active = context.active;
                              }
                              if (context.ip) {
                                  body.context.ip = context.ip;
                              }
                              if (context.locate) {
                                  body.context.locate = context.locate;
                              }
                              if (context.page) {
                                  body.context.page = context.page;
                              }
                              if (context.timezone) {
                                  body.context.timezone = context.timezone;
                              }
                              if (context.timezone) {
                                  body.context.timezone = context.timezone;
                              }
                              if (context.app) {
                                  const app = context.app.appUi;
                                  if (app) {
                                      if (app.name) {
                                          body.context.app.name = app.name;
                                      }
                                      if (app.version) {
                                          body.context.app.version = app.version;
                                      }
                                      if (app.build) {
                                          body.context.app.build = app.build;
                                      }
                                  }
                              }
                              if (context.campaign) {
                                  const campaign = context.campaign.campaignUi;
                                  if (campaign) {
                                      if (campaign.name) {
                                          body.context.campaign.name = campaign.name;
                                      }
                                      if (campaign.source) {
                                          body.context.campaign.source = campaign.source;
                                      }
                                      if (campaign.medium) {
                                          body.context.campaign.medium = campaign.medium;
                                      }
                                      if (campaign.term) {
                                          body.context.campaign.term = campaign.term;
                                      }
                                      if (campaign.content) {
                                          body.context.campaign.content = campaign.content;
                                      }
                                  }
                              }
                              if (context.device) {
                                  const device = context.device.deviceUi;
                                  if (device) {
                                      if (device.id) {
                                          body.context.device.id = device.id;
                                      }
                                      if (device.manufacturer) {
                                          body.context.device.manufacturer = device.manufacturer;
                                      }
                                      if (device.model) {
                                          body.context.device.model = device.model;
                                      }
                                      if (device.type) {
                                          body.context.device.type = device.type;
                                      }
                                      if (device.version) {
                                          body.context.device.version = device.version;
                                      }
                                  }
                              }
                          }
                          if (integrations) {
                              if (integrations.all) {
                                  body.integrations.all = integrations.all;
                              }
                              if (integrations.salesforce) {
                                  body.integrations.salesforce = integrations.salesforce;
                              }
                          }
                          if (properties) {
                              if (properties && properties.length !== 0) {
                                  for (const property of properties) {
                                      body.properties[property.key] = property.value;
                                  }
                              }
                          }
                          responseData = await GenericFunctions_1.segmentApiRequest.call(this, 'POST', '/page', body);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
              if (Array.isArray(responseData)) {
                  returnData.push.apply(returnData, responseData);
              }
              else {
                  returnData.push(responseData);
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Segment = Segment;
  //# sourceMappingURL=Segment.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SegmentApi = void 0;
  class SegmentApi {
      constructor() {
          this.name = 'segmentApi';
          this.displayName = 'Segment API';
          this.documentationUrl = 'segment';
          this.properties = [
              {
                  displayName: 'Write Key',
                  name: 'writekey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
      async authenticate(credentials, requestOptions) {
          const base64Key = Buffer.from(`${credentials.writekey}:`).toString('base64');
          requestOptions.headers.Authorization = `Basic ${base64Key}`;
          return requestOptions;
      }
  }
  exports.SegmentApi = SegmentApi;
  //# sourceMappingURL=SegmentApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SegmentApi = void 0;
  class SegmentApi {
      constructor() {
          this.name = 'segmentApi';
          this.displayName = 'Segment API';
          this.documentationUrl = 'segment';
          this.properties = [
              {
                  displayName: 'Write Key',
                  name: 'writekey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
      async authenticate(credentials, requestOptions) {
          const base64Key = Buffer.from(`${credentials.writekey}:`).toString('base64');
          requestOptions.headers.Authorization = `Basic ${base64Key}`;
          return requestOptions;
      }
  }
  exports.SegmentApi = SegmentApi;
  //# sourceMappingURL=SegmentApi.credentials.js.map

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

  # Segment node

  Use the Segment node to automate work in Segment, and integrate Segment with other applications. n8n has built-in support for a wide range of Segment features, including adding users to groups, creating identities, and tracking activities. 

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

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

  ## Operations

  * Group
      * Add a user to a group
  * Identify
      * Create an identity
  * Track
      * Record the actions your users perform. Every action triggers an event, which can also have associated properties.
      * Record page views on your website, along with optional extra information about the page being viewed.

  ## Templates and examples

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

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

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


node_type: n8n-nodes-base.SendGrid
name: SendGrid
display_name: SendGrid
description: Consume SendGrid API
category: transform
icon: file:sendGrid.svg
code_hash: c682d47a8e16769aa94a9421671141e4f81eee92760eabbe45af312286758989
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.SendGrid
documentation_title: SendGrid node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"sendgrid","description":"Templates for sendgrid"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:32
updated_at: 2025-06-09 15:18:32
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.SendGrid = void 0;
  const ListDescription_1 = require("./ListDescription");
  const ContactDescription_1 = require("./ContactDescription");
  const MailDescription_1 = require("./MailDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class SendGrid {
      constructor() {
          this.description = {
              displayName: 'SendGrid',
              name: 'sendGrid',
              icon: 'file:sendGrid.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}',
              description: 'Consume SendGrid API',
              defaults: {
                  name: 'SendGrid',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'sendGridApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                          {
                              name: 'List',
                              value: 'list',
                          },
                          {
                              name: 'Mail',
                              value: 'mail',
                          },
                      ],
                      default: 'list',
                      required: true,
                  },
                  ...ListDescription_1.listOperations,
                  ...ListDescription_1.listFields,
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
                  ...MailDescription_1.mailOperations,
                  ...MailDescription_1.mailFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCustomFields() {
                      const returnData = [];
                      const { custom_fields } = await GenericFunctions_1.sendGridApiRequest.call(this, '/marketing/field_definitions', 'GET', {}, {});
                      if (custom_fields !== undefined) {
                          for (const customField of custom_fields) {
                              returnData.push({
                                  name: customField.name,
                                  value: customField.id,
                              });
                          }
                      }
                      return returnData;
                  },
                  async getListIds() {
                      const returnData = [];
                      const lists = await GenericFunctions_1.sendGridApiRequestAllItems.call(this, '/marketing/lists', 'GET', 'result', {}, {});
                      for (const list of lists) {
                          returnData.push({
                              name: list.name,
                              value: list.id,
                          });
                      }
                      return returnData;
                  },
                  async getTemplateIds() {
                      const responseData = await GenericFunctions_1.sendGridApiRequest.call(this, '/templates', 'GET', {}, { generations: 'dynamic' });
                      return responseData.templates.map(({ id, name }) => ({
                          name,
                          value: id,
                      }));
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          const qs = {};
          let responseData;
          const timezone = this.getTimezone();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          if (resource === 'contact') {
              if (operation === 'getAll') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          let endpoint = '/marketing/contacts';
                          let method = 'GET';
                          const body = {};
                          if (filters.query && filters.query !== '') {
                              endpoint = '/marketing/contacts/search';
                              method = 'POST';
                              Object.assign(body, { query: filters.query });
                          }
                          responseData = await GenericFunctions_1.sendGridApiRequestAllItems.call(this, endpoint, method, 'result', body, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      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;
                      }
                  }
              }
              if (operation === 'get') {
                  const by = this.getNodeParameter('by', 0);
                  let endpoint;
                  let method;
                  const body = {};
                  for (let i = 0; i < length; i++) {
                      try {
                          if (by === 'id') {
                              method = 'GET';
                              const contactId = this.getNodeParameter('contactId', i);
                              endpoint = `/marketing/contacts/${contactId}`;
                          }
                          else {
                              const email = this.getNodeParameter('email', i);
                              endpoint = '/marketing/contacts/search';
                              method = 'POST';
                              Object.assign(body, { query: `email LIKE '${email}' ` });
                          }
                          responseData = await GenericFunctions_1.sendGridApiRequest.call(this, endpoint, method, body, qs);
                          responseData = responseData.result || responseData;
                          if (Array.isArray(responseData)) {
                              responseData = responseData[0];
                          }
                          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;
                      }
                  }
              }
              if (operation === 'upsert') {
                  try {
                      const contacts = [];
                      let lists;
                      for (let i = 0; i < length; i++) {
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const contact = {
                              email,
                          };
                          if (additionalFields.addressUi) {
                              const addressValues = additionalFields.addressUi
                                  .addressValues;
                              const addressLine1 = addressValues.address1;
                              const addressLine2 = addressValues.address2;
                              if (addressLine2) {
                                  Object.assign(contact, { address_line_2: addressLine2 });
                              }
                              Object.assign(contact, { address_line_1: addressLine1 });
                          }
                          if (additionalFields.city) {
                              const city = additionalFields.city;
                              Object.assign(contact, { city });
                          }
                          if (additionalFields.country) {
                              const country = additionalFields.country;
                              Object.assign(contact, { country });
                          }
                          if (additionalFields.firstName) {
                              const firstName = additionalFields.firstName;
                              Object.assign(contact, { first_name: firstName });
                          }
                          if (additionalFields.lastName) {
                              const lastName = additionalFields.lastName;
                              Object.assign(contact, { last_name: lastName });
                          }
                          if (additionalFields.postalCode) {
                              const postalCode = additionalFields.postalCode;
                              Object.assign(contact, { postal_code: postalCode });
                          }
                          if (additionalFields.stateProvinceRegion) {
                              const stateProvinceRegion = additionalFields.stateProvinceRegion;
                              Object.assign(contact, { state_province_region: stateProvinceRegion });
                          }
                          if (additionalFields.alternateEmails) {
                              const alternateEmails = additionalFields.alternateEmails
                                  .split(',')
                                  .filter((mail) => !!mail);
                              if (alternateEmails.length !== 0) {
                                  Object.assign(contact, { alternate_emails: alternateEmails });
                              }
                          }
                          if (additionalFields.listIdsUi) {
                              const listIdValues = additionalFields.listIdsUi
                                  .listIdValues;
                              const listIds = listIdValues.listIds;
                              lists = listIds;
                          }
                          if (additionalFields.customFieldsUi) {
                              const customFields = additionalFields.customFieldsUi
                                  .customFieldValues;
                              if (customFields) {
                                  const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                                  Object.assign(contact, { custom_fields: data });
                              }
                          }
                          contacts.push(contact);
                      }
                      responseData = await GenericFunctions_1.sendGridApiRequest.call(this, '/marketing/contacts', 'PUT', { list_ids: lists, contacts }, qs);
                      returnData.push(responseData);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          returnData.push({ json: { error: error.message } });
                      }
                      else {
                          throw error;
                      }
                  }
              }
              if (operation === 'delete') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const deleteAll = this.getNodeParameter('deleteAll', i);
                          if (deleteAll) {
                              qs.delete_all_contacts = 'true';
                          }
                          qs.ids = this.getNodeParameter('ids', i).replace(/\s/g, '');
                          responseData = await GenericFunctions_1.sendGridApiRequest.call(this, '/marketing/contacts', 'DELETE', {}, 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;
                      }
                  }
              }
          }
          if (resource === 'list') {
              if (operation === 'getAll') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.sendGridApiRequestAllItems.call(this, '/marketing/lists', 'GET', 'result', {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      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;
                      }
                  }
              }
              if (operation === 'get') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const listId = this.getNodeParameter('listId', i);
                          qs.contact_sample = this.getNodeParameter('contactSample', i);
                          responseData = await GenericFunctions_1.sendGridApiRequest.call(this, `/marketing/lists/${listId}`, 'GET', {}, 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;
                      }
                  }
              }
              if (operation === 'create') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const name = this.getNodeParameter('name', i);
                          responseData = await GenericFunctions_1.sendGridApiRequest.call(this, '/marketing/lists', 'POST', { name }, 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;
                      }
                  }
              }
              if (operation === 'delete') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const listId = this.getNodeParameter('listId', i);
                          qs.delete_contacts = this.getNodeParameter('deleteContacts', i);
                          responseData = await GenericFunctions_1.sendGridApiRequest.call(this, `/marketing/lists/${listId}`, 'DELETE', {}, qs);
                          responseData = { success: true };
                          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;
                      }
                  }
              }
              if (operation === 'update') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const name = this.getNodeParameter('name', i);
                          const listId = this.getNodeParameter('listId', i);
                          responseData = await GenericFunctions_1.sendGridApiRequest.call(this, `/marketing/lists/${listId}`, 'PATCH', { name }, 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;
                      }
                  }
              }
          }
          if (resource === 'mail') {
              if (operation === 'send') {
                  for (let i = 0; i < length; i++) {
                      try {
                          const toEmail = this.getNodeParameter('toEmail', i);
                          const parsedToEmail = toEmail.includes(',')
                              ? toEmail.split(',').map((entry) => ({ email: entry.trim() }))
                              : [{ email: toEmail.trim() }];
                          const { bccEmail, ccEmail, enableSandbox, sendAt, headers, attachments, categories, ipPoolName, } = this.getNodeParameter('additionalFields', i);
                          const body = {
                              personalizations: [
                                  {
                                      to: parsedToEmail,
                                  },
                              ],
                              from: {
                                  email: this.getNodeParameter('fromEmail', i).trim(),
                                  name: this.getNodeParameter('fromName', i),
                              },
                              mail_settings: {
                                  sandbox_mode: {
                                      enable: enableSandbox || false,
                                  },
                              },
                          };
                          const dynamicTemplateEnabled = this.getNodeParameter('dynamicTemplate', i);
                          if (dynamicTemplateEnabled) {
                              body.template_id = this.getNodeParameter('templateId', i);
                              const { fields } = this.getNodeParameter('dynamicTemplateFields', i);
                              if (fields) {
                                  body.personalizations[0].dynamic_template_data = {};
                                  fields.forEach((field) => {
                                      body.personalizations[0].dynamic_template_data[field.key] = field.value;
                                  });
                              }
                          }
                          else {
                              body.personalizations[0].subject = this.getNodeParameter('subject', i);
                              body.content = [
                                  {
                                      type: this.getNodeParameter('contentType', i),
                                      value: this.getNodeParameter('contentValue', i),
                                  },
                              ];
                          }
                          if (attachments) {
                              const attachmentsToSend = [];
                              const binaryProperties = attachments.split(',').map((p) => p.trim());
                              for (const property of binaryProperties) {
                                  const binaryData = this.helpers.assertBinaryData(i, property);
                                  const dataBuffer = await this.helpers.getBinaryDataBuffer(i, property);
                                  attachmentsToSend.push({
                                      content: dataBuffer.toString('base64'),
                                      filename: binaryData.fileName || 'unknown',
                                      type: binaryData.mimeType,
                                  });
                              }
                              if (attachmentsToSend.length) {
                                  body.attachments = attachmentsToSend;
                              }
                          }
                          if (bccEmail) {
                              body.personalizations[0].bcc = bccEmail
                                  .split(',')
                                  .map((entry) => ({ email: entry.trim() }));
                          }
                          if (ccEmail) {
                              body.personalizations[0].cc = ccEmail
                                  .split(',')
                                  .map((entry) => ({ email: entry.trim() }));
                          }
                          if (headers === null || headers === void 0 ? void 0 : headers.details.length) {
                              const parsedHeaders = {};
                              headers.details.forEach((obj) => (parsedHeaders[obj.key] = obj.value));
                              body.headers = parsedHeaders;
                          }
                          if (categories) {
                              body.categories = categories.split(',');
                          }
                          if (ipPoolName) {
                              body.ip_pool_name = ipPoolName;
                          }
                          if (sendAt) {
                              body.personalizations[0].send_at = moment_timezone_1.default.tz(sendAt, timezone).unix();
                          }
                          const data = await GenericFunctions_1.sendGridApiRequest.call(this, '/mail/send', 'POST', body, qs, {
                              resolveWithFullResponse: true,
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ messageId: data.headers['x-message-id'] }), { 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.SendGrid = SendGrid;
  //# sourceMappingURL=SendGrid.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SendGridApi = void 0;
  class SendGridApi {
      constructor() {
          this.name = 'sendGridApi';
          this.displayName = 'SendGrid API';
          this.documentationUrl = 'sendgrid';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://api.sendgrid.com/v3',
                  url: '/marketing/contacts',
              },
          };
      }
  }
  exports.SendGridApi = SendGridApi;
  //# sourceMappingURL=SendGridApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SendGridApi = void 0;
  class SendGridApi {
      constructor() {
          this.name = 'sendGridApi';
          this.displayName = 'SendGrid API';
          this.documentationUrl = 'sendgrid';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://api.sendgrid.com/v3',
                  url: '/marketing/contacts',
              },
          };
      }
  }
  exports.SendGridApi = SendGridApi;
  //# sourceMappingURL=SendGridApi.credentials.js.map

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

  # SendGrid node

  Use the SendGrid node to automate work in SendGrid, and integrate SendGrid with other applications. n8n has built-in support for a wide range of SendGrid features, including creating, updating, deleting, and getting contacts, and lists, as well as sending emails. 

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

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

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

  ## Operations

  * Contact
      * Create/update a contact
      * Delete a contact
      * Get a contact by ID
      * Get all contacts
  * List
      * Create a list
      * Delete a list
      * Get a list
      * Get all lists
      * Update a list
  * Mail
      * Send an email.

  ## Templates and examples

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

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

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


node_type: n8n-nodes-base.S3
name: S3
display_name: S3
description: Sends data to any S3-compatible service
category: output
icon: file:s3.png
code_hash: 80c075ea70231b2247f5c6f3da95d4769d94dc14792e809bb2a267a14d97e036
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.S3
documentation_title: S3 node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"s3","description":"Templates for s3"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:32
updated_at: 2025-06-09 15:18:32
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.S3 = void 0;
  const change_case_1 = require("change-case");
  const crypto_1 = require("crypto");
  const xml2js_1 = require("xml2js");
  const n8n_workflow_1 = require("n8n-workflow");
  const BucketDescription_1 = require("../Aws/S3/V1/BucketDescription");
  const FolderDescription_1 = require("../Aws/S3/V1/FolderDescription");
  const FileDescription_1 = require("../Aws/S3/V1/FileDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class S3 {
      constructor() {
          this.description = {
              displayName: 'S3',
              name: 's3',
              icon: 'file:s3.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends data to any S3-compatible service',
              defaults: {
                  name: 'S3',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 's3',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Bucket',
                              value: 'bucket',
                          },
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Folder',
                              value: 'folder',
                          },
                      ],
                      default: 'file',
                  },
                  ...BucketDescription_1.bucketOperations,
                  ...BucketDescription_1.bucketFields,
                  ...FolderDescription_1.folderOperations,
                  ...FolderDescription_1.folderFields,
                  ...FileDescription_1.fileOperations,
                  ...FileDescription_1.fileFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  const headers = {};
                  if (resource === 'bucket') {
                      if (operation === 'create') {
                          let credentials;
                          try {
                              credentials = await this.getCredentials('s3');
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.acl) {
                              headers['x-amz-acl'] = (0, change_case_1.paramCase)(additionalFields.acl);
                          }
                          if (additionalFields.bucketObjectLockEnabled) {
                              headers['x-amz-bucket-object-lock-enabled'] =
                                  additionalFields.bucketObjectLockEnabled;
                          }
                          if (additionalFields.grantFullControl) {
                              headers['x-amz-grant-full-control'] = '';
                          }
                          if (additionalFields.grantRead) {
                              headers['x-amz-grant-read'] = '';
                          }
                          if (additionalFields.grantReadAcp) {
                              headers['x-amz-grant-read-acp'] = '';
                          }
                          if (additionalFields.grantWrite) {
                              headers['x-amz-grant-write'] = '';
                          }
                          if (additionalFields.grantWriteAcp) {
                              headers['x-amz-grant-write-acp'] = '';
                          }
                          let region = credentials.region;
                          if (additionalFields.region) {
                              region = additionalFields.region;
                          }
                          const body = {
                              CreateBucketConfiguration: {
                                  $: {
                                      xmlns: 'http://s3.amazonaws.com/doc/2006-03-01/',
                                  },
                              },
                          };
                          let data = '';
                          if (region !== 'us-east-1') {
                              body.CreateBucketConfiguration.LocationConstraint = [region];
                              const builder = new xml2js_1.Builder();
                              data = builder.buildObject(body);
                          }
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, `${name}`, 'PUT', '', data, qs, headers);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.s3ApiRequestSOAPAllItems.call(this, 'ListAllMyBucketsResult.Buckets.Bucket', '', 'GET', '');
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.s3ApiRequestSOAPAllItems.call(this, 'ListAllMyBucketsResult.Buckets.Bucket', '', 'GET', '', '', qs);
                              responseData = responseData.slice(0, qs.limit);
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'search') {
                          const bucketName = this.getNodeParameter('bucketName', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', 0);
                          if (additionalFields.prefix) {
                              qs.prefix = additionalFields.prefix;
                          }
                          if (additionalFields.encodingType) {
                              qs['encoding-type'] = additionalFields.encodingType;
                          }
                          if (additionalFields.delmiter) {
                              qs.delimiter = additionalFields.delmiter;
                          }
                          if (additionalFields.fetchOwner) {
                              qs['fetch-owner'] = additionalFields.fetchOwner;
                          }
                          if (additionalFields.startAfter) {
                              qs['start-after'] = additionalFields.startAfter;
                          }
                          if (additionalFields.requesterPays) {
                              qs['x-amz-request-payer'] = 'requester';
                          }
                          qs['list-type'] = 2;
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', {
                              location: '',
                          });
                          const region = responseData.LocationConstraint._;
                          if (returnAll) {
                              responseData = await GenericFunctions_1.s3ApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', bucketName, 'GET', '', '', qs, {}, {}, region);
                          }
                          else {
                              qs['max-keys'] = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', qs, {}, {}, region);
                              responseData = responseData.ListBucketResult.Contents;
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
                  if (resource === 'folder') {
                      if (operation === 'create') {
                          const bucketName = this.getNodeParameter('bucketName', i);
                          const folderName = this.getNodeParameter('folderName', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          let path = `/${folderName}/`;
                          if (additionalFields.requesterPays) {
                              headers['x-amz-request-payer'] = 'requester';
                          }
                          if (additionalFields.parentFolderKey) {
                              path = `/${additionalFields.parentFolderKey}${folderName}/`;
                          }
                          if (additionalFields.storageClass) {
                              headers['x-amz-storage-class'] = (0, change_case_1.snakeCase)(additionalFields.storageClass).toUpperCase();
                          }
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', {
                              location: '',
                          });
                          const region = responseData.LocationConstraint._;
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'PUT', path, '', qs, headers, {}, region);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'delete') {
                          const bucketName = this.getNodeParameter('bucketName', i);
                          const folderKey = this.getNodeParameter('folderKey', i);
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', {
                              location: '',
                          });
                          const region = responseData.LocationConstraint._;
                          responseData = await GenericFunctions_1.s3ApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', bucketName, 'GET', '/', '', { 'list-type': 2, prefix: folderKey }, {}, {}, region);
                          if (responseData.length === 0) {
                              responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'DELETE', `/${folderKey}`, '', qs, {}, {}, region);
                              responseData = { deleted: [{ Key: folderKey }] };
                          }
                          else {
                              const body = {
                                  Delete: {
                                      $: {
                                          xmlns: 'http://s3.amazonaws.com/doc/2006-03-01/',
                                      },
                                      Object: [],
                                  },
                              };
                              for (const childObject of responseData) {
                                  body.Delete.Object.push({
                                      Key: childObject.Key,
                                  });
                              }
                              const builder = new xml2js_1.Builder();
                              const data = builder.buildObject(body);
                              headers['Content-MD5'] = (0, crypto_1.createHash)('md5').update(data).digest('base64');
                              headers['Content-Type'] = 'application/xml';
                              responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'POST', '/', data, { delete: '' }, headers, {}, region);
                              responseData = { deleted: responseData.DeleteResult.Deleted };
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'getAll') {
                          const bucketName = this.getNodeParameter('bucketName', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const options = this.getNodeParameter('options', 0);
                          if (options.folderKey) {
                              qs.prefix = options.folderKey;
                          }
                          if (options.fetchOwner) {
                              qs['fetch-owner'] = options.fetchOwner;
                          }
                          qs['list-type'] = 2;
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', {
                              location: '',
                          });
                          const region = responseData.LocationConstraint._;
                          if (returnAll) {
                              responseData = await GenericFunctions_1.s3ApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', bucketName, 'GET', '', '', qs, {}, {}, region);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.s3ApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', bucketName, 'GET', '', '', qs, {}, {}, region);
                          }
                          if (Array.isArray(responseData)) {
                              responseData = responseData.filter((e) => e.Key.endsWith('/') && e.Size === '0' && e.Key !== options.folderKey);
                              if (qs.limit) {
                                  responseData = responseData.splice(0, qs.limit);
                              }
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
                  if (resource === 'file') {
                      if (operation === 'copy') {
                          const sourcePath = this.getNodeParameter('sourcePath', i);
                          const destinationPath = this.getNodeParameter('destinationPath', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          headers['x-amz-copy-source'] = sourcePath;
                          if (additionalFields.requesterPays) {
                              headers['x-amz-request-payer'] = 'requester';
                          }
                          if (additionalFields.storageClass) {
                              headers['x-amz-storage-class'] = (0, change_case_1.snakeCase)(additionalFields.storageClass).toUpperCase();
                          }
                          if (additionalFields.acl) {
                              headers['x-amz-acl'] = (0, change_case_1.paramCase)(additionalFields.acl);
                          }
                          if (additionalFields.grantFullControl) {
                              headers['x-amz-grant-full-control'] = '';
                          }
                          if (additionalFields.grantRead) {
                              headers['x-amz-grant-read'] = '';
                          }
                          if (additionalFields.grantReadAcp) {
                              headers['x-amz-grant-read-acp'] = '';
                          }
                          if (additionalFields.grantWriteAcp) {
                              headers['x-amz-grant-write-acp'] = '';
                          }
                          if (additionalFields.lockLegalHold) {
                              headers['x-amz-object-lock-legal-hold'] = additionalFields.lockLegalHold
                                  ? 'ON'
                                  : 'OFF';
                          }
                          if (additionalFields.lockMode) {
                              headers['x-amz-object-lock-mode'] = additionalFields.lockMode.toUpperCase();
                          }
                          if (additionalFields.lockRetainUntilDate) {
                              headers['x-amz-object-lock-retain-until-date'] =
                                  additionalFields.lockRetainUntilDate;
                          }
                          if (additionalFields.serverSideEncryption) {
                              headers['x-amz-server-side-encryption'] =
                                  additionalFields.serverSideEncryption;
                          }
                          if (additionalFields.encryptionAwsKmsKeyId) {
                              headers['x-amz-server-side-encryption-aws-kms-key-id'] =
                                  additionalFields.encryptionAwsKmsKeyId;
                          }
                          if (additionalFields.serverSideEncryptionContext) {
                              headers['x-amz-server-side-encryption-context'] =
                                  additionalFields.serverSideEncryptionContext;
                          }
                          if (additionalFields.serversideEncryptionCustomerAlgorithm) {
                              headers['x-amz-server-side-encryption-customer-algorithm'] =
                                  additionalFields.serversideEncryptionCustomerAlgorithm;
                          }
                          if (additionalFields.serversideEncryptionCustomerKey) {
                              headers['x-amz-server-side-encryption-customer-key'] =
                                  additionalFields.serversideEncryptionCustomerKey;
                          }
                          if (additionalFields.serversideEncryptionCustomerKeyMD5) {
                              headers['x-amz-server-side-encryption-customer-key-MD5'] =
                                  additionalFields.serversideEncryptionCustomerKeyMD5;
                          }
                          if (additionalFields.taggingDirective) {
                              headers['x-amz-tagging-directive'] = additionalFields.taggingDirective.toUpperCase();
                          }
                          if (additionalFields.metadataDirective) {
                              headers['x-amz-metadata-directive'] = additionalFields.metadataDirective.toUpperCase();
                          }
                          const destinationParts = destinationPath.split('/');
                          const bucketName = destinationParts[1];
                          const destination = `/${destinationParts.slice(2, destinationParts.length).join('/')}`;
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', {
                              location: '',
                          });
                          const region = responseData.LocationConstraint._;
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'PUT', destination, '', qs, headers, {}, region);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.CopyObjectResult), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'download') {
                          const bucketName = this.getNodeParameter('bucketName', i);
                          const fileKey = this.getNodeParameter('fileKey', i);
                          const fileName = fileKey.split('/')[fileKey.split('/').length - 1];
                          if (fileKey.substring(fileKey.length - 1) === '/') {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Downloding a whole directory is not yet supported, please provide a file key');
                          }
                          let region = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', {
                              location: '',
                          });
                          region = region.LocationConstraint._;
                          const response = await GenericFunctions_1.s3ApiRequestREST.call(this, bucketName, 'GET', `/${fileKey}`, '', qs, {}, { encoding: null, resolveWithFullResponse: true }, region);
                          let mimeType;
                          if (response.headers['content-type']) {
                              mimeType = response.headers['content-type'];
                          }
                          const newItem = {
                              json: items[i].json,
                              binary: {},
                          };
                          if (items[i].binary !== undefined) {
                              Object.assign(newItem.binary, items[i].binary);
                          }
                          items[i] = newItem;
                          const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i);
                          const data = Buffer.from(response.body, 'utf8');
                          items[i].binary[dataPropertyNameDownload] = await this.helpers.prepareBinaryData(data, fileName, mimeType);
                      }
                      if (operation === 'delete') {
                          const bucketName = this.getNodeParameter('bucketName', i);
                          const fileKey = this.getNodeParameter('fileKey', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.versionId) {
                              qs.versionId = options.versionId;
                          }
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', {
                              location: '',
                          });
                          const region = responseData.LocationConstraint._;
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'DELETE', `/${fileKey}`, '', qs, {}, {}, region);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'getAll') {
                          const bucketName = this.getNodeParameter('bucketName', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const options = this.getNodeParameter('options', 0);
                          if (options.folderKey) {
                              qs.prefix = options.folderKey;
                          }
                          if (options.fetchOwner) {
                              qs['fetch-owner'] = options.fetchOwner;
                          }
                          qs.delimiter = '/';
                          qs['list-type'] = 2;
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', {
                              location: '',
                          });
                          const region = responseData.LocationConstraint._;
                          if (returnAll) {
                              responseData = await GenericFunctions_1.s3ApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', bucketName, 'GET', '', '', qs, {}, {}, region);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.s3ApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', bucketName, 'GET', '', '', qs, {}, {}, region);
                              responseData = responseData.splice(0, qs.limit);
                          }
                          if (Array.isArray(responseData)) {
                              responseData = responseData.filter((e) => !e.Key.endsWith('/') && e.Size !== '0');
                              if (qs.limit) {
                                  responseData = responseData.splice(0, qs.limit);
                              }
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'upload') {
                          const bucketName = this.getNodeParameter('bucketName', i);
                          const fileName = this.getNodeParameter('fileName', i);
                          const isBinaryData = this.getNodeParameter('binaryData', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const tagsValues = this.getNodeParameter('tagsUi', i)
                              .tagsValues;
                          let path = '/';
                          let body;
                          if (additionalFields.requesterPays) {
                              headers['x-amz-request-payer'] = 'requester';
                          }
                          if (additionalFields.parentFolderKey) {
                              path = `/${additionalFields.parentFolderKey}/`;
                          }
                          if (additionalFields.storageClass) {
                              headers['x-amz-storage-class'] = (0, change_case_1.snakeCase)(additionalFields.storageClass).toUpperCase();
                          }
                          if (additionalFields.acl) {
                              headers['x-amz-acl'] = (0, change_case_1.paramCase)(additionalFields.acl);
                          }
                          if (additionalFields.grantFullControl) {
                              headers['x-amz-grant-full-control'] = '';
                          }
                          if (additionalFields.grantRead) {
                              headers['x-amz-grant-read'] = '';
                          }
                          if (additionalFields.grantReadAcp) {
                              headers['x-amz-grant-read-acp'] = '';
                          }
                          if (additionalFields.grantWriteAcp) {
                              headers['x-amz-grant-write-acp'] = '';
                          }
                          if (additionalFields.lockLegalHold) {
                              headers['x-amz-object-lock-legal-hold'] = additionalFields.lockLegalHold
                                  ? 'ON'
                                  : 'OFF';
                          }
                          if (additionalFields.lockMode) {
                              headers['x-amz-object-lock-mode'] = additionalFields.lockMode.toUpperCase();
                          }
                          if (additionalFields.lockRetainUntilDate) {
                              headers['x-amz-object-lock-retain-until-date'] =
                                  additionalFields.lockRetainUntilDate;
                          }
                          if (additionalFields.serverSideEncryption) {
                              headers['x-amz-server-side-encryption'] =
                                  additionalFields.serverSideEncryption;
                          }
                          if (additionalFields.encryptionAwsKmsKeyId) {
                              headers['x-amz-server-side-encryption-aws-kms-key-id'] =
                                  additionalFields.encryptionAwsKmsKeyId;
                          }
                          if (additionalFields.serverSideEncryptionContext) {
                              headers['x-amz-server-side-encryption-context'] =
                                  additionalFields.serverSideEncryptionContext;
                          }
                          if (additionalFields.serversideEncryptionCustomerAlgorithm) {
                              headers['x-amz-server-side-encryption-customer-algorithm'] =
                                  additionalFields.serversideEncryptionCustomerAlgorithm;
                          }
                          if (additionalFields.serversideEncryptionCustomerKey) {
                              headers['x-amz-server-side-encryption-customer-key'] =
                                  additionalFields.serversideEncryptionCustomerKey;
                          }
                          if (additionalFields.serversideEncryptionCustomerKeyMD5) {
                              headers['x-amz-server-side-encryption-customer-key-MD5'] =
                                  additionalFields.serversideEncryptionCustomerKeyMD5;
                          }
                          if (tagsValues) {
                              const tags = [];
                              tagsValues.forEach((o) => {
                                  tags.push(`${o.key}=${o.value}`);
                              });
                              headers['x-amz-tagging'] = tags.join('&');
                          }
                          responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'GET', '', '', {
                              location: '',
                          });
                          const region = responseData.LocationConstraint._;
                          if (isBinaryData) {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              body = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              headers['Content-Type'] = binaryData.mimeType;
                              headers['Content-MD5'] = (0, crypto_1.createHash)('md5').update(body).digest('base64');
                              responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'PUT', `${path}${fileName || binaryData.fileName}`, body, qs, headers, {}, region);
                          }
                          else {
                              const fileContent = this.getNodeParameter('fileContent', i);
                              body = Buffer.from(fileContent, 'utf8');
                              headers['Content-Type'] = 'text/html';
                              headers['Content-MD5'] = (0, crypto_1.createHash)('md5').update(fileContent).digest('base64');
                              responseData = await GenericFunctions_1.s3ApiRequestSOAP.call(this, bucketName, 'PUT', `${path}${fileName}`, body, qs, headers, {}, region);
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (resource === 'file' && operation === 'download') {
                          items[i].json = { error: error.message };
                      }
                      else {
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (resource === 'file' && operation === 'download') {
              return [items];
          }
          return [returnData];
      }
  }
  exports.S3 = S3;
  //# sourceMappingURL=S3.node.js.map

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

  # S3 node

  Use the S3 node to automate work in non-AWS S3 storage and integrate S3 with other applications. n8n has built-in support for a wide range of S3 features, including creating, deleting, and getting buckets, files, and folders. For AWS S3, use [AWS S3](/integrations/builtin/app-nodes/n8n-nodes-base.awss3.md).

  Use the S3 node for non-AWS S3 solutions like:

  * [MinIO](https://min.io/){:target="_blank" .external-link}
  * [Wasabi](https://wasabi.com/){:target="_blank" .external-link}
  * [Digital Ocean spaces](https://www.digitalocean.com/products/spaces){:target="_blank" .external-link}

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

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

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

  ## Operations

  * Bucket
      * Create a bucket
      * Delete a bucket
      * Get all buckets
      * Search within a bucket
  * File
      * Copy a file
      * Delete a file
      * Download a file
      * Get all files
      * Upload a file

      /// note | Attach file for upload
      To attach a file for upload, use another node to pass the file as a data property. Nodes like 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) work well.
      ///

  * Folder
      * Create a folder
      * Delete a folder
      * Get all folders

  ## Templates and examples

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

  ## Node reference

  ### Setting file permissions in Wasabi

  When uploading files to [Wasabi](https://wasabi.com/){:target="_blank" .external-link}, you must set permissions for the files using the **ACL** dropdown and not the toggles.

  ![File permissions when using the S3 node with Wasabi](/_images/integrations/builtin/app-nodes/s3/acl_dropdown.png)

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


node_type: n8n-nodes-base.SeaTable
name: SeaTable
display_name: SeaTable
description: Consume the SeaTable API
category: input
icon: file:seaTable.svg
code_hash: 2838fa6931fb12f6c56a751f7251d2eed63f2f2160f055204f3a37ef31dd043a
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.SeaTable
documentation_title: SeaTable node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"seatable","description":"Templates for seatable"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:32
updated_at: 2025-06-09 15:18:32
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SeaTable = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const RowDescription_1 = require("./RowDescription");
  class SeaTable {
      constructor() {
          this.description = {
              displayName: 'SeaTable',
              name: 'seaTable',
              icon: 'file:seaTable.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
              description: 'Consume the SeaTable API',
              defaults: {
                  name: 'SeaTable',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'seaTableApi',
                      required: true,
                  },
              ],
              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 getTableNames() {
                      const returnData = [];
                      const { metadata: { tables }, } = await GenericFunctions_1.seaTableApiRequest.call(this, {}, 'GET', '/dtable-server/api/v1/dtables/{{dtable_uuid}}/metadata');
                      for (const table of tables) {
                          returnData.push({
                              name: table.name,
                              value: table.name,
                          });
                      }
                      return returnData;
                  },
                  async getTableIds() {
                      const returnData = [];
                      const { metadata: { tables }, } = await GenericFunctions_1.seaTableApiRequest.call(this, {}, 'GET', '/dtable-server/api/v1/dtables/{{dtable_uuid}}/metadata');
                      for (const table of tables) {
                          returnData.push({
                              name: table.name,
                              value: table._id,
                          });
                      }
                      return returnData;
                  },
                  async getTableUpdateAbleColumns() {
                      const tableName = this.getNodeParameter('tableName');
                      const columns = await GenericFunctions_1.getTableColumns.call(this, tableName);
                      return columns
                          .filter((column) => column.editable)
                          .map((column) => ({ name: column.name, value: column.name }));
                  },
                  async getAllSortableColumns() {
                      const tableName = this.getNodeParameter('tableName');
                      const columns = await GenericFunctions_1.getTableColumns.call(this, tableName);
                      return columns
                          .filter((column) => !['file', 'image', 'url', 'collaborator', 'long-text'].includes(column.type))
                          .map((column) => ({ name: column.name, value: column.name }));
                  },
                  async getViews() {
                      const tableName = this.getNodeParameter('tableName');
                      const views = await GenericFunctions_1.getTableViews.call(this, tableName);
                      return views.map((view) => ({ name: view.name, value: view.name }));
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const body = {};
          const qs = {};
          const ctx = {};
          if (resource === 'row') {
              if (operation === 'create') {
                  const tableName = this.getNodeParameter('tableName', 0);
                  const tableColumns = await GenericFunctions_1.getTableColumns.call(this, tableName);
                  body.table_name = tableName;
                  const fieldsToSend = this.getNodeParameter('fieldsToSend', 0);
                  let rowInput = {};
                  for (let i = 0; i < items.length; i++) {
                      rowInput = {};
                      try {
                          if (fieldsToSend === 'autoMapInputData') {
                              const incomingKeys = Object.keys(items[i].json);
                              const inputDataToIgnore = (0, GenericFunctions_1.split)(this.getNodeParameter('inputsToIgnore', i, ''));
                              for (const key of incomingKeys) {
                                  if (inputDataToIgnore.includes(key))
                                      continue;
                                  rowInput[key] = items[i].json[key];
                              }
                          }
                          else {
                              const columns = this.getNodeParameter('columnsUi.columnValues', i, []);
                              for (const column of columns) {
                                  rowInput[column.columnName] = column.columnValue;
                              }
                          }
                          body.row = (0, GenericFunctions_1.rowExport)(rowInput, (0, GenericFunctions_1.updateAble)(tableColumns));
                          responseData = await GenericFunctions_1.seaTableApiRequest.call(this, ctx, 'POST', '/dtable-server/api/v1/dtables/{{dtable_uuid}}/rows/', body);
                          const { _id: insertId } = responseData;
                          if (insertId === undefined) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'SeaTable: No identity after appending row.', { itemIndex: i });
                          }
                          const newRowInsertData = (0, GenericFunctions_1.rowMapKeyToName)(responseData, tableColumns);
                          qs.table_name = tableName;
                          qs.convert = true;
                          const newRow = await GenericFunctions_1.seaTableApiRequest.call(this, ctx, 'GET', `/dtable-server/api/v1/dtables/{{dtable_uuid}}/rows/${encodeURIComponent(insertId)}/`, body, qs);
                          if (newRow._id === undefined) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'SeaTable: No identity for appended row.', { itemIndex: i });
                          }
                          const row = (0, GenericFunctions_1.rowFormatColumns)({ ...newRowInsertData, ...newRow }, tableColumns.map(({ name }) => name).concat(['_id', '_ctime', '_mtime']));
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(row), { 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;
                      }
                  }
              }
              else if (operation === 'get') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const tableId = this.getNodeParameter('tableId', 0);
                          const rowId = this.getNodeParameter('rowId', i);
                          const response = (await GenericFunctions_1.seaTableApiRequest.call(this, ctx, 'GET', `/dtable-server/api/v1/dtables/{{dtable_uuid}}/rows/${rowId}`, {}, { table_id: tableId, convert: true }));
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response), { 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;
                      }
                  }
              }
              else if (operation === 'getAll') {
                  const tableName = this.getNodeParameter('tableName', 0);
                  const tableColumns = await GenericFunctions_1.getTableColumns.call(this, tableName);
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const endpoint = '/dtable-server/api/v1/dtables/{{dtable_uuid}}/rows/';
                          qs.table_name = tableName;
                          const filters = this.getNodeParameter('filters', i);
                          const options = this.getNodeParameter('options', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          Object.assign(qs, filters, options);
                          if (qs.convert_link_id === false) {
                              delete qs.convert_link_id;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.setableApiRequestAllItems.call(this, ctx, 'rows', 'GET', endpoint, body, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.seaTableApiRequest.call(this, ctx, 'GET', endpoint, body, qs);
                              responseData = responseData.rows;
                          }
                          const rows = responseData.map((row) => (0, GenericFunctions_1.rowFormatColumns)({ ...row }, tableColumns.map(({ name }) => name).concat(['_id', '_ctime', '_mtime'])));
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(rows), { 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);
                          }
                          throw error;
                      }
                  }
              }
              else if (operation === 'delete') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const tableName = this.getNodeParameter('tableName', 0);
                          const rowId = this.getNodeParameter('rowId', i);
                          const requestBody = {
                              table_name: tableName,
                              row_id: rowId,
                          };
                          const response = (await GenericFunctions_1.seaTableApiRequest.call(this, ctx, 'DELETE', '/dtable-server/api/v1/dtables/{{dtable_uuid}}/rows/', requestBody, qs));
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response), { 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;
                      }
                  }
              }
              else if (operation === 'update') {
                  const tableName = this.getNodeParameter('tableName', 0);
                  const tableColumns = await GenericFunctions_1.getTableColumns.call(this, tableName);
                  body.table_name = tableName;
                  const fieldsToSend = this.getNodeParameter('fieldsToSend', 0);
                  let rowInput = {};
                  for (let i = 0; i < items.length; i++) {
                      const rowId = this.getNodeParameter('rowId', i);
                      rowInput = {};
                      try {
                          if (fieldsToSend === 'autoMapInputData') {
                              const incomingKeys = Object.keys(items[i].json);
                              const inputDataToIgnore = (0, GenericFunctions_1.split)(this.getNodeParameter('inputsToIgnore', i, ''));
                              for (const key of incomingKeys) {
                                  if (inputDataToIgnore.includes(key))
                                      continue;
                                  rowInput[key] = items[i].json[key];
                              }
                          }
                          else {
                              const columns = this.getNodeParameter('columnsUi.columnValues', i, []);
                              for (const column of columns) {
                                  rowInput[column.columnName] = column.columnValue;
                              }
                          }
                          body.row = (0, GenericFunctions_1.rowExport)(rowInput, (0, GenericFunctions_1.updateAble)(tableColumns));
                          body.table_name = tableName;
                          body.row_id = rowId;
                          responseData = await GenericFunctions_1.seaTableApiRequest.call(this, ctx, 'PUT', '/dtable-server/api/v1/dtables/{{dtable_uuid}}/rows/', body);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ _id: rowId, ...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;
                      }
                  }
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`);
              }
          }
          return [returnData];
      }
  }
  exports.SeaTable = SeaTable;
  //# sourceMappingURL=SeaTable.node.js.map

credential_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SeaTableApi = void 0;
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  const timezones = moment_timezone_1.default.tz
      .countries()
      .reduce((tz, country) => {
      const zonesForCountry = moment_timezone_1.default.tz
          .zonesForCountry(country)
          .map((zone) => ({ value: zone, name: zone }));
      return tz.concat(zonesForCountry);
  }, []);
  class SeaTableApi {
      constructor() {
          this.name = 'seaTableApi';
          this.displayName = 'SeaTable API';
          this.documentationUrl = 'seaTable';
          this.properties = [
              {
                  displayName: 'Environment',
                  name: 'environment',
                  type: 'options',
                  default: 'cloudHosted',
                  options: [
                      {
                          name: 'Cloud-Hosted',
                          value: 'cloudHosted',
                      },
                      {
                          name: 'Self-Hosted',
                          value: 'selfHosted',
                      },
                  ],
              },
              {
                  displayName: 'Self-Hosted Domain',
                  name: 'domain',
                  type: 'string',
                  default: '',
                  placeholder: 'https://www.mydomain.com',
                  displayOptions: {
                      show: {
                          environment: ['selfHosted'],
                      },
                  },
              },
              {
                  displayName: 'API Token (of a Base)',
                  name: 'token',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Timezone',
                  name: 'timezone',
                  type: 'options',
                  default: '',
                  description: "Seatable server's timezone",
                  options: [...timezones],
              },
          ];
      }
  }
  exports.SeaTableApi = SeaTableApi;
  //# sourceMappingURL=SeaTableApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SeaTableApi = void 0;
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  const timezones = moment_timezone_1.default.tz
      .countries()
      .reduce((tz, country) => {
      const zonesForCountry = moment_timezone_1.default.tz
          .zonesForCountry(country)
          .map((zone) => ({ value: zone, name: zone }));
      return tz.concat(zonesForCountry);
  }, []);
  class SeaTableApi {
      constructor() {
          this.name = 'seaTableApi';
          this.displayName = 'SeaTable API';
          this.documentationUrl = 'seaTable';
          this.properties = [
              {
                  displayName: 'Environment',
                  name: 'environment',
                  type: 'options',
                  default: 'cloudHosted',
                  options: [
                      {
                          name: 'Cloud-Hosted',
                          value: 'cloudHosted',
                      },
                      {
                          name: 'Self-Hosted',
                          value: 'selfHosted',
                      },
                  ],
              },
              {
                  displayName: 'Self-Hosted Domain',
                  name: 'domain',
                  type: 'string',
                  default: '',
                  placeholder: 'https://www.mydomain.com',
                  displayOptions: {
                      show: {
                          environment: ['selfHosted'],
                      },
                  },
              },
              {
                  displayName: 'API Token (of a Base)',
                  name: 'token',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Timezone',
                  name: 'timezone',
                  type: 'options',
                  default: '',
                  description: "Seatable server's timezone",
                  options: [...timezones],
              },
          ];
      }
  }
  exports.SeaTableApi = SeaTableApi;
  //# sourceMappingURL=SeaTableApi.credentials.js.map

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

  # SeaTable node

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

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

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

  ## Operations

  * Row
      * Create
      * Delete
      * Get
      * Get All
      * Update

  ## Templates and examples

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

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


node_type: n8n-nodes-base.Sendy
name: Sendy
display_name: Sendy
description: Consume Sendy API
category: input
icon: file:sendy.png
code_hash: 8f1551f664c318139782631bc2298a5dc48d279198dcc99bfff803806441c8ab
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Sendy
documentation_title: Sendy node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"sendy","description":"Templates for sendy"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:34
updated_at: 2025-06-09 15:18:34
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Sendy = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const CampaignDescription_1 = require("./CampaignDescription");
  const SubscriberDescription_1 = require("./SubscriberDescription");
  class Sendy {
      constructor() {
          this.description = {
              displayName: 'Sendy',
              name: 'sendy',
              icon: 'file:sendy.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Sendy API',
              defaults: {
                  name: 'Sendy',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'sendyApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Campaign',
                              value: 'campaign',
                          },
                          {
                              name: 'Subscriber',
                              value: 'subscriber',
                          },
                      ],
                      default: 'subscriber',
                  },
                  ...CampaignDescription_1.campaignOperations,
                  ...CampaignDescription_1.campaignFields,
                  ...SubscriberDescription_1.subscriberOperations,
                  ...SubscriberDescription_1.subscriberFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              if (resource === 'campaign') {
                  if (operation === 'create') {
                      const fromName = this.getNodeParameter('fromName', i);
                      const fromEmail = this.getNodeParameter('fromEmail', i);
                      const replyTo = this.getNodeParameter('replyTo', i);
                      const title = this.getNodeParameter('title', i);
                      const subject = this.getNodeParameter('subject', i);
                      const htmlText = this.getNodeParameter('htmlText', i);
                      const sendCampaign = this.getNodeParameter('sendCampaign', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      let brandId = null;
                      if (!sendCampaign) {
                          brandId = this.getNodeParameter('brandId', i);
                      }
                      const body = {
                          from_name: fromName,
                          from_email: fromEmail,
                          reply_to: replyTo,
                          title,
                          subject,
                          send_campaign: sendCampaign ? 1 : 0,
                          html_text: htmlText,
                      };
                      if (brandId) {
                          body.brand_id = brandId;
                      }
                      if (additionalFields.plainText) {
                          body.plain_text = additionalFields.plainText;
                      }
                      if (additionalFields.listIds) {
                          body.list_ids = additionalFields.listIds;
                      }
                      if (additionalFields.segmentIds) {
                          body.segment_ids = additionalFields.segmentIds;
                      }
                      if (additionalFields.excludeListIds) {
                          body.exclude_list_ids = additionalFields.excludeListIds;
                      }
                      if (additionalFields.excludeSegmentIds) {
                          body.exclude_segments_ids = additionalFields.excludeSegmentIds;
                      }
                      if (additionalFields.queryString) {
                          body.query_string = additionalFields.queryString;
                      }
                      if (additionalFields.trackOpens) {
                          body.track_opens = additionalFields.trackOpens ? 1 : 0;
                      }
                      if (additionalFields.trackClicks) {
                          body.track_clicks = additionalFields.trackClicks ? 1 : 0;
                      }
                      responseData = await GenericFunctions_1.sendyApiRequest.call(this, 'POST', '/api/campaigns/create.php', body);
                      const success = ['Campaign created', 'Campaign created and now sending'];
                      if (success.includes(responseData)) {
                          responseData = { message: responseData };
                      }
                      else {
                          throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData, { httpCode: '400' });
                      }
                  }
              }
              if (resource === 'subscriber') {
                  if (operation === 'add') {
                      const email = this.getNodeParameter('email', i);
                      const listId = this.getNodeParameter('listId', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          email,
                          list: listId,
                      };
                      Object.assign(body, additionalFields);
                      responseData = await GenericFunctions_1.sendyApiRequest.call(this, 'POST', '/subscribe', body);
                      if (responseData === '1') {
                          responseData = { success: true };
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Sendy error response [${400}]: ${responseData}`, { itemIndex: i });
                      }
                  }
                  if (operation === 'count') {
                      const listId = this.getNodeParameter('listId', i);
                      const body = {
                          list_id: listId,
                      };
                      responseData = await GenericFunctions_1.sendyApiRequest.call(this, 'POST', '/api/subscribers/active-subscriber-count.php', body);
                      const errors = [
                          'No data passed',
                          'API key not passed',
                          'Invalid API key',
                          'List ID not passed',
                          'List does not exist',
                      ];
                      if (!errors.includes(responseData)) {
                          responseData = { count: responseData };
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Sendy error response [${400}]: ${responseData}`, { itemIndex: i });
                      }
                  }
                  if (operation === 'delete') {
                      const email = this.getNodeParameter('email', i);
                      const listId = this.getNodeParameter('listId', i);
                      const body = {
                          email,
                          list_id: listId,
                      };
                      responseData = await GenericFunctions_1.sendyApiRequest.call(this, 'POST', '/api/subscribers/delete.php', body);
                      if (responseData === '1') {
                          responseData = { success: true };
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Sendy error response [${400}]: ${responseData}`, { itemIndex: i });
                      }
                  }
                  if (operation === 'remove') {
                      const email = this.getNodeParameter('email', i);
                      const listId = this.getNodeParameter('listId', i);
                      const body = {
                          email,
                          list: listId,
                      };
                      responseData = await GenericFunctions_1.sendyApiRequest.call(this, 'POST', '/unsubscribe', body);
                      if (responseData === '1') {
                          responseData = { success: true };
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Sendy error response [${400}]: ${responseData}`, { itemIndex: i });
                      }
                  }
                  if (operation === 'status') {
                      const email = this.getNodeParameter('email', i);
                      const listId = this.getNodeParameter('listId', i);
                      const body = {
                          email,
                          list_id: listId,
                      };
                      responseData = await GenericFunctions_1.sendyApiRequest.call(this, 'POST', '/api/subscribers/subscription-status.php', body);
                      const status = [
                          'Subscribed',
                          'Unsubscribed',
                          'Unconfirmed',
                          'Bounced',
                          'Soft bounced',
                          'Complained',
                      ];
                      if (status.includes(responseData)) {
                          responseData = { status: responseData };
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Sendy error response [${400}]: ${responseData}`, { itemIndex: i });
                      }
                  }
              }
          }
          if (Array.isArray(responseData)) {
              returnData.push.apply(returnData, responseData);
          }
          else if (responseData !== undefined) {
              returnData.push(responseData);
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Sendy = Sendy;
  //# sourceMappingURL=Sendy.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SendyApi = void 0;
  class SendyApi {
      constructor() {
          this.name = 'sendyApi';
          this.displayName = 'Sendy API';
          this.documentationUrl = 'sendy';
          this.properties = [
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://yourdomain.com',
              },
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.SendyApi = SendyApi;
  //# sourceMappingURL=SendyApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SendyApi = void 0;
  class SendyApi {
      constructor() {
          this.name = 'sendyApi';
          this.displayName = 'Sendy API';
          this.documentationUrl = 'sendy';
          this.properties = [
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://yourdomain.com',
              },
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.SendyApi = SendyApi;
  //# sourceMappingURL=SendyApi.credentials.js.map

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

  # Sendy node

  Use the Sendy node to automate work in Sendy, and integrate Sendy with other applications. n8n has built-in support for a wide range of Sendy features, including creating campaigns, and adding, counting, deleting, and getting subscribers.

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

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

  ## Operations

  * Campaign
      * Create a campaign
  * Subscriber
      * Add a subscriber to a list
      * Count subscribers
      * Delete a subscriber from a list
      * Unsubscribe user from a list
      * Get the status of subscriber

  ## Templates and examples

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

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


node_type: n8n-nodes-base.Set
name: Set
display_name: Set
description: Add or edit fields on an input item and optionally remove other fields
category: input
icon: fa:pen
code_hash: 4414ad216090aa4ae629fc2ed5ae175c48bde7392d1133b82f472edcd1620065
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.Set
documentation_title: Edit Fields (Set)
operations: []
api_methods: []
templates: [{"name":"set","description":"Templates for set"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-09 15:18:34
updated_at: 2025-06-09 15:18:34
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Set = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const SetV1_node_1 = require("./v1/SetV1.node");
  const SetV2_node_1 = require("./v2/SetV2.node");
  class Set extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Set',
              name: 'set',
              icon: 'fa:pen',
              group: ['input'],
              description: 'Add or edit fields on an input item and optionally remove other fields',
              defaultVersion: 3.2,
          };
          const nodeVersions = {
              1: new SetV1_node_1.SetV1(baseDescription),
              2: new SetV1_node_1.SetV1(baseDescription),
              3: new SetV2_node_1.SetV2(baseDescription),
              3.1: new SetV2_node_1.SetV2(baseDescription),
              3.2: new SetV2_node_1.SetV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Set = Set;
  //# sourceMappingURL=Set.node.js.map

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

  # Edit Fields (Set)

  Use the Edit Fields node to set workflow data. This node can set new data as well as overwrite data that already exists. This node is crucial in workflows which expect incoming data from previous nodes, such as when inserting values to Google Sheets or databases.

  ## Node parameters

  These are the settings and options available in the Edit Fields node.

  ### Mode

  You can either use **Manual Mapping** to edit fields using the GUI or **JSON Output** to write JSON that n8n adds to the input data.

  ### Fields to Set

  If you select **Mode** > **Manual Mapping**, you can configure the fields by dragging and dropping values from **INPUT**.

  The default behavior when you drag a value is:

  * n8n sets the value's name as the field name.
  * The field value contains an expression which accesses the value.

  If you don't want to use expressions:

  1. Hover over a field. n8n displays the **Fixed | Expressions** toggle. 
  1. Select **Fixed**.

  You can do this for both the name and value of the field.

  ![A gif showing the drag and drop action, as well as changing a field to fixed](/_images/integrations/builtin/core-nodes/set/drag-drop-fixed-toggle.gif)

  ### Keep Only Set Fields

  Enable this to discard any input data that you don't use in **Fields to Set**.

  ### Include in Output

  Choose which input data to include in the node's output data.

  ## Node options

  Use these options to customize the behavior of the node.

  ### Include Binary Data

  If the input data includes binary data, choose whether to include it in the Edit Fields node's output data.

  ### Ignore Type Conversion Errors

  Manual Mapping only.

  Enabling this allows n8n to ignore some data type errors when mapping fields.

  ### Support Dot Notation

  By default, n8n supports dot notation.

  For example, when using manual mapping, the node follows the dot notation for the **Name** field. That means if you set the name in the **Name** field as `number.one` and the value in the **Value** field as `20`, the resulting JSON is:

  ```json
  { "number": { "one": 20} }
  ```

  You can prevent this behavior by selecting **Add Option** > **Support Dot Notation**, and setting the **Dot Notion** field to off. Now the resulting JSON is:

  ```json
  { "number.one": 20 }
  ```
  ## Templates and examples

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

  ## Arrays and expressions in JSON Output mode

  You can use arrays and expressions when creating your JSON Output.

  For example, given this input data generated by the Customer Datastore node:

  ```json
  [
    {
      "id": "23423532",
      "name": "Jay Gatsby",
      "email": "gatsby@west-egg.com",
      "notes": "Keeps asking about a green light??",
      "country": "US",
      "created": "1925-04-10"
    },
    {
      "id": "23423533",
      "name": "José Arcadio Buendía",
      "email": "jab@macondo.co",
      "notes": "Lots of people named after him. Very confusing",
      "country": "CO",
      "created": "1967-05-05"
    },
    {
      "id": "23423534",
      "name": "Max Sendak",
      "email": "info@in-and-out-of-weeks.org",
      "notes": "Keeps rolling his terrible eyes",
      "country": "US",
      "created": "1963-04-09"
    },
    {
      "id": "23423535",
      "name": "Zaphod Beeblebrox",
      "email": "captain@heartofgold.com",
      "notes": "Felt like I was talking to more than one person",
      "country": null,
      "created": "1979-10-12"
    },
    {
      "id": "23423536",
      "name": "Edmund Pevensie",
      "email": "edmund@narnia.gov",
      "notes": "Passionate sailor",
      "country": "UK",
      "created": "1950-10-16"
    }
  ]
  ```

  Add the following JSON in the **JSON Output** field, with **Include in Output** set to **All Input Fields**:

  ```json
  {
    "newKey": "new value",
    "array": [{{ $json.id }},"{{ $json.name }}"],
    "object": {
      "innerKey1": "new value",
      "innerKey2": "{{ $json.id }}",
      "innerKey3": "{{ $json.name }}",
   }
  }
  ```

  You get this output:

  ```json
  [
    {
      "id": "23423532",
      "name": "Jay Gatsby",
      "email": "gatsby@west-egg.com",
      "notes": "Keeps asking about a green light??",
      "country": "US",
      "created": "1925-04-10",
      "newKey": "new value",
      "array": [
        23423532,
        "Jay Gatsby"
      ],
      "object": {
        "innerKey1": "new value",
        "innerKey2": "23423532",
        "innerKey3": "Jay Gatsby"
      }
    },
    {
      "id": "23423533",
      "name": "José Arcadio Buendía",
      "email": "jab@macondo.co",
      "notes": "Lots of people named after him. Very confusing",
      "country": "CO",
      "created": "1967-05-05",
      "newKey": "new value",
      "array": [
        23423533,
        "José Arcadio Buendía"
      ],
      "object": {
        "innerKey1": "new value",
        "innerKey2": "23423533",
        "innerKey3": "José Arcadio Buendía"
      }
    },
    {
      "id": "23423534",
      "name": "Max Sendak",
      "email": "info@in-and-out-of-weeks.org",
      "notes": "Keeps rolling his terrible eyes",
      "country": "US",
      "created": "1963-04-09",
      "newKey": "new value",
      "array": [
        23423534,
        "Max Sendak"
      ],
      "object": {
        "innerKey1": "new value",
        "innerKey2": "23423534",
        "innerKey3": "Max Sendak"
      }
    },
    {
      "id": "23423535",
      "name": "Zaphod Beeblebrox",
      "email": "captain@heartofgold.com",
      "notes": "Felt like I was talking to more than one person",
      "country": null,
      "created": "1979-10-12",
      "newKey": "new value",
      "array": [
        23423535,
        "Zaphod Beeblebrox"
      ],
      "object": {
        "innerKey1": "new value",
        "innerKey2": "23423535",
        "innerKey3": "Zaphod Beeblebrox"
      }
    },
    {
      "id": "23423536",
      "name": "Edmund Pevensie",
      "email": "edmund@narnia.gov",
      "notes": "Passionate sailor",
      "country": "UK",
      "created": "1950-10-16",
      "newKey": "new value",
      "array": [
        23423536,
        "Edmund Pevensie"
      ],
      "object": {
        "innerKey1": "new value",
        "innerKey2": "23423536",
        "innerKey3": "Edmund Pevensie"
      }
    }
  ]
  ```

documentation_examples:
  [{"type":"json","language":"json","code":"{ \"number\": { \"one\": 20} }"},{"type":"json","language":"json","code":"{ \"number.one\": 20 }"},{"type":"json","language":"json","code":"[\n  {\n    \"id\": \"23423532\",\n    \"name\": \"Jay Gatsby\",\n    \"email\": \"gatsby@west-egg.com\",\n    \"notes\": \"Keeps asking about a green light??\",\n    \"country\": \"US\",\n    \"created\": \"1925-04-10\"\n  },\n  {\n    \"id\": \"23423533\",\n    \"name\": \"José Arcadio Buendía\",\n    \"email\": \"jab@macondo.co\",\n    \"notes\": \"Lots of people named after him. Very confusing\",\n    \"country\": \"CO\",\n    \"created\": \"1967-05-05\"\n  },\n  {\n    \"id\": \"23423534\",\n    \"name\": \"Max Sendak\",\n    \"email\": \"info@in-and-out-of-weeks.org\",\n    \"notes\": \"Keeps rolling his terrible eyes\",\n    \"country\": \"US\",\n    \"created\": \"1963-04-09\"\n  },\n  {\n    \"id\": \"23423535\",\n    \"name\": \"Zaphod Beeblebrox\",\n    \"email\": \"captain@heartofgold.com\",\n    \"notes\": \"Felt like I was talking to more than one person\",\n    \"country\": null,\n    \"created\": \"1979-10-12\"\n  },\n  {\n    \"id\": \"23423536\",\n    \"name\": \"Edmund Pevensie\",\n    \"email\": \"edmund@narnia.gov\",\n    \"notes\": \"Passionate sailor\",\n    \"country\": \"UK\",\n    \"created\": \"1950-10-16\"\n  }\n]"},{"type":"json","language":"json","code":"[\n  {\n    \"id\": \"23423532\",\n    \"name\": \"Jay Gatsby\",\n    \"email\": \"gatsby@west-egg.com\",\n    \"notes\": \"Keeps asking about a green light??\",\n    \"country\": \"US\",\n    \"created\": \"1925-04-10\",\n    \"newKey\": \"new value\",\n    \"array\": [\n      23423532,\n      \"Jay Gatsby\"\n    ],\n    \"object\": {\n      \"innerKey1\": \"new value\",\n      \"innerKey2\": \"23423532\",\n      \"innerKey3\": \"Jay Gatsby\"\n    }\n  },\n  {\n    \"id\": \"23423533\",\n    \"name\": \"José Arcadio Buendía\",\n    \"email\": \"jab@macondo.co\",\n    \"notes\": \"Lots of people named after him. Very confusing\",\n    \"country\": \"CO\",\n    \"created\": \"1967-05-05\",\n    \"newKey\": \"new value\",\n    \"array\": [\n      23423533,\n      \"José Arcadio Buendía\"\n    ],\n    \"object\": {\n      \"innerKey1\": \"new value\",\n      \"innerKey2\": \"23423533\",\n      \"innerKey3\": \"José Arcadio Buendía\"\n    }\n  },\n  {\n    \"id\": \"23423534\",\n    \"name\": \"Max Sendak\",\n    \"email\": \"info@in-and-out-of-weeks.org\",\n    \"notes\": \"Keeps rolling his terrible eyes\",\n    \"country\": \"US\",\n    \"created\": \"1963-04-09\",\n    \"newKey\": \"new value\",\n    \"array\": [\n      23423534,\n      \"Max Sendak\"\n    ],\n    \"object\": {\n      \"innerKey1\": \"new value\",\n      \"innerKey2\": \"23423534\",\n      \"innerKey3\": \"Max Sendak\"\n    }\n  },\n  {\n    \"id\": \"23423535\",\n    \"name\": \"Zaphod Beeblebrox\",\n    \"email\": \"captain@heartofgold.com\",\n    \"notes\": \"Felt like I was talking to more than one person\",\n    \"country\": null,\n    \"created\": \"1979-10-12\",\n    \"newKey\": \"new value\",\n    \"array\": [\n      23423535,\n      \"Zaphod Beeblebrox\"\n    ],\n    \"object\": {\n      \"innerKey1\": \"new value\",\n      \"innerKey2\": \"23423535\",\n      \"innerKey3\": \"Zaphod Beeblebrox\"\n    }\n  },\n  {\n    \"id\": \"23423536\",\n    \"name\": \"Edmund Pevensie\",\n    \"email\": \"edmund@narnia.gov\",\n    \"notes\": \"Passionate sailor\",\n    \"country\": \"UK\",\n    \"created\": \"1950-10-16\",\n    \"newKey\": \"new value\",\n    \"array\": [\n      23423536,\n      \"Edmund Pevensie\"\n    ],\n    \"object\": {\n      \"innerKey1\": \"new value\",\n      \"innerKey2\": \"23423536\",\n      \"innerKey3\": \"Edmund Pevensie\"\n    }\n  }\n]"}]

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


node_type: n8n-nodes-base.ServiceNow
name: ServiceNow
display_name: ServiceNow
description: Consume ServiceNow API
category: output
icon: file:servicenow.svg
code_hash: ff46288455e6d2f1a7f7f9bd7f3b80f839079d11a53c14846d3bf88f7f162af2
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.ServiceNow
documentation_title: ServiceNow node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"servicenow","description":"Templates for servicenow"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:34
updated_at: 2025-06-09 15:18:34
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ServiceNow = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const AttachmentDescription_1 = require("./AttachmentDescription");
  const BusinessServiceDescription_1 = require("./BusinessServiceDescription");
  const ConfigurationItemsDescription_1 = require("./ConfigurationItemsDescription");
  const DepartmentDescription_1 = require("./DepartmentDescription");
  const DictionaryDescription_1 = require("./DictionaryDescription");
  const IncidentDescription_1 = require("./IncidentDescription");
  const TableRecordDescription_1 = require("./TableRecordDescription");
  const UserDescription_1 = require("./UserDescription");
  const UserGroupDescription_1 = require("./UserGroupDescription");
  const UserRoleDescription_1 = require("./UserRoleDescription");
  class ServiceNow {
      constructor() {
          this.description = {
              displayName: 'ServiceNow',
              name: 'serviceNow',
              icon: 'file:servicenow.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume ServiceNow API',
              defaults: {
                  name: 'ServiceNow',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'serviceNowOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
                  {
                      name: 'serviceNowBasicApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['basicAuth'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Basic Auth',
                              value: 'basicAuth',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'oAuth2',
                      description: 'Authentication method to use',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Attachment',
                              value: 'attachment',
                          },
                          {
                              name: 'Business Service',
                              value: 'businessService',
                          },
                          {
                              name: 'Configuration Item',
                              value: 'configurationItems',
                          },
                          {
                              name: 'Department',
                              value: 'department',
                          },
                          {
                              name: 'Dictionary',
                              value: 'dictionary',
                          },
                          {
                              name: 'Incident',
                              value: 'incident',
                          },
                          {
                              name: 'Table Record',
                              value: 'tableRecord',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                          {
                              name: 'User Group',
                              value: 'userGroup',
                          },
                          {
                              name: 'User Role',
                              value: 'userRole',
                          },
                      ],
                      default: 'user',
                  },
                  ...AttachmentDescription_1.attachmentOperations,
                  ...AttachmentDescription_1.attachmentFields,
                  ...BusinessServiceDescription_1.businessServiceOperations,
                  ...BusinessServiceDescription_1.businessServiceFields,
                  ...ConfigurationItemsDescription_1.configurationItemsOperations,
                  ...ConfigurationItemsDescription_1.configurationItemsFields,
                  ...DepartmentDescription_1.departmentOperations,
                  ...DepartmentDescription_1.departmentFields,
                  ...DictionaryDescription_1.dictionaryOperations,
                  ...DictionaryDescription_1.dictionaryFields,
                  ...IncidentDescription_1.incidentOperations,
                  ...IncidentDescription_1.incidentFields,
                  ...TableRecordDescription_1.tableRecordOperations,
                  ...TableRecordDescription_1.tableRecordFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
                  ...UserGroupDescription_1.userGroupOperations,
                  ...UserGroupDescription_1.userGroupFields,
                  ...UserRoleDescription_1.userRoleOperations,
                  ...UserRoleDescription_1.userRoleFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTables() {
                      const returnData = [];
                      const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/doc/table/schema', {}, {});
                      for (const table of response.result) {
                          returnData.push({
                              name: table.label,
                              value: table.value,
                              description: table.value,
                          });
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getColumns() {
                      const resource = this.getNodeParameter('resource', 0);
                      const operation = this.getNodeParameter('operation', 0);
                      const returnData = [];
                      let tableName;
                      if (resource === 'tableRecord') {
                          tableName = this.getNodeParameter('tableName');
                      }
                      else {
                          tableName = (0, GenericFunctions_1.mapEndpoint)(resource, operation);
                      }
                      const qs = {
                          sysparm_query: `name=${tableName}`,
                          sysparm_fields: 'column_label,element',
                      };
                      const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/sys_dictionary', {}, qs);
                      for (const column of response.result) {
                          if (column.element) {
                              returnData.push({
                                  name: column.column_label,
                                  value: column.element,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getBusinessServices() {
                      const returnData = [];
                      const qs = {
                          sysparm_fields: 'name,sys_id',
                      };
                      const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/cmdb_ci_service', {}, qs);
                      for (const column of response.result) {
                          returnData.push({
                              name: column.name,
                              value: column.sys_id,
                          });
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getUsers() {
                      const returnData = [];
                      const resource = this.getNodeParameter('resource', 0);
                      const operation = this.getNodeParameter('operation', 0);
                      const qs = {
                          sysparm_fields: 'sys_id,user_name',
                      };
                      if (resource === 'incident' && operation === 'create') {
                          const additionalFields = this.getNodeParameter('additionalFields');
                          const group = additionalFields.assignment_group;
                          const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_user_grmember', {}, {
                              sysparm_query: `group=${group}^`,
                          });
                          for (const column of response) {
                              if (column.user) {
                                  const responseData = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', `/now/table/sys_user/${column.user.value}`, {}, {});
                                  const user = responseData.result;
                                  returnData.push({
                                      name: user.user_name,
                                      value: user.sys_id,
                                  });
                              }
                          }
                      }
                      else {
                          const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_user', {}, qs);
                          for (const column of response) {
                              if (column.user_name) {
                                  returnData.push({
                                      name: column.user_name,
                                      value: column.sys_id,
                                  });
                              }
                          }
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getAssignmentGroups() {
                      const returnData = [];
                      const qs = {
                          sysparm_fields: 'sys_id,name',
                      };
                      const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_user_group', {}, qs);
                      for (const column of response) {
                          if (column.name) {
                              returnData.push({
                                  name: column.name,
                                  value: column.sys_id,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getUserRoles() {
                      const returnData = [];
                      const qs = {
                          sysparm_fields: 'sys_id,name',
                      };
                      const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_user_role', {}, qs);
                      for (const column of response) {
                          if (column.name) {
                              returnData.push({
                                  name: column.name,
                                  value: column.sys_id,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getConfigurationItems() {
                      const returnData = [];
                      const qs = {
                          sysparm_fields: 'sys_id,name,sys_class_name',
                      };
                      const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/cmdb_ci', {}, qs);
                      for (const column of response) {
                          if (column.name) {
                              returnData.push({
                                  name: column.name,
                                  value: column.sys_id,
                                  description: column.sys_class_name,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getIncidentCategories() {
                      const returnData = [];
                      const qs = {
                          sysparm_fields: 'label,value',
                          sysparm_query: 'element=category^name=incident',
                      };
                      const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_choice', {}, qs);
                      for (const column of response) {
                          returnData.push({
                              name: column.label,
                              value: column.value,
                          });
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getIncidentSubcategories() {
                      const returnData = [];
                      const operation = this.getNodeParameter('operation');
                      let category;
                      if (operation === 'update') {
                          const updateFields = this.getNodeParameter('updateFields');
                          category = updateFields.category;
                      }
                      else {
                          const additionalFields = this.getNodeParameter('additionalFields');
                          category = additionalFields.category;
                      }
                      const qs = {
                          sysparm_fields: 'label,value',
                          sysparm_query: `name=incident^element=subcategory^dependent_value=${category}`,
                      };
                      const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_choice', {}, qs);
                      for (const column of response) {
                          returnData.push({
                              name: column.label,
                              value: column.value,
                          });
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getIncidentStates() {
                      const returnData = [];
                      const qs = {
                          sysparm_fields: 'label,value',
                          sysparm_query: 'element=state^name=incident',
                      };
                      const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_choice', {}, qs);
                      for (const column of response) {
                          returnData.push({
                              name: column.label,
                              value: column.value,
                          });
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getIncidentResolutionCodes() {
                      const returnData = [];
                      const qs = {
                          sysparm_fields: 'label,value',
                          sysparm_query: 'element=close_code^name=incident',
                      };
                      const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_choice', {}, qs);
                      for (const column of response) {
                          returnData.push({
                              name: column.label,
                              value: column.value,
                          });
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
                  async getIncidentHoldReasons() {
                      const returnData = [];
                      const qs = {
                          sysparm_fields: 'label,value',
                          sysparm_query: 'element=hold_reason^name=incident',
                      };
                      const response = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_choice', {}, qs);
                      for (const column of response) {
                          returnData.push({
                              name: column.label,
                              value: column.value,
                          });
                      }
                      return (0, GenericFunctions_1.sortData)(returnData);
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData = {};
          let qs;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'attachment') {
                      if (operation === 'get') {
                          const attachmentsSysId = this.getNodeParameter('attachmentId', i);
                          const download = this.getNodeParameter('download', i);
                          const endpoint = `/now/attachment/${attachmentsSysId}`;
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', endpoint, {});
                          const fileMetadata = response.result;
                          responseData = {
                              json: fileMetadata,
                          };
                          if (download) {
                              const outputField = this.getNodeParameter('outputField', i);
                              responseData = {
                                  ...responseData,
                                  binary: {
                                      [outputField]: await GenericFunctions_1.serviceNowDownloadAttachment.call(this, endpoint, fileMetadata.file_name, fileMetadata.content_type),
                                  },
                              };
                          }
                      }
                      else if (operation === 'getAll') {
                          const download = this.getNodeParameter('download', i);
                          const tableName = this.getNodeParameter('tableName', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          qs = {};
                          qs.sysparm_query = `table_name=${tableName}`;
                          if (options.queryFilter) {
                              qs.sysparm_query = `${qs.sysparm_query}^${options.queryFilter}`;
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/attachment', {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/attachment', {}, qs);
                          }
                          if (download) {
                              const outputField = this.getNodeParameter('outputField', i);
                              const responseDataWithAttachments = [];
                              for (const data of responseData) {
                                  responseDataWithAttachments.push({
                                      json: data,
                                      binary: {
                                          [outputField]: await GenericFunctions_1.serviceNowDownloadAttachment.call(this, `/now/attachment/${data.sys_id}`, data.file_name, data.content_type),
                                      },
                                  });
                              }
                              responseData = responseDataWithAttachments;
                          }
                          else {
                              responseData = responseData.map((data) => ({ json: data }));
                          }
                      }
                      else if (operation === 'upload') {
                          const tableName = this.getNodeParameter('tableName', i);
                          const recordId = this.getNodeParameter('id', i);
                          const inputDataFieldName = this.getNodeParameter('inputDataFieldName', i);
                          const options = this.getNodeParameter('options', i);
                          const binaryData = this.helpers.assertBinaryData(i, inputDataFieldName);
                          const headers = {
                              'Content-Type': binaryData.mimeType,
                          };
                          const query = {
                              table_name: tableName,
                              table_sys_id: recordId,
                              file_name: binaryData.fileName
                                  ? binaryData.fileName
                                  : `${inputDataFieldName}.${binaryData.fileExtension}`,
                              ...options,
                          };
                          const body = await this.helpers.getBinaryDataBuffer(i, inputDataFieldName);
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'POST', '/now/attachment/file', body, query, '', { headers });
                          responseData = response.result;
                      }
                      else if (operation === 'delete') {
                          const attachmentsSysId = this.getNodeParameter('attachmentId', i);
                          await GenericFunctions_1.serviceNowApiRequest.call(this, 'DELETE', `/now/attachment/${attachmentsSysId}`);
                          responseData = { success: true };
                      }
                  }
                  else if (resource === 'businessService') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/cmdb_ci_service', {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/cmdb_ci_service', {}, qs);
                          }
                      }
                  }
                  else if (resource === 'configurationItems') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/cmdb_ci', {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/cmdb_ci', {}, qs);
                          }
                      }
                  }
                  else if (resource === 'department') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/cmn_department', {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/cmn_department', {}, qs);
                          }
                      }
                  }
                  else if (resource === 'dictionary') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/sys_dictionary', {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_dictionary', {}, qs);
                          }
                      }
                  }
                  else if (resource === 'incident') {
                      if (operation === 'create') {
                          const shortDescription = this.getNodeParameter('short_description', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              short_description: shortDescription,
                              ...additionalFields,
                          };
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'POST', '/now/table/incident', body);
                          responseData = response.result;
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.serviceNowApiRequest.call(this, 'DELETE', `/now/table/incident/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', `/now/table/incident/${id}`, {}, qs);
                          responseData = response.result;
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/incident', {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/incident', {}, qs);
                          }
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = this.getNodeParameter('updateFields', i);
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'PATCH', `/now/table/incident/${id}`, body);
                          responseData = response.result;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'tableRecord') {
                      if (operation === 'create') {
                          const tableName = this.getNodeParameter('tableName', i);
                          const dataToSend = this.getNodeParameter('dataToSend', i);
                          let body = {};
                          if (dataToSend === 'mapInput') {
                              const inputsToIgnore = this.getNodeParameter('inputsToIgnore', i)
                                  .split(',')
                                  .map((field) => field.trim());
                              body = Object.entries(items[i].json)
                                  .filter(([key]) => !inputsToIgnore.includes(key))
                                  .reduce((obj, [key, val]) => Object.assign(obj, { [key]: val }), {});
                          }
                          else if (dataToSend === 'columns') {
                              const fieldsToSend = this.getNodeParameter('fieldsToSend', i);
                              body = fieldsToSend.field.reduce((obj, field) => {
                                  obj[field.column] = field.value;
                                  return obj;
                              }, {});
                          }
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'POST', `/now/table/${tableName}`, body);
                          responseData = response.result;
                      }
                      else if (operation === 'delete') {
                          const tableName = this.getNodeParameter('tableName', i);
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.serviceNowApiRequest.call(this, 'DELETE', `/now/table/${tableName}/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const tableName = this.getNodeParameter('tableName', i);
                          const id = this.getNodeParameter('id', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', `/now/table/${tableName}/${id}`, {}, qs);
                          responseData = response.result;
                      }
                      else if (operation === 'getAll') {
                          const tableName = this.getNodeParameter('tableName', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', `/now/table/${tableName}`, {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', `/now/table/${tableName}`, {}, qs);
                          }
                      }
                      else if (operation === 'update') {
                          const tableName = this.getNodeParameter('tableName', i);
                          const id = this.getNodeParameter('id', i);
                          const dataToSend = this.getNodeParameter('dataToSend', i);
                          let body = {};
                          if (dataToSend === 'mapInput') {
                              const inputsToIgnore = this.getNodeParameter('inputsToIgnore', i)
                                  .split(',')
                                  .map((field) => field.trim());
                              body = Object.entries(items[i].json)
                                  .filter(([key]) => !inputsToIgnore.includes(key))
                                  .reduce((obj, [key, val]) => Object.assign(obj, { [key]: val }), {});
                          }
                          else if (dataToSend === 'columns') {
                              const fieldsToSend = this.getNodeParameter('fieldsToSend', i);
                              body = fieldsToSend.field.reduce((obj, field) => {
                                  obj[field.column] = field.value;
                                  return obj;
                              }, {});
                          }
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'PATCH', `/now/table/${tableName}/${id}`, body);
                          responseData = response.result;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'create') {
                          const body = this.getNodeParameter('additionalFields', i);
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'POST', '/now/table/sys_user', body);
                          responseData = response.result;
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.serviceNowApiRequest.call(this, 'DELETE', `/now/table/sys_user/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const getOption = this.getNodeParameter('getOption', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (getOption === 'id') {
                              const id = this.getNodeParameter('id', i);
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', `/now/table/sys_user/${id}`, {}, qs);
                              responseData = response.result;
                          }
                          else {
                              const userName = this.getNodeParameter('user_name', i);
                              qs.sysparm_query = `user_name=${userName}`;
                              qs.sysparm_limit = 1;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/sys_user', {}, qs);
                              responseData = response.result;
                          }
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/sys_user', {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_user', {}, qs);
                          }
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = this.getNodeParameter('updateFields', i);
                          const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'PATCH', `/now/table/sys_user/${id}`, body);
                          responseData = response.result;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'userGroup') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/sys_user_group', {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_user_group', {}, qs);
                          }
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'userRole') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (qs.sysparm_fields && typeof qs.sysparm_fields !== 'string') {
                              qs.sysparm_fields = qs.sysparm_fields.join(',');
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.sysparm_limit = limit;
                              const response = await GenericFunctions_1.serviceNowApiRequest.call(this, 'GET', '/now/table/sys_user_role', {}, qs);
                              responseData = response.result;
                          }
                          else {
                              responseData = await GenericFunctions_1.serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_user_role', {}, qs);
                          }
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
              }
              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);
          }
          if (resource === 'attachment') {
              if (operation === 'get' || operation === 'getAll') {
                  return [returnData];
              }
          }
          return [returnData];
      }
  }
  exports.ServiceNow = ServiceNow;
  //# sourceMappingURL=ServiceNow.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ServiceNowOAuth2Api = void 0;
  class ServiceNowOAuth2Api {
      constructor() {
          this.name = 'serviceNowOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'ServiceNow OAuth2 API';
          this.documentationUrl = 'serviceNow';
          this.properties = [
              {
                  displayName: 'Subdomain',
                  name: 'subdomain',
                  type: 'string',
                  default: '',
                  hint: 'The subdomain can be extracted from the URL. If the URL is: https://dev99890.service-now.com the subdomain is dev99890',
                  required: true,
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: '=https://{{$self["subdomain"]}}.service-now.com/oauth_auth.do',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: '=https://{{$self["subdomain"]}}.service-now.com/oauth_token.do',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'useraccount',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: 'response_type=code',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: 'grant_type=authorization_code',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.ServiceNowOAuth2Api = ServiceNowOAuth2Api;
  //# sourceMappingURL=ServiceNowOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ServiceNowOAuth2Api = void 0;
  class ServiceNowOAuth2Api {
      constructor() {
          this.name = 'serviceNowOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'ServiceNow OAuth2 API';
          this.documentationUrl = 'serviceNow';
          this.properties = [
              {
                  displayName: 'Subdomain',
                  name: 'subdomain',
                  type: 'string',
                  default: '',
                  hint: 'The subdomain can be extracted from the URL. If the URL is: https://dev99890.service-now.com the subdomain is dev99890',
                  required: true,
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: '=https://{{$self["subdomain"]}}.service-now.com/oauth_auth.do',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: '=https://{{$self["subdomain"]}}.service-now.com/oauth_token.do',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'useraccount',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: 'response_type=code',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: 'grant_type=authorization_code',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.ServiceNowOAuth2Api = ServiceNowOAuth2Api;
  //# sourceMappingURL=ServiceNowOAuth2Api.credentials.js.map

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

  # ServiceNow node

  Use the ServiceNow node to automate work in ServiceNow, and integrate ServiceNow with other applications. n8n has built-in support for a wide range of ServiceNow features, including getting business services, departments, configuration items, and dictionary as well as creating, updating, and deleting incidents, users, and table records. 

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

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

  ## Operations

  * Business Service
      * Get All
  * Configuration Items
      * Get All
  * Department
      * Get All
  * Dictionary
      * Get All
  * Incident
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * Table Record
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * User
      * Create
      * Delete
      * Get
      * Get All
      * Update
  * User Group
      * Get All
  * User Role
      * Get All

  ## Templates and examples

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

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

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


node_type: n8n-nodes-base.SentryIo
name: SentryIo
display_name: Sentry.io
description: Consume Sentry.io API
category: output
icon: file:sentryio.svg
code_hash: 12e647ea8cb08abfa06aba35b9341919467decb8126ef162439de5714292bc31
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.SentryIo
documentation_title: Sentry.io node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"sentryio","description":"Templates for sentryio"}]
related_resources: [{"title":"Sentry.io's documentation","url":"https://docs.sentry.io/api/","type":"external"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:34
updated_at: 2025-06-09 15:18:34
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SentryIo = void 0;
  const EventDescription_1 = require("./EventDescription");
  const IssueDescription_1 = require("./IssueDescription");
  const OrganizationDescription_1 = require("./OrganizationDescription");
  const ProjectDescription_1 = require("./ProjectDescription");
  const ReleaseDescription_1 = require("./ReleaseDescription");
  const TeamDescription_1 = require("./TeamDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class SentryIo {
      constructor() {
          this.description = {
              displayName: 'Sentry.io',
              name: 'sentryIo',
              icon: 'file:sentryio.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Sentry.io API',
              defaults: {
                  name: 'Sentry.io',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'sentryIoOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                              sentryVersion: ['cloud'],
                          },
                      },
                  },
                  {
                      name: 'sentryIoApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                              sentryVersion: ['cloud'],
                          },
                      },
                  },
                  {
                      name: 'sentryIoServerApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                              sentryVersion: ['server'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Sentry Version',
                      name: 'sentryVersion',
                      type: 'options',
                      options: [
                          {
                              name: 'Cloud',
                              value: 'cloud',
                          },
                          {
                              name: 'Server (Self Hosted)',
                              value: 'server',
                          },
                      ],
                      default: 'cloud',
                  },
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      displayOptions: {
                          show: {
                              sentryVersion: ['cloud'],
                          },
                      },
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'accessToken',
                  },
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      displayOptions: {
                          show: {
                              sentryVersion: ['server'],
                          },
                      },
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                      ],
                      default: 'accessToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Issue',
                              value: 'issue',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Project',
                              value: 'project',
                          },
                          {
                              name: 'Release',
                              value: 'release',
                          },
                          {
                              name: 'Team',
                              value: 'team',
                          },
                      ],
                      default: 'event',
                  },
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...IssueDescription_1.issueOperations,
                  ...IssueDescription_1.issueFields,
                  ...OrganizationDescription_1.organizationOperations,
                  ...OrganizationDescription_1.organizationFields,
                  ...ProjectDescription_1.projectOperations,
                  ...ProjectDescription_1.projectFields,
                  ...ReleaseDescription_1.releaseOperations,
                  ...ReleaseDescription_1.releaseFields,
                  ...TeamDescription_1.teamOperations,
                  ...TeamDescription_1.teamFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getOrganizations() {
                      const returnData = [];
                      const organizations = await GenericFunctions_1.sentryApiRequestAllItems.call(this, 'GET', '/api/0/organizations/', {});
                      for (const organization of organizations) {
                          returnData.push({
                              name: organization.slug,
                              value: organization.slug,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
                  async getProjects() {
                      const returnData = [];
                      const projects = await GenericFunctions_1.sentryApiRequestAllItems.call(this, 'GET', '/api/0/projects/', {});
                      const organizationSlug = this.getNodeParameter('organizationSlug');
                      for (const project of projects) {
                          if (organizationSlug !== project.organization.slug) {
                              continue;
                          }
                          returnData.push({
                              name: project.slug,
                              value: project.slug,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
                  async getTeams() {
                      const returnData = [];
                      const organizationSlug = this.getNodeParameter('organizationSlug');
                      const teams = await GenericFunctions_1.sentryApiRequestAllItems.call(this, 'GET', `/api/0/organizations/${organizationSlug}/teams/`, {});
                      for (const team of teams) {
                          returnData.push({
                              name: team.slug,
                              value: team.slug,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'event') {
                      if (operation === 'getAll') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const projectSlug = this.getNodeParameter('projectSlug', i);
                          const full = this.getNodeParameter('full', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/events/`;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                          }
                          qs.full = full;
                          responseData = await GenericFunctions_1.sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'get') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const projectSlug = this.getNodeParameter('projectSlug', i);
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/events/${eventId}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'GET', endpoint, qs);
                      }
                  }
                  if (resource === 'issue') {
                      if (operation === 'getAll') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const projectSlug = this.getNodeParameter('projectSlug', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/issues/`;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.statsPeriod) {
                              qs.statsPeriod = additionalFields.statsPeriod;
                          }
                          if (additionalFields.shortIdLookup) {
                              qs.shortIdLookup = additionalFields.shortIdLookup;
                          }
                          if (additionalFields.query) {
                              qs.query = additionalFields.query;
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                          }
                          responseData = await GenericFunctions_1.sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'get') {
                          const issueId = this.getNodeParameter('issueId', i);
                          const endpoint = `/api/0/issues/${issueId}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'GET', endpoint, qs);
                      }
                      if (operation === 'delete') {
                          const issueId = this.getNodeParameter('issueId', i);
                          const endpoint = `/api/0/issues/${issueId}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'DELETE', endpoint, qs);
                          responseData = { success: true };
                      }
                      if (operation === 'update') {
                          const issueId = this.getNodeParameter('issueId', i);
                          const endpoint = `/api/0/issues/${issueId}/`;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.status) {
                              qs.status = additionalFields.status;
                          }
                          if (additionalFields.assignedTo) {
                              qs.assignedTo = additionalFields.assignedTo;
                          }
                          if (additionalFields.hasSeen) {
                              qs.hasSeen = additionalFields.hasSeen;
                          }
                          if (additionalFields.isBookmarked) {
                              qs.isBookmarked = additionalFields.isBookmarked;
                          }
                          if (additionalFields.isSubscribed) {
                              qs.isSubscribed = additionalFields.isSubscribed;
                          }
                          if (additionalFields.isPublic) {
                              qs.isPublic = additionalFields.isPublic;
                          }
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'PUT', endpoint, qs);
                      }
                  }
                  if (resource === 'organization') {
                      if (operation === 'get') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const endpoint = `/api/0/organizations/${organizationSlug}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'GET', endpoint, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const endpoint = '/api/0/organizations/';
                          if (additionalFields.member) {
                              qs.member = additionalFields.member;
                          }
                          if (additionalFields.owner) {
                              qs.owner = additionalFields.owner;
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                          }
                          responseData = await GenericFunctions_1.sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
                          if (responseData === undefined) {
                              responseData = [];
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const agreeTerms = this.getNodeParameter('agreeTerms', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const endpoint = '/api/0/organizations/';
                          qs.name = name;
                          qs.agreeTerms = agreeTerms;
                          if (additionalFields.slug) {
                              qs.slug = additionalFields.slug;
                          }
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'POST', endpoint, qs);
                      }
                      if (operation === 'update') {
                          const organizationSlug = this.getNodeParameter('organization_slug', i);
                          const endpoint = `/api/0/organizations/${organizationSlug}/`;
                          const body = this.getNodeParameter('updateFields', i);
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'PUT', endpoint, body, qs);
                      }
                  }
                  if (resource === 'project') {
                      if (operation === 'create') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const teamSlug = this.getNodeParameter('teamSlug', i);
                          const name = this.getNodeParameter('name', i);
                          const endpoint = `/api/0/teams/${organizationSlug}/${teamSlug}/projects/`;
                          const body = {
                              name,
                              ...this.getNodeParameter('additionalFields', i),
                          };
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'POST', endpoint, body, qs);
                      }
                      if (operation === 'get') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const projectSlug = this.getNodeParameter('projectSlug', i);
                          const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'GET', endpoint, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const endpoint = '/api/0/projects/';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                          }
                          responseData = await GenericFunctions_1.sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const projectSlug = this.getNodeParameter('projectSlug', i);
                          const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/`;
                          const body = this.getNodeParameter('updateFields', i);
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'PUT', endpoint, body, qs);
                      }
                      if (operation === 'delete') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const projectSlug = this.getNodeParameter('projectSlug', i);
                          const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'DELETE', endpoint, qs);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'release') {
                      if (operation === 'get') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const version = this.getNodeParameter('version', i);
                          const endpoint = `/api/0/organizations/${organizationSlug}/releases/${version}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'GET', endpoint, qs);
                      }
                      if (operation === 'getAll') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const endpoint = `/api/0/organizations/${organizationSlug}/releases/`;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (additionalFields.query) {
                              qs.query = additionalFields.query;
                          }
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                          }
                          responseData = await GenericFunctions_1.sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'delete') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const version = this.getNodeParameter('version', i);
                          const endpoint = `/api/0/organizations/${organizationSlug}/releases/${version}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'DELETE', endpoint, qs);
                          responseData = { success: true };
                      }
                      if (operation === 'create') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const endpoint = `/api/0/organizations/${organizationSlug}/releases/`;
                          const version = this.getNodeParameter('version', i);
                          const url = this.getNodeParameter('url', i);
                          const projects = this.getNodeParameter('projects', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.dateReleased) {
                              qs.dateReleased = additionalFields.dateReleased;
                          }
                          qs.version = version;
                          qs.url = url;
                          qs.projects = projects;
                          if (additionalFields.commits) {
                              const commits = [];
                              additionalFields.commits.commitProperties.map((commit) => {
                                  const commitObject = { id: commit.id };
                                  if (commit.repository) {
                                      commitObject.repository = commit.repository;
                                  }
                                  if (commit.message) {
                                      commitObject.message = commit.message;
                                  }
                                  if (commit.patchSet && Array.isArray(commit.patchSet)) {
                                      commit.patchSet.patchSetProperties.map((patchSet) => {
                                          var _a;
                                          (_a = commitObject.patch_set) === null || _a === void 0 ? void 0 : _a.push(patchSet);
                                      });
                                  }
                                  if (commit.authorName) {
                                      commitObject.author_name = commit.authorName;
                                  }
                                  if (commit.authorEmail) {
                                      commitObject.author_email = commit.authorEmail;
                                  }
                                  if (commit.timestamp) {
                                      commitObject.timestamp = commit.timestamp;
                                  }
                                  commits.push(commitObject);
                              });
                              qs.commits = commits;
                          }
                          if (additionalFields.refs) {
                              const refs = [];
                              additionalFields.refs.refProperties.map((ref) => {
                                  refs.push(ref);
                              });
                              qs.refs = refs;
                          }
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'POST', endpoint, qs);
                      }
                      if (operation === 'update') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const version = this.getNodeParameter('version', i);
                          const endpoint = `/api/0/organizations/${organizationSlug}/releases/${version}/`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = { ...updateFields };
                          if (updateFields.commits) {
                              const commits = [];
                              updateFields.commits.commitProperties.map((commit) => {
                                  const commitObject = { id: commit.id };
                                  if (commit.repository) {
                                      commitObject.repository = commit.repository;
                                  }
                                  if (commit.message) {
                                      commitObject.message = commit.message;
                                  }
                                  if (commit.patchSet && Array.isArray(commit.patchSet)) {
                                      commit.patchSet.patchSetProperties.map((patchSet) => {
                                          var _a;
                                          (_a = commitObject.patch_set) === null || _a === void 0 ? void 0 : _a.push(patchSet);
                                      });
                                  }
                                  if (commit.authorName) {
                                      commitObject.author_name = commit.authorName;
                                  }
                                  if (commit.authorEmail) {
                                      commitObject.author_email = commit.authorEmail;
                                  }
                                  if (commit.timestamp) {
                                      commitObject.timestamp = commit.timestamp;
                                  }
                                  commits.push(commitObject);
                              });
                              body.commits = commits;
                          }
                          if (updateFields.refs) {
                              const refs = [];
                              updateFields.refs.refProperties.map((ref) => {
                                  refs.push(ref);
                              });
                              body.refs = refs;
                          }
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'PUT', endpoint, body, qs);
                      }
                  }
                  if (resource === 'team') {
                      if (operation === 'get') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const teamSlug = this.getNodeParameter('teamSlug', i);
                          const endpoint = `/api/0/teams/${organizationSlug}/${teamSlug}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'GET', endpoint, qs);
                      }
                      if (operation === 'getAll') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const endpoint = `/api/0/organizations/${organizationSlug}/teams/`;
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                          }
                          responseData = await GenericFunctions_1.sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'create') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const name = this.getNodeParameter('name', i);
                          const endpoint = `/api/0/organizations/${organizationSlug}/teams/`;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          qs.name = name;
                          if (additionalFields.slug) {
                              qs.slug = additionalFields.slug;
                          }
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'POST', endpoint, qs);
                      }
                      if (operation === 'update') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const teamSlug = this.getNodeParameter('teamSlug', i);
                          const endpoint = `/api/0/teams/${organizationSlug}/${teamSlug}/`;
                          const body = this.getNodeParameter('updateFields', i);
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'PUT', endpoint, body, qs);
                      }
                      if (operation === 'delete') {
                          const organizationSlug = this.getNodeParameter('organizationSlug', i);
                          const teamSlug = this.getNodeParameter('teamSlug', i);
                          const endpoint = `/api/0/teams/${organizationSlug}/${teamSlug}/`;
                          responseData = await GenericFunctions_1.sentryIoApiRequest.call(this, 'DELETE', endpoint, qs);
                          responseData = { success: true };
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.SentryIo = SentryIo;
  //# sourceMappingURL=SentryIo.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SentryIoApi = void 0;
  class SentryIoApi {
      constructor() {
          this.name = 'sentryIoApi';
          this.displayName = 'Sentry.io API';
          this.documentationUrl = 'sentryIo';
          this.properties = [
              {
                  displayName: 'Token',
                  name: 'token',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.SentryIoApi = SentryIoApi;
  //# sourceMappingURL=SentryIoApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SentryIoOAuth2Api = void 0;
  class SentryIoOAuth2Api {
      constructor() {
          this.name = 'sentryIoOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Sentry.io OAuth2 API';
          this.documentationUrl = 'sentryIo';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://sentry.io/oauth/authorize/',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://sentry.io/oauth/token/',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'event:admin event:read org:read project:read project:releases team:read event:write org:admin project:write team:write project:admin team:admin',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.SentryIoOAuth2Api = SentryIoOAuth2Api;
  //# sourceMappingURL=SentryIoOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SentryIoApi = void 0;
  class SentryIoApi {
      constructor() {
          this.name = 'sentryIoApi';
          this.displayName = 'Sentry.io API';
          this.documentationUrl = 'sentryIo';
          this.properties = [
              {
                  displayName: 'Token',
                  name: 'token',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.SentryIoApi = SentryIoApi;
  //# sourceMappingURL=SentryIoApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SentryIoOAuth2Api = void 0;
  class SentryIoOAuth2Api {
      constructor() {
          this.name = 'sentryIoOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Sentry.io OAuth2 API';
          this.documentationUrl = 'sentryIo';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://sentry.io/oauth/authorize/',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://sentry.io/oauth/token/',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'event:admin event:read org:read project:read project:releases team:read event:write org:admin project:write team:write project:admin team:admin',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.SentryIoOAuth2Api = SentryIoOAuth2Api;
  //# sourceMappingURL=SentryIoOAuth2Api.credentials.js.map

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

  # Sentry.io node

  Use the Sentry.io node to automate work in Sentry.io, and integrate Sentry.io with other applications. n8n has built-in support for a wide range of Sentry.io features, including creating, updating, deleting, and getting, issues, projects, and releases, as well as getting all events.

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

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

  ## Operations

  * Event
      * Get event by ID
      * Get all events
  * Issue
      * Delete an issue
      * Get issue by ID
      * Get all issues
      * Update an issue
  * Project
      * Create a new project
      * Delete a project
      * Get project by ID
      * Get all projects
      * Update a project
  * Release
      * Create a release
      * Delete a release
      * Get release by version identifier
      * Get all releases
      * Update a release
  * Organization
      * Create an organization
      * Get organization by slug
      * Get all organizations
      * Update an organization
  * Team
      * Create a new team
      * Delete a team
      * Get team by slug
      * Get all teams
      * Update a team

  ## Templates and examples

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

  ## Related resources

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

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

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


node_type: n8n-nodes-base.Shopify
name: Shopify
display_name: Shopify
description: Consume Shopify API
category: output
icon: file:shopify.svg
code_hash: c9006b14af5d35b4e773b5812c0f324f95620663fb6b23c928b1c58ccc43a99c
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Shopify
documentation_title: Shopify node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"shopify","description":"Templates for shopify"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:34
updated_at: 2025-06-09 15:18:34
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Shopify = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const OrderDescription_1 = require("./OrderDescription");
  const ProductDescription_1 = require("./ProductDescription");
  class Shopify {
      constructor() {
          this.description = {
              displayName: 'Shopify',
              name: 'shopify',
              icon: 'file:shopify.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Shopify API',
              defaults: {
                  name: 'Shopify',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'shopifyApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['apiKey'],
                          },
                      },
                  },
                  {
                      name: 'shopifyAccessTokenApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'shopifyOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                          {
                              name: 'API Key',
                              value: 'apiKey',
                          },
                      ],
                      default: 'apiKey',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Order',
                              value: 'order',
                          },
                          {
                              name: 'Product',
                              value: 'product',
                          },
                      ],
                      default: 'order',
                  },
                  ...OrderDescription_1.orderOperations,
                  ...OrderDescription_1.orderFields,
                  ...ProductDescription_1.productOperations,
                  ...ProductDescription_1.productFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getProducts() {
                      const returnData = [];
                      const products = await GenericFunctions_1.shopifyApiRequestAllItems.call(this, 'products', 'GET', '/products.json', {}, { fields: 'id,title' });
                      for (const product of products) {
                          const productName = product.title;
                          const productId = product.id;
                          returnData.push({
                              name: productName,
                              value: productId,
                          });
                      }
                      return returnData;
                  },
                  async getLocations() {
                      const returnData = [];
                      const locations = await GenericFunctions_1.shopifyApiRequestAllItems.call(this, 'locations', 'GET', '/locations.json', {}, { fields: 'id,name' });
                      for (const location of locations) {
                          const locationName = location.name;
                          const locationId = location.id;
                          returnData.push({
                              name: locationName,
                              value: locationId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'order') {
                      if (operation === 'create') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const discount = additionalFields.discountCodesUi;
                          const billing = additionalFields.billingAddressUi;
                          const shipping = additionalFields.shippingAddressUi;
                          const lineItem = this.getNodeParameter('limeItemsUi', i)
                              .lineItemValues;
                          if (lineItem === undefined) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one line item has to be added', { itemIndex: i });
                          }
                          const body = {
                              test: true,
                              line_items: (0, GenericFunctions_1.keysToSnakeCase)(lineItem),
                          };
                          if (additionalFields.fulfillmentStatus) {
                              body.fulfillment_status = additionalFields.fulfillmentStatus;
                          }
                          if (additionalFields.inventoryBehaviour) {
                              body.inventory_behaviour = additionalFields.inventoryBehaviour;
                          }
                          if (additionalFields.locationId) {
                              body.location_id = additionalFields.locationId;
                          }
                          if (additionalFields.note) {
                              body.note = additionalFields.note;
                          }
                          if (additionalFields.sendFulfillmentReceipt) {
                              body.send_fulfillment_receipt = additionalFields.sendFulfillmentReceipt;
                          }
                          if (additionalFields.sendReceipt) {
                              body.send_receipt = additionalFields.sendReceipt;
                          }
                          if (additionalFields.sendReceipt) {
                              body.send_receipt = additionalFields.sendReceipt;
                          }
                          if (additionalFields.sourceName) {
                              body.source_name = additionalFields.sourceName;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.test) {
                              body.test = additionalFields.test;
                          }
                          if (additionalFields.email) {
                              body.email = additionalFields.email;
                          }
                          if (discount) {
                              body.discount_codes = discount.discountCodesValues;
                          }
                          if (billing) {
                              body.billing_address = (0, GenericFunctions_1.keysToSnakeCase)(billing.billingAddressValues)[0];
                          }
                          if (shipping) {
                              body.shipping_address = (0, GenericFunctions_1.keysToSnakeCase)(shipping.shippingAddressValues)[0];
                          }
                          responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'POST', '/orders.json', {
                              order: body,
                          });
                          responseData = responseData.order;
                      }
                      if (operation === 'delete') {
                          const orderId = this.getNodeParameter('orderId', i);
                          responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'DELETE', `/orders/${orderId}.json`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const orderId = this.getNodeParameter('orderId', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.fields) {
                              qs.fields = options.fields;
                          }
                          responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'GET', `/orders/${orderId}.json`, {}, qs);
                          responseData = responseData.order;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.fields) {
                              qs.fields = options.fields;
                          }
                          if (options.attributionAppId) {
                              qs.attribution_app_id = options.attributionAppId;
                          }
                          if (options.createdAtMin) {
                              qs.created_at_min = options.createdAtMin;
                          }
                          if (options.createdAtMax) {
                              qs.created_at_max = options.createdAtMax;
                          }
                          if (options.updatedAtMax) {
                              qs.updated_at_max = options.updatedAtMax;
                          }
                          if (options.updatedAtMin) {
                              qs.updated_at_min = options.updatedAtMin;
                          }
                          if (options.processedAtMin) {
                              qs.processed_at_min = options.processedAtMin;
                          }
                          if (options.processedAtMax) {
                              qs.processed_at_max = options.processedAtMax;
                          }
                          if (options.sinceId) {
                              qs.since_id = options.sinceId;
                          }
                          if (options.ids) {
                              qs.ids = options.ids;
                          }
                          if (options.status) {
                              qs.status = options.status;
                          }
                          if (options.financialStatus) {
                              qs.financial_status = options.financialStatus;
                          }
                          if (options.fulfillmentStatus) {
                              qs.fulfillment_status = options.fulfillmentStatus;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.shopifyApiRequestAllItems.call(this, 'orders', 'GET', '/orders.json', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'GET', '/orders.json', {}, qs);
                              responseData = responseData.orders;
                          }
                      }
                      if (operation === 'update') {
                          const orderId = this.getNodeParameter('orderId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const shipping = updateFields.shippingAddressUi;
                          const body = {};
                          if (updateFields.locationId) {
                              body.location_id = updateFields.locationId;
                          }
                          if (updateFields.note) {
                              body.note = updateFields.note;
                          }
                          if (updateFields.sourceName) {
                              body.source_name = updateFields.sourceName;
                          }
                          if (updateFields.tags) {
                              body.tags = updateFields.tags;
                          }
                          if (updateFields.email) {
                              body.email = updateFields.email;
                          }
                          if (shipping) {
                              body.shipping_address = (0, GenericFunctions_1.keysToSnakeCase)(shipping.shippingAddressValues)[0];
                          }
                          responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'PUT', `/orders/${orderId}.json`, {
                              order: body,
                          });
                          responseData = responseData.order;
                      }
                  }
                  else if (resource === 'product') {
                      const productId = this.getNodeParameter('productId', i, '');
                      let body = {};
                      if (operation === 'create') {
                          const title = this.getNodeParameter('title', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i, {});
                          if (additionalFields.productOptions) {
                              const metadata = additionalFields.productOptions
                                  .option;
                              additionalFields.options = {};
                              for (const data of metadata) {
                                  additionalFields.options[data.name] = data.value;
                              }
                              delete additionalFields.productOptions;
                          }
                          body = additionalFields;
                          body.title = title;
                          responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'POST', '/products.json', {
                              product: body,
                          });
                          responseData = responseData.product;
                      }
                      if (operation === 'delete') {
                          responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'DELETE', `/products/${productId}.json`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const additionalFields = this.getNodeParameter('additionalFields', i, {});
                          Object.assign(qs, additionalFields);
                          responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'GET', `/products/${productId}.json`, {}, qs);
                          responseData = responseData.product;
                      }
                      if (operation === 'getAll') {
                          const additionalFields = this.getNodeParameter('additionalFields', i, {});
                          const returnAll = this.getNodeParameter('returnAll', i);
                          Object.assign(qs, additionalFields);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.shopifyApiRequestAllItems.call(this, 'products', 'GET', '/products.json', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'GET', '/products.json', {}, qs);
                              responseData = responseData.products;
                          }
                      }
                      if (operation === 'update') {
                          const updateFields = this.getNodeParameter('updateFields', i, {});
                          if (updateFields.productOptions) {
                              const metadata = updateFields.productOptions.option;
                              updateFields.options = {};
                              for (const data of metadata) {
                                  updateFields.options[data.name] = data.value;
                              }
                              delete updateFields.productOptions;
                          }
                          body = updateFields;
                          responseData = await GenericFunctions_1.shopifyApiRequest.call(this, 'PUT', `/products/${productId}.json`, { product: body });
                          responseData = responseData.product;
                      }
                  }
                  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.Shopify = Shopify;
  //# sourceMappingURL=Shopify.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ShopifyApi = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class ShopifyApi {
      constructor() {
          this.name = 'shopifyApi';
          this.displayName = 'Shopify API';
          this.documentationUrl = 'shopify';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Shop Subdomain',
                  name: 'shopSubdomain',
                  required: true,
                  type: 'string',
                  default: '',
                  description: 'Only the subdomain without .myshopify.com',
              },
              {
                  displayName: 'Shared Secret',
                  name: 'sharedSecret',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.test = {
              request: {
                  baseURL: '=https://{{$credentials.shopSubdomain}}.myshopify.com/admin/api/2019-10',
                  url: '/products.json',
              },
          };
      }
      async authenticate(credentials, requestOptions) {
          requestOptions.headers = {
              ...requestOptions.headers,
              Authorization: `Basic ${Buffer.from(`${credentials.apiKey}:${credentials.password}`).toString(n8n_workflow_1.BINARY_ENCODING)}`,
          };
          return requestOptions;
      }
  }
  exports.ShopifyApi = ShopifyApi;
  //# sourceMappingURL=ShopifyApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ShopifyOAuth2Api = void 0;
  class ShopifyOAuth2Api {
      constructor() {
          this.name = 'shopifyOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Shopify OAuth2 API';
          this.documentationUrl = 'shopify';
          this.properties = [
              {
                  displayName: 'Shop Subdomain',
                  name: 'shopSubdomain',
                  required: true,
                  type: 'string',
                  default: '',
                  description: 'Only the subdomain without .myshopify.com',
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Client ID',
                  name: 'clientId',
                  type: 'string',
                  default: '',
                  required: true,
                  hint: 'Be aware that Shopify refers to the Client ID as API Key',
              },
              {
                  displayName: 'Client Secret',
                  name: 'clientSecret',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
                  required: true,
                  hint: 'Be aware that Shopify refers to the Client Secret as API Secret Key',
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: '=https://{{$self["shopSubdomain"]}}.myshopify.com/admin/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: '=https://{{$self["shopSubdomain"]}}.myshopify.com/admin/oauth/access_token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'write_orders read_orders write_products read_products',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: 'access_mode=value',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.ShopifyOAuth2Api = ShopifyOAuth2Api;
  //# sourceMappingURL=ShopifyOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ShopifyApi = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class ShopifyApi {
      constructor() {
          this.name = 'shopifyApi';
          this.displayName = 'Shopify API';
          this.documentationUrl = 'shopify';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Shop Subdomain',
                  name: 'shopSubdomain',
                  required: true,
                  type: 'string',
                  default: '',
                  description: 'Only the subdomain without .myshopify.com',
              },
              {
                  displayName: 'Shared Secret',
                  name: 'sharedSecret',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.test = {
              request: {
                  baseURL: '=https://{{$credentials.shopSubdomain}}.myshopify.com/admin/api/2019-10',
                  url: '/products.json',
              },
          };
      }
      async authenticate(credentials, requestOptions) {
          requestOptions.headers = {
              ...requestOptions.headers,
              Authorization: `Basic ${Buffer.from(`${credentials.apiKey}:${credentials.password}`).toString(n8n_workflow_1.BINARY_ENCODING)}`,
          };
          return requestOptions;
      }
  }
  exports.ShopifyApi = ShopifyApi;
  //# sourceMappingURL=ShopifyApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ShopifyOAuth2Api = void 0;
  class ShopifyOAuth2Api {
      constructor() {
          this.name = 'shopifyOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Shopify OAuth2 API';
          this.documentationUrl = 'shopify';
          this.properties = [
              {
                  displayName: 'Shop Subdomain',
                  name: 'shopSubdomain',
                  required: true,
                  type: 'string',
                  default: '',
                  description: 'Only the subdomain without .myshopify.com',
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Client ID',
                  name: 'clientId',
                  type: 'string',
                  default: '',
                  required: true,
                  hint: 'Be aware that Shopify refers to the Client ID as API Key',
              },
              {
                  displayName: 'Client Secret',
                  name: 'clientSecret',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
                  required: true,
                  hint: 'Be aware that Shopify refers to the Client Secret as API Secret Key',
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: '=https://{{$self["shopSubdomain"]}}.myshopify.com/admin/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: '=https://{{$self["shopSubdomain"]}}.myshopify.com/admin/oauth/access_token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'write_orders read_orders write_products read_products',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: 'access_mode=value',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.ShopifyOAuth2Api = ShopifyOAuth2Api;
  //# sourceMappingURL=ShopifyOAuth2Api.credentials.js.map

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

  # Shopify node

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

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

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

  ## Operations

  * Order
      * Create an order
      * Delete an order
      * Get an order
      * Get all orders
      * Update an order
  * Product
      * Create a product
      * Delete a product
      * Get a product
      * Get all products
      * Update a product

  ## Templates and examples

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

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

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


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

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

  // --- Next Credential File ---

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

  // --- Next Credential File ---

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

  // --- Next Credential File ---

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

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

  # Slack node

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

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

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

  ## Operations

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

  ## Templates and examples

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

  ## Related resources

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

  ## Required scopes

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

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

  <!-- vale off -->

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

  <!-- vale on -->

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

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

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

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


node_type: n8n-nodes-base.Signl4
name: Signl4
display_name: SIGNL4
description: Consume SIGNL4 API
category: transform
icon: file:signl4.png
code_hash: ecc751791e5a3ffc499f7d9a5a93314a13ff96290453d6af4f1d3438f6f0bf80
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Signl4
documentation_title: SIGNL4 node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"signl4","description":"Templates for signl4"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:34
updated_at: 2025-06-09 15:18:34
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Signl4 = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Signl4 {
      constructor() {
          this.description = {
              displayName: 'SIGNL4',
              name: 'signl4',
              icon: 'file:signl4.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume SIGNL4 API',
              defaults: {
                  name: 'SIGNL4',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'signl4Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Alert',
                              value: 'alert',
                          },
                      ],
                      default: 'alert',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['alert'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send an alert',
                              action: 'Send an alert',
                          },
                          {
                              name: 'Resolve',
                              value: 'resolve',
                              description: 'Resolve an alert',
                              action: 'Resolve an alert',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['alert'],
                          },
                      },
                      description: 'A more detailed description for the alert',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['alert'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Alerting Scenario',
                              name: 'alertingScenario',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Single ACK',
                                      value: 'single_ack',
                                      description: 'In case only one person needs to confirm this Signl',
                                  },
                                  {
                                      name: 'Multi ACK',
                                      value: 'multi_ack',
                                      description: 'In case this alert must be confirmed by the number of people who are on duty at the time this Singl is raised',
                                  },
                              ],
                              default: 'single_ack',
                          },
                          {
                              displayName: 'Attachments',
                              name: 'attachmentsUi',
                              placeholder: 'Add Attachments',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: false,
                              },
                              options: [
                                  {
                                      name: 'attachmentsBinary',
                                      displayName: 'Attachments Binary',
                                      values: [
                                          {
                                              displayName: 'Property Name',
                                              name: 'property',
                                              type: 'string',
                                              placeholder: 'data',
                                              default: '',
                                              description: 'Name of the binary properties which contain data which should be added as attachment',
                                          },
                                      ],
                                  },
                              ],
                              default: {},
                          },
                          {
                              displayName: 'External ID',
                              name: 'externalId',
                              type: 'string',
                              default: '',
                              description: 'If the event originates from a record in a 3rd party system, use this parameter to pass the unique ID of that record. That ID will be communicated in outbound webhook notifications from SIGNL4, which is great for correlation/synchronization of that record with the alert. If you resolve / close an alert you must use the same External ID as in the original alert.',
                          },
                          {
                              displayName: 'Filtering',
                              name: 'filtering',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to apply event filtering for this event, or not. If set to true, the event will only trigger a notification to the team, if it contains at least one keyword from one of your services and system categories (i.e. it is whitelisted)',
                          },
                          {
                              displayName: 'Location',
                              name: 'locationFieldsUi',
                              type: 'fixedCollection',
                              placeholder: 'Add Location',
                              default: {},
                              description: "Transmit location information ('latitude, longitude') with your event and display a map in the mobile app",
                              options: [
                                  {
                                      name: 'locationFieldsValues',
                                      displayName: 'Location',
                                      values: [
                                          {
                                              displayName: 'Latitude',
                                              name: 'latitude',
                                              type: 'string',
                                              required: true,
                                              description: 'The location latitude',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Longitude',
                                              name: 'longitude',
                                              type: 'string',
                                              required: true,
                                              description: 'The location longitude',
                                              default: '',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Service',
                              name: 'service',
                              type: 'string',
                              default: '',
                              description: 'Assigns the alert to the service/system category with the specified name',
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'The title or subject of this alert',
                          },
                      ],
                  },
                  {
                      displayName: 'External ID',
                      name: 'externalId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['resolve'],
                              resource: ['alert'],
                          },
                      },
                      description: 'If the event originates from a record in a 3rd party system, use this parameter to pass the unique ID of that record. That ID will be communicated in outbound webhook notifications from SIGNL4, which is great for correlation/synchronization of that record with the alert. If you resolve / close an alert you must use the same External ID as in the original alert.',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'alert') {
                      if (operation === 'send') {
                          const message = this.getNodeParameter('message', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const data = {
                              message,
                          };
                          if (additionalFields.title) {
                              data.title = additionalFields.title;
                          }
                          if (additionalFields.service) {
                              data.service = additionalFields.service;
                          }
                          if (additionalFields.locationFieldsUi) {
                              const locationUi = additionalFields.locationFieldsUi
                                  .locationFieldsValues;
                              if (locationUi) {
                                  data['X-S4-Location'] = `${locationUi.latitude},${locationUi.longitude}`;
                              }
                          }
                          if (additionalFields.alertingScenario) {
                              data['X-S4-AlertingScenario'] = additionalFields.alertingScenario;
                          }
                          if (additionalFields.filtering) {
                              data['X-S4-Filtering'] = additionalFields.filtering.toString();
                          }
                          if (additionalFields.externalId) {
                              data['X-S4-ExternalID'] = additionalFields.externalId;
                          }
                          data['X-S4-Status'] = 'new';
                          data['X-S4-SourceSystem'] = 'n8n';
                          const attachments = additionalFields.attachmentsUi;
                          if (attachments === null || attachments === void 0 ? void 0 : attachments.attachmentsBinary) {
                              const propertyName = attachments.attachmentsBinary
                                  .property;
                              const binaryData = this.helpers.assertBinaryData(i, propertyName);
                              if (binaryData) {
                                  const supportedFileExtension = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'mp3', 'wav'];
                                  if (!supportedFileExtension.includes(binaryData.fileExtension)) {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Invalid extension, just ${supportedFileExtension.join(',')} are supported}`, { itemIndex: i });
                                  }
                                  const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, propertyName);
                                  data.attachment = {
                                      value: binaryDataBuffer,
                                      options: {
                                          filename: binaryData.fileName,
                                          contentType: binaryData.mimeType,
                                      },
                                  };
                              }
                          }
                          responseData = await GenericFunctions_1.SIGNL4ApiRequest.call(this, 'POST', '', {}, {
                              formData: data,
                          });
                      }
                      if (operation === 'resolve') {
                          const data = {};
                          data['X-S4-ExternalID'] = this.getNodeParameter('externalId', i);
                          data['X-S4-Status'] = 'resolved';
                          data['X-S4-SourceSystem'] = 'n8n';
                          responseData = await GenericFunctions_1.SIGNL4ApiRequest.call(this, 'POST', '', {}, {
                              formData: data,
                          });
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else if (responseData !== undefined) {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Signl4 = Signl4;
  //# sourceMappingURL=Signl4.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Signl4Api = void 0;
  class Signl4Api {
      constructor() {
          this.name = 'signl4Api';
          this.displayName = 'SIGNL4 Webhook';
          this.documentationUrl = 'signl4';
          this.properties = [
              {
                  displayName: 'Team Secret',
                  name: 'teamSecret',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'The team secret is the last part of your SIGNL4 webhook URL',
              },
          ];
      }
  }
  exports.Signl4Api = Signl4Api;
  //# sourceMappingURL=Signl4Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Signl4Api = void 0;
  class Signl4Api {
      constructor() {
          this.name = 'signl4Api';
          this.displayName = 'SIGNL4 Webhook';
          this.documentationUrl = 'signl4';
          this.properties = [
              {
                  displayName: 'Team Secret',
                  name: 'teamSecret',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'The team secret is the last part of your SIGNL4 webhook URL',
              },
          ];
      }
  }
  exports.Signl4Api = Signl4Api;
  //# sourceMappingURL=Signl4Api.credentials.js.map

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

  # SIGNL4 node

  Use the SIGNL4 node to automate work in SIGNL4, and integrate SIGNL4 with other applications. n8n supports sending and resolving alerts with SIGNL4.

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

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

  ## Operations

  * Alert
      * Send an alert
      * Resolve an alert

  ## Templates and examples

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

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


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

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

  # Loop Over Items

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

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

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

  ## When to use the Loop Over Items node

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

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

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

  ## Node parameters

  ### Batch Size

  Enter the number of items to return with each call.

  ## Node options

  ### Reset

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

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

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

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

  ## Templates and examples

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

  ### Read RSS feed from two different sources

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

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

  The final workflow looks like this:

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

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

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

  ### Check that the node has processed all items

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

  ### Get the current running index of the node

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

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

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


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

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

  # Snowflake node

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

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

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

  ## Operations

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

  ## Templates and examples

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

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


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

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

  // --- Next Credential File ---

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

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

  # seven node

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

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

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

  ## Operations

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

  ## Templates and examples

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

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


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

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

  // --- Next Credential File ---

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

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

  # Spontit node

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

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

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

  ## Operations

  * Push
      * Create a push notification

  ## Templates and examples

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

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


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

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

  // --- Next Credential File ---

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

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

  # Splunk node

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

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

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

  ## Operations

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

  ## Templates and examples

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

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


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

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


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

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

  # SSH

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

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

  ## Operations

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

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

  ### Execute Command

  Configure this operation with these parameters:

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

  ### Download File

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

  #### Download File options

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

  ### Upload File

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

  #### Upload File options

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

  ## Templates and examples

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

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


