This is an n8n community node package that provides workflow backup and restore functionality for n8n instances.
- 🔄 Automatic Backup: Backup all or selected n8n workflows to GitHub
- 📥 Easy Restore: Restore workflows from GitHub backups
- 🏷️ Tag-based Filtering: Backup workflows by tags
- ⚡ Conflict Resolution: Handle name conflicts during restore
- 🔒 Safe Defaults: Restore workflows as inactive for safety
- 📅 Scheduled Backups: Perfect for automated daily/weekly backups
- 🔍 Simple Configuration: Just provide GitHub repository and go
To install this community package, follow these steps:
# Navigate to your n8n installation directory
cd ~/.n8n/nodes
# Install the package
npm install n8n-nodes-backup
Add to your docker-compose.yml:
environment:
- N8N_COMMUNITY_PACKAGES_ENABLED=true
Then run:
npm install n8n-nodes-backup
- Go to Settings > Community Nodes
- Click Install
- Enter:
n8n-nodes-backup
- Click Install
- Go to GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)
- Click Generate new token
- Give it a name:
n8n-workflow-backup
- Select scopes:
repo
(for private repos) orpublic_repo
(for public repos only) - Copy the generated token
- In n8n, create new GitHub API credential and paste the token
Note: This package uses n8n's built-in GitHub credentials for better compatibility and consistency.
- Go to your n8n instance Settings > API
- Click Create new API key
- Copy the generated API key
- In n8n, create new n8n API credential with:
-
API URL: Your n8n instance URL (e.g.,
https://your-n8n.com
orhttp://localhost:5678
) - API Key: The copied API key
-
API URL: Your n8n instance URL (e.g.,
Backs up workflows from your n8n instance to a GitHub repository.
Parameters:
-
GitHub Repository: Repository to store backups (format:
username/repo-name
) -
Backup Mode:
-
All Workflows
: Backup all workflows -
Active Only
: Backup only active workflows -
By Tags
: Backup workflows with specific tags
-
- Tags: Comma-separated list of tags (when using "By Tags" mode)
-
Backup Branch: Target branch for backups (default:
n8n-backups
)
Restores workflows from GitHub backup to your n8n instance.
Parameters:
- GitHub Repository: Repository containing backups
-
Restore Mode:
-
Latest Backup
: Restore from the most recent backup -
Specific Date
: Restore from a backup on specific date -
Individual Workflows
: Restore only selected workflows
-
-
Conflict Resolution:
-
Skip Existing
: Skip workflows that already exist -
Rename New
: Create with new name (adds timestamp) -
Overwrite
: Replace existing workflows
-
- Restore as Inactive: Import workflows in inactive state (recommended)
{
"name": "Daily Backup",
"nodes": [
{
"name": "Every Day at 2 AM",
"type": "n8n-nodes-base.cron",
"parameters": {
"triggerTimes": {
"item": [{"hour": 2, "minute": 0}]
}
}
},
{
"name": "Backup Active Workflows",
"type": "n8n-nodes-backup.n8nBackup",
"parameters": {
"repository": "myuser/n8n-backups",
"backupMode": "active"
}
},
{
"name": "Send Notification",
"type": "n8n-nodes-base.slack",
"parameters": {
"channel": "#n8n-backups",
"text": "✅ Daily backup completed: {{$node['Backup Active Workflows'].json.workflowCount}} workflows"
}
}
]
}
{
"name": "Restore Workflows",
"nodes": [
{
"name": "Manual Trigger",
"type": "n8n-nodes-base.manualTrigger"
},
{
"name": "Restore Latest Backup",
"type": "n8n-nodes-backup.n8nRestore",
"parameters": {
"repository": "myuser/n8n-backups",
"restoreMode": "latest",
"conflictResolution": "skip",
"restoreInactive": true
}
}
]
}
The backups are stored in your GitHub repository with this structure:
your-repo/
├── backups/
│ ├── backup-2024-01-15.json # Complete backup with metadata
│ ├── backup-2024-01-16.json
│ └── ...
└── workflows/
├── My_Workflow_1-123.json # Individual workflow files
├── Another_Workflow-456.json
└── ...
- Credentials: The backup process automatically removes sensitive credential data
- Private Repositories: Use private GitHub repositories for sensitive workflows
- API Keys: Store GitHub tokens and n8n API keys securely in n8n credentials
- Restore Safety: Workflows are restored as inactive by default to prevent accidental execution
"Repository not found" error:
- Verify the repository name format:
username/repo-name
- Ensure your GitHub token has access to the repository
- Check if the repository exists
"API key invalid" error:
- Verify your n8n API key is correct
- Check if the n8n instance URL is accessible
- Ensure the API key has sufficient permissions
"No backup files found" error:
- Check if backups exist in the
backups/
folder of your repository - Verify you're using the correct branch name
- Ensure the backup files follow the naming pattern:
backup-YYYY-MM-DD.json
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see the LICENSE file for details.
- Initial release
- Backup workflows to GitHub
- Restore workflows from GitHub
- Support for tag-based filtering
- Conflict resolution during restore
- Automatic credential sanitization