Use this robust n8n workflow to automatically backup all your active n8n workflows to a GitHub repository, ensuring version control and disaster recovery for every n8n template.
Download this n8n workflow template and start using it instantly.
Maintaining reliable backups for custom automation solutions is crucial. This advanced n8n workflow solves the critical problem of workflow loss by providing automated, differential version control for all your deployed n8n templates. The system intelligently checks for changes between the live n8n workflow and the last saved version on GitHub. It uses the dedicated n8n node to retrieve data, ensuring that only modified or newly created n8n workflows trigger a push to the repository, minimizing API usage and maximizing efficiency. Furthermore, it incorporates Discord notifications, providing real-time visibility into the backup status of every n8n workflow.
This comprehensive n8n workflow operates in two main phases: the main loop and the sub-workflow execution.
yyyy/MM/dd).underscore.js to perform a deep comparison (_.isMatch) between the current n8n workflow data and the existing GitHub file content.To deploy this powerful n8n workflow, follow these steps:
repo scope enabled to allow reading, writing, and modifying files in the target repository. Configure this credential for the relevant GitHub n8n node instances.repoowner value to your GitHub username.reponame value to the name of the repository designated for the n8n workflow backups. This repository must already exist. Schedule Trigger / Manual Trigger: The starting point of this automation. Allows the user to run the n8n workflow on a defined schedule or on-demand.
n8n (API) Node: Fetches a list of all current n8n workflows in the system using an internal API key. This is the source data for all n8n templates being backed up.
Loop Over Items: Breaks the list of workflows retrieved by the n8n node into individual items, initiating a loop for processing each n8n workflow sequentially.
Execute Workflow: Crucial for recursion. It calls the current n8n workflow as a sub-workflow for each item, isolating the processing and error handling for each unique n8n workflow backup attempt.
Config (Set Node): Used in the sub-workflow to define global variables like repoowner and reponame, and to structure the incoming n8n workflow JSON payload.
GitHub Node (Get file data): Attempts to fetch the existing backup file from GitHub using the n8n workflow ID and the current date path. Configured to continue on failure if the file is new.
Code Node (verifyTheDifference): The core logic comparison. It deserializes the existing GitHub file (if found) and compares it with the latest n8n workflow data using the _.isMatch function from underscore.js to determine if the file status is 'new', 'same', or 'different'.
Switch Node: Routes the execution path based on the 'githubStatus' output from the Code n8n node.
GitHub Node (Create new file / Edit existing file): Performs the necessary action (creation or modification) on the GitHub repository, committing the full n8n workflow JSON file with a commit message indicating the status and the n8n workflow name.
Discord Node: Used extensively to send notifications about the start, individual success/failure, and overall completion of the n8n workflow execution, ensuring transparency throughout the backup process.
Securely automate your Clockify data backup using this robust n8n workflow. Archive monthly time reports directly to a GitHub repository, ensuring data integrity and historical accuracy using powerful n8n templates.

Use this comprehensive n8n workflow to schedule automatic backups of all your automation. Deliver backups via Telegram and restore them easily via Google Drive download or direct upload using advanced create/update logic.

Automate backlink monitoring using a robust n8n workflow. Check link status (Live, Lost, Nofollow) using DataForSEO and instantly update your Google Sheets data.

Use this robust n8n workflow to automatically backup Squarespace header and footer code injections to GitHub on a recurring schedule. Secure your custom code with these n8n templates.

Secure your automation logic by automatically backing up all your configured n8n workflow assets to a private Gitea repository. This n8n workflow ensures version control.









































