Library / Code, Git & Developer Tools
Code, Git & Developer Tools
Back Up n8n Workflows to GitHub with Slack Alerts
When you run it or another workflow calls it, it saves all n8n workflows to GitHub, commits only new or changed ones, and reports in Slack.
What it does
## Backup to GitHub This workflow will backup all instance workflows to GitHub every 24 hours. The files are saved into folders using YYYY/MM/ for the directory path and ID.json for the filename. The Repo Owner, Repo Name and Main folder are set using the Variables feature but can be replaced with the Config node in the subworkflow. The workflow runs calls itself to help reduce memory usage, Once the workflow has completed it will send an optional notification to Slack. ### Time to Run Tested with 1423 workflows on 1.44.1 it took under 30 minutes for the first run and under 12 minutes once the initial run is complete.
The steps
- On clicking 'execute'
- Execute Workflow Trigger
- n8n
- Return
- Get File
- If file too large
- Merge Items
- isDiffOrNew
- Check Status
- Same file - Do nothing
- File is different
- File is new
- Create new file
- Edit existing file
23 steps in total.
Similar automations
Code, Git & Developer ToolsBack Up n8n Workflows to GitHub via Pull Requests22 stepsCode, Git & Developer ToolsRestore n8n Workflows from GitHub13 stepsCode, Git & Developer ToolsRestore n8n Workflows from GitHub, Skipping Existing Ones12 stepsCode, Git & Developer ToolsRestore n8n Workflows from Merged GitHub Pull Requests13 steps