Automated n8n Workflow Version Control with GitHub
detail.loadingPreview
Safeguard your n8n workflows by automatically backing them up to a GitHub repository. This solution provides robust version control, ensuring every change is tracked and easily recoverable, giving you peace of mind.
About This Workflow
Never lose an n8n workflow again! This powerful automation template provides an automated, daily backup and version control system for all your n8n workflows directly within a GitHub repository. It intelligently compares your current workflows with their GitHub counterparts, detecting whether they are new, have changed, or remain the same. Only new or modified workflows are pushed, ensuring efficient use of your repository. By tracking changes made within the last 24 hours, this system keeps your GitHub repository an up-to-date and reliable source of truth for your n8n automations, perfect for disaster recovery, collaboration, and maintaining an audit trail.
Key Features
- Automated Daily Sync: Keeps your GitHub repository continuously updated with your latest n8n workflow versions.
- Intelligent Delta Detection: Compares current workflows with existing GitHub files to only commit changes or new workflows.
- Version History & Rollback: Leverage GitHub's powerful version control to track every workflow iteration and easily revert to previous states.
- Configurable Repository Settings: Easily specify your GitHub repository owner, name, and target sub-path for organized storage.
- Efficient Filtering: Processes only workflows that have been updated within a specified timeframe (e.g., last 24 hours) to optimize performance.
How To Use
- GitHub Credentials: Ensure your n8n instance has a GitHub API credential configured with write access to your chosen repository.
- Repository Configuration: Within the GitHub nodes (
Create new fileandEdit existing file), configure theOwner,Repository, andFile Pathparameters. TheFile Pathparameter should use expressions to dynamically set the sub-path (e.g.,workflows) and the workflow's name (e.g.,={{ $('Loop Over Items').item.json.name }}.json). - Update Frequency: Review the
Filternode's condition. By default, it processes workflows updated within the last 24 hours. Adjust{{ $now.minus(1, 'days') }}to change this timeframe as needed. - Integration into Main Workflow: This snippet is designed to be part of a larger workflow that iterates over your n8n workflows (e.g., by feeding a list of workflows). Ensure the upstream node (referred to as
Loop Over Itemsin this snippet) passes the necessary workflow data (likenameand the workflow's JSON content). - Activate and Schedule: Once integrated, activate the parent workflow and set up a recurring trigger (e.g., a daily cron job) for automated backups.
Apps Used
Workflow JSON
{
"id": "312c5a26-8f62-4fb3-bfe0-0020f726cf2f",
"name": "Automated n8n Workflow Version Control with GitHub",
"nodes": 10,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 312c5a26-8f62...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Workflows
Discover more workflows you might like
Effortless Bug Reporting: Slack Slash Command to Linear Issue
Streamline your bug reporting process by instantly creating Linear issues directly from Slack using a simple slash command. This workflow enhances team collaboration by providing immediate feedback and a structured approach to logging defects, saving valuable time for development and QA teams.
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.