# Automated n8n workflow backup to GitHub: n8n workflow template

> Started by a clock, and works across GitHub. 27 steps, 4 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Source: https://millionrounds.com/workflow/automated-n8n-workflow-backup-to-github (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Documents and files](https://millionrounds.com/workflows?category=Documents+and+files#library)

# Automated n8n workflow backup to GitHub

Started by a clock, and works across GitHub. 27 steps, 4 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fautomated-n8n-workflow-backup-to-github)

**27 steps** Large: read it before trusting it with anything live

**4** Branches: places the flow splits

**1** Loop or waits

**1** Service it connects to

## The flow

Starts it 3 Logic 17 Service 7

The steps in the order they run, from what starts it.

- 1 **On clicking 'execute'** Manual trigger *Starts it*
- 2 **Schedule Trigger** Schedule trigger *Starts it*
- 3 **Execute Workflow Trigger** Execute Workflow trigger *Starts it*
- 4 **Globals** Set *Logic*
- 5 **Switch** Switch *Logic*
- 6 **Get many workflows** N8n *Service*
- 7 **Get file data** Github *Service*
- 8 **Merge** Merge *Logic*
- 9 **isDeleted** Code *Logic*
- 10 **Workflows** Aggregate *Logic*
- 11 **n8n** Set *Logic*
- 12 **If file too large** If *Logic*
- 13 **isDiffOrNew** Code *Logic*
- 14 **If** If *Logic*
- 15 **List files** Github *Service*
- 16 **Loop Over Items** Split In Batches *Logic*
- 17 **Get File** Http Request *Service*
- 18 **Check Status** Switch *Logic*
- 19 **Delete a file** Github *Service*
- 20 **Return** Set *Logic*
- 21 **github** Set *Logic*
- 22 **Execute Workflow** Execute Workflow *Logic*
- 23 **File is new** No Op *Logic*
- 24 **File is different** No Op *Logic*
- 25 **Same file - Do nothing** No Op *Logic*
- 26 **Create new file** Github *Service*
- 27 **Edit existing file** Github *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 27, with 4 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** GitHub
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own GitHub account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 27 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 27 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fautomated-n8n-workflow-backup-to-github)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[GitHub](https://millionrounds.com/workflows?service=GitHub#library)

## Workflows like it

Also documents and files, with the same services where possible, closest in size first.

- [**Backup n8n workflows to GitHub with Discord** 27 steps · Discord, GitHub](https://millionrounds.com/workflow/backup-n8n-workflows-to-github-with-discord)
- [**Automated workflow backup with GitHub** 28 steps · GitHub, Telegram](https://millionrounds.com/workflow/automated-workflow-backup-with-github)
- [**Automatic workflow & credentials backup to GitHub** 21 steps · GitHub](https://millionrounds.com/workflow/automatic-workflow-and-credentials-backup-to-github)
- [**Backup your workflows to GitHub -- in (subfolders)** 21 steps · GitHub](https://millionrounds.com/workflow/backup-your-workflows-to-github-in-subfolders)
- [**WordPress context backup to GitHub** 21 steps · GitHub, WordPress](https://millionrounds.com/workflow/wordpress-context-backup-to-github)
- [**Backup your credentials to GitHub** 20 steps · GitHub](https://millionrounds.com/workflow/backup-your-credentials-to-github)
