Templates / Sync workflows to GitHub repository files using the n8n API

Sync workflows to GitHub repository files using the n8n API

Ready for 3.0

by Birtan · 9 views · created 2026-08-22 · DevOps

Ready 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.

  1. Initialize Workflow ID (Edit Fields (Set)): sets 1 field: Workflow Id
  2. Retrieve Workflow Data (n8n): get
  3. Set Workflow Properties (Edit Fields (Set)): sets 10 fields: name, nodes, connections…
  4. Convert to JSON File Format (Convert to File): converts data to a file (to json)
  5. Fetch GitHub Workflow File (GitHub): get (file)
  6. Check for Modifications (If): checks a condition and branches into true / false
  7. Create GitHub File (GitHub): work with file
  8. Edit GitHub File (GitHub): edit (file)

Services it uses

GitHub

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)

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…

Excerpt from Birtan's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.