Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

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

  1. On clicking 'execute'
  2. Execute Workflow Trigger
  3. n8n
  4. Return
  5. Get File
  6. If file too large
  7. Merge Items
  8. isDiffOrNew
  9. Check Status
  10. Same file - Do nothing
  11. File is different
  12. File is new
  13. Create new file
  14. Edit existing file

23 steps in total.

Similar automations