Reference > Nodes

GitHub Node

Reference for the n8n GitHub node -- operations, authentication, required scopes, and common patterns.

ReferenceIntermediate4 min read

The GitHub node interacts with the GitHub API to manage repositories, issues, pull requests, releases, and users. It is used in DevOps and project management workflows to automate issue triage, release tracking, and repository administration.

Authentication

Two credential types are supported:

Method When to Use
GitHub OAuth2 API Interactive flows where users authorize access. Best for multi-user or team setups.
GitHub Personal Access Token Simple, single-user automation. Generate a token at github.com/settings/tokens.

Required token scopes (Personal Access Token -- classic):

Scope Required For
repo Full access to repositories (issues, PRs, code, commits)
read:org Listing organization members and teams
read:user Reading user profile data
workflow Triggering and managing GitHub Actions workflows

Note

For fine-grained personal access tokens, grant permissions per-repository instead of using broad scopes. Select Read and write for Issues, Pull Requests, and Contents as needed.

Operations

Resource Operation Description
Issue Create Open a new issue
Issue Edit Update title, body, labels, or assignees
Issue Get Retrieve a single issue by number
Issue List List issues with optional filters (state, labels, assignee)
Issue Lock Lock an issue from further comments
Issue Add Comment Post a comment on an issue
Pull Request Create Open a new PR from a head branch to a base branch
Pull Request Get Retrieve PR details
Pull Request List List PRs with optional filters
Pull Request Merge Merge a PR
Repository Get Retrieve repository metadata
Repository List List repositories for a user or organization
Commit List List commits on a branch
Release Create Publish a new release
Release Get Retrieve a release by tag
User Get Retrieve user profile information
File Get Download a file from a repository
File Create Create or update a file in a repository

Key Parameters

Parameter Description
Repository Owner GitHub username or organization name (e.g., n8n-io).
Repository Name Repository name (e.g., n8n).
Issue / PR Number Numeric identifier for the target issue or pull request.
Title Title for new issues or pull requests.
Body Markdown-formatted description body.
Labels Comma-separated list of label names to apply.
Assignees Comma-separated list of GitHub usernames.
Base Branch For PRs -- the branch you are merging into (e.g., main).
Head Branch For PRs -- the branch containing your changes.

Common Patterns

Create issues from external data:

Webhook --> Code (transform) --> GitHub (Create Issue)

Receive form submissions or alerts via a Webhook node, transform the payload into a title and body, and create a GitHub issue automatically.

Daily stale issue report:

Schedule Trigger --> GitHub (List Issues) --> IF (older than 30 days) --> Slack (Send Message)

List open issues on a schedule, filter for stale ones using a date comparison, and post a summary to Slack.

Auto-label new issues by content:

GitHub Trigger (issue opened) --> IF (body contains "bug") --> GitHub (Edit Issue, add label)

Use the GitHub Trigger node to listen for new issues, inspect the body with an IF or Code node, and add labels programmatically.

Tips and Gotchas

Warning: Rate limits

The GitHub API allows 5,000 requests per hour for authenticated users and only 60 for unauthenticated requests. Workflows that loop through many repositories or issues can exhaust this limit quickly. Check the X-RateLimit-Remaining header in the response or add delays between calls.

  • The repo scope is broad. It grants read and write access to all repositories the user can access. For tighter control, use fine-grained tokens scoped to specific repositories.
  • Labels must already exist. The Create Issue operation will fail if you reference a label that does not exist on the repository. Create labels manually or via the API first.
  • Markdown in the Body field. GitHub renders Markdown in issue and PR bodies. You can use full GitHub-flavored Markdown including task lists, tables, and code fences.
  • Pagination. The List operations return a maximum of 30 items per page by default. Use the Return All toggle or set a higher limit to retrieve more results. Be mindful of rate limits when fetching large sets.
  • GitHub Enterprise. If you use GitHub Enterprise Server, set the Base URL in the credentials to your instance's API endpoint (e.g., https://github.yourcompany.com/api/v3).

Common Errors

HttpRequestError: Resource not found (404) when creating an issue. The repository owner or repository name is incorrect, or the authenticated user does not have access to the repository. Double-check spelling and case. If using a fine-grained personal access token, confirm it has been granted access to the specific repository.

Validation Failed: {"resource":"Label","code":"invalid"} when creating an issue with labels. The label you specified does not exist on the repository. Labels must be created before they can be applied to issues. Create the label manually in the repository's Labels settings or via the GitHub API first.

API rate limit exceeded (403) during bulk operations. GitHub allows 5,000 authenticated requests per hour. Workflows that loop through many repositories or paginate large issue lists can exhaust this limit. Add a Wait node between iterations, reduce polling frequency, or use conditional checks to limit the number of API calls.

See Also

Want this running in your stack?

I build production n8n and Cloudflare automation for teams — the same engineering behind HarperFlow. Fixed-price, escrow-protected, US-based.