# nodes

node_type: n8n-nodes-base.Wise
name: Wise
display_name: Wise
description: Consume the Wise API
category: Other
code_hash: 07a5d221159d4a3ca44885812009b5ebf053effe21c97ccc94fde861dd9a5607
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/wise
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Wise = void 0;
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const omit_1 = __importDefault(require("lodash/omit"));
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  const uuid_1 = require("uuid");
  class Wise {
      constructor() {
          this.description = {
              displayName: 'Wise',
              name: 'wise',
              icon: 'file:wise.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Wise API',
              defaults: {
                  name: 'Wise',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'wiseApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Account',
                              value: 'account',
                          },
                          {
                              name: 'Exchange Rate',
                              value: 'exchangeRate',
                          },
                          {
                              name: 'Profile',
                              value: 'profile',
                          },
                          {
                              name: 'Quote',
                              value: 'quote',
                          },
                          {
                              name: 'Recipient',
                              value: 'recipient',
                          },
                          {
                              name: 'Transfer',
                              value: 'transfer',
                          },
                      ],
                      default: 'account',
                  },
                  ...descriptions_1.accountOperations,
                  ...descriptions_1.accountFields,
                  ...descriptions_1.exchangeRateOperations,
                  ...descriptions_1.exchangeRateFields,
                  ...descriptions_1.profileOperations,
                  ...descriptions_1.profileFields,
                  ...descriptions_1.quoteOperations,
                  ...descriptions_1.quoteFields,
                  ...descriptions_1.recipientOperations,
                  ...descriptions_1.recipientFields,
                  ...descriptions_1.transferOperations,
                  ...descriptions_1.transferFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getBorderlessAccounts() {
                      const qs = {
                          profileId: this.getNodeParameter('profileId', 0),
                      };
                      const accounts = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/borderless-accounts', {}, qs);
                      return accounts.map(({ id, balances }) => ({
                          name: balances.map(({ currency }) => currency).join(' - '),
                          value: id,
                      }));
                  },
                  async getProfiles() {
                      const profiles = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/profiles');
                      return profiles.map(({ id, type }) => ({
                          name: type.charAt(0).toUpperCase() + type.slice(1),
                          value: id,
                      }));
                  },
                  async getRecipients() {
                      const qs = {
                          profileId: this.getNodeParameter('profileId', 0),
                      };
                      const recipients = (await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/accounts', {}, qs));
                      return recipients.reduce((activeRecipients, { active, id, accountHolderName, currency, country, type }) => {
                          if (active) {
                              const recipient = {
                                  name: `[${currency}] ${accountHolderName} - (${country !== null ? country + ' - ' : ''}${type})`,
                                  value: id,
                              };
                              activeRecipients.push(recipient);
                          }
                          return activeRecipients;
                      }, []);
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const timezone = this.getTimezone();
          let responseData;
          const returnData = [];
          let binaryOutput = false;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'account') {
                      if (operation === 'getBalances') {
                          const qs = {
                              profileId: this.getNodeParameter('profileId', i),
                          };
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/borderless-accounts', {}, qs);
                      }
                      else if (operation === 'getCurrencies') {
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/borderless-accounts/balance-currencies');
                      }
                      else if (operation === 'getStatement') {
                          const profileId = this.getNodeParameter('profileId', i);
                          const borderlessAccountId = this.getNodeParameter('borderlessAccountId', i);
                          const format = this.getNodeParameter('format', i);
                          const endpoint = `v3/profiles/${profileId}/borderless-accounts/${borderlessAccountId}/statement.${format}`;
                          const qs = {
                              currency: this.getNodeParameter('currency', i),
                          };
                          const { lineStyle, range } = this.getNodeParameter('additionalFields', i);
                          if (lineStyle !== undefined) {
                              qs.type = lineStyle;
                          }
                          if (range !== undefined) {
                              qs.intervalStart = moment_timezone_1.default
                                  .tz(range.rangeProperties.intervalStart, timezone)
                                  .utc()
                                  .format();
                              qs.intervalEnd = moment_timezone_1.default
                                  .tz(range.rangeProperties.intervalEnd, timezone)
                                  .utc()
                                  .format();
                          }
                          else {
                              qs.intervalStart = (0, moment_timezone_1.default)().subtract(1, 'months').utc().format();
                              qs.intervalEnd = (0, moment_timezone_1.default)().utc().format();
                          }
                          if (format === 'json') {
                              responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', endpoint, {}, qs);
                          }
                          else {
                              const data = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', endpoint, {}, qs, {
                                  encoding: 'arraybuffer',
                              });
                              const binaryProperty = this.getNodeParameter('binaryProperty', i);
                              items[i].binary = (_a = items[i].binary) !== null && _a !== void 0 ? _a : {};
                              items[i].binary[binaryProperty] = await this.helpers.prepareBinaryData(data, this.getNodeParameter('fileName', i));
                              responseData = items;
                              binaryOutput = true;
                          }
                      }
                  }
                  else if (resource === 'exchangeRate') {
                      if (operation === 'get') {
                          const qs = {
                              source: this.getNodeParameter('source', i),
                              target: this.getNodeParameter('target', i),
                          };
                          const { interval, range, time } = this.getNodeParameter('additionalFields', i);
                          if (interval !== undefined) {
                              qs.group = interval;
                          }
                          if (time !== undefined) {
                              qs.time = time;
                          }
                          if (range !== undefined && time === undefined) {
                              qs.from = moment_timezone_1.default.tz(range.rangeProperties.from, timezone).utc().format();
                              qs.to = moment_timezone_1.default.tz(range.rangeProperties.to, timezone).utc().format();
                          }
                          else if (time === undefined) {
                              qs.from = (0, moment_timezone_1.default)().subtract(1, 'months').utc().format();
                              qs.to = (0, moment_timezone_1.default)().format();
                          }
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/rates', {}, qs);
                      }
                  }
                  else if (resource === 'profile') {
                      if (operation === 'get') {
                          const profileId = this.getNodeParameter('profileId', i);
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v1/profiles/${profileId}`);
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/profiles');
                      }
                  }
                  else if (resource === 'recipient') {
                      if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/accounts');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  else if (resource === 'quote') {
                      if (operation === 'create') {
                          const body = {
                              profile: this.getNodeParameter('profileId', i),
                              sourceCurrency: this.getNodeParameter('sourceCurrency', i).toUpperCase(),
                              targetCurrency: this.getNodeParameter('targetCurrency', i).toUpperCase(),
                          };
                          const amountType = this.getNodeParameter('amountType', i);
                          if (amountType === 'source') {
                              body.sourceAmount = this.getNodeParameter('amount', i);
                          }
                          else if (amountType === 'target') {
                              body.targetAmount = this.getNodeParameter('amount', i);
                          }
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'POST', 'v2/quotes', body, {});
                      }
                      else if (operation === 'get') {
                          const quoteId = this.getNodeParameter('quoteId', i);
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v2/quotes/${quoteId}`);
                      }
                  }
                  else if (resource === 'transfer') {
                      if (operation === 'create') {
                          const body = {
                              quoteUuid: this.getNodeParameter('quoteId', i),
                              targetAccount: this.getNodeParameter('targetAccountId', i),
                              customerTransactionId: (0, uuid_1.v4)(),
                          };
                          const { reference } = this.getNodeParameter('additionalFields', i);
                          if (reference !== undefined) {
                              body.details = { reference };
                          }
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'POST', 'v1/transfers', body, {});
                      }
                      else if (operation === 'delete') {
                          const transferId = this.getNodeParameter('transferId', i);
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'PUT', `v1/transfers/${transferId}/cancel`);
                      }
                      else if (operation === 'execute') {
                          const profileId = this.getNodeParameter('profileId', i);
                          const transferId = this.getNodeParameter('transferId', i);
                          const endpoint = `v3/profiles/${profileId}/transfers/${transferId}/payments`;
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'POST', endpoint, { type: 'BALANCE' }, {});
                          const { environment } = await this.getCredentials('wiseApi');
                          if (environment === 'test') {
                              for (const testEndpoint of [
                                  'processing',
                                  'funds_converted',
                                  'outgoing_payment_sent',
                              ]) {
                                  await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v1/simulation/transfers/${transferId}/${testEndpoint}`);
                              }
                          }
                      }
                      else if (operation === 'get') {
                          const transferId = this.getNodeParameter('transferId', i);
                          const downloadReceipt = this.getNodeParameter('downloadReceipt', i);
                          if (downloadReceipt) {
                              const data = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v1/transfers/${transferId}/receipt.pdf`, {}, {}, { encoding: 'arraybuffer' });
                              const binaryProperty = this.getNodeParameter('binaryProperty', i);
                              items[i].binary = (_b = items[i].binary) !== null && _b !== void 0 ? _b : {};
                              items[i].binary[binaryProperty] = await this.helpers.prepareBinaryData(data, this.getNodeParameter('fileName', i));
                              responseData = items;
                              binaryOutput = true;
                          }
                          else {
                              responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v1/transfers/${transferId}`);
                          }
                      }
                      else if (operation === 'getAll') {
                          const qs = {
                              profile: this.getNodeParameter('profileId', i),
                          };
                          const filters = this.getNodeParameter('filters', i);
                          Object.keys((0, omit_1.default)(filters, 'range')).forEach((key) => {
                              qs[key] = filters[key];
                          });
                          if (filters.range !== undefined) {
                              qs.createdDateStart = (0, moment_timezone_1.default)(filters.range.rangeProperties.createdDateStart).format();
                              qs.createdDateEnd = (0, moment_timezone_1.default)(filters.range.rangeProperties.createdDateEnd).format();
                          }
                          else {
                              qs.createdDateStart = (0, moment_timezone_1.default)().subtract(1, 'months').format();
                              qs.createdDateEnd = (0, moment_timezone_1.default)().format();
                          }
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/transfers', {}, qs);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.toString() });
                      continue;
                  }
                  throw error;
              }
              Array.isArray(responseData)
                  ? returnData.push(...responseData)
                  : returnData.push(responseData);
          }
          if (binaryOutput && responseData !== undefined) {
              return [responseData];
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Wise = Wise;
  //# sourceMappingURL=Wise.node.js.map

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

  # Wise credentials

  You can use these credentials to authenticate the following nodes:

  - [Wise](/integrations/builtin/app-nodes/n8n-nodes-base.wise.md)
  - [Wise Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.wisetrigger.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API token

  ## Related resources

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

  ## Using API token

  To configure this credential, you'll need:

  - An **API Token**: Go to your **user menu > Settings > API tokens** to generate an API token. Enter the generated API key in your n8n credential. Refer to [Getting started with the API](https://wise.com/help/articles/2958107/getting-started-with-the-api){:target=_blank .external-link} for more information.
  - Your **Environment**: Select the environment that best matches your Wise account environment.
      - If you're using a Wise test sandbox account, select **Test**.
      - Otherwise, select **Live**.
  - **Private Key (Optional)**: For live endpoints requiring Strong Customer Authentication (SCA), generate a public and private key. Enter the private key here. Refer to [Add a private key](#add-a-private-key) for more information.
      - If you're using a **Test** environment, you'll only need to enter a Private Key if you've enabled Strong Customer Authentication on the [public keys management page](https://sandbox.transferwise.tech/public-keys){:target=_blank .external-link}.

  ## Add a private key

  Wise protects some live endpoints and operations with Strong Customer Authentication (SCA). Refer to [Strong Customer Authentication & 2FA](https://docs.wise.com/api-docs/features/strong-customer-authentication-2fa){:target=_blank .external-link} for details.

  If you make a request to an endpoint that requires SCA, Wise returns a 403 Forbidden HTTP status code. The error returned will look like this:

  > This request requires Strong Customer Authentication (SCA). Please add a key pair to your account and n8n credentials. See https://api-docs.transferwise.com/#strong-customer-authentication-personal-token

  To use endpoints requiring SCA, generate an RSA key pair and add the relevant key information to both Wise and n8n:

  1. Generate an RSA key pair:

      ```sh
      $ openssl genrsa -out private.pem 2048 
      $ openssl rsa -pubout -in private.pem -out public.pem
      ```

  2. Add the content of the public key `public.pem` to your Wise **user menu > Settings > API tokens > Manage public keys**.
  3. Add the content of the private key `private.pem` in n8n to the **Private Key (Optional)**.

  Refer to [Personal Token SCA](https://docs.wise.com/api-docs/features/strong-customer-authentication-2fa/personal-token-sca){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"eac6c9ab-8218-48d3-8a7b-f65da08bfd05","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"0195e7256f05af93dc2318b10b96f6f69d6c54783b7156c0dfed2d825725efbd"}}


node_type: n8n-nodes-base.Wordpress
name: Wordpress
display_name: Wordpress
description: Consume Wordpress API
category: Other
code_hash: 1aa9205e0c6d3a7ea7839b9436e584331e3ac4a84917f24f07219a83e8fbd60f
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/wordpress
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Wordpress = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const PostDescription_1 = require("./PostDescription");
  const UserDescription_1 = require("./UserDescription");
  class Wordpress {
      constructor() {
          this.description = {
              displayName: 'Wordpress',
              name: 'wordpress',
              icon: 'file:wordpress.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Wordpress API',
              defaults: {
                  name: 'Wordpress',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'wordpressApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Post',
                              value: 'post',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'post',
                  },
                  ...PostDescription_1.postOperations,
                  ...PostDescription_1.postFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCategories() {
                      const returnData = [];
                      const categories = await GenericFunctions_1.wordpressApiRequestAllItems.call(this, 'GET', '/categories', {});
                      for (const category of categories) {
                          const categoryName = category.name;
                          const categoryId = category.id;
                          returnData.push({
                              name: categoryName,
                              value: categoryId,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const returnData = [];
                      const tags = await GenericFunctions_1.wordpressApiRequestAllItems.call(this, 'GET', '/tags', {});
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = tag.id;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
                  async getAuthors() {
                      const returnData = [];
                      const authors = await GenericFunctions_1.wordpressApiRequestAllItems.call(this, 'GET', '/users', {}, { who: 'authors' });
                      for (const author of authors) {
                          const authorName = author.name;
                          const authorId = author.id;
                          returnData.push({
                              name: authorName,
                              value: authorId,
                          });
                      }
                      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 === 'post') {
                      if (operation === 'create') {
                          const title = this.getNodeParameter('title', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              title,
                          };
                          if (additionalFields.authorId) {
                              body.author = additionalFields.authorId;
                          }
                          if (additionalFields.content) {
                              body.content = additionalFields.content;
                          }
                          if (additionalFields.slug) {
                              body.slug = additionalFields.slug;
                          }
                          if (additionalFields.password) {
                              body.password = additionalFields.password;
                          }
                          if (additionalFields.status) {
                              body.status = additionalFields.status;
                          }
                          if (additionalFields.commentStatus) {
                              body.comment_status = additionalFields.commentStatus;
                          }
                          if (additionalFields.pingStatus) {
                              body.ping_status = additionalFields.pingStatus;
                          }
                          if (additionalFields.sticky) {
                              body.sticky = additionalFields.sticky;
                          }
                          if (additionalFields.postTemplate) {
                              body.template = this.getNodeParameter('additionalFields.postTemplate.values.template', i, '');
                          }
                          if (additionalFields.categories) {
                              body.categories = additionalFields.categories;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.format) {
                              body.format = additionalFields.format;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'POST', '/posts', body);
                      }
                      if (operation === 'update') {
                          const postId = this.getNodeParameter('postId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              id: parseInt(postId, 10),
                          };
                          if (updateFields.authorId) {
                              body.author = updateFields.authorId;
                          }
                          if (updateFields.title) {
                              body.title = updateFields.title;
                          }
                          if (updateFields.content) {
                              body.content = updateFields.content;
                          }
                          if (updateFields.slug) {
                              body.slug = updateFields.slug;
                          }
                          if (updateFields.password) {
                              body.password = updateFields.password;
                          }
                          if (updateFields.status) {
                              body.status = updateFields.status;
                          }
                          if (updateFields.commentStatus) {
                              body.comment_status = updateFields.commentStatus;
                          }
                          if (updateFields.pingStatus) {
                              body.ping_status = updateFields.pingStatus;
                          }
                          if (updateFields.sticky) {
                              body.sticky = updateFields.sticky;
                          }
                          if (updateFields.postTemplate) {
                              body.template = this.getNodeParameter('updateFields.postTemplate.values.template', i, '');
                          }
                          if (updateFields.categories) {
                              body.categories = updateFields.categories;
                          }
                          if (updateFields.tags) {
                              body.tags = updateFields.tags;
                          }
                          if (updateFields.format) {
                              body.format = updateFields.format;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'POST', `/posts/${postId}`, body);
                      }
                      if (operation === 'get') {
                          const postId = this.getNodeParameter('postId', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.password) {
                              qs.password = options.password;
                          }
                          if (options.context) {
                              qs.context = options.context;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'GET', `/posts/${postId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.context) {
                              qs.context = options.context;
                          }
                          if (options.orderBy) {
                              qs.orderby = options.orderBy;
                          }
                          if (options.order) {
                              qs.order = options.order;
                          }
                          if (options.search) {
                              qs.search = options.search;
                          }
                          if (options.after) {
                              qs.after = options.after;
                          }
                          if (options.author) {
                              qs.author = options.author;
                          }
                          if (options.categories) {
                              qs.categories = options.categories;
                          }
                          if (options.excludedCategories) {
                              qs.categories_exclude = options.excludedCategories;
                          }
                          if (options.tags) {
                              qs.tags = options.tags;
                          }
                          if (options.excludedTags) {
                              qs.tags_exclude = options.excludedTags;
                          }
                          if (options.sticky) {
                              qs.sticky = options.sticky;
                          }
                          if (options.status) {
                              qs.status = options.status;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.wordpressApiRequestAllItems.call(this, 'GET', '/posts', {}, qs);
                          }
                          else {
                              qs.per_page = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'GET', '/posts', {}, qs);
                          }
                      }
                      if (operation === 'delete') {
                          const postId = this.getNodeParameter('postId', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.force) {
                              qs.force = options.force;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'DELETE', `/posts/${postId}`, {}, qs);
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const username = this.getNodeParameter('username', i);
                          const firstName = this.getNodeParameter('firstName', i);
                          const lastName = this.getNodeParameter('lastName', i);
                          const email = this.getNodeParameter('email', i);
                          const password = this.getNodeParameter('password', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                              username,
                              first_name: firstName,
                              last_name: lastName,
                              email,
                              password,
                          };
                          if (additionalFields.url) {
                              body.url = additionalFields.url;
                          }
                          if (additionalFields.description) {
                              body.description = additionalFields.description;
                          }
                          if (additionalFields.nickname) {
                              body.nickname = additionalFields.nickname;
                          }
                          if (additionalFields.slug) {
                              body.slug = additionalFields.slug;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'POST', '/users', body);
                      }
                      if (operation === 'update') {
                          const userId = this.getNodeParameter('userId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              id: userId,
                          };
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.firstName) {
                              body.first_name = updateFields.firstName;
                          }
                          if (updateFields.lastName) {
                              body.last_name = updateFields.lastName;
                          }
                          if (updateFields.email) {
                              body.email = updateFields.email;
                          }
                          if (updateFields.password) {
                              body.password = updateFields.password;
                          }
                          if (updateFields.username) {
                              body.username = updateFields.username;
                          }
                          if (updateFields.url) {
                              body.url = updateFields.url;
                          }
                          if (updateFields.description) {
                              body.description = updateFields.description;
                          }
                          if (updateFields.nickname) {
                              body.nickname = updateFields.nickname;
                          }
                          if (updateFields.slug) {
                              body.slug = updateFields.slug;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'POST', `/users/${userId}`, body);
                      }
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('userId', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.context) {
                              qs.context = options.context;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'GET', `/users/${userId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.context) {
                              qs.context = options.context;
                          }
                          if (options.orderBy) {
                              qs.orderby = options.orderBy;
                          }
                          if (options.order) {
                              qs.order = options.order;
                          }
                          if (options.search) {
                              qs.search = options.search;
                          }
                          if (options.who) {
                              qs.who = options.who;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.wordpressApiRequestAllItems.call(this, 'GET', '/users', {}, qs);
                          }
                          else {
                              qs.per_page = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'GET', '/users', {}, qs);
                          }
                      }
                      if (operation === 'delete') {
                          const reassign = this.getNodeParameter('reassign', i);
                          qs.reassign = reassign;
                          qs.force = true;
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'DELETE', '/users/me', {}, qs);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Wordpress = Wordpress;
  //# sourceMappingURL=Wordpress.node.js.map

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

  # WordPress credentials

  You can use these credentials to authenticate the following nodes:

  - [WordPress](/integrations/builtin/app-nodes/n8n-nodes-base.wordpress.md)

  ## Prerequisites

  - Create a [WordPress](https://wordpress.com/){:target=_blank .external-link} account or deploy WordPress on a server.

  ## Supported authentication methods

  - Basic auth

  ## Related resources

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

  ## Using basic auth

  To configure this credential, you'll need:

  - Your WordPress **Username**
  - A WordPress application **Password**
  - Your **WordPress URL**
  - Decide whether to **Ignore SSL Issues**

  Using this credential involves three steps:

  1. [Enable two-step authentication](#enable-two-step-authentication).
  2. [Create an application password](#create-an-application-password).
  3. [Set up the credential](#set-up-the-credential).

  Refer to the detailed instructions below for each step.

  ### Enable two-step authentication

  To generate an application password, you must first enable Two-Step Authentication in WordPress. If you've already done this, [skip to the next section](#create-an-application-password).

  1. Open your WordPress [profile](https://wordpress.com/me){:target=_blank .external-link}.
  2. Select **Security** from the left menu.
  3. Select **Two-Step Authentication**. The **Two-Step Authentication** page opens.
  4. If Two-Step Authentication isn't enabled, you must enable it.
  5. Choose whether to enable it using an authenticator app or SMS codes and follow the on-screen instructions.

  Refer to WordPress's [Enable Two-Step Authentication](https://wordpress.com/support/security/two-step-authentication/){:target=_blank .external-link} for detailed instructions.

  ### Create an application password

  With Two-Step Authentication enabled, you can now generate an application password:

  1. From the WordPress **Security >** [**Two-Step Authentication**](https://wordpress.com/me/security/two-step) page, select **+ Add new application password** in the **Application passwords** section.
  5. Enter an **Application name**, like `n8n integration`.
  6. Select **Generate Password**.
  7. Copy the password it generates. You'll use this in your n8n credential.

  ### Set up the credential

  Congratulations! You're now ready to set up your n8n credential:

  1. Enter your WordPress **Username** in your n8n credential.
  2. Enter the application password you copied above as the **Password** in your n8n credential.
  3. Enter the URL of your WordPress site as the **WordPress URL**.
  4. Optional: Use the **Ignore SSL Issues** to choose whether you want the n8n credential to connect even if SSL certificate validation fails (turned on) or whether to respect SSL certificate validation (turned off).

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"bcf2b55e-67b5-483a-bac1-592febc3cb9c","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"1028f8b55b319facbea7cbc96f1074073367705160e566d5974b7da9bcdee798"}}


node_type: n8n-nodes-base.WorkflowTrigger
name: WorkflowTrigger
display_name: Workflow Trigger
description: Triggers based on various lifecycle events, like when a workflow is activated
category: Other
code_hash: 254166977ea09fe9d47202b97e9ab3e90bae00f8a02f4072c9d221a554e687ce
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.WorkflowTrigger = void 0;
  class WorkflowTrigger {
      constructor() {
          this.description = {
              displayName: 'Workflow Trigger',
              name: 'workflowTrigger',
              icon: 'fa:network-wired',
              group: ['trigger'],
              version: 1,
              description: 'Triggers based on various lifecycle events, like when a workflow is activated',
              eventTriggerDescription: '',
              mockManualExecution: true,
              activationMessage: 'Your workflow will now trigger executions on the event you have defined.',
              defaults: {
                  name: 'Workflow Trigger',
                  color: '#ff6d5a',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Events',
                      name: 'events',
                      type: 'multiOptions',
                      required: true,
                      default: [],
                      description: `Specifies under which conditions an execution should happen:
  					<ul>
  						<li><b>Active Workflow Updated</b>: Triggers when this workflow is updated</li>
  						<li><b>Workflow Activated</b>: Triggers when this workflow is activated</li>
  					</ul>`,
                      options: [
                          {
                              name: 'Active Workflow Updated',
                              value: 'update',
                              description: 'Triggers when this workflow is updated',
                          },
                          {
                              name: 'Workflow Activated',
                              value: 'activate',
                              description: 'Triggers when this workflow is activated',
                          },
                      ],
                  },
              ],
          };
      }
      async trigger() {
          const events = this.getNodeParameter('events', []);
          const activationMode = this.getActivationMode();
          if (events.includes(activationMode)) {
              let event;
              if (activationMode === 'activate') {
                  event = 'Workflow activated';
              }
              if (activationMode === 'update') {
                  event = 'Workflow updated';
              }
              this.emit([
                  this.helpers.returnJsonArray([
                      { event, timestamp: new Date().toISOString(), workflow_id: this.getWorkflow().id },
                  ]),
              ]);
          }
          const manualTriggerFunction = async () => {
              this.emit([
                  this.helpers.returnJsonArray([
                      {
                          event: 'Manual execution',
                          timestamp: new Date().toISOString(),
                          workflow_id: this.getWorkflow().id,
                      },
                  ]),
              ]);
          };
          return {
              manualTriggerFunction,
          };
      }
  }
  exports.WorkflowTrigger = WorkflowTrigger;
  //# sourceMappingURL=WorkflowTrigger.node.js.map

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

  # Execute Sub-workflow Trigger node

  Use this node to start a workflow in response to another workflow. It should be the first node in the workflow.

  n8n allows you to call workflows from other workflows. This is useful if you want to:

  * Reuse a workflow: for example, you could have multiple workflows pulling and processing data from different sources, then have all those workflows call a single workflow that generates a report.
  * Break large workflows into smaller components.

  ## Usage

  This node runs in response to a call from the [Execute Sub-workflow](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow.md) or [Call n8n Workflow Tool](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md) nodes.

  --8<-- "_snippets/flow-logic/subworkflow-usage.md"

  ## Templates and examples

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

  ## How data passes between workflows

  --8<-- "_snippets/flow-logic/subworkflow-data-flow.md"

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"38220fb5-77d2-4180-8d07-0531f954763d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"d647df49d0669ca23077b85bca0eaf8bc9afc41208577c30d9f054bef12dd169"}}


node_type: n8n-nodes-base.Xero
name: Xero
display_name: Xero
description: Consume Xero API
category: Other
code_hash: aba95b820352106355fa38f55f10b5075b9568611f3b9bb24eb9473d6bbe146b
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/xero
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Xero = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const InvoiceDescription_1 = require("./InvoiceDescription");
  const ContactDescription_1 = require("./ContactDescription");
  class Xero {
      constructor() {
          this.description = {
              displayName: 'Xero',
              name: 'xero',
              icon: 'file:xero.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Xero API',
              defaults: {
                  name: 'Xero',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'xeroOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                          {
                              name: 'Invoice',
                              value: 'invoice',
                          },
                      ],
                      default: 'invoice',
                  },
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
                  ...InvoiceDescription_1.invoiceOperations,
                  ...InvoiceDescription_1.invoiceFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getItemCodes() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { Items: items } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/items', {
                          organizationId,
                      });
                      for (const item of items) {
                          const itemName = item.Description;
                          const itemId = item.Code;
                          returnData.push({
                              name: itemName,
                              value: itemId,
                          });
                      }
                      return returnData;
                  },
                  async getAccountCodes() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { Accounts: accounts } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Accounts', {
                          organizationId,
                      });
                      for (const account of accounts) {
                          const accountName = account.Name;
                          const accountId = account.Code;
                          returnData.push({
                              name: accountName,
                              value: accountId,
                          });
                      }
                      return returnData;
                  },
                  async getTenants() {
                      const returnData = [];
                      const tenants = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '', {}, {}, 'https://api.xero.com/connections');
                      for (const tenant of tenants) {
                          const tenantName = tenant.tenantName;
                          const tenantId = tenant.tenantId;
                          returnData.push({
                              name: tenantName,
                              value: tenantId,
                          });
                      }
                      return returnData;
                  },
                  async getBrandingThemes() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { BrandingThemes: themes } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/BrandingThemes', { organizationId });
                      for (const theme of themes) {
                          const themeName = theme.Name;
                          const themeId = theme.BrandingThemeID;
                          returnData.push({
                              name: themeName,
                              value: themeId,
                          });
                      }
                      return returnData;
                  },
                  async getCurrencies() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { Currencies: currencies } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Currencies', {
                          organizationId,
                      });
                      for (const currency of currencies) {
                          const currencyName = currency.Code;
                          const currencyId = currency.Description;
                          returnData.push({
                              name: currencyName,
                              value: currencyId,
                          });
                      }
                      return returnData;
                  },
                  async getTrakingCategories() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { TrackingCategories: categories } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/TrackingCategories', { organizationId });
                      for (const category of categories) {
                          const categoryName = category.Name;
                          const categoryId = category.TrackingCategoryID;
                          returnData.push({
                              name: categoryName,
                              value: categoryId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', 0);
                  const operation = this.getNodeParameter('operation', 0);
                  if (resource === 'invoice') {
                      if (operation === 'create') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const type = this.getNodeParameter('type', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          const lineItemsValues = this.getNodeParameter('lineItemsUi', i)
                              .lineItemsValues;
                          const body = {
                              organizationId,
                              Type: type,
                              Contact: { ContactID: contactId },
                          };
                          if (lineItemsValues) {
                              const lineItems = [];
                              for (const lineItemValue of lineItemsValues) {
                                  const lineItem = {
                                      Tracking: [],
                                  };
                                  lineItem.AccountCode = lineItemValue.accountCode;
                                  lineItem.Description = lineItemValue.description;
                                  lineItem.DiscountRate = lineItemValue.discountRate;
                                  lineItem.ItemCode = lineItemValue.itemCode;
                                  lineItem.LineAmount = lineItemValue.lineAmount;
                                  lineItem.Quantity = lineItemValue.quantity.toString();
                                  lineItem.TaxAmount = lineItemValue.taxAmount;
                                  lineItem.TaxType = lineItemValue.taxType;
                                  lineItem.UnitAmount = lineItemValue.unitAmount;
                                  lineItems.push(lineItem);
                              }
                              body.LineItems = lineItems;
                          }
                          if (additionalFields.brandingThemeId) {
                              body.BrandingThemeID = additionalFields.brandingThemeId;
                          }
                          if (additionalFields.currency) {
                              body.CurrencyCode = additionalFields.currency;
                          }
                          if (additionalFields.currencyRate) {
                              body.CurrencyRate = additionalFields.currencyRate;
                          }
                          if (additionalFields.date) {
                              body.Date = additionalFields.date;
                          }
                          if (additionalFields.dueDate) {
                              body.DueDate = additionalFields.dueDate;
                          }
                          if (additionalFields.dueDate) {
                              body.DueDate = additionalFields.dueDate;
                          }
                          if (additionalFields.expectedPaymentDate) {
                              body.ExpectedPaymentDate = additionalFields.expectedPaymentDate;
                          }
                          if (additionalFields.invoiceNumber) {
                              body.InvoiceNumber = additionalFields.invoiceNumber;
                          }
                          if (additionalFields.lineAmountType) {
                              body.LineAmountTypes = additionalFields.lineAmountType;
                          }
                          if (additionalFields.plannedPaymentDate) {
                              body.PlannedPaymentDate = additionalFields.plannedPaymentDate;
                          }
                          if (additionalFields.reference) {
                              body.Reference = additionalFields.reference;
                          }
                          if (additionalFields.sendToContact) {
                              body.SentToContact = additionalFields.sendToContact;
                          }
                          if (additionalFields.status) {
                              body.Status = additionalFields.status;
                          }
                          if (additionalFields.url) {
                              body.Url = additionalFields.url;
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', '/Invoices', body);
                          responseData = responseData.Invoices;
                      }
                      if (operation === 'update') {
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              organizationId,
                          };
                          if (updateFields.lineItemsUi) {
                              const lineItemsValues = updateFields.lineItemsUi
                                  .lineItemsValues;
                              if (lineItemsValues) {
                                  const lineItems = [];
                                  for (const lineItemValue of lineItemsValues) {
                                      const lineItem = {
                                          Tracking: [],
                                      };
                                      lineItem.AccountCode = lineItemValue.accountCode;
                                      lineItem.Description = lineItemValue.description;
                                      lineItem.DiscountRate = lineItemValue.discountRate;
                                      lineItem.ItemCode = lineItemValue.itemCode;
                                      lineItem.LineAmount = lineItemValue.lineAmount;
                                      lineItem.Quantity = lineItemValue.quantity.toString();
                                      lineItem.TaxAmount = lineItemValue.taxAmount;
                                      lineItem.TaxType = lineItemValue.taxType;
                                      lineItem.UnitAmount = lineItemValue.unitAmount;
                                      lineItems.push(lineItem);
                                  }
                                  body.LineItems = lineItems;
                              }
                          }
                          if (updateFields.type) {
                              body.Type = updateFields.type;
                          }
                          if (updateFields.Contact) {
                              body.Contact = { ContactID: updateFields.contactId };
                          }
                          if (updateFields.brandingThemeId) {
                              body.BrandingThemeID = updateFields.brandingThemeId;
                          }
                          if (updateFields.currency) {
                              body.CurrencyCode = updateFields.currency;
                          }
                          if (updateFields.currencyRate) {
                              body.CurrencyRate = updateFields.currencyRate;
                          }
                          if (updateFields.date) {
                              body.Date = updateFields.date;
                          }
                          if (updateFields.dueDate) {
                              body.DueDate = updateFields.dueDate;
                          }
                          if (updateFields.dueDate) {
                              body.DueDate = updateFields.dueDate;
                          }
                          if (updateFields.expectedPaymentDate) {
                              body.ExpectedPaymentDate = updateFields.expectedPaymentDate;
                          }
                          if (updateFields.invoiceNumber) {
                              body.InvoiceNumber = updateFields.invoiceNumber;
                          }
                          if (updateFields.lineAmountType) {
                              body.LineAmountTypes = updateFields.lineAmountType;
                          }
                          if (updateFields.plannedPaymentDate) {
                              body.PlannedPaymentDate = updateFields.plannedPaymentDate;
                          }
                          if (updateFields.reference) {
                              body.Reference = updateFields.reference;
                          }
                          if (updateFields.sendToContact) {
                              body.SentToContact = updateFields.sendToContact;
                          }
                          if (updateFields.status) {
                              body.Status = updateFields.status;
                          }
                          if (updateFields.url) {
                              body.Url = updateFields.url;
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', `/Invoices/${invoiceId}`, body);
                          responseData = responseData.Invoices;
                      }
                      if (operation === 'get') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', `/Invoices/${invoiceId}`, {
                              organizationId,
                          });
                          responseData = responseData.Invoices;
                      }
                      if (operation === 'getAll') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.statuses) {
                              qs.statuses = options.statuses.join(',');
                          }
                          if (options.orderBy) {
                              qs.order = `${options.orderBy} ${options.sortOrder === undefined ? 'DESC' : options.sortOrder}`;
                          }
                          if (options.where) {
                              qs.where = options.where;
                          }
                          if (options.createdByMyApp) {
                              qs.createdByMyApp = options.createdByMyApp;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.xeroApiRequestAllItems.call(this, 'Invoices', 'GET', '/Invoices', { organizationId }, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Invoices', { organizationId }, qs);
                              responseData = responseData.Invoices;
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  if (resource === 'contact') {
                      if (operation === 'create') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const addressesUi = additionalFields.addressesUi;
                          const phonesUi = additionalFields.phonesUi;
                          const body = {
                              Name: name,
                          };
                          if (additionalFields.accountNumber) {
                              body.AccountNumber = additionalFields.accountNumber;
                          }
                          if (additionalFields.bankAccountDetails) {
                              body.BankAccountDetails = additionalFields.bankAccountDetails;
                          }
                          if (additionalFields.contactNumber) {
                              body.ContactNumber = additionalFields.contactNumber;
                          }
                          if (additionalFields.contactStatus) {
                              body.ContactStatus = additionalFields.contactStatus;
                          }
                          if (additionalFields.defaultCurrency) {
                              body.DefaultCurrency = additionalFields.defaultCurrency;
                          }
                          if (additionalFields.emailAddress) {
                              body.EmailAddress = additionalFields.emailAddress;
                          }
                          if (additionalFields.firstName) {
                              body.FirstName = additionalFields.firstName;
                          }
                          if (additionalFields.lastName) {
                              body.LastName = additionalFields.lastName;
                          }
                          if (additionalFields.purchasesDefaultAccountCode) {
                              body.PurchasesDefaultAccountCode =
                                  additionalFields.purchasesDefaultAccountCode;
                          }
                          if (additionalFields.salesDefaultAccountCode) {
                              body.SalesDefaultAccountCode = additionalFields.salesDefaultAccountCode;
                          }
                          if (additionalFields.skypeUserName) {
                              body.SkypeUserName = additionalFields.skypeUserName;
                          }
                          if (additionalFields.taxNumber) {
                              body.taxNumber = additionalFields.taxNumber;
                          }
                          if (additionalFields.xeroNetworkKey) {
                              body.xeroNetworkKey = additionalFields.xeroNetworkKey;
                          }
                          if (phonesUi) {
                              const phoneValues = phonesUi === null || phonesUi === void 0 ? void 0 : phonesUi.phonesValues;
                              if (phoneValues) {
                                  const phones = [];
                                  for (const phoneValue of phoneValues) {
                                      const phone = {};
                                      phone.PhoneType = phoneValue.phoneType;
                                      phone.PhoneNumber = phoneValue.phoneNumber;
                                      phone.PhoneAreaCode = phoneValue.phoneAreaCode;
                                      phone.PhoneCountryCode = phoneValue.phoneCountryCode;
                                      phones.push(phone);
                                  }
                                  body.Phones = phones;
                              }
                          }
                          if (addressesUi) {
                              const addressValues = addressesUi === null || addressesUi === void 0 ? void 0 : addressesUi.addressesValues;
                              if (addressValues) {
                                  const addresses = [];
                                  for (const addressValue of addressValues) {
                                      const address = {};
                                      address.AddressType = addressValue.type;
                                      address.AddressLine1 = addressValue.line1;
                                      address.AddressLine2 = addressValue.line2;
                                      address.City = addressValue.city;
                                      address.Region = addressValue.region;
                                      address.PostalCode = addressValue.postalCode;
                                      address.Country = addressValue.country;
                                      address.AttentionTo = addressValue.attentionTo;
                                      addresses.push(address);
                                  }
                                  body.Addresses = addresses;
                              }
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', '/Contacts', {
                              organizationId,
                              Contacts: [body],
                          });
                          responseData = responseData.Contacts;
                      }
                      if (operation === 'get') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', `/Contacts/${contactId}`, {
                              organizationId,
                          });
                          responseData = responseData.Contacts;
                      }
                      if (operation === 'getAll') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.includeArchived) {
                              qs.includeArchived = options.includeArchived;
                          }
                          if (options.orderBy) {
                              qs.order = `${options.orderBy} ${options.sortOrder === undefined ? 'DESC' : options.sortOrder}`;
                          }
                          if (options.where) {
                              qs.where = options.where;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.xeroApiRequestAllItems.call(this, 'Contacts', 'GET', '/Contacts', { organizationId }, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Contacts', { organizationId }, qs);
                              responseData = responseData.Contacts;
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const addressesUi = updateFields.addressesUi;
                          const phonesUi = updateFields.phonesUi;
                          const body = {};
                          if (updateFields.accountNumber) {
                              body.AccountNumber = updateFields.accountNumber;
                          }
                          if (updateFields.name) {
                              body.Name = updateFields.name;
                          }
                          if (updateFields.bankAccountDetails) {
                              body.BankAccountDetails = updateFields.bankAccountDetails;
                          }
                          if (updateFields.contactNumber) {
                              body.ContactNumber = updateFields.contactNumber;
                          }
                          if (updateFields.contactStatus) {
                              body.ContactStatus = updateFields.contactStatus;
                          }
                          if (updateFields.defaultCurrency) {
                              body.DefaultCurrency = updateFields.defaultCurrency;
                          }
                          if (updateFields.emailAddress) {
                              body.EmailAddress = updateFields.emailAddress;
                          }
                          if (updateFields.firstName) {
                              body.FirstName = updateFields.firstName;
                          }
                          if (updateFields.lastName) {
                              body.LastName = updateFields.lastName;
                          }
                          if (updateFields.purchasesDefaultAccountCode) {
                              body.PurchasesDefaultAccountCode = updateFields.purchasesDefaultAccountCode;
                          }
                          if (updateFields.salesDefaultAccountCode) {
                              body.SalesDefaultAccountCode = updateFields.salesDefaultAccountCode;
                          }
                          if (updateFields.skypeUserName) {
                              body.SkypeUserName = updateFields.skypeUserName;
                          }
                          if (updateFields.taxNumber) {
                              body.taxNumber = updateFields.taxNumber;
                          }
                          if (updateFields.xeroNetworkKey) {
                              body.xeroNetworkKey = updateFields.xeroNetworkKey;
                          }
                          if (phonesUi) {
                              const phoneValues = phonesUi === null || phonesUi === void 0 ? void 0 : phonesUi.phonesValues;
                              if (phoneValues) {
                                  const phones = [];
                                  for (const phoneValue of phoneValues) {
                                      const phone = {};
                                      phone.PhoneType = phoneValue.phoneType;
                                      phone.PhoneNumber = phoneValue.phoneNumber;
                                      phone.PhoneAreaCode = phoneValue.phoneAreaCode;
                                      phone.PhoneCountryCode = phoneValue.phoneCountryCode;
                                      phones.push(phone);
                                  }
                                  body.Phones = phones;
                              }
                          }
                          if (addressesUi) {
                              const addressValues = addressesUi === null || addressesUi === void 0 ? void 0 : addressesUi.addressesValues;
                              if (addressValues) {
                                  const addresses = [];
                                  for (const addressValue of addressValues) {
                                      const address = {};
                                      address.AddressType = addressValue.type;
                                      address.AddressLine1 = addressValue.line1;
                                      address.AddressLine2 = addressValue.line2;
                                      address.City = addressValue.city;
                                      address.Region = addressValue.region;
                                      address.PostalCode = addressValue.postalCode;
                                      address.Country = addressValue.country;
                                      address.AttentionTo = addressValue.attentionTo;
                                      addresses.push(address);
                                  }
                                  body.Addresses = addresses;
                              }
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', `/Contacts/${contactId}`, {
                              organizationId,
                              Contacts: [body],
                          });
                          responseData = responseData.Contacts;
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Xero = Xero;
  //# sourceMappingURL=Xero.node.js.map

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

  # Xero credentials

  You can use these credentials to authenticate the following nodes:

  - [Xero](/integrations/builtin/app-nodes/n8n-nodes-base.xero.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - OAuth2

  ## Related resources

  Refer to [Zero's API documentation](https://developer.xero.com/documentation/api/accounting/overview){:target=_blank .external-link} for more information about the service.

  ## Using OAuth2

  To configure this credential, you'll need:

  - A **Client ID**: Generated when you create a new app for a custom connection.
  - A **Client Secret**: Generated when you create a new app for a custom connection.

  To generate your Client ID and Client Secret, [create an OAuth2 custom connection app](https://developer.xero.com/documentation/guides/oauth2/custom-connections/){:target=_blank .external-link} in your Xero developer portal [**My Apps**](https://developer.xero.com/app/manage){:target=_blank .external-link}.

  Use these settings for your app:

  /// note | Xero App Name

  Xero doesn't support app instances within the Xero Developer Centre that contain `n8n` in their name.

  ///

  - Select **Web app** as the **Integration Type**.
  - For the **Company or Application URL**, enter the URL of your n8n server or reverse proxy address. For cloud users, for example, this is: `https://your-username.app.n8n.cloud/`.
  - Copy the **OAuth Redirect URL** from n8n and add it as an **OAuth 2.0 redirect URI** in your app.
  - Select appropriate **scopes** for your app. Refer to [OAuth2 Scopes](https://developer.xero.com/documentation/guides/oauth2/scopes/){:target=_blank .external-link} for more information.
      - To use all functionality in the [Xero](/integrations/builtin/app-nodes/n8n-nodes-base.xero.md) node, add the `accounting.contacts` and `accounting.transactions` scopes.

  Refer to Xero's [OAuth Custom Connections](https://developer.xero.com/documentation/guides/oauth2/custom-connections){:target=_blank .external-link} documentation for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"92fc5a2e-0517-477f-b843-910463afdc30","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"68d93eec0867d55cdd5ce11788ab23eba115b7cf6d05048192ee995ec90a6bd1"}}


node_type: n8n-nodes-base.Yourls
name: Yourls
display_name: Yourls
description: Consume Yourls API
category: Other
code_hash: f151d26502f0f4c7287ac076071905adcc0d2dded190cf040d5bebe6d06a2cf9
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/yourls
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Yourls = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const UrlDescription_1 = require("./UrlDescription");
  class Yourls {
      constructor() {
          this.description = {
              displayName: 'Yourls',
              name: 'yourls',
              icon: 'file:yourls.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Yourls API',
              defaults: {
                  name: 'Yourls',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'yourlsApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'URL',
                              value: 'url',
                          },
                      ],
                      default: 'url',
                  },
                  ...UrlDescription_1.urlOperations,
                  ...UrlDescription_1.urlFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'url') {
                      if (operation === 'shorten') {
                          const url = this.getNodeParameter('url', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          qs.url = url;
                          qs.action = 'shorturl';
                          Object.assign(qs, additionalFields);
                          responseData = await GenericFunctions_1.yourlsApiRequest.call(this, 'GET', {}, qs);
                      }
                      if (operation === 'expand') {
                          const shortUrl = this.getNodeParameter('shortUrl', i);
                          qs.shorturl = shortUrl;
                          qs.action = 'expand';
                          responseData = await GenericFunctions_1.yourlsApiRequest.call(this, 'GET', {}, qs);
                      }
                      if (operation === 'stats') {
                          const shortUrl = this.getNodeParameter('shortUrl', i);
                          qs.shorturl = shortUrl;
                          qs.action = 'url-stats';
                          responseData = await GenericFunctions_1.yourlsApiRequest.call(this, 'GET', {}, qs);
                          responseData = responseData.link;
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Yourls = Yourls;
  //# sourceMappingURL=Yourls.node.js.map

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

  # Yourls credentials

  You can use these credentials to authenticate the following nodes:

  - [Yourls](/integrations/builtin/app-nodes/n8n-nodes-base.yourls.md)

  ## Prerequisites

  Install [Yourls](https://github.com/YOURLS/YOURLS){:target=_blank .external-link} on your server.

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - A **Signature** token: Go to **Tools > Secure passwordless API call** to get your **Signature** token. Refer to [Yourl's Passworldess API documentation](https://yourls.org/docs/guide/advanced/passwordless-api){:target=_blank .external-link} for more information.
  - A **URL**: Enter the URL of your Yourls instance.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b5d1b2f3-509f-4f24-a17f-d710b70f31f4","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"2f3a3a6340b9553213e9d6251d773672fade0fb8044a4a8f6483f620999aca3b"}}


node_type: n8n-nodes-base.Zendesk
name: Zendesk
display_name: Zendesk
description: Consume Zendesk API
category: Other
code_hash: 88e68de64c851f4c26efadf449ffbca89eabfb9b4ccda678908be23fbabe14b8
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/zendesk
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zendesk = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const TicketDescription_1 = require("./TicketDescription");
  const TicketFieldDescription_1 = require("./TicketFieldDescription");
  const UserDescription_1 = require("./UserDescription");
  const OrganizationDescription_1 = require("./OrganizationDescription");
  class Zendesk {
      constructor() {
          this.description = {
              displayName: 'Zendesk',
              name: 'zendesk',
              icon: 'file:zendesk.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Zendesk API',
              defaults: {
                  name: 'Zendesk',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zendeskApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['apiToken'],
                          },
                      },
                  },
                  {
                      name: 'zendeskOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'API Token',
                              value: 'apiToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'apiToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Ticket',
                              value: 'ticket',
                              description: 'Tickets are the means through which your end users (customers) communicate with agents in Zendesk Support',
                          },
                          {
                              name: 'Ticket Field',
                              value: 'ticketField',
                              description: 'Manage system and custom ticket fields',
                          },
                          {
                              name: 'User',
                              value: 'user',
                              description: 'Manage users',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                              description: 'Manage organizations',
                          },
                      ],
                      default: 'ticket',
                  },
                  ...TicketDescription_1.ticketOperations,
                  ...TicketDescription_1.ticketFields,
                  ...TicketFieldDescription_1.ticketFieldOperations,
                  ...TicketFieldDescription_1.ticketFieldFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
                  ...OrganizationDescription_1.organizationOperations,
                  ...OrganizationDescription_1.organizationFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCustomFields() {
                      const returnData = [];
                      const customFields = [
                          'text',
                          'textarea',
                          'date',
                          'integer',
                          'decimal',
                          'regexp',
                          'multiselect',
                          'tagger',
                      ];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'ticket_fields', 'GET', '/ticket_fields');
                      for (const field of fields) {
                          if (customFields.includes(field.type)) {
                              const fieldName = field.title;
                              const fieldId = field.id;
                              returnData.push({
                                  name: fieldName,
                                  value: fieldId,
                              });
                          }
                      }
                      return returnData;
                  },
                  async getGroups() {
                      const returnData = [];
                      const groups = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'groups', 'GET', '/groups');
                      for (const group of groups) {
                          const groupName = group.name;
                          const groupId = group.id;
                          returnData.push({
                              name: groupName,
                              value: groupId,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const returnData = [];
                      const tags = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'tags', 'GET', '/tags');
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = tag.name;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
                  async getLocales() {
                      const returnData = [];
                      const locales = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'locales', 'GET', '/locales');
                      for (const locale of locales) {
                          const localeName = `${locale.locale} - ${locale.name}`;
                          const localeId = locale.locale;
                          returnData.push({
                              name: localeName,
                              value: localeId,
                          });
                      }
                      return returnData;
                  },
                  async getUserFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'user_fields', 'GET', '/user_fields');
                      for (const field of fields) {
                          const fieldName = field.title;
                          const fieldId = field.key;
                          returnData.push({
                              name: fieldName,
                              value: fieldId,
                          });
                      }
                      return returnData;
                  },
                  async getOrganizationFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'organization_fields', 'GET', '/organization_fields');
                      for (const field of fields) {
                          const fieldName = field.title;
                          const fieldId = field.key;
                          returnData.push({
                              name: fieldName,
                              value: fieldId,
                          });
                      }
                      return returnData;
                  },
                  async getOrganizations() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'organizations', 'GET', '/organizations', {}, {});
                      for (const field of fields) {
                          returnData.push({
                              name: field.name,
                              value: field.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', 0);
                  const operation = this.getNodeParameter('operation', 0);
                  if (resource === 'ticket') {
                      if (operation === 'create') {
                          const description = this.getNodeParameter('description', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const comment = {
                              body: description,
                          };
                          const body = {
                              comment,
                          };
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.type) {
                                  body.type = additionalFields.type;
                              }
                              if (additionalFields.externalId) {
                                  body.external_id = additionalFields.externalId;
                              }
                              if (additionalFields.subject) {
                                  body.subject = additionalFields.subject;
                              }
                              if (additionalFields.status) {
                                  body.status = additionalFields.status;
                              }
                              if (additionalFields.recipient) {
                                  body.recipient = additionalFields.recipient;
                              }
                              if (additionalFields.group) {
                                  body.group_id = additionalFields.group;
                              }
                              if (additionalFields.tags) {
                                  body.tags = additionalFields.tags;
                              }
                              if (additionalFields.customFieldsUi) {
                                  body.custom_fields = additionalFields.customFieldsUi
                                      .customFieldsValues;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'POST', '/tickets', { ticket: body });
                          responseData = responseData.ticket;
                      }
                      if (operation === 'update') {
                          const ticketId = this.getNodeParameter('id', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const body = {};
                          if (jsonParameters) {
                              const updateFieldsJson = this.getNodeParameter('updateFieldsJson', i);
                              if (updateFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(updateFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(updateFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const updateFields = this.getNodeParameter('updateFields', i);
                              if (updateFields.type) {
                                  body.type = updateFields.type;
                              }
                              if (updateFields.externalId) {
                                  body.external_id = updateFields.externalId;
                              }
                              if (updateFields.subject) {
                                  body.subject = updateFields.subject;
                              }
                              if (updateFields.status) {
                                  body.status = updateFields.status;
                              }
                              if (updateFields.recipient) {
                                  body.recipient = updateFields.recipient;
                              }
                              if (updateFields.group) {
                                  body.group_id = updateFields.group;
                              }
                              if (updateFields.tags) {
                                  body.tags = updateFields.tags;
                              }
                              if (updateFields.customFieldsUi) {
                                  body.custom_fields = updateFields.customFieldsUi
                                      .customFieldsValues;
                              }
                              if (updateFields.assigneeEmail) {
                                  body.assignee_email = updateFields.assigneeEmail;
                              }
                              if (updateFields.internalNote) {
                                  const comment = {
                                      html_body: updateFields.internalNote,
                                      public: false,
                                  };
                                  body.comment = comment;
                              }
                              if (updateFields.publicReply) {
                                  const comment = {
                                      body: updateFields.publicReply,
                                      public: true,
                                  };
                                  body.comment = comment;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/tickets/${ticketId}`, {
                              ticket: body,
                          });
                          responseData = responseData.ticket;
                      }
                      if (operation === 'get') {
                          const ticketType = this.getNodeParameter('ticketType', i);
                          const ticketId = this.getNodeParameter('id', i);
                          const endpoint = ticketType === 'regular' ? `/tickets/${ticketId}` : `/suspended_tickets/${ticketId}`;
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', endpoint, {});
                          responseData = responseData.ticket || responseData.suspended_ticket;
                      }
                      if (operation === 'getAll') {
                          const ticketType = this.getNodeParameter('ticketType', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          qs.query = 'type:ticket';
                          if (options.query) {
                              qs.query += ` ${options.query}`;
                          }
                          if (options.status) {
                              qs.query += ` status:${options.status}`;
                          }
                          if (options.group) {
                              qs.query += ` group:${options.group}`;
                          }
                          if (options.sortBy) {
                              qs.sort_by = options.sortBy;
                          }
                          if (options.sortOrder) {
                              qs.sort_order = options.sortOrder;
                          }
                          const endpoint = ticketType === 'regular' ? '/search' : '/suspended_tickets';
                          const property = ticketType === 'regular' ? 'results' : 'suspended_tickets';
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, property, 'GET', endpoint, {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', endpoint, {}, qs);
                              responseData = responseData.results || responseData.suspended_tickets;
                          }
                      }
                      if (operation === 'delete') {
                          const ticketType = this.getNodeParameter('ticketType', i);
                          const ticketId = this.getNodeParameter('id', i);
                          const endpoint = ticketType === 'regular' ? `/tickets/${ticketId}` : `/suspended_tickets/${ticketId}`;
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'DELETE', endpoint, {});
                          responseData = { success: true };
                      }
                      if (operation === 'recover') {
                          const ticketId = this.getNodeParameter('id', i);
                          try {
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/suspended_tickets/${ticketId}/recover`, {});
                              responseData = responseData.ticket;
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                  }
                  if (resource === 'ticketField') {
                      if (operation === 'get') {
                          const ticketFieldId = this.getNodeParameter('ticketFieldId', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/ticket_fields/${ticketFieldId}`, {});
                          responseData = responseData.ticket_field;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'ticket_fields', 'GET', '/ticket_fields', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'ticket_fields', 'GET', '/ticket_fields', {}, qs);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                          };
                          Object.assign(body, additionalFields);
                          if (body.userFieldsUi) {
                              const userFieldsUI = body.userFieldsUi
                                  .userFieldValues;
                              if (userFieldsUI) {
                                  body.user_fields = {};
                                  for (const userField of userFieldsUI) {
                                      body.user_fields[userField.field] = userField.value;
                                  }
                                  delete body.userFieldsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'POST', '/users', { user: body });
                          responseData = responseData.user;
                      }
                      if (operation === 'update') {
                          const userId = this.getNodeParameter('id', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          if (body.userFieldsUi) {
                              const userFieldsUI = body.userFieldsUi
                                  .userFieldValues;
                              if (userFieldsUI) {
                                  body.user_fields = {};
                                  for (const userField of userFieldsUI) {
                                      body.user_fields[userField.field] = userField.value;
                                  }
                                  delete body.userFieldsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/users/${userId}`, {
                              user: body,
                          });
                          responseData = responseData.user;
                      }
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/users/${userId}`, {});
                          responseData = responseData.user;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('filters', i);
                          Object.assign(qs, options);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'users', 'GET', '/users', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/users', {}, qs);
                              responseData = responseData.users;
                          }
                      }
                      if (operation === 'getOrganizations') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/users/${userId}/organizations`, {});
                          responseData = responseData.organizations;
                      }
                      if (operation === 'search') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('filters', i);
                          Object.assign(qs, options);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'users', 'GET', '/users/search', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/users/search', {}, qs);
                              responseData = responseData.users;
                          }
                      }
                      if (operation === 'delete') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'DELETE', `/users/${userId}`, {});
                          responseData = responseData.user;
                      }
                      if (operation === 'getRelatedData') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/users/${userId}/related`, {});
                          responseData = responseData.user_related;
                      }
                  }
                  if (resource === 'organization') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          const { organizationFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, rest);
                          if (organizationFieldsUi === null || organizationFieldsUi === void 0 ? void 0 : organizationFieldsUi.organizationFieldValues.length) {
                              const organizationFieldsUI = organizationFieldsUi.organizationFieldValues;
                              if (organizationFieldsUI.length) {
                                  body.organization_fields = {};
                                  for (const organizationField of organizationFieldsUI) {
                                      body.organization_fields[organizationField.field] = organizationField.value;
                                  }
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'POST', '/organizations', {
                              organization: body,
                          });
                          responseData = responseData.organization;
                      }
                      if (operation === 'delete') {
                          const organizationId = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zendeskApiRequest.call(this, 'DELETE', `/organizations/${organizationId}`, {});
                          responseData = { success: true };
                      }
                      if (operation === 'count') {
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/organizations/count', {});
                          responseData = responseData.count;
                      }
                      if (operation === 'get') {
                          const organizationId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/organizations/${organizationId}`, {});
                          responseData = responseData.organization;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'organizations', 'GET', '/organizations', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/organizations', {}, qs);
                              responseData = responseData.organizations;
                          }
                      }
                      if (operation === 'getRelatedData') {
                          const organizationId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/organizations/${organizationId}/related`, {});
                          responseData = responseData.organization_related;
                      }
                      if (operation === 'update') {
                          const organizationId = this.getNodeParameter('id', i);
                          const body = {};
                          const { organizationFieldsUi, ...rest } = this.getNodeParameter('updateFields', i);
                          Object.assign(body, rest);
                          if (organizationFieldsUi === null || organizationFieldsUi === void 0 ? void 0 : organizationFieldsUi.organizationFieldValues.length) {
                              const organizationFieldsUI = organizationFieldsUi.organizationFieldValues;
                              if (organizationFieldsUI.length) {
                                  body.organization_fields = {};
                                  for (const organizationField of organizationFieldsUI) {
                                      body.organization_fields[organizationField.field] = organizationField.value;
                                  }
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/organizations/${organizationId}`, { organization: body });
                          responseData = responseData.organization;
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zendesk = Zendesk;
  //# sourceMappingURL=Zendesk.node.js.map

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

  # Zendesk credentials

  You can use these credentials to authenticate the following nodes:

  - [Zendesk](/integrations/builtin/app-nodes/n8n-nodes-base.zendesk.md)
  - [Zendesk Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.zendesktrigger.md)

  ## Prerequisites

  - Create a [Zendesk](https://zendesk.com/){:target=_blank .external-link} account.
  - For API token authentication, enable token access to the API in Admin Center under **Apps and integrations > APIs > Zendesk APIs**.

  ## Supported authentication methods

  - API token
  - OAuth2

  ## Related resources

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

  ## Using API token

  To configure this credential, you'll need:

  - Your **Subdomain**: Your Zendesk subdomain is the portion of the URL between `https://` and `.zendesk.com`. For example, if the Zendesk URL is `https://n8n-example.zendesk.com/agent/dashboard`, the subdomain is `n8n-example`.
  - An **Email** address: Enter the email address you use to log in to Zendesk.
  - An **API Token**: Generate an API token in **Apps and integrations > APIs > Zendesk API**. Refer to [API token](https://developer.zendesk.com/api-reference/introduction/security-and-auth/#api-token){:target=_blank .external-link} for more information.

  ## Using OAuth2

  To configure this credential, you'll need:

  - A **Client ID**: Generated when you create a new OAuth client.
  - A **Client Secret**: Generated when you create a new OAuth client.
  - Your **Subdomain**: Your Zendesk subdomain is the portion of the URL between `https://` and `.zendesk.com`. For example, if the Zendesk URL is `https://n8n-example.zendesk.com/agent/dashboard`, the subdomain is `n8n-example`.

  To create a new OAuth client, go to **Apps and integrations > APIs > Zendesk API > OAuth Clients**.

  Use these settings:

   - Copy the **OAuth Redirect URL** from n8n and enter it as a **Redirect URL** in the OAuth client.
   - Copy the **Unique identifier** for the Zendesk client and enter this as your n8n **Client ID**.
   - Copy the **Secret** from Zendesk and enter this as your n8n **Client Secret**
   
   
   Refer to [Registering your application with Zendesk](https://support.zendesk.com/hc/en-us/articles/4408845965210-Using-OAuth-authentication-with-your-application#topic_s21_lfs_qk){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"879a64cb-b41b-453e-ba54-290de3d8d9f2","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"cde720540ac0bb590675abf5ffab0fafa17ceee9e009904791d9e8f15327a1c4"}}


node_type: n8n-nodes-base.Zammad
name: Zammad
display_name: Zammad
description: Consume the Zammad API
category: Other
code_hash: e36ae4ec17e8db702c4d105e9179bc5068a484ceaf7033667c28278b5edf87b8
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/zammad
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zammad = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Zammad {
      constructor() {
          this.description = {
              displayName: 'Zammad',
              name: 'zammad',
              icon: 'file:zammad.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Zammad API',
              defaults: {
                  name: 'Zammad',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zammadBasicAuthApi',
                      required: true,
                      testedBy: 'zammadBasicAuthApiTest',
                      displayOptions: {
                          show: {
                              authentication: ['basicAuth'],
                          },
                      },
                  },
                  {
                      name: 'zammadTokenAuthApi',
                      required: true,
                      testedBy: 'zammadTokenAuthApiTest',
                      displayOptions: {
                          show: {
                              authentication: ['tokenAuth'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Basic Auth',
                              value: 'basicAuth',
                          },
                          {
                              name: 'Token Auth',
                              value: 'tokenAuth',
                          },
                      ],
                      default: 'tokenAuth',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'options',
                      options: [
                          {
                              name: 'Group',
                              value: 'group',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Ticket',
                              value: 'ticket',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'user',
                  },
                  ...descriptions_1.groupDescription,
                  ...descriptions_1.organizationDescription,
                  ...descriptions_1.ticketDescription,
                  ...descriptions_1.userDescription,
              ],
          };
          this.methods = {
              loadOptions: {
                  async loadGroupCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getGroupCustomFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadOrganizationCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getOrganizationCustomFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadUserCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getUserCustomFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadTicketCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getTicketCustomFields)(allFields).map((i) => ({ name: i.name, value: i.id }));
                  },
                  async loadGroupFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getGroupFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadOrganizationFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getOrganizationFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadTicketFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getTicketFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadUserFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getUserFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadGroupNames() {
                      const groups = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/groups'));
                      return groups.map((i) => ({ name: i.name, value: i.name }));
                  },
                  async loadOrganizationNames() {
                      const orgs = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/organizations'));
                      return orgs.filter(GenericFunctions_1.isNotZammadFoundation).map((i) => ({ name: i.name, value: i.name }));
                  },
                  async loadCustomerEmails() {
                      const users = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/users'));
                      return users.filter(GenericFunctions_1.isCustomer).map((i) => ({ name: i.email, value: i.email }));
                  },
                  async loadGroups() {
                      const groups = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/groups'));
                      return groups.map((i) => ({ name: i.name, value: i.id }));
                  },
                  async loadOrganizations() {
                      const orgs = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/organizations'));
                      return orgs.filter(GenericFunctions_1.isNotZammadFoundation).map((i) => ({ name: i.name, value: i.id }));
                  },
                  async loadUsers() {
                      const users = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/users'));
                      return users.filter(GenericFunctions_1.doesNotBelongToZammad).map((i) => ({ name: i.login, value: i.id }));
                  },
              },
              credentialTest: {
                  async zammadBasicAuthApiTest(credential) {
                      const credentials = credential.data;
                      const baseUrl = (0, GenericFunctions_1.tolerateTrailingSlash)(credentials.baseUrl);
                      const options = {
                          method: 'GET',
                          uri: `${baseUrl}/api/v1/users/me`,
                          json: true,
                          rejectUnauthorized: !credentials.allowUnauthorizedCerts,
                          auth: {
                              user: credentials.username,
                              pass: credentials.password,
                          },
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
                  async zammadTokenAuthApiTest(credential) {
                      const credentials = credential.data;
                      const baseUrl = (0, GenericFunctions_1.tolerateTrailingSlash)(credentials.baseUrl);
                      const options = {
                          method: 'GET',
                          uri: `${baseUrl}/api/v1/users/me`,
                          json: true,
                          rejectUnauthorized: !credentials.allowUnauthorizedCerts,
                          headers: {
                              Authorization: `Token token=${credentials.accessToken}`,
                          },
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const body = {
                              firstname: this.getNodeParameter('firstname', i),
                              lastname: this.getNodeParameter('lastname', i),
                          };
                          const { addressUi, customFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressDetails);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/users', body);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { addressUi, customFieldsUi, ...rest } = updateFields;
                          Object.assign(body, addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressDetails);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'PUT', `/users/${id}`, body);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/users/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/users/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const { sortUi, ...rest } = this.getNodeParameter('filters', i);
                          Object.assign(qs, sortUi === null || sortUi === void 0 ? void 0 : sortUi.sortDetails);
                          Object.assign(qs, rest);
                          qs.query || (qs.query = '');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems
                              .call(this, 'GET', '/users/search', {}, qs, limit)
                              .then((response) => {
                              return response.map((user) => {
                                  const { _preferences, ...data } = user;
                                  return data;
                              });
                          });
                      }
                      else if (operation === 'getSelf') {
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/users/me');
                      }
                  }
                  else if (resource === 'organization') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const { customFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/organizations', body);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { customFieldsUi, ...rest } = updateFields;
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'PUT', `/organizations/${id}`, body);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/organizations/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/organizations/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems.call(this, 'GET', '/organizations', {}, {}, limit);
                      }
                  }
                  else if (resource === 'group') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const { customFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/groups', body);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { customFieldsUi, ...rest } = updateFields;
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'PUT', `/groups/${id}`, body);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/groups/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/groups/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems.call(this, 'GET', '/groups', {}, {}, limit);
                      }
                  }
                  else if (resource === 'ticket') {
                      if (operation === 'create') {
                          const body = {
                              article: {},
                              title: this.getNodeParameter('title', i),
                              group: this.getNodeParameter('group', i),
                              customer: this.getNodeParameter('customer', i),
                          };
                          const article = this.getNodeParameter('article', i);
                          if (!Object.keys(article).length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Article is required', { itemIndex: i });
                          }
                          const { articleDetails: { visibility, ...rest }, } = article;
                          body.article = {
                              ...rest,
                              internal: visibility === 'internal',
                          };
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/tickets', body);
                          const { id } = responseData;
                          responseData.articles = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/ticket_articles/by_ticket/${id}`);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/tickets/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/tickets/${id}`);
                          responseData.articles = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/ticket_articles/by_ticket/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems.call(this, 'GET', '/tickets', {}, {}, limit);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zammad = Zammad;
  //# sourceMappingURL=Zammad.node.js.map

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

  # Zammad credentials

  You can use these credentials to authenticate the following nodes:

  - [Zammad](/integrations/builtin/app-nodes/n8n-nodes-base.zammad.md)

  ## Prerequisites

  - Create a hosted [Zammad](https://zammad.com/){:target=_blank .external-link} account or set up your own Zammad instance.
  - For token authentication, enable **API Token Access** in **Settings > System > API**. Refer to [Setting up a Zammad](https://admin-docs.zammad.org/en/latest/system/integrations/zabbix.html?#setting-up-a-zammad){:target=_blank .external-link} for more information.

  ## Supported authentication methods

  - Basic auth
  - Token auth: Zammad recommends using this authentication method.

  ## Related resources

  Refer to [Zammad's API Authentication documentation](https://docs.zammad.org/en/latest/api/intro.html?#authentication){:target=_blank .external-link} for more information about authenticating with the service.

  ## Using basic auth

  To configure this credential, you'll need:

  - A **Base URL**: Enter the URL of your Zammad instance.
  - An **Email** address: Enter the email address you use to log in to Zammad.
  - A **Password**: Enter your Zammad password.
  - **Ignore SSL Issues**: When turned on, n8n will connect even if SSL certificate validation fails.

  ## Using token auth

  To configure this credential, you'll need:

  - A **Base URL**: Enter the URL of your Zammad instance.
  - An **Access Token**: Once **API Token Access** is enabled for the Zammad instance, any user with the `user_preferences.access_token` permission can generate an **Access Token** by going to your **avatar > Profile > Token Access** and **Create** a new token.
      - The access token permissions depend on what actions you'd like to complete with this credential. For all functionality within the [Zammad](/integrations/builtin/app-nodes/n8n-nodes-base.zammad.md) node, select:
          - `admin.group`
          - `admin.organization`
          - `admin.user`
          - `ticket.agent`
          - `ticket.customer`
  - **Ignore SSL Issues**: When turned on, n8n will connect even if SSL certificate validation fails.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"bef699dc-a9d7-4ecd-9b46-fa65fa14a68d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"0a00fed867ed3a311071dbc21d9bea88c4d96d2523e49010859973a604ce8959"}}


node_type: n8n-nodes-base.Zoom
name: Zoom
display_name: Zoom
description: Consume Zoom API
category: Other
code_hash: 3e25ea570d229e7c9f4e48f3ac95cff39b47a344bf1b3113609fd838b9d42038
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/zoom
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zoom = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const MeetingDescription_1 = require("./MeetingDescription");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Zoom {
      constructor() {
          this.description = {
              displayName: 'Zoom',
              name: 'zoom',
              group: ['input'],
              version: 1,
              description: 'Consume Zoom API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Zoom',
              },
              icon: 'file:zoom.svg',
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zoomApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'zoomOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'accessToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Meeting',
                              value: 'meeting',
                          },
                      ],
                      default: 'meeting',
                  },
                  ...MeetingDescription_1.meetingOperations,
                  ...MeetingDescription_1.meetingFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTimezones() {
                      const returnData = [];
                      for (const timezone of moment_timezone_1.default.tz.names()) {
                          const timezoneName = timezone;
                          const timezoneId = timezone;
                          returnData.push({
                              name: timezoneName,
                              value: timezoneId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  qs = {};
                  if (resource === 'meeting') {
                      if (operation === 'get') {
                          const meetingId = this.getNodeParameter('meetingId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.showPreviousOccurrences) {
                              qs.show_previous_occurrences = additionalFields.showPreviousOccurrences;
                          }
                          if (additionalFields.occurrenceId) {
                              qs.occurrence_id = additionalFields.occurrenceId;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          if (filters.type) {
                              qs.type = filters.type;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zoomApiRequestAllItems.call(this, 'meetings', 'GET', '/users/me/meetings', {}, qs);
                          }
                          else {
                              qs.page_size = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'GET', '/users/me/meetings', {}, qs);
                              responseData = responseData.meetings;
                          }
                      }
                      if (operation === 'delete') {
                          const meetingId = this.getNodeParameter('meetingId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.scheduleForReminder) {
                              qs.schedule_for_reminder = additionalFields.scheduleForReminder;
                          }
                          if (additionalFields.occurrenceId) {
                              qs.occurrence_id = additionalFields.occurrenceId;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'DELETE', `/meetings/${meetingId}`, {}, qs);
                          responseData = { success: true };
                      }
                      if (operation === 'create') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {};
                          if (additionalFields.settings) {
                              const settingValues = {};
                              const settings = additionalFields.settings;
                              if (settings.cnMeeting) {
                                  settingValues.cn_meeting = settings.cnMeeting;
                              }
                              if (settings.inMeeting) {
                                  settingValues.in_meeting = settings.inMeeting;
                              }
                              if (settings.joinBeforeHost) {
                                  settingValues.join_before_host = settings.joinBeforeHost;
                              }
                              if (settings.muteUponEntry) {
                                  settingValues.mute_upon_entry = settings.muteUponEntry;
                              }
                              if (settings.watermark) {
                                  settingValues.watermark = settings.watermark;
                              }
                              if (settings.audio) {
                                  settingValues.audio = settings.audio;
                              }
                              if (settings.alternativeHosts) {
                                  settingValues.alternative_hosts = settings.alternativeHosts;
                              }
                              if (settings.participantVideo) {
                                  settingValues.participant_video = settings.participantVideo;
                              }
                              if (settings.hostVideo) {
                                  settingValues.host_video = settings.hostVideo;
                              }
                              if (settings.autoRecording) {
                                  settingValues.auto_recording = settings.autoRecording;
                              }
                              if (settings.registrationType) {
                                  settingValues.registration_type = settings.registrationType;
                              }
                              body.settings = settingValues;
                          }
                          body.topic = this.getNodeParameter('topic', i);
                          if (additionalFields.type) {
                              body.type = additionalFields.type;
                          }
                          if (additionalFields.startTime) {
                              if (additionalFields.timeZone) {
                                  body.start_time = (0, moment_timezone_1.default)(additionalFields.startTime).format('YYYY-MM-DDTHH:mm:ss');
                              }
                              else {
                                  body.start_time = moment_timezone_1.default
                                      .tz(additionalFields.startTime, this.getTimezone())
                                      .format();
                              }
                          }
                          if (additionalFields.duration) {
                              body.duration = additionalFields.duration;
                          }
                          if (additionalFields.scheduleFor) {
                              body.schedule_for = additionalFields.scheduleFor;
                          }
                          if (additionalFields.timeZone) {
                              body.timezone = additionalFields.timeZone;
                          }
                          if (additionalFields.password) {
                              body.password = additionalFields.password;
                          }
                          if (additionalFields.agenda) {
                              body.agenda = additionalFields.agenda;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'POST', '/users/me/meetings', body, qs);
                      }
                      if (operation === 'update') {
                          const meetingId = this.getNodeParameter('meetingId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.settings) {
                              const settingValues = {};
                              const settings = updateFields.settings;
                              if (settings.cnMeeting) {
                                  settingValues.cn_meeting = settings.cnMeeting;
                              }
                              if (settings.inMeeting) {
                                  settingValues.in_meeting = settings.inMeeting;
                              }
                              if (settings.joinBeforeHost) {
                                  settingValues.join_before_host = settings.joinBeforeHost;
                              }
                              if (settings.muteUponEntry) {
                                  settingValues.mute_upon_entry = settings.muteUponEntry;
                              }
                              if (settings.watermark) {
                                  settingValues.watermark = settings.watermark;
                              }
                              if (settings.audio) {
                                  settingValues.audio = settings.audio;
                              }
                              if (settings.alternativeHosts) {
                                  settingValues.alternative_hosts = settings.alternativeHosts;
                              }
                              if (settings.participantVideo) {
                                  settingValues.participant_video = settings.participantVideo;
                              }
                              if (settings.hostVideo) {
                                  settingValues.host_video = settings.hostVideo;
                              }
                              if (settings.autoRecording) {
                                  settingValues.auto_recording = settings.autoRecording;
                              }
                              if (settings.registrationType) {
                                  settingValues.registration_type = settings.registrationType;
                              }
                              body.settings = settingValues;
                          }
                          if (updateFields.topic) {
                              body.topic = updateFields.topic;
                          }
                          if (updateFields.type) {
                              body.type = updateFields.type;
                          }
                          if (updateFields.startTime) {
                              body.start_time = updateFields.startTime;
                          }
                          if (updateFields.duration) {
                              body.duration = updateFields.duration;
                          }
                          if (updateFields.scheduleFor) {
                              body.schedule_for = updateFields.scheduleFor;
                          }
                          if (updateFields.timeZone) {
                              body.timezone = updateFields.timeZone;
                          }
                          if (updateFields.password) {
                              body.password = updateFields.password;
                          }
                          if (updateFields.agenda) {
                              body.agenda = updateFields.agenda;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'PATCH', `/meetings/${meetingId}`, body, 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 = {
                          json: {},
                          error: error.message,
                          itemIndex: i,
                      };
                      returnData.push(executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zoom = Zoom;
  //# sourceMappingURL=Zoom.node.js.map

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

  # Zoom credentials

  You can use these credentials to authenticate the following nodes:

  - [Zoom](/integrations/builtin/app-nodes/n8n-nodes-base.zoom.md)

  ## Prerequisites

  Create a [Zoom](https://zoom.us/){:target=_blank .external-link} account. Your account must have one of the following permissions:

  - Account owner
  - Account admin
  - Zoom for developers role

  ## Supported authentication methods

  - API JWT token
  - OAuth2

  /// warning | API JWT token deprecation
  Zoom removed support for JWT access tokens in June 2023. You must use OAuth2 for all new credentials.
  ///

  ## Related resources

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

  ## Using API JWT token

  This authentication method has been fully deprecated by Zoom. Don't create new credentials with it.

  To configure this credential, you'll need:

  - A **JWT token**: To create a JWT token, create a new JWT app in the [Zoom App Marketplace](https://marketplace.zoom.us/){:target=_blank .external-link}.

  ## Using OAuth2

  To configure this credential, you'll need:

  - A **Client ID**: Generated when you create an OAuth app on the Zoom App Marketplace.
  - A **Client Secret**: Generated when you create an OAuth app.

  To generate your **Client ID** and **Client Secret**, [create an OAuth app](https://developers.zoom.us/docs/integrations/create/){:target=_blank .external-link}.

  Use these settings for your OAuth app:

  - Select **User-managed app** for **Select how the app is managed**.
  - Copy the **OAuth Callback URL** from n8n and enter it as an **OAuth Redirect URL** in Zoom.
  - If your n8n credential displays a **Whitelist URL**, also enter that URL as a an **OAuth Redirect URL**.
  - Enter **Scopes** for the scopes you plan to use. For all functionality in the [Zoom](/integrations/builtin/app-nodes/n8n-nodes-base.zoom.md) node, select:
      - `meeting:read`
      - `meeting:write`
      - Refer to [OAuth scopes | Meeting scopes](https://developers.zoom.us/docs/integrations/oauth-scopes/#meeting-scopes){:target=_blank .external-link} for more information on meeting scopes.
  - Copy the **Client ID** and **Client Secret** provided in the Zoom app and enter them in your n8n credential.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"82740cd8-4360-4f18-a220-cd887ba46015","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"6cff4354d42aa06e5fa7d95d9ff37887064eb5c00d8655d8f3e285f617807b6a"}}


node_type: n8n-nodes-base.Zulip
name: Zulip
display_name: Zulip
description: Consume Zulip API
category: Other
code_hash: 1b814052a8925706b11e31e9ba04beb7adf7197e26060dedcbad6187f2c9159b
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/zulip
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zulip = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const MessageDescription_1 = require("./MessageDescription");
  const change_case_1 = require("change-case");
  const StreamDescription_1 = require("./StreamDescription");
  const UserDescription_1 = require("./UserDescription");
  class Zulip {
      constructor() {
          this.description = {
              displayName: 'Zulip',
              name: 'zulip',
              icon: 'file:zulip.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Zulip API',
              defaults: {
                  name: 'Zulip',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zulipApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Message',
                              value: 'message',
                          },
                          {
                              name: 'Stream',
                              value: 'stream',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'message',
                  },
                  ...MessageDescription_1.messageOperations,
                  ...MessageDescription_1.messageFields,
                  ...StreamDescription_1.streamOperations,
                  ...StreamDescription_1.streamFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getStreams() {
                      const returnData = [];
                      const { streams } = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/streams');
                      for (const stream of streams) {
                          const streamName = stream.name;
                          const streamId = stream.stream_id;
                          returnData.push({
                              name: streamName,
                              value: streamId,
                          });
                      }
                      return returnData;
                  },
                  async getTopics() {
                      const streamId = this.getCurrentNodeParameter('stream');
                      const returnData = [];
                      const { topics } = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', `/users/me/${streamId}/topics`);
                      for (const topic of topics) {
                          const topicName = topic.name;
                          const topicId = topic.name;
                          returnData.push({
                              name: topicName,
                              value: topicId,
                          });
                      }
                      return returnData;
                  },
                  async getUsers() {
                      const returnData = [];
                      const { members } = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/users');
                      for (const member of members) {
                          const memberName = member.full_name;
                          const memberId = member.email;
                          returnData.push({
                              name: memberName,
                              value: memberId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'message') {
                      if (operation === 'sendPrivate') {
                          const to = this.getNodeParameter('to', i).join(',');
                          const content = this.getNodeParameter('content', i);
                          const body = {
                              type: 'private',
                              to,
                              content,
                          };
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/messages', body);
                      }
                      if (operation === 'sendStream') {
                          const stream = this.getNodeParameter('stream', i);
                          const topic = this.getNodeParameter('topic', i);
                          const content = this.getNodeParameter('content', i);
                          const body = {
                              type: 'stream',
                              to: stream,
                              topic,
                              content,
                          };
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/messages', body);
                      }
                      if (operation === 'update') {
                          const messageId = this.getNodeParameter('messageId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.content) {
                              body.content = updateFields.content;
                          }
                          if (updateFields.propagateMode) {
                              body.propagat_mode = (0, change_case_1.snakeCase)(updateFields.propagateMode);
                          }
                          if (updateFields.topic) {
                              body.topic = updateFields.topic;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'PATCH', `/messages/${messageId}`, body);
                      }
                      if (operation === 'get') {
                          const messageId = this.getNodeParameter('messageId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', `/messages/${messageId}`);
                      }
                      if (operation === 'delete') {
                          const messageId = this.getNodeParameter('messageId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'DELETE', `/messages/${messageId}`);
                      }
                      if (operation === 'updateFile') {
                          const credentials = await this.getCredentials('zulipApi');
                          const dataBinaryProperty = this.getNodeParameter('dataBinaryProperty', i);
                          const binaryData = this.helpers.assertBinaryData(i, dataBinaryProperty);
                          const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, dataBinaryProperty);
                          const formData = {
                              file: {
                                  value: binaryDataBuffer,
                                  options: {
                                      filename: binaryData.fileName,
                                      contentType: binaryData.mimeType,
                                  },
                              },
                          };
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/user_uploads', {}, {}, undefined, { formData });
                          responseData.uri = `${credentials.url}${responseData.uri}`;
                      }
                  }
                  if (resource === 'stream') {
                      const body = {};
                      if (operation === 'getAll') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.includePublic) {
                              body.include_public = additionalFields.includePublic;
                          }
                          if (additionalFields.includeSubscribed) {
                              body.include_subscribed = additionalFields.includeSubscribed;
                          }
                          if (additionalFields.includeAllActive) {
                              body.include_all_active = additionalFields.includeAllActive;
                          }
                          if (additionalFields.includeDefault) {
                              body.include_default = additionalFields.includeDefault;
                          }
                          if (additionalFields.includeOwnersubscribed) {
                              body.include_owner_subscribed = additionalFields.includeOwnersubscribed;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/streams', body);
                          responseData = responseData.streams;
                      }
                      if (operation === 'getSubscribed') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.includeSubscribers) {
                              body.include_subscribers = additionalFields.includeSubscribers;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/users/me/subscriptions', body);
                          responseData = responseData.subscriptions;
                      }
                      if (operation === 'create') {
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const subscriptions = this.getNodeParameter('subscriptions', i);
                          body.subscriptions = JSON.stringify(subscriptions.properties);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              body.subscriptions = JSON.stringify(subscriptions.properties);
                              if (additionalFields.inviteOnly) {
                                  body.invite_only = additionalFields.inviteOnly;
                              }
                              if (additionalFields.principals) {
                                  const principals = [];
                                  additionalFields.principals.properties.map((principal) => {
                                      principals.push(principal.email);
                                  });
                                  body.principals = JSON.stringify(principals);
                              }
                              if (additionalFields.authorizationErrorsFatal) {
                                  body.authorization_errors_fatal =
                                      additionalFields.authorizationErrorsFatal;
                              }
                              if (additionalFields.historyPublicToSubscribers) {
                                  body.history_public_to_subscribers =
                                      additionalFields.historyPublicToSubscribers;
                              }
                              if (additionalFields.streamPostPolicy) {
                                  body.stream_post_policy = additionalFields.streamPostPolicy;
                              }
                              if (additionalFields.announce) {
                                  body.announce = additionalFields.announce;
                              }
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/users/me/subscriptions', body);
                      }
                      if (operation === 'delete') {
                          const streamId = this.getNodeParameter('streamId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'DELETE', `/streams/${streamId}`, {});
                      }
                      if (operation === 'update') {
                          const streamId = this.getNodeParameter('streamId', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.description) {
                                  body.description = JSON.stringify(additionalFields.description);
                              }
                              if (additionalFields.newName) {
                                  body.new_name = JSON.stringify(additionalFields.newName);
                              }
                              if (additionalFields.isPrivate) {
                                  body.is_private = additionalFields.isPrivate;
                              }
                              if (additionalFields.isAnnouncementOnly) {
                                  body.is_announcement_only = additionalFields.isAnnouncementOnly;
                              }
                              if (additionalFields.streamPostPolicy) {
                                  body.stream_post_policy = additionalFields.streamPostPolicy;
                              }
                              if (additionalFields.historyPublicToSubscribers) {
                                  body.history_public_to_subscribers =
                                      additionalFields.historyPublicToSubscribers;
                              }
                              responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'PATCH', `/streams/${streamId}`, body);
                          }
                      }
                  }
                  if (resource === 'user') {
                      const body = {};
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('userId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.clientGravatar) {
                              body.client_gravatar = additionalFields.client_gravatar;
                          }
                          if (additionalFields.includeCustomProfileFields) {
                              body.include_custom_profile_fields =
                                  additionalFields.includeCustomProfileFields;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', `/users/${userId}`, body);
                      }
                      if (operation === 'getAll') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.clientGravatar) {
                              body.client_gravatar = additionalFields.client_gravatar;
                          }
                          if (additionalFields.includeCustomProfileFields) {
                              body.include_custom_profile_fields =
                                  additionalFields.includeCustomProfileFields;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/users', body);
                          responseData = responseData.members;
                      }
                      if (operation === 'create') {
                          body.email = this.getNodeParameter('email', i);
                          body.password = this.getNodeParameter('password', i);
                          body.full_name = this.getNodeParameter('fullName', i);
                          body.short_name = this.getNodeParameter('shortName', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/users', body);
                      }
                      if (operation === 'update') {
                          const userId = this.getNodeParameter('userId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.fullName) {
                              body.full_name = JSON.stringify(additionalFields.fullName);
                          }
                          if (additionalFields.isAdmin) {
                              body.is_admin = additionalFields.isAdmin;
                          }
                          if (additionalFields.isGuest) {
                              body.is_guest = additionalFields.isGuest;
                          }
                          if (additionalFields.role) {
                              body.role = additionalFields.role;
                          }
                          if (additionalFields.profileData) {
                              body.profile_data = additionalFields.profileData.properties;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'PATCH', `/users/${userId}`, body);
                      }
                      if (operation === 'deactivate') {
                          const userId = this.getNodeParameter('userId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'DELETE', `/users/${userId}`, body);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zulip = Zulip;
  //# sourceMappingURL=Zulip.node.js.map

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

  # Zulip credentials

  You can use these credentials to authenticate the following nodes:

  - [Zulip](/integrations/builtin/app-nodes/n8n-nodes-base.zulip.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - A **URL**: Enter the URL of your Zulip domain.
  - An **Email** address: Enter the email address you use to log in to Zulip.
  - An **API Key**: Get your API key in the **Gear cog > Personal Settings > Account & privacy > API Key**. Refer to [API Keys](https://zulip.com/api/api-keys){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"fbb71f2d-084d-45c1-8e24-3044fda0273f","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"c18b7615f1347469f589d2eac5fe08e8e06d7184fe23d1b567501eb2d1eb4fda"}}


node_type: n8n-nodes-base.Xml
name: Xml
display_name: XML
description: Convert data from and to XML
category: Other
code_hash: 09aee64eeb21c4566e8cd0c36ea6ba97e480c62938dc579228fb1b60c842f65b
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.xml
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:31
updated_at: 2025-06-08 08:05:31
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Xml = void 0;
  const xml2js_1 = require("xml2js");
  const n8n_workflow_1 = require("n8n-workflow");
  class Xml {
      constructor() {
          this.description = {
              displayName: 'XML',
              name: 'xml',
              icon: 'fa:file-code',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["mode"]==="jsonToxml" ? "JSON to XML" : "XML to JSON"}}',
              description: 'Convert data from and to XML',
              defaults: {
                  name: 'XML',
                  color: '#333377',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      options: [
                          {
                              name: 'JSON to XML',
                              value: 'jsonToxml',
                              description: 'Converts data from JSON to XML',
                          },
                          {
                              name: 'XML to JSON',
                              value: 'xmlToJson',
                              description: 'Converts data from XML to JSON',
                          },
                      ],
                      default: 'xmlToJson',
                      description: 'From and to what format the data should be converted',
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['jsonToxml'],
                          },
                      },
                      default: 'data',
                      required: true,
                      description: 'Name of the property to which to contains the converted XML data',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      displayOptions: {
                          show: {
                              mode: ['jsonToxml'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Allow Surrogate Chars',
                              name: 'allowSurrogateChars',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to allow using characters from the Unicode surrogate blocks',
                          },
                          {
                              displayName: 'Attribute Key',
                              name: 'attrkey',
                              type: 'string',
                              default: '$',
                              description: 'Prefix that is used to access the attributes',
                          },
                          {
                              displayName: 'Cdata',
                              name: 'cdata',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to wrap text nodes in &lt;![CDATA[ ... ]]&gt; instead of escaping when necessary. Does not add &lt;![CDATA[ ... ]]&gt; if it is not required.',
                          },
                          {
                              displayName: 'Character Key',
                              name: 'charkey',
                              type: 'string',
                              default: '_',
                              description: 'Prefix that is used to access the character content',
                          },
                          {
                              displayName: 'Headless',
                              name: 'headless',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to omit the XML header',
                          },
                          {
                              displayName: 'Root Name',
                              name: 'rootName',
                              type: 'string',
                              default: 'root',
                              description: 'Root element name to be used',
                          },
                      ],
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['xmlToJson'],
                          },
                      },
                      default: 'data',
                      required: true,
                      description: 'Name of the property which contains the XML data to convert',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      displayOptions: {
                          show: {
                              mode: ['xmlToJson'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Attribute Key',
                              name: 'attrkey',
                              type: 'string',
                              default: '$',
                              description: 'Prefix that is used to access the attributes',
                          },
                          {
                              displayName: 'Character Key',
                              name: 'charkey',
                              type: 'string',
                              default: '_',
                              description: 'Prefix that is used to access the character content',
                          },
                          {
                              displayName: 'Explicit Array',
                              name: 'explicitArray',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to always put child nodes in an array if true; otherwise an array is created only if there is more than one',
                          },
                          {
                              displayName: 'Explicit Root',
                              name: 'explicitRoot',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to set this if you want to get the root node in the resulting object',
                          },
                          {
                              displayName: 'Ignore Attributes',
                              name: 'ignoreAttrs',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to ignore all XML attributes and only create text nodes',
                          },
                          {
                              displayName: 'Merge Attributes',
                              name: 'mergeAttrs',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to merge attributes and child elements as properties of the parent, instead of keying attributes off a child attribute object. This option is ignored if ignoreAttrs is true.',
                          },
                          {
                              displayName: 'Normalize',
                              name: 'normalize',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to trim whitespaces inside text nodes',
                          },
                          {
                              displayName: 'Normalize Tags',
                              name: 'normalizeTags',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to normalize all tag names to lowercase',
                          },
                          {
                              displayName: 'Trim',
                              name: 'trim',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to trim the whitespace at the beginning and end of text nodes',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const mode = this.getNodeParameter('mode', 0);
          const dataPropertyName = this.getNodeParameter('dataPropertyName', 0);
          const options = this.getNodeParameter('options', 0, {});
          let item;
          const returnData = [];
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              try {
                  item = items[itemIndex];
                  if (mode === 'xmlToJson') {
                      const parserOptions = Object.assign({
                          mergeAttrs: true,
                          explicitArray: false,
                      }, options);
                      const parser = new xml2js_1.Parser(parserOptions);
                      if (item.json[dataPropertyName] === undefined) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Item has no JSON property called "${dataPropertyName}"`, { itemIndex });
                      }
                      const json = await parser.parseStringPromise(item.json[dataPropertyName]);
                      returnData.push({ json: (0, n8n_workflow_1.deepCopy)(json) });
                  }
                  else if (mode === 'jsonToxml') {
                      const builder = new xml2js_1.Builder(options);
                      returnData.push({
                          json: {
                              [dataPropertyName]: builder.buildObject(items[itemIndex].json),
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${mode}" is not known!`, {
                          itemIndex,
                      });
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      items[itemIndex] = {
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      };
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Xml = Xml;
  //# sourceMappingURL=Xml.node.js.map

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

  # XML

  Use the XML node to convert data from and to XML.

  /// note | Binary files
  If your XML is within a binary file, use the [Extract from File](/integrations/builtin/core-nodes/n8n-nodes-base.extractfromfile.md) node to convert it to text first.
  ///

  ## Node parameters

  - **Mode**: The format the data should be converted from and to.
  	- **JSON to XML**: Converts data from JSON to XML.
      - **XML to JSON**: Converts data from XML to JSON.
  - **Property Name**: Enter the name of the property which contains the data to convert.

  ## Node options

  These options are available regardless of the **Mode** you select:

  - **Attribute Key**: Enter the prefix used to access the attributes. Default is `$`.
  - **Character Key**: Enter the prefix used to access the character content. Default is `_`.

  All other options depend on the selected **Mode**.

  ### JSON to XML options

  These options only appear if you select **JSON to XML** as the **Mode**:

  - **Allow Surrogate Chars**: Set whether to allow using characters from the Unicode surrogate blocks (turned on) or not (turned off).
  - **Cdata**: Set whether to wrap text nodes in `<![CDATA[ ... ]]>` instead of escaping when it's required (turned on) or not (turned off).
      * Turning this option on doesn't add `<![CDATA[ ... ]]>` if it's not required.
  - **Headless**: Set whether to omit the XML header (turned on) or include it (turned off).
  - **Root Name**: Enter the root element name to use.

  ### XML to JSON options

  These options only appear if you select **XML to JSON** as the **Mode**:

  - **Explicit Array**: Set whether to put child nodes in an array (turned on) or create an array only if there's more than one child node (turned off).
  - **Explicit Root**: Set whether to get the root node in the resulting object (turned on) or not (turned off).
  - **Ignore Attributes**: Set whether to ignore all XML attributes and only create text nodes (turned on) or not (turned off).
  - **Merge Attributes**: Set whether to merge attributes and child elements as properties of the parent (turned on) or key attributes off a child attribute object (turned off). This option is ignored if **Ignore Attribute** is turned on.
  - **Normalize**: Set whether to trim whitespaces inside the text nodes (turned on) or not to trim them (turned off).
  - **Normalize Tags**: Set whether to normalize all tag names to lowercase (turned on) or keep tag names as-is (turned off).
  - **Trim**: Set whether to trim the whitespace at the beginning and end of text nodes (turned on) or to leave the whitespace as-is (turned off).

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"43611f2f-fc50-4f20-8dc2-232ac0d98689","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"60394bf5c9f07687532ddf7718e2b510565242fd7ee8d76a976f9915d27d0a61"}}


