Sync workflows to GitHub repository files using the n8n API
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.
What this workflow does
This workflow has 9 nodes and runs when another workflow calls it. Along the way it connects GitHub.
How it runs
Trigger: When another workflow calls it.
- Initialize Workflow ID (Edit Fields (Set)): sets 1 field: Workflow Id
- Retrieve Workflow Data (n8n): get
- Set Workflow Properties (Edit Fields (Set)): sets 10 fields: name, nodes, connections…
- Convert to JSON File Format (Convert to File): converts data to a file (to json)
- Fetch GitHub Workflow File (GitHub): get (file)
- Check for Modifications (If): checks a condition and branches into true / false
- Create GitHub File (GitHub): work with file
- Edit GitHub File (GitHub): edit (file)
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 (6)
- n8n
n8n-nodes-base.n8n - GitHub
n8n-nodes-base.github - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Convert to File
n8n-nodes-base.convertToFile
From the author
Quick overview This workflow is called by another n8n workflow to export a selected n8n workflow as a JSON file and sync it to a GitHub repository, creating the file if it doesn’t exist and updating it only when the workflow definition changes. How it works…