Keep your n8n workflows safe and easy to track by backing them up to GitHub on a set schedule. You also get clear Slack updates when a run starts, finishes, or hits a problem. This is ideal for teams that want version control, change history, and a simple recovery path.
On each run, a time trigger kicks things off and posts a start message to Slack. The flow calls the n8n API to list every workflow, then processes them in batches to use less memory. For each item, it builds a folder path by year and month, fetches any existing file from GitHub, and compares the content using a code step that orders JSON keys before diffing. A switch then chooses to create a new file, edit an existing one, or skip if nothing changed. The job can call itself to manage large sets and includes a check for oversized files. When done, it sends a completion notice to Slack.
Set a GitHub repo and a Slack webhook, then add your n8n API credentials. Expect the first full backup to take longer, with later runs finishing faster as only changes are committed. Use it for audit trails, compliance records, and quick rollback. You save hours of manual exports and reduce risk from missed updates.