What This Workflow Does
This n8n workflow automatically backs up all your workflow configurations to GitHub every night at 23:59. It solves the critical problem of losing complex automation setups due to accidental deletions, system failures, or corrupted files. By storing your workflows in GitHub, you gain version control capabilities and disaster recovery protection.
The workflow connects to n8n's internal API to fetch all workflow JSON files, then commits them to a specified GitHub repository. While the API isn't officially supported, this solution provides essential protection for your automation investments until official backup options become available.
How It Works
1. Scheduled Trigger
The workflow activates daily at 23:59 using n8n's scheduler. You can adjust this timing in the workflow settings if you prefer a different backup frequency.
2. Fetch Workflows
Using n8n's internal API, the workflow retrieves a list of all your current workflows along with their complete JSON configurations.
3. Prepare GitHub Commit
Each workflow configuration is prepared as a separate JSON file, ready to be pushed to your GitHub repository. The files are organized with clear naming conventions.
4. Secure Authentication
The workflow authenticates with GitHub using your personal access token (PAT), ensuring secure access to your private repository where backups are stored.
5. Versioned Backup
All workflow files are committed to GitHub with timestamped messages, creating a complete version history you can reference or revert to if needed.
Pro tip: Create a dedicated GitHub repository for your n8n backups to keep them separate from other code projects and simplify access management.
Who This Is For
This solution benefits any n8n user who values their automation investments. It's particularly valuable for:
- Businesses running critical operations through n8n workflows
- Teams collaborating on complex automation projects
- Agencies managing multiple client workflows
- Developers who want version control for their automations
- Companies requiring compliance with data protection policies
What You'll Need
- An active n8n instance (self-hosted or cloud)
- A GitHub account with repository creation privileges
- A GitHub personal access token with repo permissions
- Basic familiarity with n8n workflow editing
Quick Setup Guide
- Download the template JSON file
- Import it into your n8n instance
- Create a GitHub repository for your backups
- Generate a GitHub personal access token
- Configure the workflow with your repository details and token
- Test the workflow manually first
- Activate the workflow for automatic nightly execution
Key Benefits
Disaster Recovery: Protect against data loss from server failures, accidental deletions, or corruption with reliable GitHub backups.
Version History: Track every change to your workflows with timestamps and commit messages, enabling precise rollbacks when needed.
Team Collaboration: Multiple developers can safely work on workflows knowing changes are tracked and reversible.
Compliance Ready: Maintain audit trails of automation changes for regulatory requirements or internal governance.
Peace of Mind: Sleep well knowing your critical business automations are securely backed up off-site.