If it’s not in Git, it didn’t happen.
I run a bunch of n8n automations for clients. One server hiccup nuked a workflow last year and I had to rebuild from memory. Never again.
Now I back up every n8n workflow to GitHub using the official template workflow. It calls the n8n API, exports all workflows as JSON, then commits them to a repo on a schedule.
What gets persisted: every workflow definition - nodes, connections, triggers, settings, tags, active flag - one JSON per workflow. What doesn’t: credentials and execution history. That’s exactly what you want.
Setup is simple: create a private repo, generate a GitHub token with repo scope, add it to n8n credentials, import the template, point it at your repo. I group files by tags and use timestamped commit messages.