Backup your workflows to GitHub
Ready for 3.0What this workflow does
This workflow has 19 nodes and runs manually, when you click “Execute workflow” (plus 2 other triggers). Along the way it connects GitHub.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 2 other triggers).
- n8n: uses n8n
- Globals (Edit Fields (Set)): sets 3 fields: repo.owner, repo.name, repo.path
- Merge: merges the data from its input branches
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Get file data (GitHub): get (file)
- isDiffOrNew (Code): runs custom JavaScript code
- Execute Workflow (Execute Sub-workflow): calls another n8n workflow
- If: checks a condition and branches into true / false
- Check Status (Switch): routes items into 3 branches
- Get File (HTTP Request): calls an HTTP API
…plus 3 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (14)
- Manual Trigger
n8n-nodes-base.manualTrigger - n8n
n8n-nodes-base.n8n - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Merge
n8n-nodes-base.merge - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - No Operation, do nothing
n8n-nodes-base.noOp - GitHub
n8n-nodes-base.github - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Execute Sub-workflow
n8n-nodes-base.executeWorkflow
From the author
Based on Jonathan's work. Check out his templates. How it works This workflow will backup your workflows to GitHub. It uses the n8n API node to export all workflows. It then loops over the data, checks in GitHub to see if a file exists that uses the…