backup

Package Information

Released: 7/10/2025
Downloads: 0 weeklyĀ /Ā 0 monthly
Latest Version: 1.0.6
Author: molight

Documentation

n8n-nodes-backup

n8n.io - Workflow Automation

This is an n8n community node package that provides workflow backup and restore functionality for n8n instances.

Features

  • šŸ”„ 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

Installation

To install this community package, follow these steps:

Option 1: Manual Installation

# Navigate to your n8n installation directory
cd ~/.n8n/nodes

# Install the package
npm install n8n-nodes-backup

Option 2: Docker Environment

Add to your docker-compose.yml:

environment:
  - N8N_COMMUNITY_PACKAGES_ENABLED=true

Then run:

npm install n8n-nodes-backup

Option 3: n8n Cloud

  1. Go to Settings > Community Nodes
  2. Click Install
  3. Enter: n8n-nodes-backup
  4. Click Install

Credentials Setup

1. GitHub API Credentials (Built-in)

  1. Go to GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)
  2. Click Generate new token
  3. Give it a name: n8n-workflow-backup
  4. Select scopes: repo (for private repos) or public_repo (for public repos only)
  5. Copy the generated token
  6. 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.

2. n8n API Credentials

  1. Go to your n8n instance Settings > API
  2. Click Create new API key
  3. Copy the generated API key
  4. In n8n, create new n8n API credential with:
    • API URL: Your n8n instance URL (e.g., https://your-n8n.com or http://localhost:5678)
    • API Key: The copied API key

Nodes

Workflow Backup Node

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)

Workflow Restore Node

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)

Usage Examples

Daily Automatic Backup

{
  "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"
      }
    }
  ]
}

Restore from Backup

{
  "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
      }
    }
  ]
}

Backup Structure

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
    └── ...

Security Considerations

  • 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

Troubleshooting

Common Issues

"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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

Support

Changelog

v1.0.0

  • Initial release
  • Backup workflows to GitHub
  • Restore workflows from GitHub
  • Support for tag-based filtering
  • Conflict resolution during restore
  • Automatic credential sanitization

Discussion