# Back up and restore n8n workflows with GitHub: n8n workflow

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

Source: https://millionrounds.com/workflow/back-up-and-restore-n8n-workflows-with-github (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Data collection](https://millionrounds.com/workflows?category=Data+collection#library)

# Back up and restore n8n workflows with GitHub

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

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fback-up-and-restore-n8n-workflows-with-github)

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

**4** Branches: places the flow splits

**2** Loops or waits

**1** Service it connects to

## The flow

Starts it 2 Logic 12 Service 13

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

- 1 **Schedule Trigger** Schedule trigger *Starts it*
- 2 **When clicking ‘Execute workflow’** Manual trigger *Starts it*
- 3 **Set Github Data** Set *Logic*
- 4 **Set Github Data1** Set *Logic*
- 5 **Get Download Url for Index File** Github *Service*
- 6 **List Workflow Files** Github *Service*
- 7 **Get Index File Content** Http Request *Service*
- 8 **Index File Not Found** If *Logic*
- 9 **Loop Over Items** Split In Batches *Logic*
- 10 **Workflows Folder Not Found** If *Logic*
- 11 **Get All Workflows** N8n *Service*
- 12 **Create Index File** Github *Service*
- 13 **Get File Content** Http Request *Service*
- 14 **C,E,D Checker** Code *Logic*
- 15 **Wait** Wait *Logic*
- 16 **Create Workflow** N8n *Service*
- 17 **Switch** Switch *Logic*
- 18 **Create New Files** Github *Service*
- 19 **Get Download Url for Github File** Github *Service*
- 20 **Merge Github & n8n File** Merge *Logic*
- 21 **Delete Files** Github *Service*
- 22 **Update Index File** Github *Service*
- 23 **Get Github File Content** Http Request *Service*
- 24 **File Edit Checker** Code *Logic*
- 25 **Parse Github File Content** Code *Logic*
- 26 **If File Edited** If *Logic*
- 27 **Edit Files** Github *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 27, with 4 branches, 2 loops 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%2Fback-up-and-restore-n8n-workflows-with-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 data collection, with the same services where possible, closest in size first.

- [**Automatic Typebot flows two-way sync with GitHub** 27 steps · GitHub](https://millionrounds.com/workflow/automatic-typebot-flows-two-way-sync-with-github)
- [**Selectively import workflows** 26 steps · GitHub](https://millionrounds.com/workflow/selectively-import-workflows)
- [**Analyze npm packages with Firecrawl and GitHub** 24 steps · calls a model · GitHub, Slack](https://millionrounds.com/workflow/analyze-npm-packages-with-firecrawl-and-github)
- [**Bidirectional GitHub workflow sync & version control** 22 steps · GitHub](https://millionrounds.com/workflow/bidirectional-github-workflow-sync-and-version-control)
- [**Sync a GitHub integration catalog from GitHub to StudioCMS pages** 33 steps · GitHub](https://millionrounds.com/workflow/sync-a-github-integration-catalog-from-github-to-studiocms-p)
- [**Find and track flaky CI jobs in GitHub Actions with OpenAI** 19 steps · calls a model · GitHub, Slack](https://millionrounds.com/workflow/find-and-track-flaky-ci-jobs-in-github-actions-with-openai)
