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.
How to export and import n8n workflows via CLI, and reset a user's password from the command line if you're locked out.
Anyone who self-hosts n8n eventually reaches the point where workflows need to be backed up, transferred to another instance, or a locked-out user account needs to be reset. For all three tasks, n8n provides its own CLI commands that run directly on the server and work without a functioning web interface. This article shows the most important commands for export, import, and the emergency password reset, as described in the official n8n documentation. As of: July 2026.
The export:workflow command exports workflows from the n8n database into JSON files. Without additional arguments it applies to individual workflows, but with the right flags the export can be extended to the entire set or prepared directly for a backup.
For regular backups, the combination export:workflow --backup --output=backups/latest/ is especially suitable, and can be scheduled well as a daily or weekly task in a cron job.
The counterpart is import:workflow. It reads previously exported JSON files and writes them back into the database of the target instance, for example during a server move or a recovery after an outage.
Important: Workflows with an ID that already exists in the target database are overwritten during import, not duplicated. Before an import on a production instance, it is therefore always worthwhile to first export the existing workflows as a backup.
If access to an n8n account is missing because a password was forgotten and no SMTP server is set up for the regular reset by email, the command user-management:reset helps, according to the n8n documentation. It resets user management to the state before initial setup and removes all existing user accounts. The next time the web interface is opened, n8n asks again for the setup of a new owner account, similar to a fresh installation.
The command is deliberately radical: it deletes all user accounts of the instance, not just the affected one. Roles, permissions, and project assignments must be reassigned afterward. Workflows, credentials, and the execution history remain unaffected by this according to the documentation, since the command only resets user management.
For the narrower case that someone can no longer use two-factor authentication, for example because the recovery codes have been lost, the less drastic command mfa:disable --email=<email-address> is sufficient. It disables MFA for exactly that one account, so the person can log in again normally and set up two-factor authentication anew.
The CLI commands run directly on the server and require corresponding access, for example via SSH or docker exec. Anyone running n8n with a provider without shell access generally cannot use them and depends on the provider's support. For companies that self-host n8n and rely on reliable backups and a documented emergency plan in everyday operations, NordFlux supports the n8n setup and operation with a setup where you retain control over data and access yourself.
With the command export:workflow --backup --output=<directory> all workflows can be backed up in a readable, split form. The command works well as a daily cron job on the server, supplemented with a copy of the target directory to a second storage location.
No. According to the n8n documentation, the command exclusively resets user management and removes all user accounts. Workflows, credentials, and the execution history are retained, but must be reassigned to a new owner account after the reset.
Yes. With export:workflow --id=<ID> --output=file.json a single workflow can be exported specifically, without touching the rest of the set.
The existing workflow with the same ID is overwritten during import, not created as a copy. It is therefore recommended to make a current export as a fallback before every import on a running instance, see the n8n documentation on the command line and the documentation on user management.
Founder of NordFlux. Spent four years automating processes at enterprise scale at Dräger, and now brings that depth to the mid-market — pragmatic and with full data sovereignty.
Certifications
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.
By default, n8n runs in America/New_York instead of Europe/Berlin. Here is how to correctly set GENERIC_TIMEZONE and the workflow timezone.
Export, import, and the emergency password-reset command are part of daily operations for a self-hosted n8n, yet they're often tried for the first time in a real emergency. NordFlux runs your managed n8n operation including tested backup and recovery routines, so the CLI emergency never becomes a stress test.