Workflow Versioning: Change History, JSON Export, Git Backup Workaround for Community Edition

Workflow History shows only 24 hours without an Enterprise plan. Here is how you can permanently back up n8n workflows yourself via JSON export and Git.

Anyone building workflows in n8n changes them constantly: a node gets added, a filter gets adjusted, error handling gets retrofitted. Without versioning, every one of these changes is a silent overwrite, and the question "Which version was still running stable yesterday?" can no longer be answered. n8n comes with a built in Change History for this, but the full history and the native Git sync via Source Control are reserved for the Business and Enterprise plans, not the free Community Edition.

For everyone else, the manual JSON export remains the workaround: workflows can be downloaded as a JSON file at any time and checked into your own Git repository. This article shows what the built in Change History actually delivers, where its limits lie, and how you can build a working backup and versioning system with built in tools, even without an Enterprise license.

What does the built in workflow Change History show?

Every workflow in n8n has its own history icon, which opens a menu with all saved versions, each with a canvas preview of the selected version. According ton8n documentation on Change History n8n automatically creates a new version when you save the workflow, restore an old version (the previously active version is saved first in that case), or pull from a Git repository via Source Control.

Several actions are available for each saved version:

  • Restore version: replaces the current workflow with the selected version.
  • Clone into new workflow: creates a copy of the version as a standalone workflow.
  • Open version in new tab: allows a direct side by side comparison of two versions.
  • Download: exports the selected version as a JSON file.
  • Name version: protects it from automatic cleanup, this feature is reserved for Pro and Enterprise users.

The scope of this history matters in practice. It differs significantly depending on the plan:

  • Enterprise (Cloud or Self hosted): full workflow history without a time limit.
  • Cloud Pro: versions from the last five days.
  • All other users, including Community Edition: only versions from the last 24 hours.

In concrete terms, this means: anyone using the Community Edition or a basic Cloud plan loses access to older intermediate states after one day at the latest. For a genuine, permanent version history, the built in feature is not sufficient in these cases.

Why isn't Source Control via Git available to everyone?

With Source Control, n8n offers native Git integration that lets workflows sync automatically with a repository, including multiple environments via separate Git branches. According ton8n documentation on Source Control and Environments this feature is however "Available on Business and Enterprise plans", so it is not part of the free Community Edition, nor of the basic Cloud tiers.

Where Source Control is available, setup happens via Settings > Environments. You enter the Git repository URL there, either via SSH with a Deploy Key or via HTTPS with a Personal Access Token, and n8n automatically generates an SSH key for this (ED25519 by default). Instance owners and instance admins can then both push and pull, project admins can only push. Anyone working productively with multiple environments and holding a Business or Enterprise license should use this native path, it takes the manual maintenance of the export off your hands.

The workaround: manual Git backup via JSON export

Without a Business or Enterprise license, the JSON export remains the most reliable way to secure workflows permanently and in versioned form. According ton8n documentation on Export and Import n8n fundamentally stores workflows in JSON format, and it is exactly this format that can be exported, checked into a Git repository, and there committed, tagged, and rolled back like any other code change.

Export via the interface

For individual workflows, the editor interface is entirely sufficient:

  • Open the workflow and click the three dot menu in the top right.
  • SelectDownload to download the current workflow as a JSON file to your computer.
  • Alternatively, you can select individual nodes, copy them with Ctrl+C or Cmd+C, and paste them into a text editor, which also produces valid workflow JSON for partial sections.
  • ViaImport from File orImport from URL a JSON file can be loaded back into n8n later.

The documentation explicitly points out that exported JSON files contain credential names and credential IDs. Before you share such a file or place it in a shared repository, you should remove or anonymize this information so that no sensitive credentials accidentally end up in the version history.

Export via the command line for entire instances

For a complete backup of all workflows of a self hosted n8n instance, the CLI is better suited than the manual individual download. According ton8n documentation on the command line dedicated export and import commands are available for this:

  • `n8n export:workflow --all --output=backups/latest/` exports all workflows into a directory.
  • `n8n export:workflow --backup --output=backups/latest/` uses the dedicated backup mode, which internally sets `--all --pretty --separate`: all workflows, formatted for readability, each as its own file.
  • `n8n export:workflow --id=<ID> --output=file.json` exports a single specific workflow.
  • `n8n import:workflow --separate --input=backups/latest/` imports an entire directory of individual JSON files back.
  • `n8n import:workflow --separate --input=backups/latest/ --activeState=fromJson` also applies the original activation status of each workflow during import.

How to build a Git backup from this

Combine the CLI's backup mode with a regular cron job and a Git repository, and the result is a self built but solid versioning system:

1. Create a private Git repository, separate from your other application code.

2. Set up a daily cron job on the n8n server that runs `n8n export:workflow --backup --output=backups/latest/`.

3. Commit the exported files to the repository, automatically or manually, with a meaningful commit message.

4. Before every commit, check that no uncleaned credential references are included, ideally via a simple script that filters or flags known patterns such as `credentialId`.

5. Use `git tag` where needed to clearly mark stable production states, so you can find them again months later too.

This achieves, at its core, what Source Control offers natively, just without an automatic push pull mechanism and with a bit more manual work when rolling back. For smaller teams and individual freelancers, this is often an acceptable trade off before a Business license pays off economically.

How long does n8n retain versions automatically?

Anyone using the built in workflow history and wanting to control the retention period themselves will find the right setting in the server configuration. According ton8n documentation on the workflow history environment variables the variable `N8N_WORKFLOW_HISTORY_PRUNE_TIME` determines how many hours old versions are kept before n8n automatically deletes them. The default value is `-1`, which means that technically all versions are kept indefinitely, although the plan dependent limits from the previous section still apply to visibility.

For self hosted instances without an Enterprise license, it is still worth setting this variable deliberately and additionally establishing the JSON export workaround. This way you retain control over your version history, regardless of what the interface currently shows or hides.

Frequently asked questions

Do I necessarily need an Enterprise license for workflow versioning?

No. The built in Change History with full history and native Git synchronization via Source Control are indeed reserved for the Business and Enterprise plans, but the manual JSON export works in every n8n version, including the free Community Edition. Combined with your own Git repository and a regular CLI export, you achieve a fully fledged, if manual, versioning system.

How long does n8n store workflow versions without a Business or Enterprise plan?

In the Community Edition and in basic plans, only versions from the last 24 hours are viewable via the interface, even if the environment variable `N8N_WORKFLOW_HISTORY_PRUNE_TIME` is set to unlimited retention. For anything that needs to go back further, you need either a higher plan or your own backup system via JSON export.

Do exported JSON files contain my credentials?

According to the n8n documentation, exported workflow JSON files contain credential names and credential IDs, but no plaintext passwords or tokens. Nevertheless, you should remove or anonymize these references before sharing or checking them into a shared repository, so that no one can draw conclusions about your credential structure from the IDs.

Can I back up individual nodes instead of the entire workflow?

Yes. If you select individual nodes on the canvas and copy them with Ctrl+C or Cmd+C, you likewise get valid workflow JSON that can be saved in a text editor and pasted back in later. This works well for versioning reusable building blocks such as error handling or a standard HTTP configuration separately.

What is the difference between the CLI backup option and a simple export of all workflows?

The command `n8n export:workflow --backup` automatically sets the flags `--all --pretty --separate`, thus exporting all workflows of the instance, formatting the JSON for readability, and creating a separate file for each workflow. A simple export with `--all` without these flags, on the other hand, can write all workflows into a single file or unformatted, which makes later diff comparisons in Git considerably less clear. For a clean Git backup, the backup mode is therefore the better choice.

About NordFlux

NordFlux UG (haftungsbeschränkt)

NordFlux builds digital employees for organisations: automations and AI agents that take over repetitive work. You stay in control.

More about us
Free initial analysis

Concrete questions about automation or AI?

In a free initial analysis we discuss your case directly. No strings attached.