Skip to main content

Backup n8n workflows to Github

Workflow preview

Workflow preview
100%
Backup n8n workflows to 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

Introduction This workflow will backup all of your existed workflows to a single Github repository. The Backup folders' name are based on the current backup date and have default format: "yyyy/MM/d...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.stickynote, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.n8n, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.merge, n8n-nodes-base.noop

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Backup n8n workflows to Github
Workflow name
Backup n8n workflows to Github

Introduction

This workflow will backup all of your existed workflows to a single Github repository.

The Backup folders' name are based on the current backup date and have default format: "yyyy/MM/dd" (setup at "Create sub path" node).

Throughout the backup process, the N8N will inform user via discord with clear message about Start, Success and Failure backups.

The workflow will be

Tech Stack

The following nodes / services / libraries are used in this workflow:

Nodes:

  1. Discord: To send message to configured setup channel.
  2. N8N: To get all workflows' information.
  3. Github: To store backup data.
  4. Code: To run data comparison (Existed vs Latest workflow data).
  5. Wait: To avoid discord message rate limit.

External libraries:

  1. Underscore.js: JavaScript library that provides lots of common Javascript functions, to help user save time when using code node.

Guideline

  1. Open "Config" node and setup the following information:
    • repo_owner: Your Github username.
    • repo_name: The repository that you want to store workflows backup data.
  2. Open "Create sub path" node and change the naming and path format of backup folder(s).
  3. Setup custom messages in 3 discord nodes:
    • Starting Message: N8N inform user at the time workflow start.
    • Inform Success Flows: After each success backup, N8N will notify user.
    • Inform Failed Flows: After each failure backup, N8N will notify user to have appropriate action.
    • Completed Notifications: Then at the final, the workflow will give user a summary.
  4. Setup "Schedule Trigger" node to change default automated backup time.

Screenshots

Discord output

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 - On clicking 'execute'

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

Block 2 - Sticky Note

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

Block 3 - Execute Workflow Trigger

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

Block 4 - n8n

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

Block 5 - Return

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

Block 6 - If file too large

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

Block 7 - Merge Items

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

Block 8 - Same file - Do nothing

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

Block 9 - File is different

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

Block 10 - File is new

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

Block 11 - Create new file

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

Block 12 - Edit existing file

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

Block 13 - Loop Over Items

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

Block 14 - Schedule Trigger

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

Block 15 - Create sub path

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

Block 16 - Sticky Note2

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

Block 17 - Config

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

Block 18 - Starting Message

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

Block 19 - Completed Notification

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

Block 20 - Get file data

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

Block 21 - Execute Workflow

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

Block 22 - Wait

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

Block 23 - Get file

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

Block 24 - Wait1

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

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

3. Summary Table

Workflow Backup n8n workflows to Github
Complexity advanced
Nodes 30
Categories DevOps
Author Dat Proto
Published 12 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3990/3990.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 Backup n8n workflows to Github do?

Introduction This workflow will backup all of your existed workflows to a single Github repository. The Backup folders' name are based on the current backup date and have default format: "yyyy/MM/d...

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.