AI and Automation
n8n GitHub Guide: The n8n Source Code Repo and How to Integrate n8n with GitHub
By Amjid Ali · · Updated · 5 min read

In this article
n8n's source code is on GitHub at github.com/n8n-io/n8n, a TypeScript monorepo with over 200,000 stars (October 2026). It is "fair-code": most of the code is under the Sustainable Use License, so you can self-host and modify n8n for free for internal or personal use, but you cannot resell it as a service. To integrate n8n with GitHub, add a GitHub credential (personal access token or OAuth2), then use the GitHub node to act on repositories (issues, files, pull requests, releases, Actions workflows) and the GitHub Trigger to start workflows on events such as push or pull_request.
This guide covers both halves of "n8n GitHub": the n8n repository itself, and connecting your n8n workflows to GitHub. I run self-hosted n8n in my homelab and keep my own workflow backups in GitHub this way.
The n8n GitHub repository (n8n source code)
| Details | |
|---|---|
| Repository | github.com/n8n-io/n8n |
| Language | TypeScript (Node.js backend, Vue editor UI) |
| Default branch | master |
| License | Sustainable Use License (fair-code); .ee files under the n8n Enterprise License (LICENSE.md) |
| Releases | Frequent; n8n 2.x in October 2026 (releases) |
| Docker image | n8nio/n8n |
How the n8n source code is organized
packages/cli: the backend server, REST API, workflow execution and then8ncommand.packages/frontend/editor-ui: the visual workflow editor.packages/core: the execution engine core.packages/nodes-base: the built-in nodes and credentials, including the GitHub node.packages/node-dev: a CLI for creating your own n8n nodes.
Is n8n open source? The license in plain words
The Sustainable Use License lets you use, copy, modify and self-host n8n for your own internal business purposes or for personal, non-commercial use. You may not offer n8n itself as a paid hosted service to others or resell it. Enterprise features (files with .ee in their name) need an n8n Enterprise License. That is why n8n describes itself as fair-code and source-available, not OSI open source. Read more in my guide to n8n's fair-code model.
Build n8n from source
Most people should install n8n with Docker or npm (see self-hosting n8n on Ubuntu). If you want to read the code, contribute or build a custom node, clone the repository. The CONTRIBUTING.md lists the required Node.js and pnpm versions (Node.js 24 or newer at the time of writing). Then:
git clone https://github.com/n8n-io/n8n.git
cd n8n
pnpm install
pnpm build
pnpm start
The editor then runs on http://localhost:5678. For development, pnpm dev rebuilds on every change.
How to integrate n8n with GitHub
Prerequisites
- An n8n instance (n8n Cloud or self-hosted).
- A GitHub account with access to the repository.
- For the GitHub Trigger: an n8n URL that GitHub can reach from the internet.
Step 1: Set up GitHub credentials in n8n
- In GitHub, go to Settings > Developer settings > Personal access tokens and create a token. The n8n credentials docs recommend a classic token with the
reposcope; fine-grained tokens work but have limitations. - In n8n, open Credentials > Add credential > GitHub API. Enter your GitHub User name and the Access Token. Leave the GitHub server as is unless you use GitHub Enterprise Server.
- Alternatively, choose GitHub OAuth2 (works with the GitHub and GitHub Trigger nodes).
Step 2: Create a new workflow
Create a workflow and decide how it starts: a GitHub Trigger (repository events), a Schedule Trigger, or a Webhook from another tool.
Step 3: Configure the GitHub Trigger
Add the GitHub Trigger node, select the credential, the repository owner and name, and the events, for example push, pull_request, issues or release. When you activate the workflow, n8n registers a webhook on the repository. On a self-hosted instance set WEBHOOK_URL to your public n8n address (see n8n with Docker, Nginx and Cloudflare Tunnel).
Step 4: Add GitHub actions to the workflow
The GitHub node covers these resources:
| Resource | Operations |
|---|---|
| File | Create, Delete, Edit, Get, List |
| Issue | Create, Create Comment, Edit, Get, Lock |
| Pull Request | Create, Get, Get Diff, Get Patch, Merge, Update, Close, Reopen, comments |
| 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 |
| Workflow (GitHub Actions) | Dispatch, Enable, Disable, Get, Get Usage, List |
| Organization, User | Get Repositories, Invite |
Anything not covered can be done with the HTTP Request node and the same GitHub credential against the GitHub REST API.
Step 5: Test and activate
Run the workflow with Execute workflow, check each node's output, then activate it. Watch Executions for the first few real events.
n8n git integration: back up your workflows to GitHub
There are two ways to keep n8n workflows in Git:
- Source control and environments (built in): links an instance to a Git repository so you can push and pull workflows between dev and production instances. It is available on the Business and Enterprise plans.
- A backup workflow (works on the free Community Edition): Schedule Trigger, then the n8n node (or HTTP Request to the n8n public API) to get all workflows, then the GitHub node with File > Create or Edit to commit each workflow as JSON. Run it nightly and you have version history for free.
Use cases for n8n and GitHub integration
- Post new pull requests and failed GitHub Actions runs to Slack, Teams or Telegram.
- Create GitHub issues from form submissions, emails or monitoring alerts.
- Use an AI agent to summarize a pull request diff (Get Diff) and comment on it.
- Dispatch a GitHub Actions workflow to deploy when something happens in another system.
- Nightly backups of n8n workflows to a private repository.
Learn n8n end to end: my Mastering n8n: AI Agents, API Automation, Webhooks & No-Code course covers credentials, webhooks, APIs and AI agents with real projects.
Related articles you may like
Frequently asked questions
Where is the n8n source code on GitHub?+
The official n8n repository is github.com/n8n-io/n8n. It is a TypeScript monorepo managed with pnpm, with the backend in packages/cli, the editor UI in packages/frontend/editor-ui and the built-in integrations in packages/nodes-base. The default branch is master.
Is n8n open source?+
n8n calls itself fair-code. Most of the source code is published under the Sustainable Use License, which lets you use, modify and self-host n8n for your own internal business purposes or personal use for free, but restricts selling it as a service. Files with .ee in their name are under the n8n Enterprise License. Because of those limits it is source-available rather than OSI-approved open source.
How do I connect n8n to GitHub?+
Create a GitHub personal access token (n8n recommends a classic token with the repo scope) or use OAuth2, add a GitHub credential in n8n with your username and token, then use the GitHub node for actions such as creating issues or files, or the GitHub Trigger node to start a workflow on repository events such as push or pull_request.
Can n8n store my workflows in Git?+
Yes, in two ways. The built-in Source control and environments feature links an n8n instance to a Git repository and lets you push and pull work, but it is only available on the Business and Enterprise plans. On the free Community Edition you can build a workflow that exports your workflows through the n8n API and commits them to a GitHub repository with the GitHub node on a schedule.
Can I install n8n from GitHub?+
You can build it from source by cloning github.com/n8n-io/n8n, installing Node.js and pnpm as the CONTRIBUTING guide specifies, then running pnpm install, pnpm build and pnpm start. For normal use, n8n recommends the Docker image or npm package instead, which are built from the same repository.
Does the n8n GitHub Trigger need a public URL?+
Yes. The GitHub Trigger registers a webhook in your repository, so GitHub must be able to reach your n8n instance over the internet. On a homelab install, publish n8n through a reverse proxy or a tunnel and set the WEBHOOK_URL environment variable to that public address.
Sources
- n8n-io/n8n repository, GitHub
- n8n LICENSE.md (Sustainable Use License), n8n
- Sustainable Use License, n8n
- GitHub node, n8n docs
- GitHub credentials, n8n docs
- Source control and environments, n8n docs
Keep reading
AI and AutomationHow to Build an AI Model: A Complete Guide for DevelopersAI model development in 8 steps: define the problem, prepare your data, choose tools, engineer features, train, validate, deploy and keep improving the model. · 6 min read
AI and AutomationThe Ultimate Guide: 20 Best Low-Code Platforms for Homelab and IT Automation ProjectsThe best software for homelab automation: n8n, Node-RED and Home Assistant first, then 17 more low-code tools, what each is good at and how to get started. · 5 min read
AI and AutomationHow to Automate Your IT Infrastructure: A Beginner’s Guide to AI Agents and Homelab AutomationAre you tired of manually managing your homelab and IT infrastructure? Here's a more detailed breakdown of how automation can transform your setup from ... · 2 min read