Automated workflow & credential restoration system for self-hosted environments
n8n Restore workflows & credentials from Disk - Self-Hosted Solution This n8n template provides a safe and intelligent restore solution for self-hosted n8n instances, allowing you to restore workflows and credentials ...
Template notes
n8n Restore workflows & credentials from Disk - Self-Hosted Solution
This n8n template provides a safe and intelligent restore solution for self-hosted n8n instances, allowing you to restore workflows and credentials from disk backups.
Perfect for disaster recovery or migrating between environments, this workflow automatically identifies your most recent backup and provides a manual restore capability that intelligently excludes the current workflow to prevent conflicts. Works seamlessly with date-organized backup folders.
Good to know - This workflow uses n8n's native import commands (n8n import:workflow and n8n import:credentials) - Works with date-formatted backup folders (YYYY-MM-DD) for easy version identification - The restore process intelligently excludes the current workflow to prevent overwriting itself - Requires proper Docker volume configuration and file system permissions - All operations are performed server-side with no external dependencies - Compatible with backups created by n8n's export commands
How it works
Restore Process (Manual) 1. Manual trigger with configurable pinned data options (credentials: true/false, workflows: true/false) 2. The Init node sets up all necessary paths, timestamps, and configuration variables using your environment settings 3. The workflow scans your backup folder and automatically identifies the most recent backup 4. If restoring credentials: - Direct import from the latest backup folder using n8n's import command - Credentials are imported with their encrypted format intact 5. If restoring workflows: - Scans the backup folder for all workflow JSON files - Creates a temporary folder with all workflows from the backup - Intelligently excludes the current restore workflow to prevent conflicts - Imports all other workflows using n8n's import command - Cleans up temporary files automatically 6. Optional email notifications provide detailed restore summaries with command outputs
How to use
Prerequisites - Existing n8n backups in date-organized folder structure (format: /backup-folder/YYYY-MM-DD/) - Workflow backups as JSON files in the date folder - Credentials backups in subfolder: /backup-folder/YYYY-MM-DD/n8n-credentials/ - For new environments: N8NENCRYPTIONKEY from source environment (see dedicated section below)