Operations & Systems
Backup Worflows to Github
This n8n workflow automatically backs up all instance workflows to a specified GitHub repository. Triggered manually or daily at 7 AM, it retrieves each workflow and uses a subworkflow to save it as ID.json to GitHub, optimizing for memory usage.
Built · ~3.5 hours saved per week
Workflow Overview: Automated n8n Workflow Backup to GitHub
This workflow provides a reliable, automated solution for backing up all workflows from an n8n instance to a designated GitHub repository. It serves as a critical disaster recovery and version control mechanism, ensuring that valuable automation logic is never lost and that changes can be tracked over time.
Automation & Value
The primary value of this automation is providing a "set-and-forget" safety net for n8n development. By automatically committing each workflow as a separate JSON file to a Git repository, it helps:
- Automate Disaster Recovery: Eliminates the manual, error-prone task of periodically exporting workflows. If the n8n instance fails, all workflows can be easily restored from the GitHub backup. - Enable Version Control: Uses GitHub's inherent versioning capabilities. Users can track changes, view historical versions of a workflow, and revert to a previous state if needed. - Improve Collaboration & Auditing: Creates a centralized, transparent repository of all automations, making it easier for teams to review and audit workflow logic. - Resource Efficiency: The workflow is intelligently designed to process workflows one by one using a sub-workflow, preventing high memory usage and ensuring it can scale to handle hundreds of workflows without crashing the n8n instance.
Technologies Used
- n8n: The core automation platform executing the logic. - n8n API: Used internally to fetch the list of all workflows on the instance. - GitHub: The external cloud service used as the storage backend for the backups, providing version control and durable storage.
Node-by-Node Breakdown
This workflow is structured as a main loop that fetches all workflows and then passes each one to a sub-workflow for individual processing.
H3: Trigger Nodes (Scheduled or Manual)
- Schedule Trigger: This is the primary trigger for automation. It is configured to run the backup process automatically every day at a specified time (e.g., 7:00 AM), ensuring consistent and regular backups without any manual intervention. - On clicking 'execute': This is a Manual Trigger node.
Tags: n8n, Data Transformation
Integrations: Schedule, Sub-workflow