Your n8n workflows represent real business logic and automation. Backing them up regularly protects you from accidental deletion, server failure, or a botched upgrade.
Method 1: Export Workflows from the n8n UI (Quick)
- Log in to your n8n dashboard.
- Click on the workflow you want to export.
- Click the three-dot menu (⋮) at the top right of the workflow editor.
- Click Download or Export.
- A JSON file will be downloaded to your computer. Store it safely (Google Drive, Dropbox, etc.).
Repeat for each workflow. For a large number of workflows, use Method 2 below.
Method 2: Export All Workflows via n8n CLI (SSH)
- SSH into your server.
- Run the following command to export all workflows at once:
n8n export:workflow --all --output=/home/backups/n8n-workflows-$(date +%Y%m%d).json
- This creates a single JSON file containing all workflows with a date stamp.
Method 3: Back Up the n8n Database (Full Backup)
n8n stores all data (workflows, credentials, execution history) in a database. Backing up the database file gives you a complete restore point.
If n8n is using SQLite (default on Hordanso starter plans):
cp ~/.n8n/database.sqlite /home/backups/n8n-db-$(date +%Y%m%d).sqlite
If n8n is using PostgreSQL:
pg_dump n8n_database > /home/backups/n8n-pg-$(date +%Y%m%d).sql
Automating Backups with a Cron Job
- SSH into your server.
- Type crontab -e.
- Add a daily backup at 2am:
0 2 * * * n8n export:workflow --all --output=/home/backups/n8n-$(date +\%Y\%m\%d).json
Restoring a Workflow from Backup
- Log in to n8n.
- Click the + menu and choose Import from File.
- Select your JSON backup file.
- The workflow will be imported and available to activate.
Tip: Store your backup JSON files in Google Drive or GitHub for off-server storage. You can automate this using an n8n workflow that exports and uploads to Drive on a schedule — a workflow that backs itself up!
