Skip to main content

Sync self-hosted workflow backups to GitHub for version control

Workflow preview

Workflow preview
100%
Sync self-hosted workflow backups to GitHub for version control preview
Open on n8n.io

1. Workflow Overview

Automatically back up and sync your n8n workflows to GitHub with unlimited version control. This workflow ensures your repository always reflects the latest state of your n8n instance by creating, ...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.github, n8n-nodes-base.aggregate, n8n-nodes-base.n8n, n8n-nodes-base.code, n8n-nodes-base.converttofile, n8n-nodes-base.extractfromfile

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Ucartz Online.

Original n8n.io source

1.1 Workflow description

Title
Sync self-hosted workflow backups to GitHub for version control
Workflow name
Sync self-hosted workflow backups to GitHub for version control

Automatically back up and sync your n8n workflows to GitHub with unlimited version control. This workflow ensures your repository always reflects the latest state of your n8n instance by creating, updating, and deleting workflow files as needed.

Ideal for developers, teams, and DevOps use cases where workflow backup, versioning, and audit tracking are important.

♾️ Unlimited Version Control

This workflow enables unlimited version control using GitHub, solving the limitation of version history that is not available in the self-hosted free version of n8n.

Every workflow change is stored as a Git commit, allowing you to:

Track full history of changes Roll back to previous versions anytime Maintain a reliable audit trail

⚑ Key Features

πŸ”„ Automatic Sync – Runs on a schedule to keep workflows updated πŸ†• Create New Workflows – Automatically adds new workflows to GitHub ✏️ Update Only When Changed – Detects and updates modified workflows 🧹 Auto Cleanup – Removes deleted or renamed workflows from GitHub ⚑ Smart Diff Check – Skips unchanged workflows to avoid unnecessary commits πŸ•’ Timestamped Commits – Clear and trackable commit history ♾️ Unlimited Version Control – Store unlimited workflow versions in GitHub

πŸ› οΈ How It Works

Fetch existing files from your GitHub repository Retrieve all workflows from your n8n instance via API Compare workflows using size-based change detection Create or update workflow JSON files in GitHub Remove orphaned files (deleted or renamed workflows)

βš™οΈ Setup Requirements

GitHub Personal Access Token (with repo scope) n8n API Key (Settings β†’ API) A GitHub repository for storing workflow backups Update GitHub nodes with your repository name and owner Configure the schedule trigger as needed

πŸ“ File Naming

Workflows are stored as: workflow-name.json (lowercase, hyphen-separated)

πŸ›‘οΈ Safety Mechanism

Includes a safety check to prevent accidental deletion of all files if the n8n API returns zero workflows (e.g., due to an error).

πŸ’‘ Use Cases

Backup and restore n8n workflows Version control and change tracking Team collaboration via GitHub CI/CD integration for workflow management

πŸ“¬ Support

Contact us for suggestions or support: [email protected]

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - README

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note β€” Fetch GitHub Files

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note β€” Fetch & Filter Workflows

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note β€” Commit to GitHub

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note β€” Cleanup Deleted Workflows

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 7 - List Files in GitHub Repo

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1

Block 8 - Collect GitHub Filenames

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 9 - Fetch All n8n Workflows

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 10 - Filter Changed/New Workflows

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Convert Workflow to JSON File

Type / Role
n8n-nodes-base.convertToFile - convertToFile
Config choices
Version 1.1

Block 12 - Encode as Base64

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 13 - Build Filename & Commit Date

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - File Already Exists in Repo?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 15 - Update Existing File

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1

Block 16 - Create New File

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1

Block 17 - Find Orphaned Files to Delete

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Any Files to Delete?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 19 - Delete Orphaned File

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1.1

Block 20 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Sync self-hosted workflow backups to GitHub for version control
Complexity advanced
Nodes 20
Categories DevOps
Author Ucartz Online
Published 08 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14925/14925.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Sync self-hosted workflow backups to GitHub for version control do?

Automatically back up and sync your n8n workflows to GitHub with unlimited version control. This workflow ensures your repository always reflects the latest state of your n8n instance by creating, ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.