Exporting and importing n8n workflows and credentials

Copying n8n workflows and credentials between instances works with JSON exports and the CLI, but credential exports carry real risk and history does not travel. This page explains when to use them and when to choose packages or Git.

On this page

Exporting and importing n8n workflows and credentials: when a copy is enough

A team often needs one workflow or credential moved from a development instance to production, or to a new server after a rebuild. The n8n editor and the CLI can both export workflows as JSON and import them into another instance, which is enough to copy the workflow logic. Credentials and execution history need separate handling, because a workflow JSON file does not carry the secret values behind its credentials, and history stays with the instance where the runs happened. Before you move anything, decide which of these you actually need to carry across, since each one follows a different path.

A workflow JSON export holds the nodes, connections, settings and references to credentials by name and ID. It is safe to store in source control only after you check it for hardcoded tokens, hostnames and test data. Credential exports are different. The CLI can export credentials with decrypted secret values when a flag such as --decrypted is set, which produces a plaintext file that anyone who reads it can use. Confirm the exact flags, the encryption key handling and the import behavior against the documentation and --help output for your installed n8n version before you script anything, because these details change between releases.

This page covers the editor and CLI export and import paths, what each output contains, the risk of decrypted credential files, and the history you lose when you copy. It also explains when a copy is enough and when the team should move to n8n packages for dependencies or to Git for a reviewable record of change. Those approaches have their own sibling pages, so the decision here is narrow: whether a JSON copy and a separately handled credential are sufficient for the move you have in front of you.

Editor export, CLI export and API export compared

The editor export is the simplest route and the one most builders reach first. From a workflow's menu you can download it as a JSON file that contains the nodes, connections and settings. The file does not carry credential secrets. Nodes reference credentials by name and ID, so the file can be shared in a ticket, but it will not run on another instance until matching credentials exist there.

  • What it includes: the workflow definition as JSON, including node parameters and connections. Confirm whether pinned data is included in your version.
  • Who can run it: any user with edit access to the workflow in the editor, within your roles and projects. Confirm the minimum role your edition requires.
  • Where the output goes: a file on the downloading user's workstation. Nothing is written to the server or to Git.
  • What it leaves out: execution history, version history and credential secrets. Those stay on the source instance.

Export a test workflow and review the file's contents before your team relies on this route for anything beyond a single workflow.

Which transfer method fits which copy job

This table compares five ways to copy n8n workflows and credentials between instances, showing what each method moves, what it leaves behind and who should run it. Read each row against the copy job you need, then check the stay-behind column before choosing. The main takeaway is that only Git-based promotion keeps a durable change record, and credentials need their own handling in every method.

MethodWhat movesWhat stays behindWhen it fits
Editor JSON export and importSelected workflows as JSON filesCredentials, execution history and version historyA builder copying a few workflows to another instance
CLI export and importWorkflows and, if the export includes them, credentialsExecutions and version history; credentials need the source encryption key on the targetAn administrator scripting copies on the server
Decrypted credential exportCredential values in readable formNothing is protected in the file; the file itself becomes the secretOnly when a target cannot share the encryption key; restrict and delete the file
n8n packages (.n8np)Workflows with declared dependencies in one fileCredentials and missing dependencies must be supplied by the target; no execution historyMoving a bundled set of workflows between instances; confirm Preview status and plan access
Git-based promotionWorkflow definitions committed to a repositoryCredentials, environment-specific values and execution dataTeams needing review, history and rollback; requires the Business or Enterprise plan

Why decrypted credential exports change your risk profile

A decrypted credential export turns stored secrets into plaintext in a file, and that file then becomes the thing you must protect. n8n keeps credentials in its database encrypted with the instance encryption key, so the export format matters. When an export decrypts those values, every API key, password and OAuth token inside it can be read by anyone who opens the file, outside the access controls that protect the running instance. Treat the export as a credential store in its own right, with the same owner, retention and audit expectations you apply to a vault.

The file can leak in more places than the instance does. Common paths include a laptop that syncs to a personal cloud folder, an attachment on a ticket or chat thread, a copy left in a shared drive or CI artifact, and a backup that was never scoped for secrets. Ask the team to confirm where exports are written, who can read those locations, and whether backup jobs will sweep them up. Any export that must cross a team boundary should be encrypted for transport and handled by a named owner, not passed along informally.

Imports depend on the same key. The target instance must use the same encryption key as the source, or it cannot read the imported credentials, which means the key itself is part of what you must move and protect. Keep the key out of the export file and out of the ticket that requests it, and confirm with your own environment how the key is stored on each side. Put three controls around every export: restrict who can create and read it, delete it once the import is verified, and log who exported what and when, using your own audit tooling. Confirm with n8n which audit events your edition records before you rely on them.

How to run a controlled export and import

This sequence moves n8n workflows and, only when truly needed, credentials from a source instance to a target instance with a recorded check at each stage, so the target runs the same logic and nobody is left guessing what changed.

  1. Confirm matching n8n versions

    Before anything moves, the person running the migration checks the version shown in the source and target instances under settings and compares them. Both should run the same n8n release, or the target should be upgraded first in a separate, tested change. Mismatched versions can change how exported node parameters are read, so record both version numbers in the change ticket. Done means the two numbers are written down and match, or the upgrade is scheduled and the import waits for it. Confirm the exact release notes for any gap with the n8n release notes before proceeding.

  2. Freeze changes on the source

    The workflow owner announces a change freeze on the source instance so no one edits or activates workflows while the export runs. Anyone who edits during the window creates a difference between the export and the live version that the import will not reflect. Record the export time and the list of workflows in scope. Done means the freeze is acknowledged by the workflow owners and the list of in-scope workflows is recorded, with active status noted for each one.

  3. Export workflows to JSON

    Export each in-scope workflow from the editor or with the CLI, saving one JSON file per workflow into a restricted folder with a naming pattern that includes the workflow ID and export date. Workflow exports contain node configuration and connections but not the secret values held in credentials. Done means every in-scope workflow has a file, and the count of files matches the list from the freeze step. Also record the node count of each workflow, since the target check depends on it.

  4. Export credentials only when required

    Most moves should not export credentials at all. Re-creating them on the target keeps secrets from ever leaving the source. If a decrypted export is unavoidable, the security owner approves it in writing, the export runs under a named operator, the file is encrypted at rest, and it is deleted after the import. Decrypted credential files carry live secrets, so treat them like a password vault backup. Done means either the approval record exists and the file is stored under those controls, or the step is skipped with the credential list noted for manual re-creation.

  5. Transfer over an approved channel

    Move the files only through a channel your security team has approved, such as an internal file share or a controlled artifact store, and never by personal email or public chat. Compute a checksum for each file before transfer and verify it on arrival. Done means the checksums on the target match the source and the transfer log is attached to the change record. If a checksum fails, re-transfer rather than editing the file.

  6. Import workflows on the target

    On the target instance, import each JSON file into the designated project, leaving the workflows inactive. Imported workflows keep their node graph but not the version history, execution history or the source's sharing settings, so note those as lost in the change record. Done means each file produces one workflow on the target, and the node count of every imported workflow matches the count recorded at export.

  7. Re-create or re-link credentials

    Open each imported workflow and attach credentials that exist on the target, which were created by the owning team through their own login flow rather than copied from the source. Nodes without a matching credential show a missing-credential warning that must be cleared before activation. Done means no node in an in-scope workflow reports a missing credential, and each credential used is recorded with its owner.

  8. Activate and verify with test runs

    Run a manual test execution of each workflow on the target using known sample input, and compare the output with the expected result from the source. Only after the outputs match, activate triggers and schedules, then confirm the first live executions succeed. Keep the source workflows frozen until this is complete, then decide with the owners whether to retire them. Done means each workflow has a passing test run recorded, activation is logged, and the change record is signed by the workflow owner.

How data and secrets move between source and target instances

The export starts on the source instance, either from the editor or the CLI, and produces a JSON file for workflows plus an optional credential file that can contain decrypted secrets. That file sits outside the instance's control, so it is the trust boundary to watch: it must travel over an approved channel and be handled as sensitive material. On the target, imported credentials are re-encrypted with the target's own key and stored in its own database, while the workflow history on the source never leaves. Check that the file is deleted after import and that no copy remains in shared storage.

Export files cross a trust boundary; history and source secrets stay behind.

Protecting exported files and the encryption key

An n8n export can carry workflow logic, and with decrypted credentials it can carry live passwords and tokens. The cards below cover who may export, how files move and get deleted, and what happens to the encryption key when data moves between instances.

Restrict who can run exports

Any user who can open a workflow or the CLI on the host may be able to copy its definition out of the instance. Decide in writing which roles may export workflows and, separately, which may export credentials, and keep that list short. Check who holds the owner or admin role and who has shell access to the server, since both paths bypass editor-level sharing. Confirm the exact export permissions for your n8n version with the n8n docs before you publish the policy.

SAML user docs

Treat decrypted credential files as secrets

A credential export with decrypted values is a file of working passwords, API keys and OAuth tokens. Store it the way you store a secret: encrypted at rest, in a restricted location, and never in a shared drive folder. Name the file so its sensitivity is obvious, and record who created it and why. Rotate the affected credentials if the file is exposed outside the approved path.

Plan for the shared encryption key

Credentials in the database are encrypted with the main instance's encryption key, and a package or export does not carry that key. The target can read encrypted credentials only if it has the same key, which means the key is itself a high-value secret. In queue mode the key must also be shared with every worker and webhook processor. Before moving data to a new instance, confirm which key it uses, how the key is delivered, and who can read it.

Queue mode docs

Keep files out of chat and tickets

Engineers often paste workflow JSON into a chat thread or attach it to a ticket to ask for help. Those systems are usually retained longer than the workflow, are searchable by many people, and may sync to external services. Share a reference to the workflow inside your source control or n8n project instead. If a file has already been posted, delete it from the tool and check its retention and backup settings.

Delete temporary export files

Downloads folders, temp directories and CI artifacts keep exports long after the migration ends. Set a rule that each export is deleted once the import is verified, and make the deletion part of the change ticket. Check that the export did not land in a synced folder or a container volume that outlives the job. For CI pipelines, mark any artifact that contains credentials as non-downloadable and short-lived.

Log export and import activity

Exports leave little trace in the editor, so a copied file can go unnoticed. Record who exported, what was exported, when, to which target, and who ran the import. Keep these records with your change management evidence, and review them when credentials are rotated or an incident is investigated. Ask your n8n plan and hosting setup which audit and log features you have, and confirm what is captured before you rely on them.

Questions teams ask before copying n8n workflows and credentials

Can our team copy n8n workflows and credentials between instances without outside help?

Yes, a team with someone comfortable with the n8n editor, the command-line tools and its database can usually copy a small set of workflows alone. The work becomes harder when the set is large, the workflows depend on each other or on credentials, or the two instances differ in version, database or encryption key. Those factors decide whether an in-house move is a short task or a planned project. Before deciding, list the workflows, their credentials and their external dependencies, then compare that list with what the target instance already has. A partner's role is usually to plan, carry out and document the move under a written scope, which is a different question from whether your staff can run the commands.

What makes an n8n export or migration take longer?

Effort follows the number of workflows, the number of credentials, how the workflows depend on one another and how far the source and target environments differ. Each credential must be recreated or reconnected on the target, and each workflow that calls a sub-workflow, uses a variable or points at a hard-coded URL needs a check. Differences in n8n version, database, base URL, webhook paths and encryption key add further steps. Testing matters too: every workflow that runs on a schedule or responds to a webhook should be exercised on the target before the source is switched off. Ask for a written inventory of these items before agreeing to a timeline, since the inventory is what the estimate rests on.

Do n8n exports keep workflow history and execution records?

A standard workflow export keeps the workflow definition, meaning its nodes, connections and settings, but not its version history or its past executions. Teams that need the earlier versions or the run records should archive them separately or keep the source instance available for reference. Check the current n8n documentation for exactly which fields each export method includes, because this varies by version and by how the export is run. The history question also affects the migration plan: if change records must be kept for audit purposes, the team should decide where they live before the source is retired, and treat that archive as a separate deliverable.

When should we move to n8n packages or Git instead of exporting JSON?

JSON exports suit a one-off copy of a few workflows that have few dependencies. Packages suit moves where a workflow's dependencies need to travel with it, and Git suits any setup where several people change workflows and each change needs a history, a review and a rollback point. Consider switching when you copy the same workflows more than once, when more than one environment must stay aligned, or when auditors ask who changed what and when. Git-based environments and packages depend on plan and feature availability, so confirm on n8n's pricing page which features your edition includes before designing around them. Packages may also carry preview limits that should be checked against the version you run.

Is it ever safe to export n8n credentials in decrypted form?

A decrypted credential export writes secrets such as API keys, passwords and OAuth tokens in readable form to a file, so anyone who gets that file gets the secrets. Treat it as a last resort, and only when the target cannot receive the encrypted data and an approved secret store is not available. If it is used, limit who can run the export, transfer the file over an approved channel, store it in restricted storage, delete it after import and rotate every exposed secret. Also consider that the encryption key must match between instances for encrypted credentials to work, so the cleaner path is usually to recreate credentials on the target and let its own key protect them. Record the decision and its approval for your security and compliance teams.

What should we ask a partner to include in a quote for a move?

Ask for a written scope that names the source and target versions, the databases, the number of workflows and credentials in scope, and which dependencies and environment differences are covered. The quote should state what is excluded, such as history archiving, third-party account changes or retraining, and who performs each credential reconnection. Ask how testing will be done, who signs off on each workflow, how cutover and rollback work, and what documentation you receive at the end. Also ask whether the work is fixed-scope or open-ended, what happens if the inventory changes after the quote, and whether follow-up support is included or sold separately. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and does not publish a price list, so the written scope is the basis of any quote.

How long will a move between n8n instances take?

The duration depends on scope, and no fixed figure applies to every move. It is driven by the inventory of workflows and credentials, the number of dependencies, the gap between source and target and how much testing and sign-off your organization requires. A move with a few self-contained workflows differs greatly from one involving many interlinked workflows, multiple environments and regulated change approvals. Ask for an estimate in writing that breaks the work into inventory, credential reconnection, testing, cutover and handover, and state which of those assumptions it depends on. Revisit the estimate if the inventory changes during the work.

Limits to confirm in your own environment

The export and import path depends on details that change between n8n versions and editions, and on how your instances are configured. Treat each item below as a question to answer with the vendor or in a test instance before you choose a method or set a migration date.

CLI command syntax for your version

Confirm the exact export and import subcommands, flags and output formats for the n8n version you run, including whether workflows and credentials are exported in separate calls. n8n ships minor releases roughly weekly under semantic versioning, so a command that worked on an older build may have changed flags or defaults. Run the commands against a copy of your instance, record the version, and keep the working syntax in your runbook next to the version it was tested on.

Example release cited
2.43
n8n release notes

Credential compatibility across versions

Ask whether a decrypted or encrypted credential export written by one version imports cleanly into another, and whether credential types, field names or OAuth scopes changed in between. Also confirm which encryption key the target instance needs to read exported credentials. A mismatch can leave credentials present but unusable, which often shows up only when a workflow first runs in production.

Node types that need extra setup

List every node type in the workflows you plan to move and check which ones need community packages, custom nodes, external credentials, local services or network access on the target. Exports store node configuration but not the infrastructure behind it, so a workflow can import successfully and still fail on the first execution. Mark each node as ready, needs setup or needs a rebuild, and assign an owner to each item marked as needing setup.

Behavior of IDs on import

Confirm whether workflow and credential IDs are preserved, regenerated or matched by name when imported into a different database or instance. Trigger URLs, webhook paths, sub-workflow references and credential links all depend on these identifiers. If IDs change, check every reference inside the exported JSON and every external system that calls a webhook, because those callers will not update themselves.

Edition effects on the chosen method

Confirm whether the export and import method you plan to use is available on your current plan and whether source control, packages or review features change what you can move. Community and paid editions differ in features, and some capabilities are gated to Business or Enterprise plans. Ask your vendor contact to confirm in writing which edition your target instance needs before you design the process around it.

n8n pricing page

How DeployOpen works on this

DeployOpen treats export and import as a controlled migration of workflows and credentials between instances you run in your own infrastructure. The work starts with an inventory of what must move, what must be re-entered and what history must be kept elsewhere, then proceeds through a tested copy, a written handover and optional ongoing support.

How we scope

  • The written scope lists which workflows, credentials and environments are in and out of the move.
  • Scope records how each credential will be re-entered or re-authorized on the target instance.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • We run test exports and imports on a non-production copy before any production change.
  • We check that imported workflows reference the right target credentials and environment settings.
  • We record decisions on secrets handling, the encryption key and where version history is kept.

How we hand over

  • You receive a runbook covering the export, import, verification and rollback steps used.
  • The handover lists every credential that was re-created, with its owner and where it is stored.
  • We document which history was lost in transfer and how your team will keep future change records.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • A retainer can cover repeating migrations between your development, staging and production instances.
  • Support requests are handled against the agreed scope, with changes quoted in writing before work begins.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.