Why teams set up dev, staging and production n8n instances
Workflows that touch customer or finance data are often edited directly on a live instance, so a broken branch, a wrong credential or an untested expression reaches production before anyone reviews it. Separate n8n instances tied to Git branches let each change be reviewed and tested in a lower environment before it runs against real data. The point is not the number of servers but the gate between them: a change moves forward only after someone other than its author has looked at it.
n8n's Git-based environments are listed on its pricing page as part of the Business and Enterprise plans, alongside SSO and LDAP and log streaming. Teams on the Community edition, which the pricing page lists as free and self-hosted, do not get that built-in source control flow, so they must design their own promotion process. Confirm the current plan contents with n8n before you commit to a design, because the pricing page is the source for what each plan includes and it changes over time.
A manual process on the Community edition needs the same decisions a managed one would make: who exports a workflow, where the export is stored, who approves the import into production, and how credentials are re-entered on the target. Write those steps down before the first promotion, and record which person owns each one. Teams that skip this step usually discover the gap during their first incident, when nobody can say which version is running in production.
Which environment model fits your team
This table compares three ways to lay out n8n instances under Git: long-lived branch instances, a shared dev instance with a live production instance, and short-lived instances per pull request. Read each column as one model, and use the rows to check who edits where, how many instances you must run and patch, and what history Git keeps. The main takeaway is that instance count, not the Git workflow itself, usually sets the operating effort.
| Factor | One instance per branch | Shared dev with production-only live | Short-lived instance per pull request |
|---|---|---|---|
| Where changes are made | Each change is made in the dev instance, promoted by pull request to staging, then to production | Builders edit in the shared dev instance, and changes reach production only through a reviewed export or Git pull | Each pull request gets its own instance where the change is built and tested before merge |
| Instances to run and patch | Three long-lived instances (dev, staging, production), each upgraded on the same schedule | Two instances, but dev is shared and can drift from what production runs | One production instance plus a changing number of temporary instances that must be created and removed |
| What Git history records | Promotion path from dev to staging to production, with merges marking each release | Commits pushed from the shared dev instance, which may mix work from several people | One branch per change, with history showing the test run and the merge decision for that change |
| Credential handling | Each instance holds its own credentials, so production secrets never reach dev | Dev and production need separate credential sets, and dev credentials may point at real systems | Temporary instances need test credentials only, which limits exposure but requires an automated provisioning step |
| Edition needed for Git environments | Business or Enterprise plan, since environments with Git are listed on those plans only | Business or Enterprise plan, as the Git environment feature is listed on those plans only | Business or Enterprise plan, plus automation to create and remove instances |
| Main operating risk | Staging and production drift if fixes are applied directly to one instance | Shared dev hides who changed what, and production can lag behind dev | Instance sprawl and cost of automation, which grow with the number of open pull requests |
| Best fit | Teams with a stable release cadence and a dedicated platform owner | Small teams with few builders and a single production owner | Teams with many parallel changes and mature pipeline automation |
How changes move from dev to production
Changes start on a feature branch in the dev instance, where a developer pushes work to Git. A pull request into the staging branch goes through review before merge, and the staging instance pulls that branch. The same pattern repeats from staging to the main branch and the production instance. Check at each hand-off that the reviewer approved the exact change, that credentials are set up separately in each instance, and that the encryption key stays inside its own trust boundary.
Branches map one to one onto n8n instances, with review gates between them.
Who may push and pull in each environment
Workflow builders create and change workflows on their development instance and push work to named feature branches. They should not be able to write to the shared branches that feed staging or production. Their changes move forward only when a pull request is opened and merged, so the Git provider controls what advances. Environments with Git are listed on the n8n pricing page as part of the Business and Enterprise plans, so confirm your plan before you design these rights.
- Push scope: feature branches only, with one branch per change and no direct writes to protected branches.
- Pull scope: their own development instance, where they can pull teammates' branches for testing.
- Staging and production: no pull rights into these instances unless your release process grants them.
- Credentials: test credentials in development, with production credentials kept by the platform team.
- Review: every pull request needs at least one approval from someone other than the author.
Check that builders cannot merge into protected branches and that their n8n user role does not let them publish directly to production.
Reviewers and approvers check workflow changes before they move between environments. Their job is to confirm that the change does what the pull request describes, that it uses approved nodes and credentials, and that it does not expose data. Reviewers should not push the content they approve, because a change that one person both writes and accepts weakens the control the review is meant to provide. Required approvals and code owners are enforced in the Git provider, so the review is recorded where auditors can find it.
- Required approvals: set the number of approvals needed for merges into staging and for merges into the production branch.
- Code owners: assign owners to the folders that hold exported workflow files so the right people review each change.
- Separate sign-off: if policy requires a second approval for production releases, record it as a distinct step.
- Author separation: block approvers from approving their own pull requests in the Git provider settings.
- In-product review: where your edition offers a review feature inside n8n, confirm how it links to the Git approval.
Confirm that approvers can see the diff of exported workflow JSON and that the approval history is retained in the Git provider.
Platform and release engineers own the rules that govern the whole flow. They configure branch protection, set who may pull into staging and production, manage the n8n user roles and environment-specific values, and perform production releases. They also decide how rollbacks happen, usually by reverting a merge in Git and pulling the previous state back into the production instance. Because these people hold the broadest rights, their accounts need the strongest sign-in controls.
- Branch protection: owns the rules for shared branches, including blocked force pushes and required checks.
- Instance access: grants pull rights into staging and production and reviews them on a set schedule.
- Role assignment: confirm exactly which n8n role permits push and pull actions in your edition, because role names and permissions can change between releases.
- Environment values: maintains per-environment variables and keeps secrets out of exported files.
- Rollback: tests the Git revert and pull path before it is needed in an incident.
Verify the role mapping on a development instance before you apply it to production, and record who holds each privileged role.
Automation accounts are non-human identities used by CI pipelines and scheduled jobs to push or pull workflow changes. They should never share a personal login. Each pipeline should have its own account or API key, limited to the instances and actions it needs. A pipeline that only promotes approved branches to staging should not be able to change production or edit other pipelines' settings. The automation design should follow the Git flow, so a pipeline never bypasses a review that a person would have to pass.
- Dedicated identity: one account or API key per pipeline, named for its purpose.
- Minimum rights: access only to the instance and branch the pipeline serves.
- No review bypass: pipelines open or merge pull requests only where the Git provider's approval rules allow it.
- Key rotation: rotate keys on a schedule you set and revoke them when a pipeline is retired.
- Logging: keep pipeline run logs with the pull request record so each change traces to a run.
Confirm that each automation identity is restricted in both the Git provider and the n8n instance, and test that a revoked key stops the pipeline from working.
Setup sequence for three n8n environments
This sequence takes a team from a licensing check to a working promotion path, with dev, staging and production each running on its own n8n instance and Git branch. The result is a set of instances where every workflow change has a Git record and production only receives changes that have been reviewed.
Confirm the plan and license terms
Before provisioning anything, confirm that your plan includes environments with Git. The n8n pricing page lists this feature only in the Business and Enterprise plans, and the Sustainable Use License governs how you may use and modify the software internally. Ask n8n for the current plan scope in writing, and record which plan covers each instance. If you expect to use multi-main high availability later, note that it is limited to Enterprise self-hosted deployments. Done when the plan name and license scope are in your design record and approved by the budget owner.
Choose the environment model
Decide how many instances you need and how each maps to a branch. A common model is one instance per branch: a dev instance tracking the dev branch, a staging instance tracking staging, and a production instance tracking main. Decide whether each instance gets separate infrastructure or at least a separate database, since shared databases make it hard to keep environments apart. Record the mapping in a table with the branch, instance address, database, owner and the people allowed to approve changes into it. Done when security and the platform team have reviewed the table and every row has a named owner.
Deploy each instance separately
Deploy dev, staging and production as separate n8n installations, each with its own database, hostname and encryption key. Keep the production encryption key off lower environments. If you run queue mode, remember that the main instance's encryption key must be shared with its workers and webhook processors, so keep that key scoped to the instance it belongs to. Confirm that each instance starts, serves its own sign-in page and writes to its own database. Done when a sign-in on dev gives no access to production and each database connection points to its own host.
Connect each instance to its branch
Configure each instance's source control connection so that it tracks its own branch in the Git repository. Use a separate repository identity per instance, and limit write access to the branch that instance owns. Pull the current state of each branch into its instance, then save a test workflow in dev. Check that the change appears as a commit on the dev branch and that the staging and production branches are unchanged. Confirm the exact setup screens and whether each instance pushes, pulls or both in the n8n environments documentation for your version. Done when the commit history shows the test change under the dev branch only.
Set access rules for push and pull
Define who may push changes from each instance and who may pull them. Developers push from dev, and staging receives changes only through a pull request from dev. Production receives changes only through a pull request from staging, approved by a named reviewer. Limit direct editing on the production instance to a small set of break-glass accounts, and make sure any direct edit is captured in Git or reversed. Apply branch protection on staging and main in your Git provider, and match the n8n roles to the same people. Done when a developer account cannot merge into main without an approval.
Separate variables and credentials per environment
Set environment-specific values as variables on each instance, so workflows reference the same names everywhere while the values differ. Keep secrets out of the repository and out of anything that travels with Git. Create credentials separately on each instance, using test accounts or sandbox tenants in dev and staging and production accounts only in production. Because each instance holds its own encrypted credential store, plan how credentials are recreated or rotated when workflows are promoted, and confirm the behavior for your n8n version. Done when a promoted workflow runs on staging with staging credentials and no production secret appears in the repository.
Run a test change from dev to production
Make a harmless test change in dev, such as renaming a node or adding a sticky note, and move it through staging to production using the same pull requests and approvals that real changes will use. At each stage, check the record: the change appears in the dev commit history, the staging pull request shows the diff, and production reflects the change only after the approved merge. Then open the production instance and confirm that no unreviewed edit exists. Keep the test record and the branch protection settings as evidence for your change management review. Done when the promotion path has been exercised end to end and the record is filed.
How credentials differ between n8n instances
Each n8n instance keeps its own credential store, so credentials do not travel with workflows. The four cards below cover what this means for keys, accounts, references and queue mode workers when you run dev, staging and production side by side.
Each instance has its own store
Every n8n instance stores credentials in its own database, encrypted with its own encryption key. Copying a credential value from one environment to another means copying data that only decrypts on the instance that holds the matching key. Treat credential values as environment-local, and plan how each instance is provisioned with its own secrets rather than exporting them from development. Confirm with your team how your backup and restore process handles encryption keys, since a database restore without the matching key leaves credentials unreadable.
Queue mode docsSeparate test and production accounts
Development and staging should authenticate against test accounts, sandboxes or non-production tenants of the same SaaS services, while production uses live accounts. Sharing one login across environments means a broken test workflow can send real messages, write to live records or consume production quotas. Create a separate account for each environment in every external system a workflow touches, and record which account each instance uses so reviewers can confirm the target before a release goes live.
Referenced credentials must exist
A workflow that references a credential by name or ID expects that credential to exist on the instance where it runs. If a workflow promoted from development refers to a credential that was never created in production, it fails at the first node that needs it. Build an inventory of every credential each workflow uses, create matching entries in each target instance before promotion, and check the inventory as part of the release checklist. Confirm how your version of n8n matches referenced credentials when Git-synced workflows are pulled into a new instance.
Queue mode workers need the key
In queue mode, the main instance hands executions to worker processes through Redis, and those workers read credentials from PostgreSQL. n8n's queue mode documentation states that the main instance's encryption key must be shared with every worker and webhook processor so they can decrypt those credentials. Set the same key on each worker as part of provisioning, and treat a key change as a coordinated change across the whole cluster. Confirm this rule against the version you run before you rely on it in production.
Queue mode docsKeeping environment-specific values out of workflows
A workflow copied from a development instance to production should not carry the development instance's hostnames, endpoints, folder IDs, sheet IDs or channel IDs inside its JSON. Hardcoded values are the most common reason a promoted workflow fails on the first run, because the target instance either calls a system that does not exist there or writes data to the wrong place. The fix is to decide, for every value a workflow uses, whether it is an environment setting, a secret or a fixed business rule, and then to hold it in the right place: n8n variables for non-secret settings such as base URLs and feature switches, and credentials for anything that authenticates. Each environment then supplies its own values, and the workflow JSON stays identical across instances.
Before promoting anything, review each node for literal values and sort them into those three groups. Credentials are already separate objects, but each instance holds its own copy, so the production credential must be created or linked on the production instance rather than imported from development. Identifiers that differ by environment, such as the ID of a production spreadsheet, should be moved into a variable and referenced by name. A dry run on a staging instance, with a deliberately different set of values, will show which nodes still depend on development settings. Illustrative example: a webhook node that posts to a development hostname will keep posting there after promotion unless that hostname is replaced by a variable.
The mechanics of variables, including scopes, naming limits and how they travel with source control, change between n8n releases and depend on your plan. Confirm these in the target version before you design the naming convention, using the n8n release notes and the variables documentation for that version. The sibling topic on custom variables across environments covers the details, so keep the convention in one document that every workflow author follows. Your reviewers should reject any pull request that adds an environment-specific literal to a workflow.
Security controls for multi-instance n8n environments
A dev, staging and production setup multiplies the places where secrets, access and changes live. The four controls below keep each instance's data isolated, limit who can move changes toward production, scope automation credentials, and leave a record that reviewers can follow. Confirm each one in your own environment before the first production release.
Separate encryption keys and databases
Each n8n instance encrypts its stored credentials with its own key and keeps its own database, so a leaked development key or copied development database does not expose production secrets. In queue mode, the encryption key must be shared with every worker and webhook processor, which means the key copy inside production is the one to protect most carefully. Confirm where each key is stored, who can read it, and that staging never receives the production key or a production database dump.
n8n queue mode docsRestricted push access to production
Only reviewed changes should reach the production branch. Protect the production branch in your Git provider so that direct pushes are blocked and merges require an approved pull request from a named group. Decide who may push to development, who may merge into staging, and who may trigger a pull into the production instance. Confirm that the same people cannot both approve and merge their own change, and that repository administrators are listed and reviewed.
Scoped API keys for pipelines
A pipeline that pushes or pulls workflows should use its own n8n API key rather than an administrator's personal key. Create one key per pipeline or per environment, give it only the permissions the job needs, and rotate it on a schedule you define. Confirm that keys are stored in your CI secret store rather than in the repository, that revoking one key does not break other pipelines, and that you know which plan includes the environments feature the pipeline depends on.
Audit trails in Git and n8n
Git history records who proposed each workflow change, who approved it and when it merged, while n8n's own history records saved versions inside each instance. Together they answer what changed, who changed it and what ran afterward, but neither proves the other is complete. Confirm that your retention settings keep the records you need, that Git commit identities map to named people, and that the production instance's version history and execution logs are exported or retained for the period your change policy requires.
Questions teams ask before setting up n8n environments
What drives the cost of running three n8n instances?
The cost comes from three places: the n8n plan you choose for each instance, the infrastructure hosting them, and the people who design and maintain the Git workflow. Running self-hosted, the Community edition has no license fee, but Git-based environments are not part of it. The Business plan is listed at 667 euros per month billed annually on the n8n pricing page, and that figure applies to the plan, so ask whether one plan covers all instances in your setup. Infrastructure for dev, staging and production is recurring, and so are backups and upgrades. The one-time cost is the design and build. Ask any quote to separate these components.
Can the Community edition support Git-based n8n environments?
No, the Community edition does not include environments with Git. According to n8n's pricing page, environments with Git, SSO and LDAP, and log streaming are included only in the Business and Enterprise plans. The Community edition remains free to self-host and can run workflows, but you would manage promotion between instances by hand, such as exporting and importing workflows. Confirm the current feature list on the pricing page before you decide, because plan contents change over time. If Git-backed promotion is a requirement, that points you to Business or Enterprise.
How long does setting up dev, staging and production n8n take?
The duration depends on the number of instances, how many branches and environments you define, your Git provider setup, how many credentials and variables must differ per environment, and how much of the review process you want to automate. Identity integration and network access often take the longest, since they depend on approvals outside the project. No timeline applies to every organization, so ask for a duration in the written scope, with each phase and the client dependencies listed separately. A fixed-scope agreement sets the timeline before work starts.
What does the setup need from our team?
Plan on three kinds of input from your side. First, a Git provider administrator who can create repositories, branch protection rules, approval requirements and API keys for each pipeline. Second, network access that lets the instances reach the Git provider and each other, and that lets your reviewers reach the admin interfaces. Third, identity setup, meaning an administrator who can register the n8n applications with your identity provider if SSO is in scope. Also name an owner who decides which credentials and variables differ by environment, since those choices shape the design.
Can our internal team build this environment setup alone?
Yes, if your team has experience with n8n administration, Git branching and CI/CD, and access to the n8n plan that includes environments with Git. The work is more than installing three copies of n8n. It requires deciding how branches map to instances, who may push and pull, how variables and credentials differ per environment, and how rollback works. Teams that lack one of these skills often spend more time on the design than on the build. A partner can run the design and build under a written scope, and your team keeps ownership of the result.
How do credentials differ between the dev, staging and production instances?
Each instance should hold its own credentials, issued against the test or production accounts that the instance is meant to reach. Credentials are stored encrypted in each instance's database, so they do not travel with Git in plain form. If you run queue mode, the main instance's encryption key must be shared with all worker and webhook processor nodes so they can read credentials, which means that key belongs to the same environment and must be protected. Confirm with your security team how keys and secrets are rotated per environment before you finalize the design.
What is the risk of letting a single instance serve as staging and production?
A shared instance means a failed test workflow can affect live automations, and a test credential can reach production systems. Separate instances create a boundary that reviewers can see, and they let you test upgrades before production. The trade-off is cost and operating effort, since each instance needs hosting, backups and patching. Ask whether your change management policy requires a separate staging environment, because that requirement decides whether this design is necessary or optional.
Does n8n's Sustainable Use License limit how we can run these environments?
The Sustainable Use License allows use or modification for your own internal business purposes, so running dev, staging and production instances for your organization fits within it. Files with .ee in their name or directory require a valid n8n Enterprise License. Your deployment should not distribute n8n to third parties free of charge for commercial purposes. Have your legal team review the license text at the n8n LICENSE.md file before you commit, especially if you plan to host instances for other companies.
Limits to confirm in your environment
The Git-backed environment model depends on your n8n edition, your license terms and your Git provider's controls. Confirm each limit below against your own plan and network before you design the branch flow, because a gap found after rollout is far more costly to fix.
Environments with Git availability
Git environments and their push and pull controls are listed on n8n's pricing page as part of the Business and Enterprise plans, not the free Community edition. Confirm that the plan you intend to buy, and the deployment type you run (self-hosted or cloud), includes environment sync with Git before you plan a dev, staging and production split. Ask n8n in writing which permissions control who may push and who may pull, since your approval model depends on them.
n8n pricingSustainable Use License terms
n8n is source-available under the Sustainable Use License, which permits use for your own internal business purposes but not commercial redistribution. Your staging and production instances inside the company generally fall under internal use, but confirm this with your legal team, especially if an environment serves customers or partners. Files marked with .ee require a valid Enterprise License, so check which features your environment design depends on before assuming they are covered.
Credential and variable handling in Git sync
Confirm how the Git sync feature in your n8n version treats credentials and variables before you commit anything to a repository. Credentials are encrypted with each instance's own key, so the encrypted data does not move between instances by itself, and the target instance needs its own credential definitions. Ask n8n which values, if any, are exported with workflows and how environment-specific values are mapped during a pull, then test that behavior on a non-production instance first.
High availability options by edition
Multi-main setup, which runs several main instances for high availability, is restricted to Enterprise self-hosted deployments and is not available in the Community edition or n8n Cloud. If your production environment needs redundant main instances, confirm that your intended edition includes it. Queue mode is a separate choice: in queue mode, the encryption key must be shared with every worker and webhook processor, so plan that key distribution as part of your production build.
Queue mode docsBranch protection and approval enforcement
Your Git provider, not n8n, decides whether a pull request to the production branch can merge without review. Confirm that your provider can require approvals, block direct pushes to protected branches and restrict who may merge, and that these rules apply to administrators too. Check whether the provider's audit log records approvals and merges, since that record is often the evidence a change management review asks for.
How DeployOpen scopes and delivers n8n environment setup
DeployOpen plans and builds the Git-backed dev, staging and production n8n instances in infrastructure you control, with branch mapping, review rules, variables and credential separation written down before any work starts. Engagements are fixed-scope, so the environment design, deliverables and timeline are agreed in writing first.
How we scope
- Confirm which n8n edition and plan you run, since environments with Git are included only in Business and Enterprise plans.
- Map which branch deploys to which instance and who may push, pull and approve changes in each.
- Record which variables, credentials and external systems differ between dev, staging and production.
How we build
- Deploy each n8n instance with its own database, encryption key and credential store, kept separate per environment.
- Configure source control connections, branch-to-instance mapping and pull request rules in your Git provider.
- Test a sample workflow through dev, staging and production, including rollback through Git history.
How we hand over
- Deliver a written runbook covering branch rules, promotion steps, variable naming and credential ownership.
- Document access roles for developers, reviewers and release operators, with the reasons for each grant.
- Walk your engineers through a live promotion so they can run the next release without us.
How we support
- Offer ongoing support and upgrades as a retainer, so environment settings stay aligned with new n8n releases.
- Review environment drift, access changes and failed promotions on a schedule agreed in the scope.
- Retest the promotion path after each n8n upgrade or change to your Git provider configuration.

