Back up and sync workflow JSONs with GitHub using semantic SHAs
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (13)
- Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - n8n
n8n-nodes-base.n8n - Filter
n8n-nodes-base.filter - GitHub
n8n-nodes-base.github - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp - Code
n8n-nodes-base.code - Split Out
n8n-nodes-base.splitOut - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Stop and Error
n8n-nodes-base.stopAndError - Switch
n8n-nodes-base.switch
What it does
Quick overview This workflow backs up all non-archived n8n workflows to a GitHub repository as JSON files, using a deterministic semantic SHA in each filename to detect new, updated, renamed, and deleted workflows and keep the repository in sync. How it works 1. Runs when you manually execute the workflow and loads the GitHub backup configuration (repo owner/name, visibility, commit messages, and filename separator). 2. Retrieves all workflows from the n8n API, filters out archived workflows, and stops if there is nothing to back up. 3. Creates a deterministic SHA-256 for each workflow based on its nodes, connections, and settings, and sanitizes the workflow name for use in the backup filename. 4. Calls the GitHub REST API to verify whether the target repository exists and routes errors for connectivity, authentication, permissions, rate limits, and unexpected responses. 5. If the repository is missing, creates it and uploads one JSON backup per workflow to the repository root using the <id<separator<sha<separator<name.json naming scheme. 6. If the repository exists, lists repo files, compares them to current n8n workflows to identify new, changed, renamed, and deleted workflows, then creates replacement files before deleting outdated ones and removes backups for workflows deleted from n8n. Setup 1. Create an n8n API credential/connection with access to list workflows on your n8n instance. 2. Add a GitHub OAuth2 credential with repo access (and permission to create repositories if you want auto-create) and ensure it can access the configured repoowner account or organization. 3. Update the configuration values for repoowner, reponame, and repoprivate (and optionally commit messages and separatorcharacter) to match your GitHub setup. 4. If you want automated backups, replace the manual trigger with a schedule trigger and adjust the workflow execution timeout in settings if you have many workflows.