What This Workflow Does
This automation solves the critical problem of losing valuable n8n workflow configurations. Many businesses invest hundreds of hours building complex automations, only to risk losing them to accidental deletions, system failures, or unwanted modifications. The workflow connects to your n8n instance via its API, exports all workflows as JSON files, and pushes them to a designated GitHub repository.
By implementing this solution, you gain version control capabilities for your automations. Each backup creates a new commit in your GitHub history, allowing you to track changes over time and revert to previous versions if needed. This is particularly valuable for teams collaborating on workflow development or businesses subject to compliance requirements.
How It Works
1. API Authentication
The workflow begins by authenticating with your n8n instance using API credentials. This establishes a secure connection to access your workflow data.
2. Workflow Export
It then retrieves a list of all your workflows and exports each one as a JSON file. The export includes the complete configuration with nodes, connections, and settings.
3. GitHub Commit
Finally, the workflow pushes these JSON files to your GitHub repository, creating a new commit with a timestamp. The commit message includes metadata about the backup operation.
Pro tip: Schedule this workflow to run automatically at regular intervals (daily/weekly) to ensure continuous protection of your automation investments.
Who This Is For
This solution is ideal for any business or team using n8n for critical automation processes. It's particularly valuable for:
- Teams collaborating on workflow development
- Businesses with compliance or audit requirements
- Organizations that can't afford workflow downtime
- Companies with complex, hard-to-recreate automations
What You'll Need
- An n8n instance with API access enabled
- API credentials for your n8n installation
- A GitHub account with repository creation privileges
- A personal access token for GitHub API authentication
Quick Setup Guide
- Download the template and import it to your automation platform
- Configure the n8n API connection with your instance details
- Set up the GitHub connection with your repository information
- Test the workflow with a manual trigger
- Schedule automatic runs at your preferred interval
Key Benefits
Disaster recovery: Protect against data loss from system failures or accidental deletions with secure cloud backups.
Version history: Track changes to your workflows over time and revert to previous versions when needed.
Team collaboration: Multiple developers can work on workflows with change tracking and conflict resolution.
Compliance readiness: Maintain an auditable history of automation changes for regulatory requirements.
Peace of mind: Know your automation investments are protected without manual intervention.