Keep your automations safe with daily version control. Each night, your n8n workflows are saved as JSON files in a GitHub repo. Teams gain history, audit trails, and fast recovery without manual exports.
A schedule runs at 23:59. The flow pulls all workflows from your n8n REST API and then fetches full data for each item. It also reads the current file list from GitHub and downloads file contents. Two compare steps match workflow names with file names. New items are saved as new JSON files. Existing items are updated through an edit action with a clean commit message. Simple function steps split arrays into single items so matching stays accurate.
You need a GitHub repo and a token with repo scope, plus your n8n URL with basic auth. Set the owner and repository fields in the GitHub nodes, and point the HTTP requests to your n8n base URL. Expect backups to run in minutes and cut manual work by most of the hour you would spend. Useful for change reviews, rollback, and compliance records.