Skip to content
About 8 min read0% read

n8n Git: version control for workflows, paid and free routes

Otomatzia editorial team · Last verified

Short answer

n8n has built-in Git source control, but only on self-hosted Business or Enterprise and on Cloud Enterprise. It pushes workflows and credential stubs to a branch and pulls them into another instance. On the free Community Edition, export workflows with the CLI and commit the files yourself. New to the tool? Read what n8n is.

Key facts
TopicDetail
Plans with Git source controlSelf-hosted Business and Enterprise, n8n Cloud Enterprise (n8n docs)
Available sincen8n 1.1.0, as Environments (Classic) (n8n docs)
Community EditionNo built-in Git version control (n8n docs)
Credentials in GitStubs only: ID, name and type (n8n docs)
Connection methodsSSH deploy key or HTTPS with a personal access token (n8n docs)
Free alternativen8n export:workflow and import:workflow on the server CLI (n8n docs)

Which n8n plans include Git?

By the end of this guide your n8n workflows live as JSON files in a Git repository, with a commit for each change. There are two ways to get there. If you run a paid plan, n8n's built-in source control does the commit and push from the editor. If you run the free Community Edition, a short export script does the same job from the command line. The paid route takes a repository, a deploy key and one settings screen; the free route takes one export command and a normal git commit.

Git source control is a paid feature. n8n's source control docs list it on n8n Cloud Enterprise and on self-hosted Business and Enterprise. The edition comparison lists version control using Git among the features the free Community Edition does not include, and the pricing page shows version control using Git in the Business plan and the environments and version control rows as not included on Cloud Starter and Pro. The pricing page aims Business at companies with fewer than 100 employees, offers it self-hosted only, and lists 6 shared projects on it.

If you are still choosing where n8n runs, our Cloud vs self-hosted comparison covers the trade-off, and the n8n tool profile puts it next to other platforms.

Git source control by n8n plan (from n8n docs and pricing page, December 2026)
PlanBuilt-in Git source controlWhat to use insteadSource
Self-hosted Community EditionNoCLI export and import, committed by youn8n docs
n8n Cloud Starter and ProNoCloud Enterprise, or self-hosting with the CLI routen8n pricing
Self-hosted BusinessYesNot neededn8n docs
Self-hosted or Cloud EnterpriseYes, plus the newer Environments in PreviewNot neededn8n docs

How does n8n source control work?

n8n links an instance to one branch of a Git repository. Each instance pushes its work to the branch, pulls work from it, or both. In n8n a commit and a push happen at the same time, as one action, according to n8n's Git primer. The same page warns that n8n does not implement all of Git and that you should not treat it as full version control. In particular, there is no pull request review and merge inside n8n; if you want one, do it in your Git provider.

Roles matter. Instance owners and instance admins can push and pull. Project admins can push but cannot pull, per the source control overview.

The most common surprise is that credentials do not travel with their secrets. n8n commits a stub with the ID, name and type, and after a pull you fill in the values on the target instance. The full list from the push and pull docs is below.

n8n now calls the feature above Environments (Classic). A newer version, simply called Environments, arrived in n8n 2.47.0 for Enterprise plans on Cloud and self-hosted. It uses promote and apply instead of push and pull, and it can add an optional promotion review before changes reach production. It is in Preview, so n8n advises trying it on test instances first. Classic remains the current default.

What n8n pushes to the repository
ItemWhat is committedWhat is not
WorkflowsThe saved version, with tags and the owner's emailThe published version; publish separately on the target
CredentialsStub: ID, name, type, plus fields set by expressionsSecret values
VariablesStub: ID, name, typeValues, never pushed
Data tablesSchema: table name and column definitionsRow data
Projects and foldersYesNothing excluded in the docs

Set up built-in source control (Business or Enterprise)

The setup steps below come from n8n's documentation. They were not run on our test instance, because the feature needs a paid plan. A hands-on Community Edition exercise is in the free versioning section further down.

These steps follow n8n's setup guide. You must be the instance owner or an instance admin.

  1. Create a new repository at your Git host and the branches you need, for example one branch for development and one for production.
  2. In n8n, open Settings, then Environments.
  3. Pick SSH or HTTPS. For SSH, paste the SSH URL (git@github.com:username/repo.git) and copy the key n8n shows. ED25519 is the default; choose RSA if your host requires it.
  4. For SSH, add that key as a deploy key with write access in your Git host. For HTTPS, create a personal access token with repository read and write access and enter your username and the token in n8n.
  5. Select Connect, choose the branch for this instance, and optionally turn on Protected instance for production so nobody edits source-controlled resources there.
  6. Select Save settings. The Push and Pull buttons now appear in the menu.

Push and pull without losing work

To push, select Push, choose the workflows and data tables to include, write a one-sentence commit message and select Commit and Push. Tags and the variable and credential stubs go automatically. To pull, select Pull; n8n may warn that it will override local changes.

n8n cannot detect conflicts on workflows, and the push and pull docs describe Pull and override as replacing your local work with the content in Git. Their advice is to make work flow in one direction: edit on development, push to Git, pull to production, and never edit on production and push back. If you also need test triggers that do not fire on production, see our guide to staging trigger isolation.

On pull you can set Auto-publish pulled version to Off, to publish only workflows already published, or to On. The modal always starts at Off and does not remember your choice; the API pull endpoint takes an autoPublish value of none, published or all if you want the same mode every time.

If you plan to let an AI assistant edit workflows, our n8n MCP server guide is a good companion, since a Git history makes those edits easy to review and undo.

How can you version n8n workflows for free?

Community Edition has no Push button, but the server CLI can export every workflow as its own JSON file, which is what Git needs. The --backup flag sets --all, --pretty and --separate, so you get one readable file per workflow. In Docker, run n8n commands inside the container with docker exec, as the CLI docs show.

The script below exports to /tmp inside the container and then copies the files out. We export to /tmp so the export folder stays separate from n8n's data volume, and docker cp copies it out to the host. The container name n8n matches the docker run command in our Docker install guide.

To load the files back, copy them into the container and run import:workflow with --separate and --input pointing at the folder. Two warnings from the CLI docs apply. Exported files carry their IDs, so a workflow with the same ID in the target database is overwritten. And import:workflow deactivates every imported workflow by default; keeping the active state from the JSON with --activeState=fromJson is supported only in multi-main and queue mode.

Do not commit credentials exported with --decrypted. The docs note that all sensitive information is visible in those files. Keep credentials out of the repository and recreate them on the target, which is also what the paid feature does with its stubs.

To practice, use a clean test container, not a live instance, because the export step writes every workflow it finds. Copy the minimal workflow fixture into the container and import it with docker exec -u node n8n n8n import:workflow --input=/tmp/version-export-fixture.json. On n8n 2.49.7, the commands below then produced one formatted JSON file for the fixture and committed it to an empty Git repository.

Export all workflows from a Docker n8n container and commit them
bash
# 1. Export one pretty JSON file per workflow inside the container
docker exec -u node n8n n8n export:workflow --backup --output=/tmp/n8n-export/

# 2. Copy the files out to your repository folder
mkdir -p workflows
docker cp n8n:/tmp/n8n-export/. ./workflows/

# 3. Commit
git add workflows
git commit -m "Export n8n workflows"

Failure modes and fixes

Each row is a problem the n8n or Docker docs describe, with the fix they give.

Common n8n Git problems
SymptomCauseFixSource
Cannot push onto read-only branchProtected instance is on for this instance, not a Git branch rulePush from the development instance, or clear Protected instance in Settings, Environmentsn8n docs
Host key verification failedThe Git server's SSH key changed, for example after a migrationSelect Disconnect Git, then connect again to reset stored host keysn8n docs
SSL certificate problem: unable to get local issuer certificateGit host uses a private certificate authoritySet GIT_SSL_CAINFO to a PEM file with the CA certificate (n8n 2.40.0 and later)n8n docs
Local edits vanished after a pullPull overwrites changes not stored in GitPush finished work first; keep work flowing in one directionn8n docs
Data table rows deleted on pullA table exists locally but not in Git, or columns were removedPush the table before pulling; removed columns cannot be recoveredn8n docs
Imported workflows are inactiveimport:workflow deactivates them by defaultPublish them again after importn8n docs

Questions about n8n and Git

Short answers, each from the n8n documentation.

Is n8n Git version control free?

No. The edition comparison lists version control using Git as a feature the free Community Edition does not include. It comes with self-hosted Business and Enterprise and with Cloud Enterprise. The free route is CLI export plus your own commits.

Does n8n push my credentials to Git?

Only stubs: ID, name and type, plus any fields set by expressions. Secret values stay on the instance, and you fill them in after a pull, per the push and pull docs. For different credentials per environment, n8n points to external secrets.

Can I review changes with a pull request?

Not inside n8n. n8n's Git primer says its source control does not support a pull request style review and merge unless you do it outside n8n in your Git provider.

Does a pull publish workflows automatically?

Only if you choose it. The Auto-publish pulled version setting starts at Off on every pull, and n8n never auto publishes archived workflows, according to the push and pull docs.

Need help putting n8n under version control

If you want a development and production setup with Git for your team, tell us what you run and we will match you with a provider from the n8n provider list.

Sources

Vendor features and prices change. Confirm details on the linked official pages before you rely on them.

Keep reading

More in this topic: n8n

All guides