# nodes

node_type: n8n-nodes-base.Git
name: Git
display_name: Git
description: Control git.
category: transform
icon: file:git.svg
code_hash: 50ecff111cb4e7515e3a857d6d6c64da67db9cdb8bed00c31a04f424748b70ba
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:35
updated_at: 2025-06-12 08:58:35
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Git = void 0;
  const descriptions_1 = require("./descriptions");
  const simple_git_1 = __importDefault(require("simple-git"));
  const promises_1 = require("fs/promises");
  const url_1 = require("url");
  class Git {
      constructor() {
          this.description = {
              displayName: 'Git',
              name: 'git',
              icon: 'file:git.svg',
              group: ['transform'],
              version: 1,
              description: 'Control git.',
              defaults: {
                  name: 'Git',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'gitPassword',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['gitPassword'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Authenticate',
                              value: 'gitPassword',
                          },
                          {
                              name: 'None',
                              value: 'none',
                          },
                      ],
                      displayOptions: {
                          show: {
                              operation: ['clone', 'push'],
                          },
                      },
                      default: 'none',
                      description: 'The way to authenticate',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      default: 'log',
                      options: [
                          {
                              name: 'Add',
                              value: 'add',
                              description: 'Add a file or folder to commit',
                              action: 'Add a file or folder to commit',
                          },
                          {
                              name: 'Add Config',
                              value: 'addConfig',
                              description: 'Add configuration property',
                              action: 'Add configuration property',
                          },
                          {
                              name: 'Clone',
                              value: 'clone',
                              description: 'Clone a repository',
                              action: 'Clone a repository',
                          },
                          {
                              name: 'Commit',
                              value: 'commit',
                              description: 'Commit files or folders to git',
                              action: 'Commit files or folders to git',
                          },
                          {
                              name: 'Fetch',
                              value: 'fetch',
                              description: 'Fetch from remote repository',
                              action: 'Fetch from remote repository',
                          },
                          {
                              name: 'List Config',
                              value: 'listConfig',
                              description: 'Return current configuration',
                              action: 'Return current configuration',
                          },
                          {
                              name: 'Log',
                              value: 'log',
                              description: 'Return git commit history',
                              action: 'Return git commit history',
                          },
                          {
                              name: 'Pull',
                              value: 'pull',
                              description: 'Pull from remote repository',
                              action: 'Pull from remote repository',
                          },
                          {
                              name: 'Push',
                              value: 'push',
                              description: 'Push to remote repository',
                              action: 'Push to remote repository',
                          },
                          {
                              name: 'Push Tags',
                              value: 'pushTags',
                              description: 'Push Tags to remote repository',
                              action: 'Push tags to remote repository',
                          },
                          {
                              name: 'Status',
                              value: 'status',
                              description: 'Return status of current repository',
                              action: 'Return status of current repository',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                              description: 'Create a new tag',
                              action: 'Create a new tag',
                          },
                          {
                              name: 'User Setup',
                              value: 'userSetup',
                              description: 'Set the user',
                              action: 'Set up a user',
                          },
                      ],
                  },
                  {
                      displayName: 'Repository Path',
                      name: 'repositoryPath',
                      type: 'string',
                      displayOptions: {
                          hide: {
                              operation: ['clone'],
                          },
                      },
                      default: '',
                      placeholder: '/tmp/repository',
                      required: true,
                      description: 'Local path of the git repository to operate on',
                  },
                  {
                      displayName: 'New Repository Path',
                      name: 'repositoryPath',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['clone'],
                          },
                      },
                      default: '',
                      placeholder: '/tmp/repository',
                      required: true,
                      description: 'Local path to which the git repository should be cloned into',
                  },
                  ...descriptions_1.addFields,
                  ...descriptions_1.addConfigFields,
                  ...descriptions_1.cloneFields,
                  ...descriptions_1.commitFields,
                  ...descriptions_1.logFields,
                  ...descriptions_1.pushFields,
                  ...descriptions_1.tagFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const prepareRepository = async (repositoryPath) => {
              const authentication = this.getNodeParameter('authentication', 0);
              if (authentication === 'gitPassword') {
                  const gitCredentials = await this.getCredentials('gitPassword');
                  const url = new url_1.URL(repositoryPath);
                  url.username = gitCredentials.username;
                  url.password = gitCredentials.password;
                  return url.toString();
              }
              return repositoryPath;
          };
          const operation = this.getNodeParameter('operation', 0);
          const returnItems = [];
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              try {
                  const repositoryPath = this.getNodeParameter('repositoryPath', itemIndex, '');
                  const options = this.getNodeParameter('options', itemIndex, {});
                  if (operation === 'clone') {
                      try {
                          await (0, promises_1.access)(repositoryPath);
                      }
                      catch (error) {
                          await (0, promises_1.mkdir)(repositoryPath);
                      }
                  }
                  const gitOptions = {
                      baseDir: repositoryPath,
                  };
                  const git = (0, simple_git_1.default)(gitOptions)
                      .env('GIT_TERMINAL_PROMPT', '0');
                  if (operation === 'add') {
                      const pathsToAdd = this.getNodeParameter('pathsToAdd', itemIndex, '');
                      await git.add(pathsToAdd.split(','));
                      returnItems.push({
                          json: {
                              success: true,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else if (operation === 'addConfig') {
                      const key = this.getNodeParameter('key', itemIndex, '');
                      const value = this.getNodeParameter('value', itemIndex, '');
                      let append = false;
                      if (options.mode === 'append') {
                          append = true;
                      }
                      await git.addConfig(key, value, append);
                      returnItems.push({
                          json: {
                              success: true,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else if (operation === 'clone') {
                      let sourceRepository = this.getNodeParameter('sourceRepository', itemIndex, '');
                      sourceRepository = await prepareRepository(sourceRepository);
                      await git.clone(sourceRepository, '.');
                      returnItems.push({
                          json: {
                              success: true,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else if (operation === 'commit') {
                      const message = this.getNodeParameter('message', itemIndex, '');
                      let pathsToAdd = undefined;
                      if (options.files !== undefined) {
                          pathsToAdd = options.pathsToAdd.split(',');
                      }
                      await git.commit(message, pathsToAdd);
                      returnItems.push({
                          json: {
                              success: true,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else if (operation === 'fetch') {
                      await git.fetch();
                      returnItems.push({
                          json: {
                              success: true,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else if (operation === 'log') {
                      const logOptions = {};
                      const returnAll = this.getNodeParameter('returnAll', itemIndex, false);
                      if (!returnAll) {
                          logOptions.maxCount = this.getNodeParameter('limit', itemIndex, 100);
                      }
                      if (options.file) {
                          logOptions.file = options.file;
                      }
                      const log = await git.log(logOptions);
                      returnItems.push(...this.helpers.returnJsonArray(log.all).map((item) => {
                          return {
                              ...item,
                              pairedItem: { item: itemIndex },
                          };
                      }));
                  }
                  else if (operation === 'pull') {
                      await git.pull();
                      returnItems.push({
                          json: {
                              success: true,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else if (operation === 'push') {
                      if (options.repository) {
                          const targetRepository = await prepareRepository(options.targetRepository);
                          await git.push(targetRepository);
                      }
                      else {
                          const authentication = this.getNodeParameter('authentication', 0);
                          if (authentication === 'gitPassword') {
                              const config = await git.listConfig();
                              let targetRepository;
                              for (const fileName of Object.keys(config.values)) {
                                  if (config.values[fileName]['remote.origin.url']) {
                                      targetRepository = config.values[fileName]['remote.origin.url'];
                                      break;
                                  }
                              }
                              targetRepository = await prepareRepository(targetRepository);
                              await git.push(targetRepository);
                          }
                          else {
                              await git.push();
                          }
                      }
                      returnItems.push({
                          json: {
                              success: true,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else if (operation === 'pushTags') {
                      await git.pushTags();
                      returnItems.push({
                          json: {
                              success: true,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else if (operation === 'listConfig') {
                      const config = await git.listConfig();
                      const data = [];
                      for (const fileName of Object.keys(config.values)) {
                          data.push({
                              _file: fileName,
                              ...config.values[fileName],
                          });
                      }
                      returnItems.push(...this.helpers.returnJsonArray(data).map((item) => {
                          return {
                              ...item,
                              pairedItem: { item: itemIndex },
                          };
                      }));
                  }
                  else if (operation === 'status') {
                      const status = await git.status();
                      returnItems.push(...this.helpers.returnJsonArray([status]).map((item) => {
                          return {
                              ...item,
                              pairedItem: { item: itemIndex },
                          };
                      }));
                  }
                  else if (operation === 'tag') {
                      const name = this.getNodeParameter('name', itemIndex, '');
                      await git.addTag(name);
                      returnItems.push({
                          json: {
                              success: true,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnItems.push({
                          json: {
                              error: error.toString(),
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnItems];
      }
  }
  exports.Git = Git;
  //# sourceMappingURL=Git.node.js.map

example_workflow:
  {"name":"Git Example Workflow","nodes":[{"parameters":{"authentication":"gitPassword","operation":"add","repositoryPath":"example-value","dynamic_property":null},"id":"o6iomu6d4gvn7l7e98uwm","name":"Git","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"authentication":"gitPassword","operation":"add","repositoryPath":"example-value","dynamic_property":null}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"none","description":"The way to authenticate","options":[{"name":"Authenticate","value":"gitPassword"},{"name":"None","value":"none"}]},{"displayName":"Operation","name":"operation","type":"options","default":"log","description":"Add a file or folder to commit","options":[{"name":"Add","value":"add","description":"Add a file or folder to commit"},{"name":"Add Config","value":"addConfig","description":"Add configuration property"},{"name":"Clone","value":"clone","description":"Clone a repository"},{"name":"Commit","value":"commit","description":"Commit files or folders to git"},{"name":"Fetch","value":"fetch","description":"Fetch from remote repository"},{"name":"List Config","value":"listConfig","description":"Return current configuration"},{"name":"Log","value":"log","description":"Return git commit history"},{"name":"Pull","value":"pull","description":"Pull from remote repository"},{"name":"Push","value":"push","description":"Push to remote repository"},{"name":"Push Tags","value":"pushTags","description":"Push Tags to remote repository"},{"name":"Status","value":"status","description":"Return status of current repository"},{"name":"Tag","value":"tag","description":"Create a new tag"},{"name":"User Setup","value":"userSetup","description":"Set the user"}]},{"displayName":"Repository Path","name":"repositoryPath","type":"string","default":"","required":true,"description":"Local path of the git repository to operate on","placeholder":"/tmp/repository"},{"displayName":"New Repository Path","name":"repositoryPath","type":"string","default":"","required":true,"description":"Local path to which the git repository should be cloned into","placeholder":"/tmp/repository"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.addFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.addConfigFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.cloneFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.commitFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.logFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.pushFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.tagFields"}]


node_type: n8n-nodes-base.Gitlab
name: Gitlab
display_name: GitLab
description: Retrieve data from GitLab API
category: input
icon: file:gitlab.svg
code_hash: 202529f826b67f848238e5d8a754b41d8ad35c4213dab7a775f0a7af3b15fbcd
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Gitlab
documentation_title: GitLab node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"gitlab","description":"Templates for gitlab"}]
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:35
updated_at: 2025-06-12 08:58:35
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Gitlab = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Gitlab {
      constructor() {
          this.description = {
              displayName: 'GitLab',
              name: 'gitlab',
              icon: 'file:gitlab.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Retrieve data from GitLab API',
              defaults: {
                  name: 'GitLab',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'gitlabApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'gitlabOAuth2Api',
                      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: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Issue',
                              value: 'issue',
                          },
                          {
                              name: 'Release',
                              value: 'release',
                          },
                          {
                              name: 'Repository',
                              value: 'repository',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'issue',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['issue'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a new issue',
                              action: 'Create an issue',
                          },
                          {
                              name: 'Create Comment',
                              value: 'createComment',
                              description: 'Create a new comment on an issue',
                              action: 'Create a comment on an issue',
                          },
                          {
                              name: 'Edit',
                              value: 'edit',
                              description: 'Edit an issue',
                              action: 'Edit an issue',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the data of a single issue',
                              action: 'Get an issue',
                          },
                          {
                              name: 'Lock',
                              value: 'lock',
                              description: 'Lock an issue',
                              action: 'Lock an issue',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['repository'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the data of a single repository',
                              action: 'Get a repository',
                          },
                          {
                              name: 'Get Issues',
                              value: 'getIssues',
                              description: 'Returns issues of a repository',
                              action: 'Get issues of a repository',
                          },
                      ],
                      default: 'getIssues',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Repositories',
                              value: 'getRepositories',
                              description: 'Returns the repositories of a user',
                              action: "Get a user's repositories",
                          },
                      ],
                      default: 'getRepositories',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['release'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a new release',
                              action: 'Create a release',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a release',
                              action: 'Delete a release',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a release',
                              action: 'Get a release',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many releases',
                              action: 'Get many releases',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a release',
                              action: 'Update a release',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a new file in repository',
                              action: 'Create a file',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a file in repository',
                              action: 'Delete a file',
                          },
                          {
                              name: 'Edit',
                              value: 'edit',
                              description: 'Edit a file in repository',
                              action: 'Edit a file',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the data of a single file',
                              action: 'Get a file',
                          },
                          {
                              name: 'List',
                              value: 'list',
                              description: 'List contents of a folder',
                              action: 'List files',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Project Owner',
                      name: 'owner',
                      type: 'string',
                      default: '',
                      required: true,
                      placeholder: 'n8n-io',
                      description: 'User, group or namespace of the project',
                  },
                  {
                      displayName: 'Project Name',
                      name: 'repository',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          hide: {
                              resource: ['user'],
                              operation: ['getRepositories'],
                          },
                      },
                      placeholder: 'n8n',
                      description: 'The name of the project',
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The title of the issue',
                  },
                  {
                      displayName: 'Body',
                      name: 'body',
                      type: 'string',
                      typeOptions: {
                          rows: 5,
                      },
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The body of the issue',
                  },
                  {
                      displayName: 'Due Date',
                      name: 'due_date',
                      type: 'dateTime',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['issue'],
                          },
                      },
                      default: '',
                      description: 'Due Date for issue',
                  },
                  {
                      displayName: 'Labels',
                      name: 'labels',
                      type: 'collection',
                      typeOptions: {
                          multipleValues: true,
                          multipleValueButtonText: 'Add Label',
                      },
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['issue'],
                          },
                      },
                      default: { label: '' },
                      options: [
                          {
                              displayName: 'Label',
                              name: 'label',
                              type: 'string',
                              default: '',
                              description: 'Label to add to issue',
                          },
                      ],
                  },
                  {
                      displayName: 'Assignees',
                      name: 'assignee_ids',
                      type: 'collection',
                      typeOptions: {
                          multipleValues: true,
                          multipleValueButtonText: 'Add Assignee',
                      },
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['issue'],
                          },
                      },
                      default: { assignee: '' },
                      options: [
                          {
                              displayName: 'Assignee',
                              name: 'assignee',
                              type: 'number',
                              default: 0,
                              description: 'User ID to assign issue to',
                          },
                      ],
                  },
                  {
                      displayName: 'Issue Number',
                      name: 'issueNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['createComment'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The number of the issue on which to create the comment on',
                  },
                  {
                      displayName: 'Body',
                      name: 'body',
                      type: 'string',
                      typeOptions: {
                          rows: 5,
                      },
                      displayOptions: {
                          show: {
                              operation: ['createComment'],
                              resource: ['issue'],
                          },
                      },
                      default: '',
                      description: 'The body of the comment',
                  },
                  {
                      displayName: 'Issue Number',
                      name: 'issueNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['edit'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The number of the issue edit',
                  },
                  {
                      displayName: 'Edit Fields',
                      name: 'editFields',
                      type: 'collection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Field',
                      },
                      displayOptions: {
                          show: {
                              operation: ['edit'],
                              resource: ['issue'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'The title of the issue',
                          },
                          {
                              displayName: 'Body',
                              name: 'description',
                              type: 'string',
                              typeOptions: {
                                  rows: 5,
                              },
                              default: '',
                              description: 'The body of the issue',
                          },
                          {
                              displayName: 'State',
                              name: 'state',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Closed',
                                      value: 'closed',
                                      description: 'Set the state to "closed"',
                                  },
                                  {
                                      name: 'Open',
                                      value: 'open',
                                      description: 'Set the state to "open"',
                                  },
                              ],
                              default: 'open',
                              description: 'The state to set',
                          },
                          {
                              displayName: 'Labels',
                              name: 'labels',
                              type: 'collection',
                              typeOptions: {
                                  multipleValues: true,
                                  multipleValueButtonText: 'Add Label',
                              },
                              default: { label: '' },
                              options: [
                                  {
                                      displayName: 'Label',
                                      name: 'label',
                                      type: 'string',
                                      default: '',
                                      description: 'Label to add to issue',
                                  },
                              ],
                          },
                          {
                              displayName: 'Assignees',
                              name: 'assignee_ids',
                              type: 'collection',
                              typeOptions: {
                                  multipleValues: true,
                                  multipleValueButtonText: 'Add Assignee',
                              },
                              default: { assignee: '' },
                              options: [
                                  {
                                      displayName: 'Assignees',
                                      name: 'assignee',
                                      type: 'string',
                                      default: '',
                                      description: 'User to assign issue too',
                                  },
                              ],
                          },
                          {
                              displayName: 'Due Date',
                              name: 'due_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Due Date for issue',
                          },
                      ],
                  },
                  {
                      displayName: 'Issue Number',
                      name: 'issueNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The number of the issue get data of',
                  },
                  {
                      displayName: 'Issue Number',
                      name: 'issueNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['lock'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The number of the issue to lock',
                  },
                  {
                      displayName: 'Lock Reason',
                      name: 'lockReason',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['lock'],
                              resource: ['issue'],
                          },
                      },
                      options: [
                          {
                              name: 'Off-Topic',
                              value: 'off-topic',
                              description: 'The issue is Off-Topic',
                          },
                          {
                              name: 'Too Heated',
                              value: 'too heated',
                              description: 'The discussion is too heated',
                          },
                          {
                              name: 'Resolved',
                              value: 'resolved',
                              description: 'The issue got resolved',
                          },
                          {
                              name: 'Spam',
                              value: 'spam',
                              description: 'The issue is spam',
                          },
                      ],
                      default: 'resolved',
                      description: 'The reason to lock the issue',
                  },
                  {
                      displayName: 'Tag',
                      name: 'releaseTag',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['release'],
                          },
                      },
                      description: 'The tag of the release',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Field',
                      },
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['release'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'The name of the release',
                          },
                          {
                              displayName: 'Description',
                              name: 'description',
                              type: 'string',
                              typeOptions: {
                                  rows: 5,
                              },
                              default: '',
                              description: 'The description of the release',
                          },
                          {
                              displayName: 'Ref',
                              name: 'ref',
                              type: 'string',
                              default: '',
                              description: 'If Tag doesn’t exist, the release will be created from Ref. It can be a commit SHA, another tag name, or a branch name.',
                          },
                      ],
                  },
                  {
                      displayName: 'Project ID',
                      name: 'projectId',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['delete', 'get'],
                              resource: ['release'],
                          },
                      },
                      description: 'The ID or URL-encoded path of the project',
                  },
                  {
                      displayName: 'Tag Name',
                      name: 'tag_name',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['delete', 'get'],
                              resource: ['release'],
                          },
                      },
                      description: 'The Git tag the release is associated with',
                  },
                  {
                      displayName: 'Project ID',
                      name: 'projectId',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['release'],
                          },
                      },
                      description: 'The ID or URL-encoded path of the project',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['release', 'file'],
                              operation: ['getAll', 'list'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['release', 'file'],
                              operation: ['getAll', 'list'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 20,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Field',
                      },
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['release'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Order By',
                              name: 'order_by',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Created At',
                                      value: 'created_at',
                                  },
                                  {
                                      name: 'Released At',
                                      value: 'released_at',
                                  },
                              ],
                              default: 'released_at',
                              description: 'The field to use as order',
                          },
                          {
                              displayName: 'Sort',
                              name: 'sort',
                              type: 'options',
                              options: [
                                  {
                                      name: 'ASC',
                                      value: 'asc',
                                  },
                                  {
                                      name: 'DESC',
                                      value: 'desc',
                                  },
                              ],
                              default: 'desc',
                              description: 'The direction of the order. .',
                          },
                      ],
                  },
                  {
                      displayName: 'Project ID',
                      name: 'projectId',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['release'],
                          },
                      },
                      description: 'The ID or URL-encoded path of the project',
                  },
                  {
                      displayName: 'Tag Name',
                      name: 'tag_name',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['release'],
                          },
                      },
                      description: 'The Git tag the release is associated with',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Field',
                      },
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['release'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'The release name',
                          },
                          {
                              displayName: 'Description',
                              name: 'description',
                              type: 'string',
                              default: '',
                              description: 'The description of the release. You can use Markdown.',
                          },
                          {
                              displayName: 'Milestones',
                              name: 'milestones',
                              type: 'string',
                              default: '',
                              description: 'The title of each milestone to associate with the release (provide a titles list spearated with comma)',
                          },
                          {
                              displayName: 'Released At',
                              name: 'released_at',
                              type: 'dateTime',
                              default: '',
                              description: 'The date when the release is/was ready',
                          },
                      ],
                  },
                  {
                      displayName: 'Filters',
                      name: 'getRepositoryIssuesFilters',
                      type: 'collection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Filter',
                      },
                      displayOptions: {
                          show: {
                              operation: ['getIssues'],
                              resource: ['repository'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Assignee',
                              name: 'assignee_username',
                              type: 'string',
                              default: '',
                              description: 'Return only issues which are assigned to a specific user',
                          },
                          {
                              displayName: 'Creator',
                              name: 'author_username',
                              type: 'string',
                              default: '',
                              description: 'Return only issues which were created by a specific user',
                          },
                          {
                              displayName: 'Labels',
                              name: 'labels',
                              type: 'string',
                              default: '',
                              description: 'Return only issues with the given labels. Multiple lables can be separated by comma.',
                          },
                          {
                              displayName: 'Updated After',
                              name: 'updated_after',
                              type: 'dateTime',
                              default: '',
                              description: 'Return only issues updated at or after this time',
                          },
                          {
                              displayName: 'State',
                              name: 'state',
                              type: 'options',
                              options: [
                                  {
                                      name: 'All',
                                      value: '',
                                      description: 'Returns issues with any state',
                                  },
                                  {
                                      name: 'Closed',
                                      value: 'closed',
                                      description: 'Return issues with "closed" state',
                                  },
                                  {
                                      name: 'Open',
                                      value: 'opened',
                                      description: 'Return issues with "open" state',
                                  },
                              ],
                              default: 'opened',
                              description: 'The state to filter by',
                          },
                          {
                              displayName: 'Sort',
                              name: 'order_by',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Created At',
                                      value: 'created_at',
                                      description: 'Sort by created date',
                                  },
                                  {
                                      name: 'Updated At',
                                      value: 'updated_at',
                                      description: 'Sort by updated date',
                                  },
                                  {
                                      name: 'Priority',
                                      value: 'priority',
                                      description: 'Sort by priority',
                                  },
                              ],
                              default: 'created_at',
                              description: 'The order the issues should be returned in',
                          },
                          {
                              displayName: 'Direction',
                              name: 'sort',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Ascending',
                                      value: 'asc',
                                      description: 'Sort in ascending order',
                                  },
                                  {
                                      name: 'Descending',
                                      value: 'desc',
                                      description: 'Sort in descending order',
                                  },
                              ],
                              default: 'desc',
                              description: 'The sort order',
                          },
                      ],
                  },
                  {
                      displayName: 'File Path',
                      name: 'filePath',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                          hide: {
                              operation: ['list'],
                          },
                      },
                      placeholder: 'docs/README.md',
                      description: 'The file path of the file. Has to contain the full path or leave it empty for root folder.',
                  },
                  {
                      displayName: 'Path',
                      name: 'filePath',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['file'],
                              operation: ['list'],
                          },
                      },
                      placeholder: 'docs/',
                      description: 'The path of the folder to list',
                  },
                  {
                      displayName: 'Page',
                      name: 'page',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['file'],
                              operation: ['list'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 1000,
                      },
                      default: 1,
                      description: 'Page of results to display',
                  },
                  {
                      displayName: 'Additional Parameters',
                      name: 'additionalParameters',
                      placeholder: 'Add Parameter',
                      description: 'Additional fields to add',
                      type: 'collection',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['file'],
                              operation: ['list'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Reference',
                              name: 'ref',
                              type: 'string',
                              default: '',
                              placeholder: 'main',
                              description: 'The name of the commit/branch/tag. Default: the repository’s default branch (usually main).',
                          },
                          {
                              displayName: 'Recursive',
                              name: 'recursive',
                              type: 'boolean',
                              default: false,
                              description: 'Whether or not to get a recursive file tree. Default is false.',
                          },
                      ],
                  },
                  {
                      displayName: 'As Binary Property',
                      name: 'asBinaryProperty',
                      type: 'boolean',
                      default: true,
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      description: 'Whether to set the data of the file as binary property instead of returning the raw API response',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              asBinaryProperty: [true],
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property in which to save the binary data of the received file',
                  },
                  {
                      displayName: 'Additional Parameters',
                      name: 'additionalParameters',
                      placeholder: 'Add Parameter',
                      description: 'Additional fields to add',
                      type: 'collection',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Reference',
                              name: 'reference',
                              type: 'string',
                              default: '',
                              placeholder: 'main',
                              description: 'The name of the commit/branch/tag. Default: the repository’s default branch (usually main).',
                          },
                      ],
                  },
                  {
                      displayName: 'Binary Data',
                      name: 'binaryData',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create', 'edit'],
                              resource: ['file'],
                          },
                      },
                      description: 'Whether the data to upload should be taken from binary field',
                  },
                  {
                      displayName: 'File Content',
                      name: 'fileContent',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              binaryData: [false],
                              operation: ['create', 'edit'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'The text content of the file',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              binaryData: [true],
                              operation: ['create', 'edit'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file',
                  },
                  {
                      displayName: 'Commit Message',
                      name: 'commitMessage',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create', 'delete', 'edit'],
                              resource: ['file'],
                          },
                      },
                  },
                  {
                      displayName: 'Branch',
                      name: 'branch',
                      type: 'string',
                      default: '',
                      description: 'Name of the new branch to create. The commit is added to this branch.',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create', 'delete', 'edit'],
                              resource: ['file'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Parameters',
                      name: 'additionalParameters',
                      placeholder: 'Add Parameter',
                      description: 'Additional fields to add',
                      type: 'fixedCollection',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['create', 'delete', 'edit'],
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Start Branch',
                              name: 'branchStart',
                              values: [
                                  {
                                      displayName: 'Start Branch',
                                      name: 'branchStart',
                                      type: 'string',
                                      default: '',
                                      description: 'Name of the base branch to create the new branch from',
                                  },
                              ],
                          },
                          {
                              name: 'author',
                              displayName: 'Author',
                              values: [
                                  {
                                      displayName: 'Name',
                                      name: 'name',
                                      type: 'string',
                                      default: '',
                                      description: 'The name of the author of the commit',
                                  },
                                  {
                                      displayName: 'Email',
                                      name: 'email',
                                      type: 'string',
                                      placeholder: 'name@email.com',
                                      default: '',
                                      description: 'The email of the author of the commit',
                                  },
                              ],
                          },
                          {
                              name: 'encoding',
                              displayName: 'Encoding',
                              values: [
                                  {
                                      displayName: 'Encoding',
                                      name: 'encoding',
                                      type: 'string',
                                      default: 'text',
                                      description: 'Change encoding to base64. Default is text.',
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const overwriteDataOperations = [
              'file:get',
              'file:create',
              'file:edit',
              'file:delete',
              'issue:create',
              'issue:createComment',
              'issue:edit',
              'issue:get',
              'release:create',
              'release:delete',
              'release:get',
              'release:update',
              'repository:get',
          ];
          const overwriteDataOperationsArray = [
              'file:list',
              'release:getAll',
              'repository:getIssues',
              'user:getRepositories',
          ];
          let responseData;
          let body;
          let qs;
          let requestMethod;
          let endpoint;
          let returnAll = false;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          const fullOperation = `${resource}:${operation}`;
          for (let i = 0; i < items.length; i++) {
              try {
                  requestMethod = 'GET';
                  endpoint = '';
                  body = {};
                  qs = {};
                  let owner = this.getNodeParameter('owner', i);
                  owner = owner.replace(new RegExp(/\//g), '%2F');
                  let repository = '';
                  if (fullOperation !== 'user:getRepositories') {
                      repository = this.getNodeParameter('repository', i);
                  }
                  const baseEndpoint = `/projects/${owner}%2F${repository}`;
                  if (resource === 'issue') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          body.title = this.getNodeParameter('title', i);
                          body.description = this.getNodeParameter('body', i);
                          body.due_date = this.getNodeParameter('due_date', i);
                          const labels = this.getNodeParameter('labels', i);
                          const assigneeIds = this.getNodeParameter('assignee_ids', i);
                          body.labels = labels.map((data) => data.label).join(',');
                          body.assignee_ids = assigneeIds.map((data) => data.assignee);
                          endpoint = `${baseEndpoint}/issues`;
                      }
                      else if (operation === 'createComment') {
                          requestMethod = 'POST';
                          const issueNumber = this.getNodeParameter('issueNumber', i);
                          body.body = this.getNodeParameter('body', i);
                          endpoint = `${baseEndpoint}/issues/${issueNumber}/notes`;
                      }
                      else if (operation === 'edit') {
                          requestMethod = 'PUT';
                          const issueNumber = this.getNodeParameter('issueNumber', i);
                          body = this.getNodeParameter('editFields', i, {});
                          if (body.labels !== undefined) {
                              body.labels = body.labels.map((data) => data.label).join(',');
                          }
                          if (body.assignee_ids !== undefined) {
                              body.assignee_ids = body.assignee_ids.map((data) => data.assignee);
                          }
                          endpoint = `${baseEndpoint}/issues/${issueNumber}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const issueNumber = this.getNodeParameter('issueNumber', i);
                          endpoint = `${baseEndpoint}/issues/${issueNumber}`;
                      }
                      else if (operation === 'lock') {
                          requestMethod = 'PUT';
                          const issueNumber = this.getNodeParameter('issueNumber', i);
                          body.discussion_locked = true;
                          endpoint = `${baseEndpoint}/issues/${issueNumber}`;
                      }
                  }
                  else if (resource === 'release') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          body = this.getNodeParameter('additionalFields', i, {});
                          body.tag_name = this.getNodeParameter('releaseTag', i);
                          endpoint = `${baseEndpoint}/releases`;
                      }
                      if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const id = this.getNodeParameter('projectId', i);
                          const tagName = this.getNodeParameter('tag_name', i);
                          endpoint = `/projects/${id}/releases/${tagName}`;
                      }
                      if (operation === 'get') {
                          requestMethod = 'GET';
                          const id = this.getNodeParameter('projectId', i);
                          const tagName = this.getNodeParameter('tag_name', i);
                          endpoint = `/projects/${id}/releases/${tagName}`;
                      }
                      if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const id = this.getNodeParameter('projectId', i);
                          qs = this.getNodeParameter('additionalFields', i, {});
                          returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              qs.per_page = this.getNodeParameter('limit', 0);
                          }
                          endpoint = `/projects/${id}/releases`;
                      }
                      if (operation === 'update') {
                          requestMethod = 'PUT';
                          const id = this.getNodeParameter('projectId', i);
                          const tagName = this.getNodeParameter('tag_name', i);
                          body = this.getNodeParameter('additionalFields', i, {});
                          if (body.milestones) {
                              body.milestones = body.milestones.split(',');
                          }
                          endpoint = `/projects/${id}/releases/${tagName}`;
                      }
                  }
                  else if (resource === 'repository') {
                      if (operation === 'get') {
                          requestMethod = 'GET';
                          endpoint = `${baseEndpoint}`;
                      }
                      else if (operation === 'getIssues') {
                          requestMethod = 'GET';
                          qs = this.getNodeParameter('getRepositoryIssuesFilters', i);
                          endpoint = `${baseEndpoint}/issues`;
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'getRepositories') {
                          requestMethod = 'GET';
                          endpoint = `/users/${owner}/projects`;
                      }
                  }
                  else if (resource === 'file') {
                      if (['create', 'edit'].includes(operation)) {
                          requestMethod = operation === 'create' ? 'POST' : 'PUT';
                          const filePath = this.getNodeParameter('filePath', i);
                          const additionalParameters = this.getNodeParameter('additionalParameters', i);
                          body.branch = this.getNodeParameter('branch', i);
                          body.commit_message = this.getNodeParameter('commitMessage', i);
                          if (additionalParameters.author) {
                              body.author = additionalParameters.author;
                          }
                          if (additionalParameters.branchStart &&
                              additionalParameters.branchStart.branchStart) {
                              body.start_branch = additionalParameters.branchStart.branchStart;
                          }
                          if (this.getNodeParameter('binaryData', i)) {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              body.content = binaryData.data;
                              body.encoding = 'base64';
                          }
                          else {
                              if (additionalParameters.encoding === 'base64') {
                                  body.content = Buffer.from(this.getNodeParameter('fileContent', i)).toString('base64');
                              }
                              else {
                                  body.content = this.getNodeParameter('fileContent', i);
                              }
                          }
                          endpoint = `${baseEndpoint}/repository/files/${encodeURIComponent(filePath)}`;
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const additionalParameters = this.getNodeParameter('additionalParameters', i, {});
                          if (additionalParameters.author) {
                              body.author = additionalParameters.author;
                          }
                          body.branch = this.getNodeParameter('branch', i);
                          body.commit_message = this.getNodeParameter('commitMessage', i);
                          const filePath = this.getNodeParameter('filePath', i);
                          endpoint = `${baseEndpoint}/repository/files/${encodeURIComponent(filePath)}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const filePath = this.getNodeParameter('filePath', i);
                          const additionalParameters = this.getNodeParameter('additionalParameters', i);
                          if (additionalParameters.reference) {
                              qs.ref = additionalParameters.reference;
                          }
                          else {
                              qs.ref = 'master';
                          }
                          endpoint = `${baseEndpoint}/repository/files/${encodeURIComponent(filePath)}`;
                      }
                      else if (operation === 'list') {
                          requestMethod = 'GET';
                          const filePath = this.getNodeParameter('filePath', i);
                          qs = this.getNodeParameter('additionalParameters', i, {});
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.per_page = this.getNodeParameter('limit', i);
                              qs.page = this.getNodeParameter('page', i);
                          }
                          if (filePath) {
                              qs.path = filePath;
                          }
                          endpoint = `${baseEndpoint}/repository/tree`;
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  const asBinaryProperty = this.getNodeParameter('asBinaryProperty', i, false);
                  if (returnAll) {
                      responseData = await GenericFunctions_1.gitlabApiRequestAllItems.call(this, requestMethod, endpoint, body, qs);
                  }
                  else {
                      responseData = await GenericFunctions_1.gitlabApiRequest.call(this, requestMethod, endpoint, body, qs);
                  }
                  if (fullOperation === 'file:get' && asBinaryProperty) {
                      if (Array.isArray(responseData) && responseData.length > 1) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'File Path is a folder, not a file.', {
                              itemIndex: i,
                          });
                      }
                      const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                      const newItem = {
                          json: items[i].json,
                          binary: {},
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      const { content, path } = responseData;
                      newItem.binary[binaryPropertyName] = await this.helpers.prepareBinaryData(Buffer.from(content, 'base64'), path);
                      items[i] = newItem;
                      return [items];
                  }
                  if (overwriteDataOperations.includes(fullOperation) ||
                      overwriteDataOperationsArray.includes(fullOperation)) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (overwriteDataOperations.includes(fullOperation) ||
                          overwriteDataOperationsArray.includes(fullOperation)) {
                          const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                          returnData.push(...executionErrorData);
                      }
                      else {
                          items[i].json = { error: error.message };
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (overwriteDataOperations.includes(fullOperation) ||
              overwriteDataOperationsArray.includes(fullOperation)) {
              return [returnData];
          }
          else {
              return [items];
          }
      }
  }
  exports.Gitlab = Gitlab;
  //# sourceMappingURL=Gitlab.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GitlabApi = void 0;
  class GitlabApi {
      constructor() {
          this.name = 'gitlabApi';
          this.displayName = 'GitLab API';
          this.documentationUrl = 'gitlab';
          this.properties = [
              {
                  displayName: 'Gitlab Server',
                  name: 'server',
                  type: 'string',
                  default: 'https://gitlab.com',
              },
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      'Private-Token': '={{$credentials.accessToken}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.server.replace(new RegExp("/$"), "") + "/api/v4" }}',
                  url: '/personal_access_tokens/self',
              },
          };
      }
  }
  exports.GitlabApi = GitlabApi;
  //# sourceMappingURL=GitlabApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GitlabOAuth2Api = void 0;
  class GitlabOAuth2Api {
      constructor() {
          this.name = 'gitlabOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'GitLab OAuth2 API';
          this.documentationUrl = 'gitlab';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Gitlab Server',
                  name: 'server',
                  type: 'string',
                  default: 'https://gitlab.com',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: '={{$self["server"]}}/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: '={{$self["server"]}}/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'api',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.GitlabOAuth2Api = GitlabOAuth2Api;
  //# sourceMappingURL=GitlabOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GitlabApi = void 0;
  class GitlabApi {
      constructor() {
          this.name = 'gitlabApi';
          this.displayName = 'GitLab API';
          this.documentationUrl = 'gitlab';
          this.properties = [
              {
                  displayName: 'Gitlab Server',
                  name: 'server',
                  type: 'string',
                  default: 'https://gitlab.com',
              },
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      'Private-Token': '={{$credentials.accessToken}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.server.replace(new RegExp("/$"), "") + "/api/v4" }}',
                  url: '/personal_access_tokens/self',
              },
          };
      }
  }
  exports.GitlabApi = GitlabApi;
  //# sourceMappingURL=GitlabApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GitlabOAuth2Api = void 0;
  class GitlabOAuth2Api {
      constructor() {
          this.name = 'gitlabOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'GitLab OAuth2 API';
          this.documentationUrl = 'gitlab';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Gitlab Server',
                  name: 'server',
                  type: 'string',
                  default: 'https://gitlab.com',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: '={{$self["server"]}}/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: '={{$self["server"]}}/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'api',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.GitlabOAuth2Api = GitlabOAuth2Api;
  //# sourceMappingURL=GitlabOAuth2Api.credentials.js.map

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

  # GitLab node

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

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

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

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

  ## Operations

  * File
  	* Create
  	* Delete
  	* Edit
  	* Get
  	* List
  * Issue
      * Create a new issue
      * Create a new comment on an issue
      * Edit an issue
      * Get the data of a single issue
      * Lock an issue
  * Release
      * Create a new release
      * Delete a new release
      * Get a new release
      * Get all releases
      * Update a new release
  * Repository
      * Get the data of a single repository
      * Returns issues of a repository
  * User
      * Returns the repositories of a user

  ## Templates and examples

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

  ## Related resources

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

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

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

related_resources:
  [{"title":"GitLab's documentation","url":"https://docs.gitlab.com/ee/api/rest/","type":"external"},{"title":"here","url":"/integrations/builtin/trigger-nodes/n8n-nodes-base.gitlabtrigger.md","type":"documentation"}]

example_workflow:
  {"name":"GitLab Example Workflow","nodes":[{"parameters":{"authentication":"accessToken","resource":"file","operation":"create","owner":"example-value","repository":"example-value","title":"example-value","body":"example-value","due_date":null,"labels":{},"assignee_ids":{},"issueNumber":10,"editFields":{},"lockReason":"off-topic","releaseTag":"example-value","additionalFields":{},"projectId":"example-value","tag_name":"Example Name","returnAll":false,"limit":20,"getRepositoryIssuesFilters":{},"filePath":"example-value","page":1,"additionalParameters":{},"asBinaryProperty":true,"binaryPropertyName":"Example Name","binaryData":false,"fileContent":"example-value","commitMessage":"example-value","branch":"example-value"},"id":"xjzb2gfwfubqj9axwpcq","name":"GitLab","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"authentication":"accessToken","resource":"file","operation":"create","owner":"example-value","repository":"example-value","title":"example-value","body":"example-value","due_date":null,"labels":{},"assignee_ids":{},"issueNumber":10,"editFields":{},"lockReason":"off-topic","releaseTag":"example-value","additionalFields":{},"projectId":"example-value","tag_name":"Example Name","returnAll":false,"limit":20,"getRepositoryIssuesFilters":{},"filePath":"example-value","page":1,"additionalParameters":{},"asBinaryProperty":true,"binaryPropertyName":"Example Name","binaryData":false,"fileContent":"example-value","commitMessage":"example-value","branch":"example-value"}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"accessToken","options":[{"name":"Access Token","value":"accessToken"},{"name":"OAuth2","value":"oAuth2"}]},{"displayName":"Resource","name":"resource","type":"options","default":"issue","options":[{"name":"File","value":"file"},{"name":"Issue","value":"issue"},{"name":"Release","value":"release"},{"name":"Repository","value":"repository"},{"name":"User","value":"user"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a new issue","options":[{"name":"Create","value":"create","description":"Create a new issue"},{"name":"Create Comment","value":"createComment","description":"Create a new comment on an issue"},{"name":"Edit","value":"edit","description":"Edit an issue"},{"name":"Get","value":"get","description":"Get the data of a single issue"},{"name":"Lock","value":"lock","description":"Lock an issue"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getIssues","description":"Get the data of a single repository","options":[{"name":"Get","value":"get","description":"Get the data of a single repository"},{"name":"Get Issues","value":"getIssues","description":"Returns issues of a repository"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getRepositories","description":"Returns the repositories of a user","options":[{"name":"Get Repositories","value":"getRepositories","description":"Returns the repositories of a user"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a new release","options":[{"name":"Create","value":"create","description":"Create a new release"},{"name":"Delete","value":"delete","description":"Delete a release"},{"name":"Get","value":"get","description":"Get a release"},{"name":"Get Many","value":"getAll","description":"Get many releases"},{"name":"Update","value":"update","description":"Update a release"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a new file in repository","options":[{"name":"Create","value":"create","description":"Create a new file in repository"},{"name":"Delete","value":"delete","description":"Delete a file in repository"},{"name":"Edit","value":"edit","description":"Edit a file in repository"},{"name":"Get","value":"get","description":"Get the data of a single file"},{"name":"List","value":"list","description":"List contents of a folder"}]},{"displayName":"Project Owner","name":"owner","type":"string","default":"","required":true,"description":"User, group or namespace of the project","placeholder":"n8n-io"},{"displayName":"Project Name","name":"repository","type":"string","default":"","required":true,"description":"The name of the project","placeholder":"n8n"},{"displayName":"Title","name":"title","type":"string","default":"","required":true,"description":"The title of the issue"},{"displayName":"Body","name":"body","type":"string","default":"","description":"The body of the issue"},{"displayName":"Due Date","name":"due_date","type":"dateTime","default":"","description":"Due Date for issue"},{"displayName":"Labels","name":"labels","type":"collection","default":"{ label: ''","description":"Label to add to issue"},{"displayName":"Assignees","name":"assignee_ids","type":"collection","default":"{ assignee: ''","description":"User ID to assign issue to"},{"displayName":"Issue Number","name":"issueNumber","type":"number","default":0,"required":true,"description":"The number of the issue on which to create the comment on"},{"displayName":"Body","name":"body","type":"string","default":"","description":"The body of the comment"},{"displayName":"Issue Number","name":"issueNumber","type":"number","default":0,"required":true,"description":"The number of the issue edit"},{"displayName":"Edit Fields","name":"editFields","type":"collection","default":"{","description":"The title of the issue"},{"displayName":"Issue Number","name":"issueNumber","type":"number","default":0,"required":true,"description":"The number of the issue get data of"},{"displayName":"Issue Number","name":"issueNumber","type":"number","default":0,"required":true,"description":"The number of the issue to lock"},{"displayName":"Lock Reason","name":"lockReason","type":"options","default":"resolved","description":"The issue is Off-Topic","options":[{"name":"Off-Topic","value":"off-topic","description":"The issue is Off-Topic"},{"name":"Too Heated","value":"too heated","description":"The discussion is too heated"},{"name":"Resolved","value":"resolved","description":"The issue got resolved"},{"name":"Spam","value":"spam","description":"The issue is spam"}]},{"displayName":"Tag","name":"releaseTag","type":"string","default":"","required":true,"description":"The tag of the release"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The name of the release"},{"displayName":"Project ID","name":"projectId","type":"string","default":"","required":true,"description":"The ID or URL-encoded path of the project"},{"displayName":"Tag Name","name":"tag_name","type":"string","default":"","required":true,"description":"The Git tag the release is associated with"},{"displayName":"Project ID","name":"projectId","type":"string","default":"","required":true,"description":"The ID or URL-encoded path of the project"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":20,"description":"Max number of results to return"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The field to use as order"},{"displayName":"Project ID","name":"projectId","type":"string","default":"","required":true,"description":"The ID or URL-encoded path of the project"},{"displayName":"Tag Name","name":"tag_name","type":"string","default":"","required":true,"description":"The Git tag the release is associated with"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The release name"},{"displayName":"Filters","name":"getRepositoryIssuesFilters","type":"collection","default":"{","description":"Return only issues which are assigned to a specific user"},{"displayName":"File Path","name":"filePath","type":"string","default":"","description":"The file path of the file. Has to contain the full path or leave it empty for root folder.","placeholder":"docs/README.md"},{"displayName":"Path","name":"filePath","type":"string","default":"","description":"The path of the folder to list","placeholder":"docs/"},{"displayName":"Page","name":"page","type":"number","default":1,"description":"Page of results to display"},{"displayName":"Additional Parameters","name":"additionalParameters","type":"collection","default":"{","description":"Additional fields to add","placeholder":"Add Parameter"},{"displayName":"As Binary Property","name":"asBinaryProperty","type":"boolean","default":true,"description":"Whether to set the data of the file as binary property instead of returning the raw API response"},{"displayName":"Binary Property","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Name of the binary property in which to save the binary data of the received file"},{"displayName":"Additional Parameters","name":"additionalParameters","type":"collection","default":"{","description":"Additional fields to add","placeholder":"Add Parameter"},{"displayName":"Binary Data","name":"binaryData","type":"boolean","default":false,"required":true,"description":"Whether the data to upload should be taken from binary field"},{"displayName":"File Content","name":"fileContent","type":"string","default":"","required":true,"description":"The text content of the file"},{"displayName":"Binary Property","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Name of the binary property which contains the data for the file"},{"displayName":"Commit Message","name":"commitMessage","type":"string","default":"","required":true},{"displayName":"Branch","name":"branch","type":"string","default":"","required":true,"description":"Name of the new branch to create. The commit is added to this branch."},{"displayName":"Additional Parameters","name":"additionalParameters","type":"fixedCollection","default":"{","description":"Additional fields to add","placeholder":"Add Parameter"}]


node_type: n8n-nodes-base.Github
name: Github
display_name: GitHub
description: Consume GitHub API
category: input
icon: file:github.svg
code_hash: 749f403fea31f46ff0b72d3f102f45d2b3b252be9caad1c740dbf910d757f364
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Github
documentation_title: GitHub node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"github","description":"Templates for github"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:35
updated_at: 2025-06-12 08:58:35
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Github = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const change_case_1 = require("change-case");
  const SearchFunctions_1 = require("./SearchFunctions");
  class Github {
      constructor() {
          this.description = {
              displayName: 'GitHub',
              name: 'github',
              icon: 'file:github.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume GitHub API',
              defaults: {
                  name: 'GitHub',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'githubApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'githubOAuth2Api',
                      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: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Issue',
                              value: 'issue',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Release',
                              value: 'release',
                          },
                          {
                              name: 'Repository',
                              value: 'repository',
                          },
                          {
                              name: 'Review',
                              value: 'review',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'issue',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['organization'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Repositories',
                              value: 'getRepositories',
                              description: 'Returns all repositories of an organization',
                              action: 'Get repositories for an organization',
                          },
                      ],
                      default: 'getRepositories',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['issue'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a new issue',
                              action: 'Create an issue',
                          },
                          {
                              name: 'Create Comment',
                              value: 'createComment',
                              description: 'Create a new comment on an issue',
                              action: 'Create a comment on an issue',
                          },
                          {
                              name: 'Edit',
                              value: 'edit',
                              description: 'Edit an issue',
                              action: 'Edit an issue',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the data of a single issue',
                              action: 'Get an issue',
                          },
                          {
                              name: 'Lock',
                              value: 'lock',
                              description: 'Lock an issue',
                              action: 'Lock an issue',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a new file in repository',
                              action: 'Create a file',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a file in repository',
                              action: 'Delete a file',
                          },
                          {
                              name: 'Edit',
                              value: 'edit',
                              description: 'Edit a file in repository',
                              action: 'Edit a file',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the data of a single file',
                              action: 'Get a file',
                          },
                          {
                              name: 'List',
                              value: 'list',
                              description: 'List contents of a folder',
                              action: 'List a file',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['repository'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the data of a single repository',
                              action: 'Get a repository',
                          },
                          {
                              name: 'Get Issues',
                              value: 'getIssues',
                              description: 'Returns issues of a repository',
                              action: 'Get issues of a repository',
                          },
                          {
                              name: 'Get License',
                              value: 'getLicense',
                              description: "Returns the contents of the repository's license file, if one is detected",
                              action: 'Get the license of a repository',
                          },
                          {
                              name: 'Get Profile',
                              value: 'getProfile',
                              description: 'Get the community profile of a repository with metrics, health score, description, license, etc',
                              action: 'Get the profile of a repository',
                          },
                          {
                              name: 'List Popular Paths',
                              value: 'listPopularPaths',
                              description: 'Get the top 10 popular content paths over the last 14 days',
                              action: 'List popular paths in a repository',
                          },
                          {
                              name: 'List Referrers',
                              value: 'listReferrers',
                              description: 'Get the top 10 referrering domains over the last 14 days',
                              action: 'List the top referrers of a repository',
                          },
                      ],
                      default: 'getIssues',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Repositories',
                              value: 'getRepositories',
                              description: 'Returns the repositories of a user',
                              action: "Get a user's repositories",
                          },
                          {
                              name: 'Invite',
                              value: 'invite',
                              description: 'Invites a user to an organization',
                              action: 'Invite a user',
                          },
                      ],
                      default: 'getRepositories',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['release'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Creates a new release',
                              action: 'Create a release',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a release',
                              action: 'Delete a release',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a release',
                              action: 'Get a release',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many repository releases',
                              action: 'Get many releases',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a release',
                              action: 'Update a release',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['review'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Creates a new review',
                              action: 'Create a review',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a review for a pull request',
                              action: 'Get a review',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many reviews for a pull request',
                              action: 'Get many reviews',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a review',
                              action: 'Update a review',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Repository Owner',
                      name: 'owner',
                      type: 'resourceLocator',
                      default: { mode: 'list', value: '' },
                      required: true,
                      modes: [
                          {
                              displayName: 'Repository Owner',
                              name: 'list',
                              type: 'list',
                              placeholder: 'Select an owner...',
                              typeOptions: {
                                  searchListMethod: 'getUsers',
                                  searchable: true,
                                  searchFilterRequired: true,
                              },
                          },
                          {
                              displayName: 'Link',
                              name: 'url',
                              type: 'string',
                              placeholder: 'e.g. https://github.com/n8n-io',
                              extractValue: {
                                  type: 'regex',
                                  regex: 'https:\\/\\/github.com\\/([-_0-9a-zA-Z]+)',
                              },
                              validation: [
                                  {
                                      type: 'regex',
                                      properties: {
                                          regex: 'https:\\/\\/github.com\\/([-_0-9a-zA-Z]+)(?:.*)',
                                          errorMessage: 'Not a valid Github URL',
                                      },
                                  },
                              ],
                          },
                          {
                              displayName: 'By Name',
                              name: 'name',
                              type: 'string',
                              placeholder: 'e.g. n8n-io',
                              validation: [
                                  {
                                      type: 'regex',
                                      properties: {
                                          regex: '[-_a-zA-Z0-9]+',
                                          errorMessage: 'Not a valid Github Owner Name',
                                      },
                                  },
                              ],
                              url: '=https://github.com/{{$value}}',
                          },
                      ],
                      displayOptions: {
                          hide: {
                              operation: ['invite'],
                          },
                      },
                  },
                  {
                      displayName: 'Repository Name',
                      name: 'repository',
                      type: 'resourceLocator',
                      default: { mode: 'list', value: '' },
                      required: true,
                      modes: [
                          {
                              displayName: 'Repository Name',
                              name: 'list',
                              type: 'list',
                              placeholder: 'Select an Repository...',
                              typeOptions: {
                                  searchListMethod: 'getRepositories',
                                  searchable: true,
                              },
                          },
                          {
                              displayName: 'Link',
                              name: 'url',
                              type: 'string',
                              placeholder: 'e.g. https://github.com/n8n-io/n8n',
                              extractValue: {
                                  type: 'regex',
                                  regex: 'https:\\/\\/github.com\\/(?:[-_0-9a-zA-Z]+)\\/([-_.0-9a-zA-Z]+)',
                              },
                              validation: [
                                  {
                                      type: 'regex',
                                      properties: {
                                          regex: 'https:\\/\\/github.com\\/(?:[-_0-9a-zA-Z]+)\\/([-_.0-9a-zA-Z]+)(?:.*)',
                                          errorMessage: 'Not a valid Github Repository URL',
                                      },
                                  },
                              ],
                          },
                          {
                              displayName: 'By Name',
                              name: 'name',
                              type: 'string',
                              placeholder: 'e.g. n8n',
                              validation: [
                                  {
                                      type: 'regex',
                                      properties: {
                                          regex: '[-_.0-9a-zA-Z]+',
                                          errorMessage: 'Not a valid Github Repository Name',
                                      },
                                  },
                              ],
                              url: '=https://github.com/{{$parameter["owner"]}}/{{$value}}',
                          },
                      ],
                      displayOptions: {
                          hide: {
                              resource: ['user', 'organization'],
                              operation: ['getRepositories'],
                          },
                      },
                  },
                  {
                      displayName: 'File Path',
                      name: 'filePath',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                          hide: {
                              operation: ['list'],
                          },
                      },
                      placeholder: 'docs/README.md',
                      description: 'The file path of the file. Has to contain the full path.',
                  },
                  {
                      displayName: 'Path',
                      name: 'filePath',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['file'],
                              operation: ['list'],
                          },
                      },
                      placeholder: 'docs/',
                      description: 'The path of the folder to list',
                  },
                  {
                      displayName: 'Binary Data',
                      name: 'binaryData',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create', 'edit'],
                              resource: ['file'],
                          },
                      },
                      description: 'Whether the data to upload should be taken from binary field',
                  },
                  {
                      displayName: 'File Content',
                      name: 'fileContent',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              binaryData: [false],
                              operation: ['create', 'edit'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'The text content of the file',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              binaryData: [true],
                              operation: ['create', 'edit'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file',
                  },
                  {
                      displayName: 'Commit Message',
                      name: 'commitMessage',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create', 'delete', 'edit'],
                              resource: ['file'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Parameters',
                      name: 'additionalParameters',
                      placeholder: 'Add Parameter',
                      description: 'Additional fields to add',
                      type: 'fixedCollection',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['create', 'delete', 'edit'],
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'author',
                              displayName: 'Author',
                              values: [
                                  {
                                      displayName: 'Name',
                                      name: 'name',
                                      type: 'string',
                                      default: '',
                                      description: 'The name of the author of the commit',
                                  },
                                  {
                                      displayName: 'Email',
                                      name: 'email',
                                      type: 'string',
                                      placeholder: 'name@email.com',
                                      default: '',
                                      description: 'The email of the author of the commit',
                                  },
                              ],
                          },
                          {
                              name: 'branch',
                              displayName: 'Branch',
                              values: [
                                  {
                                      displayName: 'Branch',
                                      name: 'branch',
                                      type: 'string',
                                      default: '',
                                      description: 'The branch to commit to. If not set the repository’s default branch (usually master) is used.',
                                  },
                              ],
                          },
                          {
                              name: 'committer',
                              displayName: 'Committer',
                              values: [
                                  {
                                      displayName: 'Name',
                                      name: 'name',
                                      type: 'string',
                                      default: '',
                                      description: 'The name of the committer of the commit',
                                  },
                                  {
                                      displayName: 'Email',
                                      name: 'email',
                                      type: 'string',
                                      placeholder: 'name@email.com',
                                      default: '',
                                      description: 'The email of the committer of the commit',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'As Binary Property',
                      name: 'asBinaryProperty',
                      type: 'boolean',
                      default: true,
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      description: 'Whether to set the data of the file as binary property instead of returning the raw API response',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              asBinaryProperty: [true],
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property in which to save the binary data of the received file',
                  },
                  {
                      displayName: 'Additional Parameters',
                      name: 'additionalParameters',
                      placeholder: 'Add Parameter',
                      description: 'Additional fields to add',
                      type: 'collection',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Reference',
                              name: 'reference',
                              type: 'string',
                              default: '',
                              placeholder: 'master',
                              description: 'The name of the commit/branch/tag. Default: the repository’s default branch (usually master).',
                          },
                      ],
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The title of the issue',
                  },
                  {
                      displayName: 'Body',
                      name: 'body',
                      type: 'string',
                      typeOptions: {
                          rows: 5,
                      },
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The body of the issue',
                  },
                  {
                      displayName: 'Labels',
                      name: 'labels',
                      type: 'collection',
                      typeOptions: {
                          multipleValues: true,
                          multipleValueButtonText: 'Add Label',
                      },
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['issue'],
                          },
                      },
                      default: { label: '' },
                      options: [
                          {
                              displayName: 'Label',
                              name: 'label',
                              type: 'string',
                              default: '',
                              description: 'Label to add to issue',
                          },
                      ],
                  },
                  {
                      displayName: 'Assignees',
                      name: 'assignees',
                      type: 'collection',
                      typeOptions: {
                          multipleValues: true,
                          multipleValueButtonText: 'Add Assignee',
                      },
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['issue'],
                          },
                      },
                      default: { assignee: '' },
                      options: [
                          {
                              displayName: 'Assignee',
                              name: 'assignee',
                              type: 'string',
                              default: '',
                              description: 'User to assign issue too',
                          },
                      ],
                  },
                  {
                      displayName: 'Issue Number',
                      name: 'issueNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['createComment'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The number of the issue on which to create the comment on',
                  },
                  {
                      displayName: 'Body',
                      name: 'body',
                      type: 'string',
                      typeOptions: {
                          rows: 5,
                      },
                      displayOptions: {
                          show: {
                              operation: ['createComment'],
                              resource: ['issue'],
                          },
                      },
                      default: '',
                      description: 'The body of the comment',
                  },
                  {
                      displayName: 'Issue Number',
                      name: 'issueNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['edit'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The number of the issue edit',
                  },
                  {
                      displayName: 'Edit Fields',
                      name: 'editFields',
                      type: 'collection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Field',
                      },
                      displayOptions: {
                          show: {
                              operation: ['edit'],
                              resource: ['issue'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'The title of the issue',
                          },
                          {
                              displayName: 'Body',
                              name: 'body',
                              type: 'string',
                              typeOptions: {
                                  rows: 5,
                              },
                              default: '',
                              description: 'The body of the issue',
                          },
                          {
                              displayName: 'State',
                              name: 'state',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Closed',
                                      value: 'closed',
                                      description: 'Set the state to "closed"',
                                  },
                                  {
                                      name: 'Open',
                                      value: 'open',
                                      description: 'Set the state to "open"',
                                  },
                              ],
                              default: 'open',
                              description: 'The state to set',
                          },
                          {
                              displayName: 'Labels',
                              name: 'labels',
                              type: 'collection',
                              typeOptions: {
                                  multipleValues: true,
                                  multipleValueButtonText: 'Add Label',
                              },
                              default: { label: '' },
                              options: [
                                  {
                                      displayName: 'Label',
                                      name: 'label',
                                      type: 'string',
                                      default: '',
                                      description: 'Label to add to issue',
                                  },
                              ],
                          },
                          {
                              displayName: 'Assignees',
                              name: 'assignees',
                              type: 'collection',
                              typeOptions: {
                                  multipleValues: true,
                                  multipleValueButtonText: 'Add Assignee',
                              },
                              default: { assignee: '' },
                              options: [
                                  {
                                      displayName: 'Assignees',
                                      name: 'assignee',
                                      type: 'string',
                                      default: '',
                                      description: 'User to assign issue to',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Issue Number',
                      name: 'issueNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The number of the issue get data of',
                  },
                  {
                      displayName: 'Issue Number',
                      name: 'issueNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['lock'],
                              resource: ['issue'],
                          },
                      },
                      description: 'The number of the issue to lock',
                  },
                  {
                      displayName: 'Lock Reason',
                      name: 'lockReason',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['lock'],
                              resource: ['issue'],
                          },
                      },
                      options: [
                          {
                              name: 'Off-Topic',
                              value: 'off-topic',
                              description: 'The issue is Off-Topic',
                          },
                          {
                              name: 'Too Heated',
                              value: 'too heated',
                              description: 'The discussion is too heated',
                          },
                          {
                              name: 'Resolved',
                              value: 'resolved',
                              description: 'The issue got resolved',
                          },
                          {
                              name: 'Spam',
                              value: 'spam',
                              description: 'The issue is spam',
                          },
                      ],
                      default: 'resolved',
                      description: 'The reason to lock the issue',
                  },
                  {
                      displayName: 'Tag',
                      name: 'releaseTag',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['release'],
                          },
                      },
                      description: 'The tag of the release',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Field',
                      },
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['release'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'The name of the issue',
                          },
                          {
                              displayName: 'Body',
                              name: 'body',
                              type: 'string',
                              typeOptions: {
                                  rows: 5,
                              },
                              default: '',
                              description: 'The body of the release',
                          },
                          {
                              displayName: 'Draft',
                              name: 'draft',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to create a draft (unpublished) release, "false" to create a published one',
                          },
                          {
                              displayName: 'Prerelease',
                              name: 'prerelease',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to point out that the release is non-production ready',
                          },
                          {
                              displayName: 'Target Commitish',
                              name: 'target_commitish',
                              type: 'string',
                              default: '',
                              description: "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch(usually master).",
                          },
                      ],
                  },
                  {
                      displayName: 'Release ID',
                      name: 'release_id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['release'],
                              operation: ['get', 'delete', 'update'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Field',
                      },
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['release'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Body',
                              name: 'body',
                              type: 'string',
                              typeOptions: {
                                  rows: 5,
                              },
                              default: '',
                              description: 'The body of the release',
                          },
                          {
                              displayName: 'Draft',
                              name: 'draft',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to create a draft (unpublished) release, "false" to create a published one',
                          },
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'The name of the release',
                          },
                          {
                              displayName: 'Prerelease',
                              name: 'prerelease',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to point out that the release is non-production ready',
                          },
                          {
                              displayName: 'Tag Name',
                              name: 'tag_name',
                              type: 'string',
                              default: '',
                              description: 'The name of the tag',
                          },
                          {
                              displayName: 'Target Commitish',
                              name: 'target_commitish',
                              type: 'string',
                              default: '',
                              description: "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch(usually master).",
                          },
                      ],
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['release'],
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['release'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 50,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['repository'],
                              operation: ['getIssues'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['repository'],
                              operation: ['getIssues'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 50,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Filters',
                      name: 'getRepositoryIssuesFilters',
                      type: 'collection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Filter',
                      },
                      displayOptions: {
                          show: {
                              operation: ['getIssues'],
                              resource: ['repository'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Assignee',
                              name: 'assignee',
                              type: 'string',
                              default: '',
                              description: 'Return only issues which are assigned to a specific user',
                          },
                          {
                              displayName: 'Creator',
                              name: 'creator',
                              type: 'string',
                              default: '',
                              description: 'Return only issues which were created by a specific user',
                          },
                          {
                              displayName: 'Mentioned',
                              name: 'mentioned',
                              type: 'string',
                              default: '',
                              description: 'Return only issues in which a specific user was mentioned',
                          },
                          {
                              displayName: 'Labels',
                              name: 'labels',
                              type: 'string',
                              default: '',
                              description: 'Return only issues with the given labels. Multiple lables can be separated by comma.',
                          },
                          {
                              displayName: 'Updated Since',
                              name: 'since',
                              type: 'dateTime',
                              default: '',
                              description: 'Return only issues updated at or after this time',
                          },
                          {
                              displayName: 'State',
                              name: 'state',
                              type: 'options',
                              options: [
                                  {
                                      name: 'All',
                                      value: 'all',
                                      description: 'Returns issues with any state',
                                  },
                                  {
                                      name: 'Closed',
                                      value: 'closed',
                                      description: 'Return issues with "closed" state',
                                  },
                                  {
                                      name: 'Open',
                                      value: 'open',
                                      description: 'Return issues with "open" state',
                                  },
                              ],
                              default: 'open',
                              description: 'The state to set',
                          },
                          {
                              displayName: 'Sort',
                              name: 'sort',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Created',
                                      value: 'created',
                                      description: 'Sort by created date',
                                  },
                                  {
                                      name: 'Updated',
                                      value: 'updated',
                                      description: 'Sort by updated date',
                                  },
                                  {
                                      name: 'Comments',
                                      value: 'comments',
                                      description: 'Sort by comments',
                                  },
                              ],
                              default: 'created',
                              description: 'The order the issues should be returned in',
                          },
                          {
                              displayName: 'Direction',
                              name: 'direction',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Ascending',
                                      value: 'asc',
                                      description: 'Sort in ascending order',
                                  },
                                  {
                                      name: 'Descending',
                                      value: 'desc',
                                      description: 'Sort in descending order',
                                  },
                              ],
                              default: 'desc',
                              description: 'The sort order',
                          },
                      ],
                  },
                  {
                      displayName: 'PR Number',
                      name: 'pullRequestNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['get', 'update'],
                              resource: ['review'],
                          },
                      },
                      description: 'The number of the pull request',
                  },
                  {
                      displayName: 'Review ID',
                      name: 'reviewId',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['get', 'update'],
                              resource: ['review'],
                          },
                      },
                      description: 'ID of the review',
                  },
                  {
                      displayName: 'PR Number',
                      name: 'pullRequestNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['review'],
                          },
                      },
                      description: 'The number of the pull request',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['review'],
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['review'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 50,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'PR Number',
                      name: 'pullRequestNumber',
                      type: 'number',
                      default: 0,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['review'],
                          },
                      },
                      description: 'The number of the pull request to review',
                  },
                  {
                      displayName: 'Event',
                      name: 'event',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['review'],
                          },
                      },
                      options: [
                          {
                              name: 'Approve',
                              value: 'approve',
                              description: 'Approve the pull request',
                          },
                          {
                              name: 'Request Change',
                              value: 'requestChanges',
                              description: 'Request code changes',
                          },
                          {
                              name: 'Comment',
                              value: 'comment',
                              description: 'Add a comment without approval or change requests',
                          },
                          {
                              name: 'Pending',
                              value: 'pending',
                              description: 'You will need to submit the pull request review when you are ready',
                          },
                      ],
                      default: 'approve',
                      description: 'The review action you want to perform',
                  },
                  {
                      displayName: 'Body',
                      name: 'body',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['review'],
                              event: ['requestChanges', 'comment'],
                          },
                      },
                      default: '',
                      description: 'The body of the review (required for events Request Changes or Comment)',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      placeholder: 'Add Field',
                      type: 'collection',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['review'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Commit ID',
                              name: 'commitId',
                              type: 'string',
                              default: '',
                              description: 'The SHA of the commit that needs a review, if different from the latest',
                          },
                      ],
                  },
                  {
                      displayName: 'Body',
                      name: 'body',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['review'],
                          },
                      },
                      default: '',
                      description: 'The body of the review',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['getRepositories'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['getRepositories'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 50,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Organization',
                      name: 'organization',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['invite'],
                              resource: ['user'],
                          },
                      },
                      description: 'The GitHub organization that the user is being invited to',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['invite'],
                              resource: ['user'],
                          },
                      },
                      description: 'The email address of the invited user',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['organization'],
                              operation: ['getRepositories'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['organization'],
                              operation: ['getRepositories'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 50,
                      description: 'Max number of results to return',
                  },
              ],
          };
          this.methods = {
              listSearch: {
                  getUsers: SearchFunctions_1.getUsers,
                  getRepositories: SearchFunctions_1.getRepositories,
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let returnAll = false;
          let responseData;
          const overwriteDataOperations = [
              'file:create',
              'file:delete',
              'file:edit',
              'file:get',
              'issue:create',
              'issue:createComment',
              'issue:edit',
              'issue:get',
              'release:create',
              'release:delete',
              'release:get',
              'release:update',
              'repository:get',
              'repository:getLicense',
              'repository:getProfile',
              'review:create',
              'review:get',
              'review:update',
              'user:invite',
          ];
          const overwriteDataOperationsArray = [
              'file:list',
              'repository:getIssues',
              'repository:listPopularPaths',
              'repository:listReferrers',
              'user:getRepositories',
              'release:getAll',
              'review:getAll',
              'organization:getRepositories',
          ];
          let body;
          let qs;
          let requestMethod;
          let endpoint;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          const fullOperation = `${resource}:${operation}`;
          for (let i = 0; i < items.length; i++) {
              try {
                  requestMethod = 'GET';
                  endpoint = '';
                  body = {};
                  qs = {};
                  let owner = '';
                  if (fullOperation !== 'user:invite') {
                      owner = this.getNodeParameter('owner', i, '', { extractValue: true });
                  }
                  let repository = '';
                  if (fullOperation !== 'user:getRepositories' &&
                      fullOperation !== 'user:invite' &&
                      fullOperation !== 'organization:getRepositories') {
                      repository = this.getNodeParameter('repository', i, '', { extractValue: true });
                  }
                  if (resource === 'file') {
                      if (['create', 'edit'].includes(operation)) {
                          requestMethod = 'PUT';
                          const filePath = this.getNodeParameter('filePath', i);
                          const additionalParameters = this.getNodeParameter('additionalParameters', i, {});
                          if (additionalParameters.author) {
                              body.author = additionalParameters.author;
                          }
                          if (additionalParameters.committer) {
                              body.committer = additionalParameters.committer;
                          }
                          if (additionalParameters.branch &&
                              additionalParameters.branch.branch) {
                              body.branch = additionalParameters.branch.branch;
                          }
                          if (operation === 'edit') {
                              body.sha = await GenericFunctions_1.getFileSha.call(this, owner, repository, filePath, body.branch);
                          }
                          body.message = this.getNodeParameter('commitMessage', i);
                          if (this.getNodeParameter('binaryData', i)) {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              body.content = binaryData.data;
                          }
                          else {
                              body.content = Buffer.from(this.getNodeParameter('fileContent', i)).toString('base64');
                          }
                          endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`;
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const additionalParameters = this.getNodeParameter('additionalParameters', i, {});
                          if (additionalParameters.author) {
                              body.author = additionalParameters.author;
                          }
                          if (additionalParameters.committer) {
                              body.committer = additionalParameters.committer;
                          }
                          if (additionalParameters.branch &&
                              additionalParameters.branch.branch) {
                              body.branch = additionalParameters.branch.branch;
                          }
                          const filePath = this.getNodeParameter('filePath', i);
                          body.message = this.getNodeParameter('commitMessage', i);
                          body.sha = await GenericFunctions_1.getFileSha.call(this, owner, repository, filePath, body.branch);
                          endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const filePath = this.getNodeParameter('filePath', i);
                          const additionalParameters = this.getNodeParameter('additionalParameters', i);
                          if (additionalParameters.reference) {
                              qs.ref = additionalParameters.reference;
                          }
                          endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`;
                      }
                      else if (operation === 'list') {
                          requestMethod = 'GET';
                          const filePath = this.getNodeParameter('filePath', i);
                          endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`;
                      }
                  }
                  else if (resource === 'issue') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          body.title = this.getNodeParameter('title', i);
                          body.body = this.getNodeParameter('body', i);
                          const labels = this.getNodeParameter('labels', i);
                          const assignees = this.getNodeParameter('assignees', i);
                          body.labels = labels.map((data) => data.label);
                          body.assignees = assignees.map((data) => data.assignee);
                          endpoint = `/repos/${owner}/${repository}/issues`;
                      }
                      else if (operation === 'createComment') {
                          requestMethod = 'POST';
                          const issueNumber = this.getNodeParameter('issueNumber', i);
                          body.body = this.getNodeParameter('body', i);
                          endpoint = `/repos/${owner}/${repository}/issues/${issueNumber}/comments`;
                      }
                      else if (operation === 'edit') {
                          requestMethod = 'PATCH';
                          const issueNumber = this.getNodeParameter('issueNumber', i);
                          body = this.getNodeParameter('editFields', i, {});
                          if (body.labels !== undefined) {
                              body.labels = body.labels.map((data) => data.label);
                          }
                          if (body.assignees !== undefined) {
                              body.assignees = body.assignees.map((data) => data.assignee);
                          }
                          endpoint = `/repos/${owner}/${repository}/issues/${issueNumber}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const issueNumber = this.getNodeParameter('issueNumber', i);
                          endpoint = `/repos/${owner}/${repository}/issues/${issueNumber}`;
                      }
                      else if (operation === 'lock') {
                          requestMethod = 'PUT';
                          const issueNumber = this.getNodeParameter('issueNumber', i);
                          qs.lock_reason = this.getNodeParameter('lockReason', i);
                          endpoint = `/repos/${owner}/${repository}/issues/${issueNumber}/lock`;
                      }
                  }
                  else if (resource === 'release') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          body = this.getNodeParameter('additionalFields', i, {});
                          body.tag_name = this.getNodeParameter('releaseTag', i);
                          endpoint = `/repos/${owner}/${repository}/releases`;
                      }
                      if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const releaseId = this.getNodeParameter('release_id', i);
                          endpoint = `/repos/${owner}/${repository}/releases/${releaseId}`;
                      }
                      if (operation === 'get') {
                          requestMethod = 'GET';
                          const releaseId = this.getNodeParameter('release_id', i);
                          endpoint = `/repos/${owner}/${repository}/releases/${releaseId}`;
                      }
                      if (operation === 'getAll') {
                          requestMethod = 'GET';
                          endpoint = `/repos/${owner}/${repository}/releases`;
                          returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              qs.per_page = this.getNodeParameter('limit', 0);
                          }
                      }
                      if (operation === 'update') {
                          requestMethod = 'PATCH';
                          const releaseId = this.getNodeParameter('release_id', i);
                          body = this.getNodeParameter('additionalFields', i, {});
                          endpoint = `/repos/${owner}/${repository}/releases/${releaseId}`;
                      }
                  }
                  else if (resource === 'repository') {
                      if (operation === 'listPopularPaths') {
                          requestMethod = 'GET';
                          endpoint = `/repos/${owner}/${repository}/traffic/popular/paths`;
                      }
                      else if (operation === 'listReferrers') {
                          requestMethod = 'GET';
                          endpoint = `/repos/${owner}/${repository}/traffic/popular/referrers`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          endpoint = `/repos/${owner}/${repository}`;
                      }
                      else if (operation === 'getLicense') {
                          requestMethod = 'GET';
                          endpoint = `/repos/${owner}/${repository}/license`;
                      }
                      else if (operation === 'getIssues') {
                          requestMethod = 'GET';
                          qs = this.getNodeParameter('getRepositoryIssuesFilters', i);
                          endpoint = `/repos/${owner}/${repository}/issues`;
                          returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              qs.per_page = this.getNodeParameter('limit', 0);
                          }
                      }
                  }
                  else if (resource === 'review') {
                      if (operation === 'get') {
                          requestMethod = 'GET';
                          const reviewId = this.getNodeParameter('reviewId', i);
                          const pullRequestNumber = this.getNodeParameter('pullRequestNumber', i);
                          endpoint = `/repos/${owner}/${repository}/pulls/${pullRequestNumber}/reviews/${reviewId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', 0);
                          const pullRequestNumber = this.getNodeParameter('pullRequestNumber', i);
                          if (!returnAll) {
                              qs.per_page = this.getNodeParameter('limit', 0);
                          }
                          endpoint = `/repos/${owner}/${repository}/pulls/${pullRequestNumber}/reviews`;
                      }
                      else if (operation === 'create') {
                          requestMethod = 'POST';
                          const pullRequestNumber = this.getNodeParameter('pullRequestNumber', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                          body.event = (0, change_case_1.snakeCase)(this.getNodeParameter('event', i)).toUpperCase();
                          if (body.event === 'REQUEST_CHANGES' || body.event === 'COMMENT') {
                              body.body = this.getNodeParameter('body', i);
                          }
                          endpoint = `/repos/${owner}/${repository}/pulls/${pullRequestNumber}/reviews`;
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const pullRequestNumber = this.getNodeParameter('pullRequestNumber', i);
                          const reviewId = this.getNodeParameter('reviewId', i);
                          body.body = this.getNodeParameter('body', i);
                          endpoint = `/repos/${owner}/${repository}/pulls/${pullRequestNumber}/reviews/${reviewId}`;
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'getRepositories') {
                          requestMethod = 'GET';
                          endpoint = `/users/${owner}/repos`;
                          returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              qs.per_page = this.getNodeParameter('limit', 0);
                          }
                      }
                      else if (operation === 'invite') {
                          requestMethod = 'POST';
                          const org = this.getNodeParameter('organization', i);
                          endpoint = `/orgs/${org}/invitations`;
                          body.email = this.getNodeParameter('email', i);
                      }
                  }
                  else if (resource === 'organization') {
                      if (operation === 'getRepositories') {
                          requestMethod = 'GET';
                          endpoint = `/orgs/${owner}/repos`;
                          returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              qs.per_page = this.getNodeParameter('limit', 0);
                          }
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  const asBinaryProperty = this.getNodeParameter('asBinaryProperty', i, false);
                  if (returnAll) {
                      responseData = await GenericFunctions_1.githubApiRequestAllItems.call(this, requestMethod, endpoint, body, qs);
                  }
                  else {
                      responseData = await GenericFunctions_1.githubApiRequest.call(this, requestMethod, endpoint, body, qs);
                  }
                  if (fullOperation === 'file:get') {
                      if (asBinaryProperty) {
                          if (Array.isArray(responseData) && responseData.length > 1) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'File Path is a folder, not a file.', {
                                  itemIndex: i,
                              });
                          }
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const newItem = {
                              json: items[i].json,
                              binary: {},
                          };
                          if (items[i].binary !== undefined) {
                              Object.assign(newItem.binary, items[i].binary);
                          }
                          const { content, path } = responseData;
                          newItem.binary[binaryPropertyName] = await this.helpers.prepareBinaryData(Buffer.from(content, 'base64'), path);
                          items[i] = newItem;
                          return [items];
                      }
                  }
                  if (fullOperation === 'release:delete') {
                      responseData = { success: true };
                  }
                  if (overwriteDataOperations.includes(fullOperation) ||
                      overwriteDataOperationsArray.includes(fullOperation)) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (overwriteDataOperations.includes(fullOperation) ||
                          overwriteDataOperationsArray.includes(fullOperation)) {
                          const executionErrorData = this.helpers.constructExecutionMetaData([
                              {
                                  json: {
                                      error: error.message,
                                  },
                              },
                          ], { itemData: { item: i } });
                          returnData.push(...executionErrorData);
                      }
                      else {
                          items[i].json = { error: error.message };
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (overwriteDataOperations.includes(fullOperation) ||
              overwriteDataOperationsArray.includes(fullOperation)) {
              return [returnData];
          }
          else {
              return [items];
          }
      }
  }
  exports.Github = Github;
  //# sourceMappingURL=Github.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GithubApi = void 0;
  class GithubApi {
      constructor() {
          this.name = 'githubApi';
          this.displayName = 'GitHub API';
          this.documentationUrl = 'github';
          this.properties = [
              {
                  displayName: 'Github Server',
                  name: 'server',
                  type: 'string',
                  default: 'https://api.github.com',
                  description: 'The server to connect to. Only has to be set if Github Enterprise is used.',
              },
              {
                  displayName: 'User',
                  name: 'user',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=token {{$credentials?.accessToken}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials?.server}}',
                  url: '/user',
                  method: 'GET',
              },
          };
      }
  }
  exports.GithubApi = GithubApi;
  //# sourceMappingURL=GithubApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GithubOAuth2Api = void 0;
  class GithubOAuth2Api {
      constructor() {
          this.name = 'githubOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'GitHub OAuth2 API';
          this.documentationUrl = 'github';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Github Server',
                  name: 'server',
                  type: 'string',
                  default: 'https://api.github.com',
                  description: 'The server to connect to. Only has to be set if Github Enterprise is used.',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: '={{$self["server"] === "https://api.github.com" ? "https://github.com" : $self["server"]}}/login/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: '={{$self["server"] === "https://api.github.com" ? "https://github.com" : $self["server"]}}/login/oauth/access_token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'repo,admin:repo_hook,admin:org,admin:org_hook,gist,notifications,user,write:packages,read:packages,delete:packages,workflow',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.GithubOAuth2Api = GithubOAuth2Api;
  //# sourceMappingURL=GithubOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GithubApi = void 0;
  class GithubApi {
      constructor() {
          this.name = 'githubApi';
          this.displayName = 'GitHub API';
          this.documentationUrl = 'github';
          this.properties = [
              {
                  displayName: 'Github Server',
                  name: 'server',
                  type: 'string',
                  default: 'https://api.github.com',
                  description: 'The server to connect to. Only has to be set if Github Enterprise is used.',
              },
              {
                  displayName: 'User',
                  name: 'user',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=token {{$credentials?.accessToken}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials?.server}}',
                  url: '/user',
                  method: 'GET',
              },
          };
      }
  }
  exports.GithubApi = GithubApi;
  //# sourceMappingURL=GithubApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GithubOAuth2Api = void 0;
  class GithubOAuth2Api {
      constructor() {
          this.name = 'githubOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'GitHub OAuth2 API';
          this.documentationUrl = 'github';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Github Server',
                  name: 'server',
                  type: 'string',
                  default: 'https://api.github.com',
                  description: 'The server to connect to. Only has to be set if Github Enterprise is used.',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: '={{$self["server"] === "https://api.github.com" ? "https://github.com" : $self["server"]}}/login/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: '={{$self["server"] === "https://api.github.com" ? "https://github.com" : $self["server"]}}/login/oauth/access_token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'repo,admin:repo_hook,admin:org,admin:org_hook,gist,notifications,user,write:packages,read:packages,delete:packages,workflow',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.GithubOAuth2Api = GithubOAuth2Api;
  //# sourceMappingURL=GithubOAuth2Api.credentials.js.map

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

  # GitHub node

  Use the GitHub node to automate work in GitHub, and integrate GitHub with other applications. n8n has built-in support for a wide range of GitHub features, including creating, updating, deleting, and editing files, repositories, issues, releases, and users. 

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

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

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

  ## Operations

  * File
  	* Create
  	* Delete
  	* Edit
  	* Get
  	* List
  * Issue
  	* Create
  	* Create Comment
  	* Edit
  	* Get
  	* Lock
  * Organization
  	* Get Repositories
  * Release
  	* Create
  	* Delete
  	* Get
  	* Get Many
  	* Update
  * Repository
      * Get
  	* Get Issues
  	* Get License
  	* Get Profile
  	* Get Pull Requests
  	* List Popular Paths
  	* List Referrers
  * Review
  	* Create
  	* Get
  	* Get Many
  	* Update
  * User
      * Get Repositories
      * Invite
  * Workflow
  	* Disable
  	* Dispatch
  	* Enable
  	* Get
  	* Get Usage
  	* List

  ## Templates and examples

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

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

example_workflow:
  {"name":"GitHub Example Workflow","nodes":[{"parameters":{"authentication":"accessToken","resource":"file","operation":"create","owner":"{ mode: 'list'","repository":"{ mode: 'list'","filePath":"example-value","binaryData":false,"fileContent":"example-value","binaryPropertyName":"Example Name","commitMessage":"example-value","additionalParameters":{},"asBinaryProperty":true,"title":"example-value","body":"example-value","labels":{},"assignees":{},"issueNumber":10,"editFields":{},"lockReason":"off-topic","releaseTag":"example-value","additionalFields":{},"release_id":"example-value","returnAll":false,"limit":50,"getRepositoryIssuesFilters":{},"pullRequestNumber":10,"reviewId":"example-value","event":"approve","organization":"example-value","email":"user@example.com"},"id":"mjxq95m9slf20uyartkxmf","name":"GitHub","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"authentication":"accessToken","resource":"file","operation":"create","owner":"{ mode: 'list'","repository":"{ mode: 'list'","filePath":"example-value","binaryData":false,"fileContent":"example-value","binaryPropertyName":"Example Name","commitMessage":"example-value","additionalParameters":{},"asBinaryProperty":true,"title":"example-value","body":"example-value","labels":{},"assignees":{},"issueNumber":10,"editFields":{},"lockReason":"off-topic","releaseTag":"example-value","additionalFields":{},"release_id":"example-value","returnAll":false,"limit":50,"getRepositoryIssuesFilters":{},"pullRequestNumber":10,"reviewId":"example-value","event":"approve","organization":"example-value","email":"user@example.com"}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"accessToken","options":[{"name":"Access Token","value":"accessToken"},{"name":"OAuth2","value":"oAuth2"}]},{"displayName":"Resource","name":"resource","type":"options","default":"issue","options":[{"name":"File","value":"file"},{"name":"Issue","value":"issue"},{"name":"Organization","value":"organization"},{"name":"Release","value":"release"},{"name":"Repository","value":"repository"},{"name":"Review","value":"review"},{"name":"User","value":"user"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getRepositories","description":"Returns all repositories of an organization","options":[{"name":"Get Repositories","value":"getRepositories","description":"Returns all repositories of an organization"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a new issue","options":[{"name":"Create","value":"create","description":"Create a new issue"},{"name":"Create Comment","value":"createComment","description":"Create a new comment on an issue"},{"name":"Edit","value":"edit","description":"Edit an issue"},{"name":"Get","value":"get","description":"Get the data of a single issue"},{"name":"Lock","value":"lock","description":"Lock an issue"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Create a new file in repository","options":[{"name":"Create","value":"create","description":"Create a new file in repository"},{"name":"Delete","value":"delete","description":"Delete a file in repository"},{"name":"Edit","value":"edit","description":"Edit a file in repository"},{"name":"Get","value":"get","description":"Get the data of a single file"},{"name":"List","value":"list","description":"List contents of a folder"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getIssues","description":"Get the data of a single repository","options":[{"name":"Get","value":"get","description":"Get the data of a single repository"},{"name":"Get Issues","value":"getIssues","description":"Returns issues of a repository"},{"name":"Get License","value":"getLicense","description":"Returns the contents of the repository"},{"name":"Get Profile","value":"getProfile","description":"Get the community profile of a repository with metrics, health score, description, license, etc"},{"name":"List Popular Paths","value":"listPopularPaths","description":"Get the top 10 popular content paths over the last 14 days"},{"name":"List Referrers","value":"listReferrers","description":"Get the top 10 referrering domains over the last 14 days"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getRepositories","description":"Returns the repositories of a user","options":[{"name":"Get Repositories","value":"getRepositories","description":"Returns the repositories of a user"},{"name":"Invite","value":"invite","description":"Invites a user to an organization"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Creates a new release","options":[{"name":"Create","value":"create","description":"Creates a new release"},{"name":"Delete","value":"delete","description":"Delete a release"},{"name":"Get","value":"get","description":"Get a release"},{"name":"Get Many","value":"getAll","description":"Get many repository releases"},{"name":"Update","value":"update","description":"Update a release"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","description":"Creates a new review","options":[{"name":"Create","value":"create","description":"Creates a new review"},{"name":"Get","value":"get","description":"Get a review for a pull request"},{"name":"Get Many","value":"getAll","description":"Get many reviews for a pull request"},{"name":"Update","value":"update","description":"Update a review"}]},{"displayName":"Repository Owner","name":"owner","type":"resourceLocator","default":"{ mode: 'list'","required":true,"placeholder":"Select an owner..."},{"displayName":"Repository Name","name":"repository","type":"resourceLocator","default":"{ mode: 'list'","required":true,"placeholder":"Select an Repository..."},{"displayName":"File Path","name":"filePath","type":"string","default":"","required":true,"description":"The file path of the file. Has to contain the full path.","placeholder":"docs/README.md"},{"displayName":"Path","name":"filePath","type":"string","default":"","description":"The path of the folder to list","placeholder":"docs/"},{"displayName":"Binary Data","name":"binaryData","type":"boolean","default":false,"required":true,"description":"Whether the data to upload should be taken from binary field"},{"displayName":"File Content","name":"fileContent","type":"string","default":"","required":true,"description":"The text content of the file"},{"displayName":"Binary Property","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Name of the binary property which contains the data for the file"},{"displayName":"Commit Message","name":"commitMessage","type":"string","default":"","required":true},{"displayName":"Additional Parameters","name":"additionalParameters","type":"fixedCollection","default":"{","description":"Additional fields to add","placeholder":"Add Parameter"},{"displayName":"As Binary Property","name":"asBinaryProperty","type":"boolean","default":true,"description":"Whether to set the data of the file as binary property instead of returning the raw API response"},{"displayName":"Binary Property","name":"binaryPropertyName","type":"string","default":"data","required":true,"description":"Name of the binary property in which to save the binary data of the received file"},{"displayName":"Additional Parameters","name":"additionalParameters","type":"collection","default":"{","description":"Additional fields to add","placeholder":"Add Parameter"},{"displayName":"Title","name":"title","type":"string","default":"","required":true,"description":"The title of the issue"},{"displayName":"Body","name":"body","type":"string","default":"","description":"The body of the issue"},{"displayName":"Labels","name":"labels","type":"collection","default":"{ label: ''","description":"Label to add to issue"},{"displayName":"Assignees","name":"assignees","type":"collection","default":"{ assignee: ''","description":"User to assign issue too"},{"displayName":"Issue Number","name":"issueNumber","type":"number","default":0,"required":true,"description":"The number of the issue on which to create the comment on"},{"displayName":"Body","name":"body","type":"string","default":"","description":"The body of the comment"},{"displayName":"Issue Number","name":"issueNumber","type":"number","default":0,"required":true,"description":"The number of the issue edit"},{"displayName":"Edit Fields","name":"editFields","type":"collection","default":"{","description":"The title of the issue"},{"displayName":"Issue Number","name":"issueNumber","type":"number","default":0,"required":true,"description":"The number of the issue get data of"},{"displayName":"Issue Number","name":"issueNumber","type":"number","default":0,"required":true,"description":"The number of the issue to lock"},{"displayName":"Lock Reason","name":"lockReason","type":"options","default":"resolved","description":"The issue is Off-Topic","options":[{"name":"Off-Topic","value":"off-topic","description":"The issue is Off-Topic"},{"name":"Too Heated","value":"too heated","description":"The discussion is too heated"},{"name":"Resolved","value":"resolved","description":"The issue got resolved"},{"name":"Spam","value":"spam","description":"The issue is spam"}]},{"displayName":"Tag","name":"releaseTag","type":"string","default":"","required":true,"description":"The tag of the release"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The name of the issue"},{"displayName":"Release ID","name":"release_id","type":"string","default":"","required":true},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The body of the release"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":50,"description":"Max number of results to return"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":50,"description":"Max number of results to return"},{"displayName":"Filters","name":"getRepositoryIssuesFilters","type":"collection","default":"{","description":"Return only issues which are assigned to a specific user"},{"displayName":"PR Number","name":"pullRequestNumber","type":"number","default":0,"required":true,"description":"The number of the pull request"},{"displayName":"Review ID","name":"reviewId","type":"string","default":"","required":true,"description":"ID of the review"},{"displayName":"PR Number","name":"pullRequestNumber","type":"number","default":0,"required":true,"description":"The number of the pull request"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":50,"description":"Max number of results to return"},{"displayName":"PR Number","name":"pullRequestNumber","type":"number","default":0,"required":true,"description":"The number of the pull request to review"},{"displayName":"Event","name":"event","type":"options","default":"approve","description":"Approve the pull request","options":[{"name":"Approve","value":"approve","description":"Approve the pull request"},{"name":"Request Change","value":"requestChanges","description":"Request code changes"},{"name":"Comment","value":"comment","description":"Add a comment without approval or change requests"},{"name":"Pending","value":"pending","description":"You will need to submit the pull request review when you are ready"}]},{"displayName":"Body","name":"body","type":"string","default":"","description":"The body of the review (required for events Request Changes or Comment)"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The SHA of the commit that needs a review, if different from the latest","placeholder":"Add Field"},{"displayName":"Body","name":"body","type":"string","default":"","description":"The body of the review"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":50,"description":"Max number of results to return"},{"displayName":"Organization","name":"organization","type":"string","default":"","required":true,"description":"The GitHub organization that the user is being invited to"},{"displayName":"Email","name":"email","type":"string","default":"","required":true,"description":"The email address of the invited user","placeholder":"name@email.com"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":50,"description":"Max number of results to return"}]


node_type: n8n-nodes-base.GoToWebinar
name: GoToWebinar
display_name: GoToWebinar
description: Consume the GoToWebinar API
category: transform
icon: file:gotowebinar.svg
code_hash: 477c98f0558a9020e82b630957e1037aac792527cbe9a47e226875a9af67f884
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.GoToWebinar
documentation_title: GoToWebinar node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"gotowebinar","description":"Templates for gotowebinar"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"attendee","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:35
updated_at: 2025-06-12 08:58:35
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GoToWebinar = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  const omit_1 = __importDefault(require("lodash/omit"));
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class GoToWebinar {
      constructor() {
          this.description = {
              displayName: 'GoToWebinar',
              name: 'goToWebinar',
              icon: 'file:gotowebinar.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the GoToWebinar API',
              defaults: {
                  name: 'GoToWebinar',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'goToWebinarOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Attendee',
                              value: 'attendee',
                          },
                          {
                              name: 'Co-Organizer',
                              value: 'coorganizer',
                          },
                          {
                              name: 'Panelist',
                              value: 'panelist',
                          },
                          {
                              name: 'Registrant',
                              value: 'registrant',
                          },
                          {
                              name: 'Session',
                              value: 'session',
                          },
                          {
                              name: 'Webinar',
                              value: 'webinar',
                          },
                      ],
                      default: 'attendee',
                  },
                  ...descriptions_1.attendeeOperations,
                  ...descriptions_1.attendeeFields,
                  ...descriptions_1.coorganizerOperations,
                  ...descriptions_1.coorganizerFields,
                  ...descriptions_1.panelistOperations,
                  ...descriptions_1.panelistFields,
                  ...descriptions_1.registrantOperations,
                  ...descriptions_1.registrantFields,
                  ...descriptions_1.sessionOperations,
                  ...descriptions_1.sessionFields,
                  ...descriptions_1.webinarOperations,
                  ...descriptions_1.webinarFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getWebinars() {
                      return GenericFunctions_1.loadWebinars.call(this);
                  },
                  async getAnswers() {
                      return GenericFunctions_1.loadAnswers.call(this);
                  },
                  async getWebinarSessions() {
                      return GenericFunctions_1.loadWebinarSessions.call(this);
                  },
                  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 getRegistranSimpleQuestions() {
                      return GenericFunctions_1.loadRegistranSimpleQuestions.call(this);
                  },
                  async getRegistranMultiChoiceQuestions() {
                      return GenericFunctions_1.loadRegistranMultiChoiceQuestions.call(this);
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          const { oauthTokenData } = (await this.getCredentials('goToWebinarOAuth2Api'));
          const accountKey = oauthTokenData.account_key;
          const organizerKey = oauthTokenData.organizer_key;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'attendee') {
                      if (operation === 'get') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const sessionKey = this.getNodeParameter('sessionKey', i);
                          const registrantKey = this.getNodeParameter('registrantKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/sessions/${sessionKey}/attendees/${registrantKey}`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'GET', endpoint, {}, {});
                      }
                      else if (operation === 'getAll') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const sessionKey = this.getNodeParameter('sessionKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/sessions/${sessionKey}/attendees`;
                          responseData = await GenericFunctions_1.handleGetAll.call(this, endpoint, {}, {}, resource);
                      }
                      else if (operation === 'getDetails') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const sessionKey = this.getNodeParameter('sessionKey', i);
                          const registrantKey = this.getNodeParameter('registrantKey', i);
                          const details = this.getNodeParameter('details', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/sessions/${sessionKey}/attendees/${registrantKey}/${details}`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'GET', endpoint, {}, {});
                      }
                  }
                  else if (resource === 'coorganizer') {
                      if (operation === 'create') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const body = {
                              external: this.getNodeParameter('isExternal', i),
                          };
                          if (body.external === false) {
                              body.organizerKey = this.getNodeParameter('organizerKey', i);
                          }
                          if (body.external === true) {
                              body.givenName = this.getNodeParameter('givenName', i);
                              body.email = this.getNodeParameter('email', i);
                          }
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/coorganizers`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'POST', endpoint, {}, [body]);
                      }
                      else if (operation === 'delete') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const coorganizerKey = this.getNodeParameter('coorganizerKey', i);
                          const qs = {
                              external: this.getNodeParameter('isExternal', i),
                          };
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/coorganizers/${coorganizerKey}`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'DELETE', endpoint, qs, {});
                          responseData = { success: true };
                      }
                      else if (operation === 'getAll') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/coorganizers`;
                          responseData = await GenericFunctions_1.handleGetAll.call(this, endpoint, {}, {}, resource);
                      }
                      else if (operation === 'reinvite') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const coorganizerKey = this.getNodeParameter('coorganizerKey', i);
                          const qs = {
                              external: this.getNodeParameter('isExternal', i),
                          };
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/coorganizers/${coorganizerKey}/resendInvitation`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'POST', endpoint, qs, {});
                          responseData = { success: true };
                      }
                  }
                  else if (resource === 'panelist') {
                      if (operation === 'create') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const body = [
                              {
                                  name: this.getNodeParameter('name', i),
                                  email: this.getNodeParameter('email', i),
                              },
                          ];
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/panelists`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'POST', endpoint, {}, body);
                      }
                      else if (operation === 'delete') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const panelistKey = this.getNodeParameter('panelistKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/panelists/${panelistKey}`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'DELETE', endpoint, {}, {});
                          responseData = { success: true };
                      }
                      else if (operation === 'getAll') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/panelists`;
                          responseData = await GenericFunctions_1.handleGetAll.call(this, endpoint, {}, {}, resource);
                      }
                      else if (operation === 'reinvite') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const panelistKey = this.getNodeParameter('panelistKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/panelists/${panelistKey}/resendInvitation`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'POST', endpoint, {}, {});
                          responseData = { success: true };
                      }
                  }
                  else if (resource === 'registrant') {
                      if (operation === 'create') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const qs = {};
                          const body = {
                              firstName: this.getNodeParameter('firstName', i),
                              lastName: this.getNodeParameter('lastName', i),
                              email: this.getNodeParameter('email', i),
                              responses: [],
                          };
                          let additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.resendConfirmation) {
                              qs.resendConfirmation = additionalFields.resendConfirmation;
                              additionalFields = (0, omit_1.default)(additionalFields, ['resendConfirmation']);
                          }
                          if (additionalFields.fullAddress) {
                              Object.assign(body, additionalFields.fullAddress.details);
                              additionalFields = (0, omit_1.default)(additionalFields, ['fullAddress']);
                          }
                          if (additionalFields.simpleResponses) {
                              body.responses.push(...additionalFields.simpleResponses.details);
                              additionalFields = (0, omit_1.default)(additionalFields, ['simpleResponses']);
                          }
                          if (additionalFields.multiChoiceResponses) {
                              body.responses.push(...additionalFields.multiChoiceResponses.details);
                              additionalFields = (0, omit_1.default)(additionalFields, ['multiChoiceResponses']);
                          }
                          Object.assign(body, additionalFields);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/registrants`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'POST', endpoint, qs, body);
                      }
                      else if (operation === 'delete') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const registrantKey = this.getNodeParameter('registrantKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/registrants/${registrantKey}`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'DELETE', endpoint, {}, {});
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const registrantKey = this.getNodeParameter('registrantKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/registrants/${registrantKey}`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'GET', endpoint, {}, {});
                      }
                      else if (operation === 'getAll') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/registrants`;
                          responseData = await GenericFunctions_1.handleGetAll.call(this, endpoint, {}, {}, resource);
                      }
                  }
                  else if (resource === 'session') {
                      if (operation === 'get') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const sessionKey = this.getNodeParameter('sessionKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/sessions/${sessionKey}`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'GET', endpoint, {}, {});
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', 0);
                          }
                          const { webinarKey, times } = this.getNodeParameter('additionalFields', i);
                          if (times) {
                              qs.fromTime = (0, moment_timezone_1.default)(times.timesProperties.fromTime).format();
                              qs.toTime = (0, moment_timezone_1.default)(times.timesProperties.toTime).format();
                          }
                          else {
                              qs.fromTime = (0, moment_timezone_1.default)().subtract(1, 'years').format();
                              qs.toTime = (0, moment_timezone_1.default)().format();
                          }
                          if (webinarKey !== undefined) {
                              const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/sessions`;
                              responseData = await GenericFunctions_1.goToWebinarApiRequestAllItems.call(this, 'GET', endpoint, qs, {}, resource);
                          }
                          else {
                              const endpoint = `organizers/${organizerKey}/sessions`;
                              responseData = await GenericFunctions_1.goToWebinarApiRequestAllItems.call(this, 'GET', endpoint, qs, {}, resource);
                          }
                      }
                      else if (operation === 'getDetails') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const sessionKey = this.getNodeParameter('sessionKey', i);
                          const details = this.getNodeParameter('details', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}/sessions/${sessionKey}/${details}`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'GET', endpoint, {}, {});
                      }
                  }
                  else if (resource === 'webinar') {
                      if (operation === 'create') {
                          const timesProperties = this.getNodeParameter('times.timesProperties', i, []);
                          const body = {
                              subject: this.getNodeParameter('subject', i),
                              times: timesProperties,
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                          const endpoint = `organizers/${organizerKey}/webinars`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'POST', endpoint, {}, body);
                      }
                      else if (operation === 'delete') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const { sendCancellationEmails } = this.getNodeParameter('additionalFields', i);
                          const qs = {};
                          if (sendCancellationEmails) {
                              qs.sendCancellationEmails = sendCancellationEmails;
                          }
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}`;
                          await GenericFunctions_1.goToWebinarApiRequest.call(this, 'DELETE', endpoint, qs, {});
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequest.call(this, 'GET', endpoint, {}, {});
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', 0);
                          }
                          const { times } = this.getNodeParameter('additionalFields', i);
                          if (times) {
                              qs.fromTime = (0, moment_timezone_1.default)(times.timesProperties.fromTime).format();
                              qs.toTime = (0, moment_timezone_1.default)(times.timesProperties.toTime).format();
                          }
                          else {
                              qs.fromTime = (0, moment_timezone_1.default)().subtract(1, 'years').format();
                              qs.toTime = (0, moment_timezone_1.default)().format();
                          }
                          const endpoint = `accounts/${accountKey}/webinars`;
                          responseData = await GenericFunctions_1.goToWebinarApiRequestAllItems.call(this, 'GET', endpoint, qs, {}, resource);
                      }
                      else if (operation === 'update') {
                          const webinarKey = this.getNodeParameter('webinarKey', i);
                          const qs = {
                              notifyParticipants: this.getNodeParameter('notifyParticipants', i),
                          };
                          let body = {};
                          let updateFields = this.getNodeParameter('updateFields', i);
                          if (updateFields.times) {
                              const { times } = updateFields;
                              body = {
                                  times: times.timesProperties,
                              };
                              updateFields = (0, omit_1.default)(updateFields, ['times']);
                          }
                          Object.assign(body, updateFields);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          const endpoint = `organizers/${organizerKey}/webinars/${webinarKey}`;
                          await GenericFunctions_1.goToWebinarApiRequest.call(this, 'PUT', endpoint, qs, body);
                          responseData = { success: true };
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.GoToWebinar = GoToWebinar;
  //# sourceMappingURL=GoToWebinar.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GoToWebinarOAuth2Api = void 0;
  class GoToWebinarOAuth2Api {
      constructor() {
          this.name = 'goToWebinarOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'GoToWebinar OAuth2 API';
          this.documentationUrl = 'goToWebinar';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://api.getgo.com/oauth/v2/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.getgo.com/oauth/v2/token',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.GoToWebinarOAuth2Api = GoToWebinarOAuth2Api;
  //# sourceMappingURL=GoToWebinarOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GoToWebinarOAuth2Api = void 0;
  class GoToWebinarOAuth2Api {
      constructor() {
          this.name = 'goToWebinarOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'GoToWebinar OAuth2 API';
          this.documentationUrl = 'goToWebinar';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://api.getgo.com/oauth/v2/authorize',
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://api.getgo.com/oauth/v2/token',
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.GoToWebinarOAuth2Api = GoToWebinarOAuth2Api;
  //# sourceMappingURL=GoToWebinarOAuth2Api.credentials.js.map

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

  # GoToWebinar node

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

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

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

  ## Operations

  * Attendee
      * Get
      * Get All
      * Get Details
  * Co-Organizer
      * Create
      * Delete
      * Get All
      * Re-invite
  * Panelist
      * Create
      * Delete
      * Get All
      * Re-invite
  * Registrant
      * Create
      * Delete
      * Get
      * Get All
  * Session
      * Get
      * Get All
      * Get Details
  * Webinar
      * Create
      * Get
      * Get All
      * Update

  ## Templates and examples

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

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"attendee","options":[{"name":"Attendee","value":"attendee"},{"name":"Co-Organizer","value":"coorganizer"},{"name":"Panelist","value":"panelist"},{"name":"Registrant","value":"registrant"},{"name":"Session","value":"session"},{"name":"Webinar","value":"webinar"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.attendeeOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.attendeeFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.coorganizerOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.coorganizerFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.panelistOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.panelistFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.registrantOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.registrantFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.sessionOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.sessionFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.webinarOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.webinarFields"}]


node_type: n8n-nodes-base.GSuiteAdmin
name: GSuiteAdmin
display_name: Google Workspace Admin
description: Consume Google Workspace Admin API
category: input
icon: file:google-workspace-admin.png
code_hash: f071a02014ea9f596115099ea9f2240ac048a4dd7802ef3d9e499d28cbfc2d21
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.GSuiteAdmin
documentation_title: Google Workspace Admin node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"google-workspace-admin","description":"Templates for google-workspace-admin"}]
related_resources: []
required_scopes: []
parameter_schemas: []
example_parameters: {"resource":"group","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:39
updated_at: 2025-06-12 08:58:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GSuiteAdmin = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const UserDescription_1 = require("./UserDescription");
  const GroupDescripion_1 = require("./GroupDescripion");
  class GSuiteAdmin {
      constructor() {
          this.description = {
              displayName: 'Google Workspace Admin',
              name: 'gSuiteAdmin',
              icon: 'file:google-workspace-admin.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Google Workspace Admin API',
              defaults: {
                  name: 'Google Workspace Admin',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'gSuiteAdminOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Group',
                              value: 'group',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'user',
                  },
                  ...GroupDescripion_1.groupOperations,
                  ...GroupDescripion_1.groupFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getDomains() {
                      const returnData = [];
                      const domains = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'domains', 'GET', '/directory/v1/customer/my_customer/domains');
                      for (const domain of domains) {
                          const domainName = domain.domainName;
                          const domainId = domain.domainName;
                          returnData.push({
                              name: domainName,
                              value: domainId,
                          });
                      }
                      return returnData;
                  },
                  async getSchemas() {
                      const returnData = [];
                      const schemas = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'schemas', 'GET', '/directory/v1/customer/my_customer/schemas');
                      for (const schema of schemas) {
                          const schemaName = schema.displayName;
                          const schemaId = schema.schemaName;
                          returnData.push({
                              name: schemaName,
                              value: schemaId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              if (resource === 'group') {
                  if (operation === 'create') {
                      const email = this.getNodeParameter('email', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          email,
                      };
                      Object.assign(body, additionalFields);
                      responseData = await GenericFunctions_1.googleApiRequest.call(this, 'POST', '/directory/v1/groups', body);
                  }
                  if (operation === 'delete') {
                      const groupId = this.getNodeParameter('groupId', i);
                      responseData = await GenericFunctions_1.googleApiRequest.call(this, 'DELETE', `/directory/v1/groups/${groupId}`, {});
                      responseData = { success: true };
                  }
                  if (operation === 'get') {
                      const groupId = this.getNodeParameter('groupId', i);
                      responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', `/directory/v1/groups/${groupId}`, {});
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      Object.assign(qs, options);
                      if (qs.customer === undefined) {
                          qs.customer = 'my_customer';
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'groups', 'GET', '/directory/v1/groups', {}, qs);
                      }
                      else {
                          qs.maxResults = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/directory/v1/groups', {}, qs);
                          responseData = responseData.groups;
                      }
                  }
                  if (operation === 'update') {
                      const groupId = this.getNodeParameter('groupId', i);
                      const updateFields = this.getNodeParameter('updateFields', i);
                      const body = {};
                      Object.assign(body, updateFields);
                      responseData = await GenericFunctions_1.googleApiRequest.call(this, 'PUT', `/directory/v1/groups/${groupId}`, body);
                  }
              }
              if (resource === 'user') {
                  if (operation === 'create') {
                      const domain = this.getNodeParameter('domain', i);
                      const firstName = this.getNodeParameter('firstName', i);
                      const lastName = this.getNodeParameter('lastName', i);
                      const password = this.getNodeParameter('password', i);
                      const username = this.getNodeParameter('username', i);
                      const makeAdmin = this.getNodeParameter('makeAdmin', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          name: {
                              familyName: lastName,
                              givenName: firstName,
                          },
                          password,
                          primaryEmail: `${username}@${domain}`,
                      };
                      Object.assign(body, additionalFields);
                      if (additionalFields.phoneUi) {
                          const phones = additionalFields.phoneUi.phoneValues;
                          body.phones = phones;
                          delete body.phoneUi;
                      }
                      if (additionalFields.emailUi) {
                          const emails = additionalFields.emailUi.emailValues;
                          body.emails = emails;
                          delete body.emailUi;
                      }
                      responseData = await GenericFunctions_1.googleApiRequest.call(this, 'POST', '/directory/v1/users', body, qs);
                      if (makeAdmin) {
                          await GenericFunctions_1.googleApiRequest.call(this, 'POST', `/directory/v1/users/${responseData.id}/makeAdmin`, { status: true });
                          responseData.isAdmin = true;
                      }
                  }
                  if (operation === 'delete') {
                      const userId = this.getNodeParameter('userId', i);
                      responseData = await GenericFunctions_1.googleApiRequest.call(this, 'DELETE', `/directory/v1/users/${userId}`, {});
                      responseData = { success: true };
                  }
                  if (operation === 'get') {
                      const userId = this.getNodeParameter('userId', i);
                      const projection = this.getNodeParameter('projection', i);
                      const options = this.getNodeParameter('options', i);
                      qs.projection = projection;
                      Object.assign(qs, options);
                      if (qs.customFieldMask) {
                          qs.customFieldMask = qs.customFieldMask.join(' ');
                      }
                      if (qs.projection === 'custom' && qs.customFieldMask === undefined) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'When projection is set to custom, the custom schemas field must be defined', { itemIndex: i });
                      }
                      responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', `/directory/v1/users/${userId}`, {}, qs);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const projection = this.getNodeParameter('projection', i);
                      const options = this.getNodeParameter('options', i);
                      qs.projection = projection;
                      Object.assign(qs, options);
                      if (qs.customer === undefined) {
                          qs.customer = 'my_customer';
                      }
                      if (qs.customFieldMask) {
                          qs.customFieldMask = qs.customFieldMask.join(' ');
                      }
                      if (qs.projection === 'custom' && qs.customFieldMask === undefined) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'When projection is set to custom, the custom schemas field must be defined', { itemIndex: i });
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'users', 'GET', '/directory/v1/users', {}, qs);
                      }
                      else {
                          qs.maxResults = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/directory/v1/users', {}, qs);
                          responseData = responseData.users;
                      }
                  }
                  if (operation === 'update') {
                      const userId = this.getNodeParameter('userId', i);
                      const updateFields = this.getNodeParameter('updateFields', i);
                      const body = { name: {} };
                      Object.assign(body, updateFields);
                      if (updateFields.firstName) {
                          body.name.givenName = updateFields.firstName;
                          delete body.firstName;
                      }
                      if (updateFields.lastName) {
                          body.name.familyName = updateFields.lastName;
                          delete body.lastName;
                      }
                      if (Object.keys(body.name).length === 0) {
                          delete body.name;
                      }
                      if (updateFields.phoneUi) {
                          const phones = updateFields.phoneUi.phoneValues;
                          body.phones = phones;
                          delete body.phoneUi;
                      }
                      if (updateFields.emailUi) {
                          const emails = updateFields.emailUi.emailValues;
                          body.emails = emails;
                          delete body.emailUi;
                      }
                      responseData = await GenericFunctions_1.googleApiRequest.call(this, 'PUT', `/directory/v1/users/${userId}`, body, qs);
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.GSuiteAdmin = GSuiteAdmin;
  //# sourceMappingURL=GSuiteAdmin.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GSuiteAdminOAuth2Api = void 0;
  const scopes = [
      'https://www.googleapis.com/auth/admin.directory.group',
      'https://www.googleapis.com/auth/admin.directory.user',
      'https://www.googleapis.com/auth/admin.directory.domain.readonly',
      'https://www.googleapis.com/auth/admin.directory.userschema.readonly',
  ];
  class GSuiteAdminOAuth2Api {
      constructor() {
          this.name = 'gSuiteAdminOAuth2Api';
          this.extends = ['googleOAuth2Api'];
          this.displayName = 'Google Workspace Admin OAuth2 API';
          this.documentationUrl = 'google';
          this.properties = [
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: scopes.join(' '),
              },
          ];
      }
  }
  exports.GSuiteAdminOAuth2Api = GSuiteAdminOAuth2Api;
  //# sourceMappingURL=GSuiteAdminOAuth2Api.credentials.js.map

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

  # Google Workspace Admin node

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

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

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

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

  ## Operations

  * Group
      * Create a group
      * Delete a group
      * Get a group
      * Get all groups
      * Update a group
  * User
      * Create a user
      * Delete a user
      * Get a user
      * Get all users
      * Update a user

  ## Templates and examples

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

  ## How to project a user's information

  There are three different ways to project a user's information:

  - **Basic**: Doesn't include any custom fields.
  - **Custom**: Includes the custom fields from schemas in `customField`.
  - **Full**: Include all the fields associated with the user.

  To include custom fields, follow these steps:

  1. Select **Custom** from the **Projection** dropdown list.
  2. Select the **Add Options** button and select **Custom Schemas** from the dropdown list.
  3. Select the schema names you want to include from the **Custom Schemas** dropdown list.

troubleshooting_info:
  [{"issue":"How to project a user's information","solution":"There are three different ways to project a user's information:"}]

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"user","options":[{"name":"Group","value":"group"},{"name":"User","value":"user"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...GroupDescripion_1.groupOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...GroupDescripion_1.groupFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserDescription_1.userOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...UserDescription_1.userFields"}]


node_type: n8n-nodes-base.Gmail
name: Gmail
display_name: Gmail
description: Consume the Gmail API
category: transform
icon: file:gmail.svg
code_hash: 778830fab42a07b1a235be83dedadc666da237bc40fda6257ed59e3c102fdbbe
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-12 08:58:39
updated_at: 2025-06-12 08:58:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Gmail = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GmailV1_node_1 = require("./v1/GmailV1.node");
  const GmailV2_node_1 = require("./v2/GmailV2.node");
  class Gmail extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Gmail',
              name: 'gmail',
              icon: 'file:gmail.svg',
              group: ['transform'],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Gmail API',
              defaultVersion: 2.1,
          };
          const nodeVersions = {
              1: new GmailV1_node_1.GmailV1(baseDescription),
              2: new GmailV2_node_1.GmailV2(baseDescription),
              2.1: new GmailV2_node_1.GmailV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Gmail = Gmail;
  //# sourceMappingURL=Gmail.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GmailOAuth2Api = void 0;
  const scopes = [
      'https://www.googleapis.com/auth/gmail.labels',
      'https://www.googleapis.com/auth/gmail.addons.current.action.compose',
      'https://www.googleapis.com/auth/gmail.addons.current.message.action',
      'https://mail.google.com/',
      'https://www.googleapis.com/auth/gmail.modify',
      'https://www.googleapis.com/auth/gmail.compose',
  ];
  class GmailOAuth2Api {
      constructor() {
          this.name = 'gmailOAuth2';
          this.extends = ['googleOAuth2Api'];
          this.displayName = 'Gmail OAuth2 API';
          this.documentationUrl = 'google/oauth-single-service';
          this.properties = [
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: scopes.join(' '),
              },
          ];
      }
  }
  exports.GmailOAuth2Api = GmailOAuth2Api;
  //# sourceMappingURL=GmailOAuth2Api.credentials.js.map

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


node_type: n8n-nodes-base.Gotify
name: Gotify
display_name: Gotify
description: Consume Gotify API
category: input
icon: file:gotify.png
code_hash: a3f8bbf0c942d4fce2b47cb39956d8f3ac03218d4307e9f794f4ef07f72bbb76
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Gotify
documentation_title: Gotify node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"gotify","description":"Templates for gotify"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:41
updated_at: 2025-06-12 08:58:41
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Gotify = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Gotify {
      constructor() {
          this.description = {
              displayName: 'Gotify',
              name: 'gotify',
              icon: 'file:gotify.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Gotify API',
              defaults: {
                  name: 'Gotify',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'gotifyApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Message',
                              value: 'message',
                          },
                      ],
                      default: 'message',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              action: 'Create a message',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              action: 'Delete a message',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              action: 'Get many messages',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['create'],
                          },
                      },
                      default: '',
                      description: 'The message. Markdown (excluding html) is allowed.',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['create'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Priority',
                              name: 'priority',
                              type: 'number',
                              default: 1,
                              description: 'The priority of the message',
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'The title of the message',
                          },
                      ],
                  },
                  {
                      displayName: 'Message ID',
                      name: 'messageId',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['delete'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      description: 'Max number of results to return',
                      default: 20,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                  },
              ],
          };
      }
      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 === 'message') {
                      if (operation === 'create') {
                          const message = this.getNodeParameter('message', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              message,
                          };
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.gotifyApiRequest.call(this, 'POST', '/message', body);
                      }
                      if (operation === 'delete') {
                          const messageId = this.getNodeParameter('messageId', i);
                          responseData = await GenericFunctions_1.gotifyApiRequest.call(this, 'DELETE', `/message/${messageId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.gotifyApiRequestAllItems.call(this, 'messages', 'GET', '/message', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.gotifyApiRequest.call(this, 'GET', '/message', {}, qs);
                              responseData = responseData.messages;
                          }
                      }
                  }
                  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.Gotify = Gotify;
  //# sourceMappingURL=Gotify.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GotifyApi = void 0;
  class GotifyApi {
      constructor() {
          this.name = 'gotifyApi';
          this.displayName = 'Gotify API';
          this.documentationUrl = 'gotify';
          this.properties = [
              {
                  displayName: 'App API Token',
                  name: 'appApiToken',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
                  description: '(Optional) Needed for message creation',
              },
              {
                  displayName: 'Client API Token',
                  name: 'clientApiToken',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
                  description: '(Optional) Needed for everything (delete, getAll) but message creation',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  description: 'The URL of the Gotify host',
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'ignoreSSLIssues',
                  type: 'boolean',
                  default: false,
                  description: 'Whether to connect even if SSL certificate validation is not possible',
              },
          ];
      }
  }
  exports.GotifyApi = GotifyApi;
  //# sourceMappingURL=GotifyApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GotifyApi = void 0;
  class GotifyApi {
      constructor() {
          this.name = 'gotifyApi';
          this.displayName = 'Gotify API';
          this.documentationUrl = 'gotify';
          this.properties = [
              {
                  displayName: 'App API Token',
                  name: 'appApiToken',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
                  description: '(Optional) Needed for message creation',
              },
              {
                  displayName: 'Client API Token',
                  name: 'clientApiToken',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
                  description: '(Optional) Needed for everything (delete, getAll) but message creation',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  description: 'The URL of the Gotify host',
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'ignoreSSLIssues',
                  type: 'boolean',
                  default: false,
                  description: 'Whether to connect even if SSL certificate validation is not possible',
              },
          ];
      }
  }
  exports.GotifyApi = GotifyApi;
  //# sourceMappingURL=GotifyApi.credentials.js.map

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

  # Gotify node

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

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

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

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

  ## Operations

  * Message
      * Create
      * Delete
      * Get All

  ## Templates and examples

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

example_workflow:
  {"name":"Gotify Example Workflow","nodes":[{"parameters":{"resource":"message","operation":"create","message":"example-value","additionalFields":{},"messageId":"example-value","returnAll":false,"limit":20},"id":"fcxpbdoptophnlmb9v6ii","name":"Gotify","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"resource":"message","operation":"create","message":"example-value","additionalFields":{},"messageId":"example-value","returnAll":false,"limit":20}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"message","options":[{"name":"Message","value":"message"}]},{"displayName":"Operation","name":"operation","type":"options","default":"create","options":[{"name":"Create","value":"create"},{"name":"Delete","value":"delete"},{"name":"Get Many","value":"getAll"}]},{"displayName":"Message","name":"message","type":"string","default":"","required":true,"description":"The message. Markdown (excluding html) is allowed."},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The priority of the message","placeholder":"Add Field"},{"displayName":"Message ID","name":"messageId","type":"string","default":"","required":true},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":20,"description":"Max number of results to return"}]


node_type: n8n-nodes-base.Grafana
name: Grafana
display_name: Grafana
description: Consume the Grafana API
category: transform
icon: file:grafana.svg
code_hash: 95682e6de4432f32165ece9a16ca1a7af19369715ee5993df156d8c95acbe80f
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Grafana
documentation_title: Grafana node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"grafana","description":"Templates for grafana"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"dashboard","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:41
updated_at: 2025-06-12 08:58:41
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Grafana = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Grafana {
      constructor() {
          this.description = {
              displayName: 'Grafana',
              name: 'grafana',
              icon: 'file:grafana.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Grafana API',
              defaults: {
                  name: 'Grafana',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'grafanaApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'options',
                      options: [
                          {
                              name: 'Dashboard',
                              value: 'dashboard',
                          },
                          {
                              name: 'Team',
                              value: 'team',
                          },
                          {
                              name: 'Team Member',
                              value: 'teamMember',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'dashboard',
                  },
                  ...descriptions_1.dashboardOperations,
                  ...descriptions_1.dashboardFields,
                  ...descriptions_1.teamOperations,
                  ...descriptions_1.teamFields,
                  ...descriptions_1.teamMemberOperations,
                  ...descriptions_1.teamMemberFields,
                  ...descriptions_1.userOperations,
                  ...descriptions_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getDashboards() {
                      const dashboards = (await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', '/search', {}, { qs: 'dash-db' }));
                      return dashboards.map(({ id, title }) => ({ value: id, name: title }));
                  },
                  async getFolders() {
                      const folders = (await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', '/folders'));
                      return folders.map(({ id, title }) => ({ value: id, name: title }));
                  },
                  async getTeams() {
                      const res = (await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', '/teams/search'));
                      return res.teams.map(({ id, name }) => ({ value: id, name }));
                  },
                  async getUsers() {
                      const users = (await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', '/org/users'));
                      return users.map(({ userId, email }) => ({ value: userId, name: email }));
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'dashboard') {
                      if (operation === 'create') {
                          const body = {
                              dashboard: {
                                  id: null,
                                  title: this.getNodeParameter('title', i),
                              },
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              if (additionalFields.folderId === '')
                                  delete additionalFields.folderId;
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'POST', '/dashboards/db', body);
                      }
                      else if (operation === 'delete') {
                          const uidOrUrl = this.getNodeParameter('dashboardUidOrUrl', i);
                          const uid = GenericFunctions_1.deriveUid.call(this, uidOrUrl);
                          const endpoint = `/dashboards/uid/${uid}`;
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const uidOrUrl = this.getNodeParameter('dashboardUidOrUrl', i);
                          const uid = GenericFunctions_1.deriveUid.call(this, uidOrUrl);
                          const endpoint = `/dashboards/uid/${uid}`;
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const qs = {
                              type: 'dash-db',
                          };
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              Object.assign(qs, { limit });
                          }
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', '/search', {}, qs);
                      }
                      else if (operation === 'update') {
                          const uidOrUrl = this.getNodeParameter('dashboardUidOrUrl', i);
                          const uid = GenericFunctions_1.deriveUid.call(this, uidOrUrl);
                          await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', `/dashboards/uid/${uid}`);
                          const body = {
                              overwrite: true,
                              dashboard: { uid },
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          const { title, ...rest } = updateFields;
                          if (!title) {
                              const { dashboard } = await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', `/dashboards/uid/${uid}`);
                              body.dashboard.title = dashboard.title;
                          }
                          else {
                              const dashboards = (await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', '/search'));
                              const titles = dashboards.map(({ title: entry }) => entry);
                              if (titles.includes(title)) {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
                                      message: 'A dashboard with the same name already exists in the selected folder',
                                  });
                              }
                              body.dashboard.title = title;
                          }
                          if (title) {
                              body.dashboard.title = title;
                          }
                          if (Object.keys(rest).length) {
                              if (rest.folderId === '')
                                  delete rest.folderId;
                              Object.assign(body, rest);
                          }
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'POST', '/dashboards/db', body);
                      }
                  }
                  else if (resource === 'team') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'POST', '/teams', body);
                      }
                      else if (operation === 'delete') {
                          const teamId = this.getNodeParameter('teamId', i);
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'DELETE', `/teams/${teamId}`);
                      }
                      else if (operation === 'get') {
                          const teamId = this.getNodeParameter('teamId', i);
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', `/teams/${teamId}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', '/teams/search', {}, qs);
                          responseData = responseData.teams;
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      else if (operation === 'update') {
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          const body = {};
                          const teamId = this.getNodeParameter('teamId', i);
                          await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', `/teams/${teamId}`);
                          if (!updateFields.email) {
                              const { email } = await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', `/teams/${teamId}`);
                              body.email = email;
                          }
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'PUT', `/teams/${teamId}`, body);
                      }
                  }
                  else if (resource === 'teamMember') {
                      if (operation === 'add') {
                          const userId = this.getNodeParameter('userId', i);
                          const body = {
                              userId: parseInt(userId, 10),
                          };
                          const teamId = this.getNodeParameter('teamId', i);
                          const endpoint = `/teams/${teamId}/members`;
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'POST', endpoint, body);
                      }
                      else if (operation === 'remove') {
                          const teamId = this.getNodeParameter('teamId', i);
                          const memberId = this.getNodeParameter('memberId', i);
                          const endpoint = `/teams/${teamId}/members/${memberId}`;
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const teamId = this.getNodeParameter('teamId', i);
                          await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', `/teams/${teamId}`);
                          const endpoint = `/teams/${teamId}/members`;
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', endpoint);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'create') {
                          const body = {
                              role: this.getNodeParameter('role', i),
                              loginOrEmail: this.getNodeParameter('loginOrEmail', i),
                          };
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'POST', '/org/users', body);
                      }
                      else if (operation === 'delete') {
                          const userId = this.getNodeParameter('userId', i);
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'DELETE', `/org/users/${userId}`);
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'GET', '/org/users');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          const userId = this.getNodeParameter('userId', i);
                          responseData = await GenericFunctions_1.grafanaApiRequest.call(this, 'PATCH', `/org/users/${userId}`, body);
                      }
                  }
                  Array.isArray(responseData)
                      ? returnData.push(...responseData)
                      : returnData.push(responseData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Grafana = Grafana;
  //# sourceMappingURL=Grafana.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GrafanaApi = void 0;
  class GrafanaApi {
      constructor() {
          this.name = 'grafanaApi';
          this.displayName = 'Grafana API';
          this.documentationUrl = 'grafana';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  required: true,
              },
              {
                  displayName: 'Base URL',
                  name: 'baseUrl',
                  type: 'string',
                  default: '',
                  description: 'Base URL of your Grafana instance',
                  placeholder: 'e.g. https://n8n.grafana.net/',
                  required: true,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.baseUrl.replace(new RegExp("/$"), "") + "/api" }}',
                  url: '/folders',
              },
          };
      }
  }
  exports.GrafanaApi = GrafanaApi;
  //# sourceMappingURL=GrafanaApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GrafanaApi = void 0;
  class GrafanaApi {
      constructor() {
          this.name = 'grafanaApi';
          this.displayName = 'Grafana API';
          this.documentationUrl = 'grafana';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  required: true,
              },
              {
                  displayName: 'Base URL',
                  name: 'baseUrl',
                  type: 'string',
                  default: '',
                  description: 'Base URL of your Grafana instance',
                  placeholder: 'e.g. https://n8n.grafana.net/',
                  required: true,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.apiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.baseUrl.replace(new RegExp("/$"), "") + "/api" }}',
                  url: '/folders',
              },
          };
      }
  }
  exports.GrafanaApi = GrafanaApi;
  //# sourceMappingURL=GrafanaApi.credentials.js.map

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

  # Grafana node

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

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

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

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

  ## Operations

  * Dashboard
      * Create a dashboard
      * Delete a dashboard
      * Get a dashboard
      * Get all dashboards
      * Update a dashboard
  * Team
      * Create a team
      * Delete a team
      * Get a team
      * Retrieve all teams
      * Update a team
  * Team Member
      * Add a member to a team
      * Retrieve all team members
      * Remove a member from a team
  * User
      * Delete a user from the current organization
      * Retrieve all users in the current organization
      * Update a user in the current organization

  ## Templates and examples

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

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"dashboard","options":[{"name":"Dashboard","value":"dashboard"},{"name":"Team","value":"team"},{"name":"Team Member","value":"teamMember"},{"name":"User","value":"user"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.dashboardOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.dashboardFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.teamOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.teamFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.teamMemberOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.teamMemberFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.userOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...descriptions_1.userFields"}]


node_type: n8n-nodes-base.YouTube
name: YouTube
display_name: YouTube
description: Consume YouTube API
category: input
icon: file:youTube.png
code_hash: f834b8bd47ceff5c44239f11db43a05b8839404dd4001472a33e5aad9cb7e619
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.YouTube
documentation_title: YouTube node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"youtube","description":"Templates for youtube"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
example_parameters: {"resource":"channel","dynamic_property":null}
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:41
updated_at: 2025-06-12 08:58:41
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.YouTube = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const ChannelDescription_1 = require("./ChannelDescription");
  const PlaylistDescription_1 = require("./PlaylistDescription");
  const PlaylistItemDescription_1 = require("./PlaylistItemDescription");
  const VideoDescription_1 = require("./VideoDescription");
  const VideoCategoryDescription_1 = require("./VideoCategoryDescription");
  const CountryCodes_1 = require("./CountryCodes");
  const UPLOAD_CHUNK_SIZE = 1024 * 1024;
  class YouTube {
      constructor() {
          this.description = {
              displayName: 'YouTube',
              name: 'youTube',
              icon: 'file:youTube.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume YouTube API',
              defaults: {
                  name: 'YouTube',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'youTubeOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Channel',
                              value: 'channel',
                          },
                          {
                              name: 'Playlist',
                              value: 'playlist',
                          },
                          {
                              name: 'Playlist Item',
                              value: 'playlistItem',
                          },
                          {
                              name: 'Video',
                              value: 'video',
                          },
                          {
                              name: 'Video Category',
                              value: 'videoCategory',
                          },
                      ],
                      default: 'channel',
                  },
                  ...ChannelDescription_1.channelOperations,
                  ...ChannelDescription_1.channelFields,
                  ...PlaylistDescription_1.playlistOperations,
                  ...PlaylistDescription_1.playlistFields,
                  ...PlaylistItemDescription_1.playlistItemOperations,
                  ...PlaylistItemDescription_1.playlistItemFields,
                  ...VideoDescription_1.videoOperations,
                  ...VideoDescription_1.videoFields,
                  ...VideoCategoryDescription_1.videoCategoryOperations,
                  ...VideoCategoryDescription_1.videoCategoryFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLanguages() {
                      const returnData = [];
                      const languages = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'items', 'GET', '/youtube/v3/i18nLanguages');
                      for (const language of languages) {
                          const languageName = language.id.toUpperCase();
                          const languageId = language.id;
                          returnData.push({
                              name: languageName,
                              value: languageId,
                          });
                      }
                      return returnData;
                  },
                  async getCountriesCodes() {
                      const returnData = [];
                      for (const countryCode of CountryCodes_1.countriesCodes) {
                          const countryCodeName = `${countryCode.name} - ${countryCode.alpha2}`;
                          const countryCodeId = countryCode.alpha2;
                          returnData.push({
                              name: countryCodeName,
                              value: countryCodeId,
                          });
                      }
                      return returnData;
                  },
                  async getVideoCategories() {
                      const countryCode = this.getCurrentNodeParameter('regionCode');
                      const returnData = [];
                      const qs = {};
                      qs.regionCode = countryCode;
                      qs.part = 'snippet';
                      const categories = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'items', 'GET', '/youtube/v3/videoCategories', {}, qs);
                      for (const category of categories) {
                          const categoryName = category.snippet.title;
                          const categoryId = category.id;
                          returnData.push({
                              name: categoryName,
                              value: categoryId,
                          });
                      }
                      return returnData;
                  },
                  async getPlaylists() {
                      const returnData = [];
                      const qs = {};
                      qs.part = 'snippet';
                      qs.mine = true;
                      const playlists = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'items', 'GET', '/youtube/v3/playlists', {}, qs);
                      for (const playlist of playlists) {
                          const playlistName = playlist.snippet.title;
                          const playlistId = playlist.id;
                          returnData.push({
                              name: playlistName,
                              value: playlistId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a, _b, _c, _d;
          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 === 'channel') {
                      if (operation === 'get') {
                          let part = this.getNodeParameter('part', i);
                          const channelId = this.getNodeParameter('channelId', i);
                          if (part.includes('*')) {
                              part = [
                                  'brandingSettings',
                                  'contentDetails',
                                  'contentOwnerDetails',
                                  'id',
                                  'localizations',
                                  'snippet',
                                  'statistics',
                                  'status',
                                  'topicDetails',
                              ];
                          }
                          qs.part = part.join(',');
                          qs.id = channelId;
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/youtube/v3/channels', {}, qs);
                          responseData = responseData.items;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          let part = this.getNodeParameter('part', i);
                          const options = this.getNodeParameter('options', i);
                          const filters = this.getNodeParameter('filters', i);
                          if (part.includes('*')) {
                              part = [
                                  'brandingSettings',
                                  'contentDetails',
                                  'contentOwnerDetails',
                                  'id',
                                  'localizations',
                                  'snippet',
                                  'statistics',
                                  'status',
                                  'topicDetails',
                              ];
                          }
                          qs.part = part.join(',');
                          Object.assign(qs, options, filters);
                          qs.mine = true;
                          if (qs.categoryId || qs.forUsername || qs.id || qs.managedByMe) {
                              delete qs.mine;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'items', 'GET', '/youtube/v3/channels', {}, qs);
                          }
                          else {
                              qs.maxResults = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/youtube/v3/channels', {}, qs);
                              responseData = responseData.items;
                          }
                      }
                      if (operation === 'update') {
                          const channelId = this.getNodeParameter('channelId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              id: channelId,
                              brandingSettings: {
                                  channel: {},
                                  image: {},
                              },
                          };
                          qs.part = 'brandingSettings';
                          if (updateFields.onBehalfOfContentOwner) {
                              qs.onBehalfOfContentOwner = updateFields.onBehalfOfContentOwner;
                          }
                          if (updateFields.brandingSettingsUi) {
                              const channelSettingsValues = updateFields.brandingSettingsUi
                                  .channelSettingsValues;
                              const channelSettings = {};
                              if (channelSettingsValues === null || channelSettingsValues === void 0 ? void 0 : channelSettingsValues.channel) {
                                  const channelSettingsOptions = channelSettingsValues.channel;
                                  if (channelSettingsOptions.country) {
                                      channelSettings.country = channelSettingsOptions.country;
                                  }
                                  if (channelSettingsOptions.description) {
                                      channelSettings.description = channelSettingsOptions.description;
                                  }
                                  if (channelSettingsOptions.defaultLanguage) {
                                      channelSettings.defaultLanguage = channelSettingsOptions.defaultLanguage;
                                  }
                                  if (channelSettingsOptions.defaultTab) {
                                      channelSettings.defaultTab = channelSettingsOptions.defaultTab;
                                  }
                                  if (channelSettingsOptions.featuredChannelsTitle) {
                                      channelSettings.featuredChannelsTitle =
                                          channelSettingsOptions.featuredChannelsTitle;
                                  }
                                  if (channelSettingsOptions.featuredChannelsUrls) {
                                      channelSettings.featuredChannelsUrls =
                                          channelSettingsOptions.featuredChannelsUrls;
                                  }
                                  if (channelSettingsOptions.keywords) {
                                      channelSettings.keywords = channelSettingsOptions.keywords;
                                  }
                                  if (channelSettingsOptions.moderateComments) {
                                      channelSettings.moderateComments =
                                          channelSettingsOptions.moderateComments;
                                  }
                                  if (channelSettingsOptions.profileColor) {
                                      channelSettings.profileColor = channelSettingsOptions.profileColor;
                                  }
                                  if (channelSettingsOptions.profileColor) {
                                      channelSettings.profileColor = channelSettingsOptions.profileColor;
                                  }
                                  if (channelSettingsOptions.showRelatedChannels) {
                                      channelSettings.showRelatedChannels =
                                          channelSettingsOptions.showRelatedChannels;
                                  }
                                  if (channelSettingsOptions.showBrowseView) {
                                      channelSettings.showBrowseView = channelSettingsOptions.showBrowseView;
                                  }
                                  if (channelSettingsOptions.trackingAnalyticsAccountId) {
                                      channelSettings.trackingAnalyticsAccountId =
                                          channelSettingsOptions.trackingAnalyticsAccountId;
                                  }
                                  if (channelSettingsOptions.unsubscribedTrailer) {
                                      channelSettings.unsubscribedTrailer =
                                          channelSettingsOptions.unsubscribedTrailer;
                                  }
                              }
                              const imageSettingsValues = updateFields.brandingSettingsUi
                                  .imageSettingsValues;
                              const imageSettings = {};
                              if (imageSettingsValues === null || imageSettingsValues === void 0 ? void 0 : imageSettingsValues.image) {
                                  const imageSettingsOptions = imageSettings.image;
                                  if (imageSettingsOptions.bannerExternalUrl) {
                                      imageSettings.bannerExternalUrl =
                                          imageSettingsOptions.bannerExternalUrl;
                                  }
                                  if (imageSettingsOptions.trackingImageUrl) {
                                      imageSettings.trackingImageUrl = imageSettingsOptions.trackingImageUrl;
                                  }
                                  if (imageSettingsOptions.watchIconImageUrl) {
                                      imageSettings.watchIconImageUrl =
                                          imageSettingsOptions.watchIconImageUrl;
                                  }
                              }
                              body.brandingSettings.channel = channelSettings;
                              body.brandingSettings.image = imageSettings;
                          }
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'PUT', '/youtube/v3/channels', body, qs);
                      }
                      if (operation === 'uploadBanner') {
                          const channelId = this.getNodeParameter('channelId', i);
                          const binaryProperty = this.getNodeParameter('binaryProperty', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryProperty);
                          const body = await this.helpers.getBinaryDataBuffer(i, binaryProperty);
                          const requestOptions = {
                              headers: {
                                  ...(binaryData.mimeType ? { 'Content-Type': binaryData.mimeType } : {}),
                              },
                              json: false,
                          };
                          const response = await GenericFunctions_1.googleApiRequest.call(this, 'POST', '/upload/youtube/v3/channelBanners/insert', body, qs, undefined, requestOptions);
                          const { url } = JSON.parse(response);
                          qs.part = 'brandingSettings';
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'PUT', '/youtube/v3/channels', {
                              id: channelId,
                              brandingSettings: {
                                  image: {
                                      bannerExternalUrl: url,
                                  },
                              },
                          }, qs);
                      }
                  }
                  if (resource === 'playlist') {
                      if (operation === 'get') {
                          let part = this.getNodeParameter('part', i);
                          const playlistId = this.getNodeParameter('playlistId', i);
                          const options = this.getNodeParameter('options', i);
                          if (part.includes('*')) {
                              part = ['contentDetails', 'id', 'localizations', 'player', 'snippet', 'status'];
                          }
                          qs.part = part.join(',');
                          qs.id = playlistId;
                          Object.assign(qs, options);
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/youtube/v3/playlists', {}, qs);
                          responseData = responseData.items;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          let part = this.getNodeParameter('part', i);
                          const options = this.getNodeParameter('options', i);
                          const filters = this.getNodeParameter('filters', i);
                          if (part.includes('*')) {
                              part = ['contentDetails', 'id', 'localizations', 'player', 'snippet', 'status'];
                          }
                          qs.part = part.join(',');
                          Object.assign(qs, options, filters);
                          qs.mine = true;
                          if (qs.channelId || qs.id) {
                              delete qs.mine;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'items', 'GET', '/youtube/v3/playlists', {}, qs);
                          }
                          else {
                              qs.maxResults = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/youtube/v3/playlists', {}, qs);
                              responseData = responseData.items;
                          }
                      }
                      if (operation === 'create') {
                          const title = this.getNodeParameter('title', i);
                          const options = this.getNodeParameter('options', i);
                          qs.part = 'snippet';
                          const body = {
                              snippet: {
                                  title,
                              },
                          };
                          if (options.tags) {
                              body.snippet.tags = options.tags.split(',');
                          }
                          if (options.description) {
                              body.snippet.privacyStatus = options.privacyStatus;
                          }
                          if (options.defaultLanguage) {
                              body.snippet.defaultLanguage = options.defaultLanguage;
                          }
                          if (options.onBehalfOfContentOwner) {
                              qs.onBehalfOfContentOwner = options.onBehalfOfContentOwner;
                          }
                          if (options.onBehalfOfContentOwnerChannel) {
                              qs.onBehalfOfContentOwnerChannel = options.onBehalfOfContentOwnerChannel;
                          }
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'POST', '/youtube/v3/playlists', body, qs);
                      }
                      if (operation === 'update') {
                          const playlistId = this.getNodeParameter('playlistId', i);
                          const title = this.getNodeParameter('title', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          qs.part = 'snippet, status';
                          const body = {
                              id: playlistId,
                              snippet: {
                                  title,
                              },
                              status: {},
                          };
                          if (updateFields.tags) {
                              body.snippet.tags = updateFields.tags.split(',');
                          }
                          if (updateFields.privacyStatus) {
                              body.status.privacyStatus = updateFields.privacyStatus;
                          }
                          if (updateFields.description) {
                              body.snippet.description = updateFields.description;
                          }
                          if (updateFields.defaultLanguage) {
                              body.snippet.defaultLanguage = updateFields.defaultLanguage;
                          }
                          if (updateFields.onBehalfOfContentOwner) {
                              qs.onBehalfOfContentOwner = updateFields.onBehalfOfContentOwner;
                          }
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'PUT', '/youtube/v3/playlists', body, qs);
                      }
                      if (operation === 'delete') {
                          const playlistId = this.getNodeParameter('playlistId', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              id: playlistId,
                          };
                          if (options.onBehalfOfContentOwner) {
                              qs.onBehalfOfContentOwner = options.onBehalfOfContentOwner;
                          }
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'DELETE', '/youtube/v3/playlists', body);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'playlistItem') {
                      if (operation === 'get') {
                          let part = this.getNodeParameter('part', i);
                          const playlistItemId = this.getNodeParameter('playlistItemId', i);
                          const options = this.getNodeParameter('options', i);
                          if (part.includes('*')) {
                              part = ['contentDetails', 'id', 'snippet', 'status'];
                          }
                          qs.part = part.join(',');
                          qs.id = playlistItemId;
                          Object.assign(qs, options);
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/youtube/v3/playlistItems', {}, qs);
                          responseData = responseData.items;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          let part = this.getNodeParameter('part', i);
                          const options = this.getNodeParameter('options', i);
                          const playlistId = this.getNodeParameter('playlistId', i);
                          if (part.includes('*')) {
                              part = ['contentDetails', 'id', 'snippet', 'status'];
                          }
                          qs.playlistId = playlistId;
                          qs.part = part.join(',');
                          Object.assign(qs, options);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'items', 'GET', '/youtube/v3/playlistItems', {}, qs);
                          }
                          else {
                              qs.maxResults = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/youtube/v3/playlistItems', {}, qs);
                              responseData = responseData.items;
                          }
                      }
                      if (operation === 'add') {
                          const playlistId = this.getNodeParameter('playlistId', i);
                          const videoId = this.getNodeParameter('videoId', i);
                          const options = this.getNodeParameter('options', i);
                          qs.part = 'snippet, contentDetails';
                          const body = {
                              snippet: {
                                  playlistId,
                                  resourceId: {
                                      kind: 'youtube#video',
                                      videoId,
                                  },
                              },
                              contentDetails: {},
                          };
                          if (options.position) {
                              body.snippet.position = options.position;
                          }
                          if (options.note) {
                              body.contentDetails.note = options.note;
                          }
                          if (options.startAt) {
                              body.contentDetails.startAt = options.startAt;
                          }
                          if (options.endAt) {
                              body.contentDetails.endAt = options.endAt;
                          }
                          if (options.onBehalfOfContentOwner) {
                              qs.onBehalfOfContentOwner = options.onBehalfOfContentOwner;
                          }
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'POST', '/youtube/v3/playlistItems', body, qs);
                      }
                      if (operation === 'delete') {
                          const playlistItemId = this.getNodeParameter('playlistItemId', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              id: playlistItemId,
                          };
                          if (options.onBehalfOfContentOwner) {
                              qs.onBehalfOfContentOwner = options.onBehalfOfContentOwner;
                          }
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'DELETE', '/youtube/v3/playlistItems', body);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'video') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          const filters = this.getNodeParameter('filters', i);
                          qs.part = 'snippet';
                          qs.type = 'video';
                          qs.forMine = true;
                          Object.assign(qs, options, filters);
                          if (Object.keys(filters).length > 0) {
                              delete qs.forMine;
                          }
                          if (qs.relatedToVideoId && qs.forDeveloper !== undefined) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), "When using the parameter 'related to video' the parameter 'for developer' cannot be set", { itemIndex: i });
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.googleApiRequestAllItems.call(this, 'items', 'GET', '/youtube/v3/search', {}, qs);
                          }
                          else {
                              qs.maxResults = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/youtube/v3/search', {}, qs);
                              responseData = responseData.items;
                          }
                      }
                      if (operation === 'get') {
                          let part = this.getNodeParameter('part', i);
                          const videoId = this.getNodeParameter('videoId', i);
                          const options = this.getNodeParameter('options', i);
                          if (part.includes('*')) {
                              part = [
                                  'contentDetails',
                                  'id',
                                  'liveStreamingDetails',
                                  'localizations',
                                  'player',
                                  'recordingDetails',
                                  'snippet',
                                  'statistics',
                                  'status',
                                  'topicDetails',
                              ];
                          }
                          qs.part = part.join(',');
                          qs.id = videoId;
                          Object.assign(qs, options);
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/youtube/v3/videos', {}, qs);
                          responseData = responseData.items;
                      }
                      if (operation === 'upload') {
                          const title = this.getNodeParameter('title', i);
                          const categoryId = this.getNodeParameter('categoryId', i);
                          const options = this.getNodeParameter('options', i);
                          const binaryProperty = this.getNodeParameter('binaryProperty', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryProperty);
                          let mimeType;
                          let contentLength;
                          let fileContent;
                          if (binaryData.id) {
                              fileContent = await this.helpers.getBinaryStream(binaryData.id, UPLOAD_CHUNK_SIZE);
                              const metadata = await this.helpers.getBinaryMetadata(binaryData.id);
                              contentLength = metadata.fileSize;
                              mimeType = (_a = metadata.mimeType) !== null && _a !== void 0 ? _a : binaryData.mimeType;
                          }
                          else {
                              fileContent = Buffer.from(binaryData.data, n8n_workflow_1.BINARY_ENCODING);
                              contentLength = fileContent.length;
                              mimeType = binaryData.mimeType;
                          }
                          const payload = {
                              snippet: {
                                  title,
                                  categoryId,
                                  description: options.description,
                                  tags: (_b = options.tags) === null || _b === void 0 ? void 0 : _b.split(','),
                                  defaultLanguage: options.defaultLanguage,
                              },
                              status: {
                                  privacyStatus: options.privacyStatus,
                                  embeddable: options.embeddable,
                                  publicStatsViewable: options.publicStatsViewable,
                                  publishAt: options.publishAt,
                                  selfDeclaredMadeForKids: options.selfDeclaredMadeForKids,
                                  license: options.license,
                              },
                              recordingDetails: {
                                  recordingDate: options.recordingDate,
                              },
                          };
                          const resumableUpload = await GenericFunctions_1.googleApiRequest.call(this, 'POST', '/upload/youtube/v3/videos', payload, {
                              uploadType: 'resumable',
                              part: 'snippet,status,recordingDetails',
                              notifySubscribers: (_c = options.notifySubscribers) !== null && _c !== void 0 ? _c : false,
                          }, undefined, {
                              headers: {
                                  'X-Upload-Content-Length': contentLength,
                                  'X-Upload-Content-Type': mimeType,
                              },
                              json: true,
                              resolveWithFullResponse: true,
                          });
                          const uploadUrl = resumableUpload.headers.location;
                          let uploadId;
                          let offset = 0;
                          for await (const chunk of fileContent) {
                              const nextOffset = offset + Number(chunk.length);
                              try {
                                  const response = await this.helpers.httpRequest({
                                      method: 'PUT',
                                      url: uploadUrl,
                                      headers: {
                                          'Content-Length': chunk.length,
                                          'Content-Range': `bytes ${offset}-${nextOffset - 1}/${contentLength}`,
                                      },
                                      body: chunk,
                                  });
                                  uploadId = response.id;
                              }
                              catch (error) {
                                  if (((_d = error.response) === null || _d === void 0 ? void 0 : _d.status) !== 308)
                                      throw error;
                              }
                              offset = nextOffset;
                          }
                          responseData = { uploadId, ...resumableUpload.body };
                      }
                      if (operation === 'update') {
                          const id = this.getNodeParameter('videoId', i);
                          const title = this.getNodeParameter('title', i);
                          const categoryId = this.getNodeParameter('categoryId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          qs.part = 'snippet, status, recordingDetails';
                          const body = {
                              id,
                              snippet: {
                                  title,
                                  categoryId,
                              },
                              status: {},
                              recordingDetails: {},
                          };
                          if (updateFields.description) {
                              body.snippet.description = updateFields.description;
                          }
                          if (updateFields.privacyStatus) {
                              body.status.privacyStatus = updateFields.privacyStatus;
                          }
                          if (updateFields.tags) {
                              body.snippet.tags = updateFields.tags.split(',');
                          }
                          if (updateFields.embeddable) {
                              body.status.embeddable = updateFields.embeddable;
                          }
                          if (updateFields.publicStatsViewable) {
                              body.status.publicStatsViewable = updateFields.publicStatsViewable;
                          }
                          if (updateFields.publishAt) {
                              body.status.publishAt = updateFields.publishAt;
                          }
                          if (updateFields.selfDeclaredMadeForKids) {
                              body.status.selfDeclaredMadeForKids = updateFields.selfDeclaredMadeForKids;
                          }
                          if (updateFields.recordingDate) {
                              body.recordingDetails.recordingDate = updateFields.recordingDate;
                          }
                          if (updateFields.license) {
                              body.status.license = updateFields.license;
                          }
                          if (updateFields.defaultLanguage) {
                              body.snippet.defaultLanguage = updateFields.defaultLanguage;
                          }
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'PUT', '/youtube/v3/videos', body, qs);
                      }
                      if (operation === 'delete') {
                          const videoId = this.getNodeParameter('videoId', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              id: videoId,
                          };
                          if (options.onBehalfOfContentOwner) {
                              qs.onBehalfOfContentOwner = options.onBehalfOfContentOwner;
                          }
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'DELETE', '/youtube/v3/videos', body);
                          responseData = { success: true };
                      }
                      if (operation === 'rate') {
                          const videoId = this.getNodeParameter('videoId', i);
                          const rating = this.getNodeParameter('rating', i);
                          const body = {
                              id: videoId,
                              rating,
                          };
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'POST', '/youtube/v3/videos/rate', body);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'videoCategory') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const regionCode = this.getNodeParameter('regionCode', i);
                          qs.regionCode = regionCode;
                          qs.part = 'snippet';
                          responseData = await GenericFunctions_1.googleApiRequest.call(this, 'GET', '/youtube/v3/videoCategories', {}, qs);
                          responseData = responseData.items;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.YouTube = YouTube;
  //# sourceMappingURL=YouTube.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.YouTubeOAuth2Api = void 0;
  const scopes = [
      'https://www.googleapis.com/auth/youtube',
      'https://www.googleapis.com/auth/youtubepartner',
      'https://www.googleapis.com/auth/youtube.force-ssl',
      'https://www.googleapis.com/auth/youtube.upload',
      'https://www.googleapis.com/auth/youtubepartner-channel-audit',
  ];
  class YouTubeOAuth2Api {
      constructor() {
          this.name = 'youTubeOAuth2Api';
          this.icon = 'node:n8n-nodes-base.youTube';
          this.extends = ['googleOAuth2Api'];
          this.displayName = 'YouTube OAuth2 API';
          this.documentationUrl = 'google';
          this.properties = [
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: scopes.join(' '),
              },
          ];
      }
  }
  exports.YouTubeOAuth2Api = YouTubeOAuth2Api;
  //# sourceMappingURL=YouTubeOAuth2Api.credentials.js.map

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

  # YouTube node

  Use the YouTube node to automate work in YouTube, and integrate YouTube with other applications. n8n has built-in support for a wide range of YouTube features, including retrieving and updating channels, as well as creating and deleting playlists. 

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

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

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

  ## Operations

  * Channel
      * Retrieve a channel
      * Retrieve all channels
      * Update a channel
      * Upload a channel banner
  * Playlist
      * Create a playlist
      * Delete a playlist
      * Get a playlist
      * Retrieve all playlists
      * Update a playlist
  * Playlist Item
      * Add an item to a playlist
      * Delete a item from a playlist
      * Get a playlist's item
      * Retrieve all playlist items
  * Video
      * Delete a video
      * Get a video
      * Retrieve all videos
      * Rate a video
      * Update a video
      * Upload a video
  * Video Category
      * Retrieve all video categories

  ## Templates and examples

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

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

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

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"channel","options":[{"name":"Channel","value":"channel"},{"name":"Playlist","value":"playlist"},{"name":"Playlist Item","value":"playlistItem"},{"name":"Video","value":"video"},{"name":"Video Category","value":"videoCategory"}]},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ChannelDescription_1.channelOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...ChannelDescription_1.channelFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PlaylistDescription_1.playlistOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PlaylistDescription_1.playlistFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PlaylistItemDescription_1.playlistItemOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...PlaylistItemDescription_1.playlistItemFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...VideoDescription_1.videoOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...VideoDescription_1.videoFields"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...VideoCategoryDescription_1.videoCategoryOperations"},{"name":"dynamic_property","type":"unknown","displayName":"Dynamic Property","_source":"...VideoCategoryDescription_1.videoCategoryFields"}]


node_type: n8n-nodes-base.GraphQL
name: GraphQL
display_name: GraphQL
description: Makes a GraphQL request and returns the received data
category: input
icon: file:graphql.png
code_hash: f9b7d2d27319e62247e107607877b0a9dd51497c47e8eca06c74ba2bd1e36054
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.GraphQL
documentation_title: GraphQL
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"graphql","description":"Templates for graphql"}]
related_resources: [{"title":"Introduction to GraphQL","url":"https://graphql.org/learn/","type":"external"}]
required_scopes: []
parameter_schemas: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:43
updated_at: 2025-06-12 08:58:43
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.GraphQL = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class GraphQL {
      constructor() {
          this.description = {
              displayName: 'GraphQL',
              name: 'graphql',
              icon: 'file:graphql.png',
              group: ['input'],
              version: 1,
              description: 'Makes a GraphQL request and returns the received data',
              defaults: {
                  name: 'GraphQL',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'httpBasicAuth',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['basicAuth'],
                          },
                      },
                  },
                  {
                      name: 'httpCustomAuth',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['customAuth'],
                          },
                      },
                  },
                  {
                      name: 'httpDigestAuth',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['digestAuth'],
                          },
                      },
                  },
                  {
                      name: 'httpHeaderAuth',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['headerAuth'],
                          },
                      },
                  },
                  {
                      name: 'httpQueryAuth',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['queryAuth'],
                          },
                      },
                  },
                  {
                      name: 'oAuth1Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth1'],
                          },
                      },
                  },
                  {
                      name: 'oAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Basic Auth',
                              value: 'basicAuth',
                          },
                          {
                              name: 'Custom Auth',
                              value: 'customAuth',
                          },
                          {
                              name: 'Digest Auth',
                              value: 'digestAuth',
                          },
                          {
                              name: 'Header Auth',
                              value: 'headerAuth',
                          },
                          {
                              name: 'None',
                              value: 'none',
                          },
                          {
                              name: 'OAuth1',
                              value: 'oAuth1',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                          {
                              name: 'Query Auth',
                              value: 'queryAuth',
                          },
                      ],
                      default: 'none',
                      description: 'The way to authenticate',
                  },
                  {
                      displayName: 'HTTP Request Method',
                      name: 'requestMethod',
                      type: 'options',
                      options: [
                          {
                              name: 'GET',
                              value: 'GET',
                          },
                          {
                              name: 'POST',
                              value: 'POST',
                          },
                      ],
                      default: 'POST',
                      description: 'The underlying HTTP request method to use',
                  },
                  {
                      displayName: 'Endpoint',
                      name: 'endpoint',
                      type: 'string',
                      default: '',
                      placeholder: 'http://example.com/graphql',
                      description: 'The GraphQL endpoint',
                      required: true,
                  },
                  {
                      displayName: 'Ignore SSL Issues',
                      name: 'allowUnauthorizedCerts',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to download the response even if SSL certificate validation is not possible',
                  },
                  {
                      displayName: 'Request Format',
                      name: 'requestFormat',
                      type: 'options',
                      required: true,
                      options: [
                          {
                              name: 'GraphQL (Raw)',
                              value: 'graphql',
                          },
                          {
                              name: 'JSON',
                              value: 'json',
                          },
                      ],
                      displayOptions: {
                          show: {
                              requestMethod: ['POST'],
                          },
                      },
                      default: 'graphql',
                      description: 'The format for the query payload',
                  },
                  {
                      displayName: 'Query',
                      name: 'query',
                      type: 'json',
                      default: '',
                      description: 'GraphQL query',
                      required: true,
                  },
                  {
                      displayName: 'Variables',
                      name: 'variables',
                      type: 'json',
                      default: '',
                      description: 'Query variables',
                      displayOptions: {
                          show: {
                              requestFormat: ['json'],
                              requestMethod: ['POST'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation Name',
                      name: 'operationName',
                      type: 'string',
                      default: '',
                      description: 'Name of operation to execute',
                      displayOptions: {
                          show: {
                              requestFormat: ['json'],
                              requestMethod: ['POST'],
                          },
                      },
                  },
                  {
                      displayName: 'Response Format',
                      name: 'responseFormat',
                      type: 'options',
                      options: [
                          {
                              name: 'JSON',
                              value: 'json',
                          },
                          {
                              name: 'String',
                              value: 'string',
                          },
                      ],
                      default: 'json',
                      description: 'The format in which the data gets returned from the URL',
                  },
                  {
                      displayName: 'Response Data Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              responseFormat: ['string'],
                          },
                      },
                      description: 'Name of the property to which to write the response data',
                  },
                  {
                      displayName: 'Headers',
                      name: 'headerParametersUi',
                      placeholder: 'Add Header',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      description: 'The headers to send',
                      default: {},
                      options: [
                          {
                              name: 'parameter',
                              displayName: 'Header',
                              values: [
                                  {
                                      displayName: 'Name',
                                      name: 'name',
                                      type: 'string',
                                      default: '',
                                      description: 'Name of the header',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                      description: 'Value to set for the header',
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          var _a;
          const items = this.getInputData();
          let httpBasicAuth;
          let httpDigestAuth;
          let httpCustomAuth;
          let httpHeaderAuth;
          let httpQueryAuth;
          let oAuth1Api;
          let oAuth2Api;
          try {
              httpBasicAuth = await this.getCredentials('httpBasicAuth');
          }
          catch (error) {
          }
          try {
              httpCustomAuth = await this.getCredentials('httpCustomAuth');
          }
          catch (error) {
          }
          try {
              httpDigestAuth = await this.getCredentials('httpDigestAuth');
          }
          catch (error) {
          }
          try {
              httpHeaderAuth = await this.getCredentials('httpHeaderAuth');
          }
          catch (error) {
          }
          try {
              httpQueryAuth = await this.getCredentials('httpQueryAuth');
          }
          catch (error) {
          }
          try {
              oAuth1Api = await this.getCredentials('oAuth1Api');
          }
          catch (error) {
          }
          try {
              oAuth2Api = await this.getCredentials('oAuth2Api');
          }
          catch (error) {
          }
          let requestOptions;
          const returnItems = [];
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              try {
                  const requestMethod = this.getNodeParameter('requestMethod', itemIndex, 'POST');
                  const endpoint = this.getNodeParameter('endpoint', itemIndex, '');
                  const requestFormat = this.getNodeParameter('requestFormat', itemIndex, 'graphql');
                  const responseFormat = this.getNodeParameter('responseFormat', 0);
                  const { parameter } = this.getNodeParameter('headerParametersUi', itemIndex, {});
                  const headerParameters = (parameter || []).reduce((result, item) => ({
                      ...result,
                      [item.name]: item.value,
                  }), {});
                  requestOptions = {
                      headers: {
                          'content-type': `application/${requestFormat}`,
                          ...headerParameters,
                      },
                      method: requestMethod,
                      uri: endpoint,
                      simple: false,
                      rejectUnauthorized: !this.getNodeParameter('allowUnauthorizedCerts', itemIndex, false),
                  };
                  if (httpBasicAuth !== undefined) {
                      requestOptions.auth = {
                          user: httpBasicAuth.user,
                          pass: httpBasicAuth.password,
                      };
                  }
                  if (httpCustomAuth !== undefined) {
                      const customAuth = (0, n8n_workflow_1.jsonParse)(httpCustomAuth.json || '{}', { errorMessage: 'Invalid Custom Auth JSON' });
                      if (customAuth.headers) {
                          requestOptions.headers = { ...requestOptions.headers, ...customAuth.headers };
                      }
                      if (customAuth.body) {
                          requestOptions.body = { ...requestOptions.body, ...customAuth.body };
                      }
                      if (customAuth.qs) {
                          requestOptions.qs = { ...requestOptions.qs, ...customAuth.qs };
                      }
                  }
                  if (httpHeaderAuth !== undefined) {
                      requestOptions.headers[httpHeaderAuth.name] = httpHeaderAuth.value;
                  }
                  if (httpQueryAuth !== undefined) {
                      if (!requestOptions.qs) {
                          requestOptions.qs = {};
                      }
                      requestOptions.qs[httpQueryAuth.name] = httpQueryAuth.value;
                  }
                  if (httpDigestAuth !== undefined) {
                      requestOptions.auth = {
                          user: httpDigestAuth.user,
                          pass: httpDigestAuth.password,
                          sendImmediately: false,
                      };
                  }
                  const gqlQuery = this.getNodeParameter('query', itemIndex, '');
                  if (requestMethod === 'GET') {
                      if (!requestOptions.qs) {
                          requestOptions.qs = {};
                      }
                      requestOptions.qs.query = gqlQuery;
                  }
                  else {
                      if (requestFormat === 'json') {
                          requestOptions.body = {
                              ...requestOptions.body,
                              query: gqlQuery,
                              variables: this.getNodeParameter('variables', itemIndex, {}),
                              operationName: this.getNodeParameter('operationName', itemIndex),
                          };
                          if (typeof requestOptions.body.variables === 'string') {
                              try {
                                  requestOptions.body.variables = JSON.parse(requestOptions.body.variables || '{}');
                              }
                              catch (error) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Using variables failed:\n' +
                                      requestOptions.body.variables +
                                      '\n\nWith error message:\n' +
                                      error, { itemIndex });
                              }
                          }
                          if (requestOptions.body.operationName === '') {
                              requestOptions.body.operationName = null;
                          }
                          requestOptions.json = true;
                      }
                      else {
                          requestOptions.body = gqlQuery;
                      }
                  }
                  let response;
                  if (oAuth1Api !== undefined) {
                      response = await this.helpers.requestOAuth1.call(this, 'oAuth1Api', requestOptions);
                  }
                  else if (oAuth2Api !== undefined) {
                      response = await this.helpers.requestOAuth2.call(this, 'oAuth2Api', requestOptions, {
                          tokenType: 'Bearer',
                      });
                  }
                  else {
                      response = await this.helpers.request(requestOptions);
                  }
                  if (responseFormat === 'string') {
                      const dataPropertyName = this.getNodeParameter('dataPropertyName', 0);
                      returnItems.push({
                          json: {
                              [dataPropertyName]: response,
                          },
                      });
                  }
                  else {
                      if (typeof response === 'string') {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Response body is not valid JSON. Change "Response Format" to "String"', { itemIndex });
                          }
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response), { itemData: { item: itemIndex } });
                      returnItems.push(...executionData);
                  }
                  if (typeof response === 'string' && response.startsWith('{"errors":')) {
                      try {
                          const errorResponse = JSON.parse(response);
                          if (Array.isArray(errorResponse.errors)) {
                              response = errorResponse;
                          }
                      }
                      catch (e) { }
                  }
                  if (typeof response === 'object' && response.errors) {
                      const message = ((_a = response.errors) === null || _a === void 0 ? void 0 : _a.map((error) => error.message).join(', ')) ||
                          'Unexpected error';
                      throw new n8n_workflow_1.NodeApiError(this.getNode(), response.errors, { message });
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const errorData = this.helpers.returnJsonArray({
                          $error: error,
                          json: this.getInputData(itemIndex),
                          itemIndex,
                      });
                      const exectionErrorWithMetaData = this.helpers.constructExecutionMetaData(errorData, {
                          itemData: { item: itemIndex },
                      });
                      returnItems.push(...exectionErrorWithMetaData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnItems];
      }
  }
  exports.GraphQL = GraphQL;
  //# sourceMappingURL=GraphQL.node.js.map

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

  # GraphQL

  [GraphQL](https://graphql.org/){:target=_blank .external-link} is an open-source data query and manipulation language for APIs, and a runtime for fulfilling queries with existing data. Use the GraphQL node to query a GraphQL endpoint.

  ## Node parameters

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

  ### Authentication

  Select the type of authentication to use.

  If you select anything other than **None**, the **Credential for <selected-auth-type>** parameter appears for you to select an existing or create a new authentication credential for that authentication type.

  ### HTTP Request Method

  Select the underlying HTTP Request method the node should use. Choose from:

  * **GET**
  * **POST**: If you select this method, you'll also need to select the **Request Format** the node should use for the query payload. Choose from:
      * **GraphQL (Raw)**
      * **JSON**

  ### Endpoint

  Enter the GraphQL Endpoint you'd like to hit.

  ### Ignore SSL Issues

  When you turn on this control, n8n ignores SSL certificate validation failure.

  ### Query

  Enter the GraphQL query you want to execute.

  Refer to [Related Resources](#related-resources) for information on writing your query.

  ### Response Format

  Select the format you'd like to receive query results in. Choose between:

  * **JSON**
  * **String**: If you select this format, enter a **Response Data Property Name** to define the property the string is written to.

  ## Headers

  Enter any **Headers** you want to pass as part of the query as **Name** / **Value** pairs.

  ## Templates and examples

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

  ## Related resources

  To use the GraphQL node, you need to understand GraphQL query language. GraphQL have their own [Introduction to GraphQL](https://graphql.org/learn/){:target=_blank .external-link} tutorial.

troubleshooting_info:
  [{"issue":"Node parameters","solution":"--8<-- \"_snippets/integrations/builtin/app-nodes/ai-tools.md\""},{"issue":"Authentication","solution":"Select the type of authentication to use."},{"issue":"HTTP Request Method","solution":"Select the underlying HTTP Request method the node should use. Choose from:"},{"issue":"Ignore SSL Issues","solution":"When you turn on this control, n8n ignores SSL certificate validation failure."},{"issue":"Query","solution":"Enter the GraphQL query you want to execute."},{"issue":"Response Format","solution":"Select the format you'd like to receive query results in. Choose between:"},{"issue":"Headers","solution":"Enter any **Headers** you want to pass as part of the query as **Name** / **Value** pairs."}]

example_workflow:
  {"name":"GraphQL Example Workflow","nodes":[{"parameters":{"authentication":"basicAuth","requestMethod":"GET","endpoint":"example-value","allowUnauthorizedCerts":false,"requestFormat":"graphql","query":null,"variables":null,"operationName":"Example Name","responseFormat":"json","dataPropertyName":"Example Name","headerParametersUi":{}},"id":"3cum2vnvnvzcvhz73y6fnh","name":"GraphQL","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"authentication":"basicAuth","requestMethod":"GET","endpoint":"example-value","allowUnauthorizedCerts":false,"requestFormat":"graphql","query":null,"variables":null,"operationName":"Example Name","responseFormat":"json","dataPropertyName":"Example Name","headerParametersUi":{}}

properties_schema:
  [{"displayName":"Authentication","name":"authentication","type":"options","default":"none","description":"The way to authenticate","options":[{"name":"Basic Auth","value":"basicAuth"},{"name":"Custom Auth","value":"customAuth"},{"name":"Digest Auth","value":"digestAuth"},{"name":"Header Auth","value":"headerAuth"},{"name":"None","value":"none"},{"name":"OAuth1","value":"oAuth1"},{"name":"OAuth2","value":"oAuth2"},{"name":"Query Auth","value":"queryAuth"}]},{"displayName":"HTTP Request Method","name":"requestMethod","type":"options","default":"POST","description":"The underlying HTTP request method to use","options":[{"name":"GET","value":"GET"},{"name":"POST","value":"POST"}]},{"displayName":"Endpoint","name":"endpoint","type":"string","default":"","required":true,"description":"The GraphQL endpoint","placeholder":"http://example.com/graphql"},{"displayName":"Ignore SSL Issues","name":"allowUnauthorizedCerts","type":"boolean","default":false,"description":"Whether to download the response even if SSL certificate validation is not possible"},{"displayName":"Request Format","name":"requestFormat","type":"options","default":"graphql","required":true,"description":"The format for the query payload","options":[{"name":"GraphQL (Raw)","value":"graphql"},{"name":"JSON","value":"json"}]},{"displayName":"Query","name":"query","type":"json","default":"","required":true,"description":"GraphQL query"},{"displayName":"Variables","name":"variables","type":"json","default":"","description":"Query variables"},{"displayName":"Operation Name","name":"operationName","type":"string","default":"","description":"Name of operation to execute"},{"displayName":"Response Format","name":"responseFormat","type":"options","default":"json","description":"The format in which the data gets returned from the URL","options":[{"name":"JSON","value":"json"},{"name":"String","value":"string"}]},{"displayName":"Response Data Property Name","name":"dataPropertyName","type":"string","default":"data","required":true,"description":"Name of the property to which to write the response data"},{"displayName":"Headers","name":"headerParametersUi","type":"fixedCollection","default":"{","description":"The headers to send","placeholder":"Add Header"}]


node_type: n8n-nodes-base.HackerNews
name: HackerNews
display_name: Hacker News
description: Consume Hacker News API
category: transform
icon: file:hackernews.png
code_hash: 390a3ac297411fe2c0fc2a82381c6d6bf1ad8892139f36e09da9b1782c055c0e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.HackerNews
documentation_title: Hacker News node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"hacker-news","description":"Templates for hacker-news"}]
related_resources: []
required_scopes: []
parameter_schemas: []
troubleshooting_info: []
node_connections: [{"fromNode":"When clicking ‘Execute workflow’","toNode":"Hacker News","connectionType":"main"}]
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-12 08:58:43
updated_at: 2025-06-12 08:58:43
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.HackerNews = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class HackerNews {
      constructor() {
          this.description = {
              displayName: 'Hacker News',
              name: 'hackerNews',
              icon: 'file:hackernews.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Hacker News API',
              defaults: {
                  name: 'Hacker News',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'All',
                              value: 'all',
                          },
                          {
                              name: 'Article',
                              value: 'article',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'article',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['all'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many items',
                              action: 'Get many items',
                          },
                      ],
                      default: 'getAll',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['article'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a Hacker News article',
                              action: 'Get an article',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a Hacker News user',
                              action: 'Get a user',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Article ID',
                      name: 'articleId',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The ID of the Hacker News article to be returned',
                      displayOptions: {
                          show: {
                              resource: ['article'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Username',
                      name: 'username',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The Hacker News user to be returned',
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                      displayOptions: {
                          show: {
                              resource: ['all'],
                              operation: ['getAll'],
                          },
                      },
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                      displayOptions: {
                          show: {
                              resource: ['all'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['article'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Include Comments',
                              name: 'includeComments',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to include all the comments in a Hacker News article',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['all'],
                              operation: ['getAll'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Keyword',
                              name: 'keyword',
                              type: 'string',
                              default: '',
                              description: 'The keyword for filtering the results of the query',
                          },
                          {
                              displayName: 'Tags',
                              name: 'tags',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Ask HN',
                                      value: 'ask_hn',
                                      description: 'Returns query results filtered by Ask HN tag',
                                  },
                                  {
                                      name: 'Comment',
                                      value: 'comment',
                                      description: 'Returns query results filtered by comment tag',
                                  },
                                  {
                                      name: 'Front Page',
                                      value: 'front_page',
                                      description: 'Returns query results filtered by Front Page tag',
                                  },
                                  {
                                      name: 'Poll',
                                      value: 'poll',
                                      description: 'Returns query results filtered by poll tag',
                                  },
                                  {
                                      name: 'Show HN',
                                      value: 'show_hn',
                                      description: 'Returns query results filtered by Show HN tag',
                                  },
                                  {
                                      name: 'Story',
                                      value: 'story',
                                      description: 'Returns query results filtered by story tag',
                                  },
                              ],
                              default: [],
                              description: 'Tags for filtering the results of the query',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let returnAll = false;
          for (let i = 0; i < items.length; i++) {
              try {
                  let qs = {};
                  let endpoint = '';
                  let includeComments = false;
                  if (resource === 'all') {
                      if (operation === 'getAll') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const keyword = additionalFields.keyword;
                          const tags = additionalFields.tags;
                          qs = {
                              query: keyword,
                              tags: tags ? tags.join() : '',
                          };
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.hitsPerPage = this.getNodeParameter('limit', i);
                          }
                          endpoint = 'search?';
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation '${operation}' is unknown!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'article') {
                      if (operation === 'get') {
                          endpoint = `items/${this.getNodeParameter('articleId', i)}`;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          includeComments = additionalFields.includeComments;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation '${operation}' is unknown!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'get') {
                          endpoint = `users/${this.getNodeParameter('username', i)}`;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation '${operation}' is unknown!`, { itemIndex: i });
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource '${resource}' is unknown!`, {
                          itemIndex: i,
                      });
                  }
                  let responseData;
                  if (returnAll) {
                      responseData = await GenericFunctions_1.hackerNewsApiRequestAllItems.call(this, 'GET', endpoint, qs);
                  }
                  else {
                      responseData = await GenericFunctions_1.hackerNewsApiRequest.call(this, 'GET', endpoint, qs);
                      if (resource === 'all' && operation === 'getAll') {
                          responseData = responseData.hits;
                      }
                  }
                  if (resource === 'article' && operation === 'get' && !includeComments) {
                      delete responseData.children;
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.HackerNews = HackerNews;
  //# sourceMappingURL=HackerNews.node.js.map

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

  # Hacker News node

  Use the Hacker News node to automate work in Hacker News, and integrate Hacker News with other applications. n8n has built-in support for a wide range of Hacker News features, including getting articles, and users. 

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

  /// note | Credentials
  This node doesn't require authentication. 
  ///

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

  ## Operations

  * All
      * Get all items
  * Article
      * Get a Hacker News article
  * User
      * Get a Hacker News user

  ## Templates and examples

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

workflow_examples:
  [{"name":"chapter-2","workflow":{"nodes":[{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[0,0],"id":"5738d1d8-ae7d-4e04-bca4-885c59e1d9e8","name":"When clicking ‘Execute workflow’"},{"parameters":{"resource":"all","limit":10,"additionalFields":{"keyword":"automation"}},"type":"n8n-nodes-base.hackerNews","typeVersion":1,"position":[220,0],"id":"65e9d0a6-5261-4c7d-8d85-6ff49de04dee","name":"Hacker News","notesInFlow":true,"notes":"Get the 10 latest articles."}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Hacker News","type":"main","index":0}]]}},"pinData":{},"meta":{"instanceId":"24789c4d5aa56ca018d140332e7a43fd37dd7af0409453314fff12dc1aeebfa8"}},"nodeConfigurations":[{"nodeType":"n8n-nodes-base.hackerNews","version":1,"parameters":{"resource":"all","limit":10,"additionalFields":{"keyword":"automation"}},"position":[220,0]}],"connections":{"When clicking ‘Execute workflow’":{"main":[[{"node":"Hacker News","type":"main","index":0}]]}},"source":"docs/_workflows/courses/level-one/chapter-2.json","description":"Workflow example from docs/_workflows/courses/level-one/chapter-2.json"}]

example_workflow:
  {"name":"Hacker News Example Workflow","nodes":[{"parameters":{"resource":"all","operation":"get","articleId":"example-value","username":"Example Name","returnAll":false,"limit":100,"additionalFields":{}},"id":"jx74i04unyd1fqx0gwg2ml","name":"Hacker News","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}

example_parameters:
  {"resource":"all","operation":"get","articleId":"example-value","username":"Example Name","returnAll":false,"limit":100,"additionalFields":{}}

properties_schema:
  [{"displayName":"Resource","name":"resource","type":"options","default":"article","options":[{"name":"All","value":"all"},{"name":"Article","value":"article"},{"name":"User","value":"user"}]},{"displayName":"Operation","name":"operation","type":"options","default":"getAll","description":"Get many items","options":[{"name":"Get Many","value":"getAll","description":"Get many items"}]},{"displayName":"Operation","name":"operation","type":"options","default":"get","description":"Get a Hacker News article","options":[{"name":"Get","value":"get","description":"Get a Hacker News article"}]},{"displayName":"Operation","name":"operation","type":"options","default":"get","description":"Get a Hacker News user","options":[{"name":"Get","value":"get","description":"Get a Hacker News user"}]},{"displayName":"Article ID","name":"articleId","type":"string","default":"","required":true,"description":"The ID of the Hacker News article to be returned"},{"displayName":"Username","name":"username","type":"string","default":"","required":true,"description":"The Hacker News user to be returned"},{"displayName":"Return All","name":"returnAll","type":"boolean","default":false,"description":"Whether to return all results or only up to a given limit"},{"displayName":"Limit","name":"limit","type":"number","default":100,"description":"Max number of results to return"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"Whether to include all the comments in a Hacker News article","placeholder":"Add Field"},{"displayName":"Additional Fields","name":"additionalFields","type":"collection","default":"{","description":"The keyword for filtering the results of the query","placeholder":"Add Field"}]


