✨ $500 AI Visibility Audit — live at Spurlock Studios. Book the audit

Operations & Systems

Backup Workflows to Github

This n8n workflow automates the backup of all active n8n workflows to a specified GitHub repository. It iterates through each workflow, compares its current state with the version on GitHub, and then either creates a new file, updates an existing one, or skips it if no changes…

Built · ~4.5 hours saved per week

Workflow Overview: Backup Workflows to GitHub Automation & Value This workflow provides a reliable, automated solution for version control and disaster recovery of an n8n instance. It systematically iterates through every workflow, compares it to a version stored in a GitHub repository, and commits any new or updated workflows. This automation eliminates the manual, error-prone task of backing up workflows, ensuring that a complete version history is always maintained. This provides significant value by: - Ensuring Business Continuity: Creates a reliable disaster recovery point. If the n8n instance fails, all workflows can be restored from GitHub. - Providing Version Control: Uses GitHub's powerful versioning to track every change to a workflow, allowing developers to review history, understand changes, and revert to previous versions if a bug is introduced. - Enhancing Collaboration & Auditing: Creates an audit trail of all workflow modifications, showing who changed what and when (via commit history). - Improving Operational Efficiency: Runs automatically on a schedule, requiring no manual intervention after initial setup. Its intelligent diff-checking prevents redundant commits, keeping the repository clean. Technologies Used - n8n: The core automation platform. The workflow uses internal n8n nodes to fetch workflow data and a subworkflow pattern for scalable processing. - GitHub: Used as the version control system and data store for the workflow backups. - Node.js (Code Node): Used for custom logic to perform an intelligent comparison (diff) between the live workflow and the backed-up version. Node-by-Node Analysis The workflow is cleverly designed in two parts: a main loop to fetch all workflows and a subworkflow to process each one individually. This design pattern is highly scalable and prevents memory issues on instances with many workflows. Main Workflow The main workflow's job is to get the list of all workflows and trigger the processing for each one.

Tags: Admin, n8n, Data Transformation

Integrations: HTTP, Code, Schedule, Sub-workflow

Related automations

Back to the Automation Library