Templates / Sync self-hosted workflow backups to GitHub for version control

Sync self-hosted workflow backups to GitHub for version control

Ready for 3.0

by Ucartz Online · 263 views · created 2026-04-08 · DevOps

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (9)

GitHub

What it does

Automatically back up and sync your n8n workflows to GitHub with unlimited version control. This workflow ensures your repository always reflects the latest state of your n8n instance by creating, updating, and deleting workflow files as needed. Ideal for developers, teams, and DevOps use cases where workflow backup, versioning, and audit tracking are important. ♾️ Unlimited Version Control This workflow enables unlimited version control using GitHub, solving the limitation of version history that is not available in the self-hosted free version of n8n. Every workflow change is stored as a Git commit, allowing you to: Track full history of changes Roll back to previous versions anytime Maintain a reliable audit trail ⚡ Key Features 🔄 Automatic Sync – Runs on a schedule to keep workflows updated 🆕 Create New Workflows – Automatically adds new workflows to GitHub ✏️ Update Only When Changed – Detects and updates modified workflows 🧹 Auto Cleanup – Removes deleted or renamed workflows from GitHub ⚡ Smart Diff Check – Skips unchanged workflows to avoid unnecessary commits 🕒 Timestamped Commits – Clear and trackable commit history ♾️ Unlimited Version Control – Store unlimited workflow versions in GitHub 🛠️ How It Works Fetch existing files from your GitHub repository Retrieve all workflows from your n8n instance via API Compare workflows using size-based change detection Create or update workflow JSON files in GitHub Remove orphaned files (deleted or renamed workflows) ⚙️ Setup Requirements GitHub Personal Access Token (with repo scope) n8n API Key (Settings → API) A GitHub repository for storing workflow backups Update GitHub nodes with your repository name and owner Configure the schedule trigger as needed 📁 File Naming Workflows are stored as: workflow-name.json (lowercase, hyphen-separated) 🛡️ Safety Mechanism Includes a safety check to prevent accidental deletion of all files if the n8n API returns zero workflows (e.g., due to an error). 💡 Use Cases Backup and restore n8n workflows Version control and change tracking Team collaboration via GitHub CI/CD integration for workflow management 📬 Support Contact us for suggestions or support: [email protected]

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.