Skip to main content

Automated workflow backup with intelligent change detection using GitHub

Workflow preview

Workflow preview
100%
Automated workflow backup with intelligent change detection using GitHub preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Advanced n8n Workflow Sync with GitHub A robust workflow to back up and synchronize your n8n workflows to a GitHub repository, with intelligent change detection and support for file renames. Who...

Best for

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

Tools used

n8n-nodes-base.splitinbatches, n8n-nodes-base.github, n8n-nodes-base.scheduletrigger, n8n-nodes-base.n8n, n8n-nodes-base.code, n8n-nodes-base.merge, n8n-nodes-base.stickynote, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automated workflow backup with intelligent change detection using GitHub
Workflow name
Automated workflow backup with intelligent change detection using GitHub

Advanced n8n Workflow Sync with GitHub

A robust workflow to back up and synchronize your n8n workflows to a GitHub repository, with intelligent change detection and support for file renames.

🎯 Who's it for?

This workflow is for n8n administrators, developers, and power users who want a reliable, automated way to:

  • Keep a version-controlled history of their workflows.
  • Collaborate on workflows using GitHub's infrastructure.
  • Prevent data loss and have a disaster recovery plan for their n8n instance.

✨ Key Features (What it does)

  • Intelligent Sync: Backs up all your n8n workflows to a designated GitHub repository.
  • Human-Readable Filenames: Saves workflows with filenames based on their actual names in n8n (e.g., My Awesome Workflow.json).
  • Reliable Matching: Uses the unique n8n workflow ID to reliably track files, even if their names change.
  • Rename Detection: If you rename a workflow in n8n, it intelligently deletes the old file and creates a new one in a single logical operation.
  • Efficient Commits: Commits changes to GitHub only when there are actual modifications to a workflow's logic or structure. It performs a deep comparison, ignoring metadata changes.
  • Clear Commit History: Generates clean, informative commit messages:
    • create: workflowName
    • update: workflowName
    • rename: oldName - newName

⚙️ How It Works (Simple Steps)

  1. Get n8n Workflows: The workflow starts by fetching all your current workflows from n8n.
  2. Get GitHub Files: At the same time, it lists all existing workflow files from your GitHub repository.
  3. Compare & Decide: It then compares each n8n workflow with its GitHub counterpart. It checks if anything changed, if it was renamed, or if it's new.
  4. Take Action:
    • If a workflow is new, it's created on GitHub.
    • If a workflow is updated, the file content is changed on GitHub.
    • If a workflow was renamed, the old file is deleted, and a new one is created.
    • If nothing changed, the workflow is skipped.
  5. Send Report: Finally, it can send a summary report to Telegram about what happened.

🚀 How to Set Up

  1. Credentials:

    • GitHub: Go to Credentials > New and add your GitHub credentials. You'll need a token with repo permissions.
    • n8n API: In the same Credentials section, create n8n API credentials. You'll need your n8n instance's Base URL and an API key (you can create one in your n8n user settings).
    • Telegram (Optional): If you want notifications, add your Telegram Bot credentials.
  2. Configure the Workflow:

    • Open the Configuration node (the green one at the start).
    • Fill in the following values:
      • repo.owner: Your GitHub username or organization name.
      • repo.name: The name of the repository for backups.
      • repo.path: The folder inside the repository to store workflows (e.g., workflows/).
      • report.tg.chatID (Optional): Your Telegram chat ID for notifications. Set to 0 to disable.
      • report.verbose: Set to true to receive a report even if there were no changes.
  3. Connect Credentials:

    • Select your newly created credentials in the following nodes:
      • Get all workflows: Select your n8n API credentials.
      • All GitHub nodes (e.g., List files, Create new file): Select your GitHub credentials.
      • Send a message (Telegram): Select your Telegram credentials.
  4. Set the Schedule:

    • In the Schedule Trigger node, configure how often you want the backup to run (e.g., every hour, once a day).
  5. Activate the Workflow:

    • Save the workflow and toggle it to "Active".

🔧 How to Customize

  • Change Report Destination: The final part of the workflow sends a report to Telegram. You can easily replace the Send a message node with a node for Slack, Discord, or email to change where notifications go. The message is pre-formatted in the Render summary node.

💡 What's Next? (Future Updates)

This workflow is actively maintained! Here's a sneak peek at what's planned for future versions:

  • Automatic Archive Handling: The next major update will introduce logic to automatically detect when a workflow is archived in n8n and move it to a dedicated archived/ folder in your GitHub repository, keeping your main backup directory clean.
  • Performance Optimizations: I'm exploring ways to reduce API traffic by intelligently checking for changes before fetching full workflow data.

To get the latest version with these features when it's released, be sure to follow my profile for new workflow publications!

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 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 2 - Update file content and commit

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

Block 3 - Schedule Trigger

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

Block 4 - Get all workflows

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

Block 5 - Encode N8N workflows

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

Block 6 - Decide changes

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

Block 7 - Delete old file

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

Block 8 - Create new file (rename)

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

Block 9 - Merge after create (rename)

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 10 - Merge after update

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 11 - List files

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

Block 12 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 13 - Sticky Note

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

Block 14 - Sticky Note1

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

Block 15 - Sticky Note2

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

Block 16 - Sticky Note3

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

Block 17 - Sticky Note4

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

Block 18 - Build summary arrays

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

Block 19 - Render summary

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

Block 20 - Anything changed?

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

Block 21 - Extract workflow parameters

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

Block 22 - Get files

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

Block 23 - Is Telegram configured?

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

Block 24 - Send a message

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

Showing the first 24 of 38 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Automated workflow backup with intelligent change detection using GitHub
Complexity advanced
Nodes 38
Categories DevOps, Multimodal AI
Author Maksym Brashenko
Published 12 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7304/7304.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 Automated workflow backup with intelligent change detection using GitHub do?

Advanced n8n Workflow Sync with GitHub A robust workflow to back up and synchronize your n8n workflows to a GitHub repository, with intelligent change detection and support for file renames. Who...

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, Multimodal AI use case.