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

> Started by someone submitting a form, and works across FTP and GitHub. 41 steps, 1 branch, 2 loops or waits: large, and worth reading before you trust it...

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

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

# Back up and restore n8n workflows and credentials with GitHub

Started by someone submitting a form, and works across FTP and GitHub. 41 steps, 1 branch, 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-and-credentials-with-githu)

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

**1** Branch: places the flow splits

**2** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Logic 18 Service 21

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

- 1 **Cron: Trigger Backup** Schedule trigger *Starts it*
- 2 **Form: Upload Restore File** Form trigger *Starts it*
- 3 **Set: Backup Date** Set *Logic*
- 4 **JS: Extract Binary Data** Code *Logic*
- 5 **GitHub: Init Workflow Folder** Github *Service*
- 6 **Extract: JSON from Binary** Extract From File *Service*
- 7 **GitHub: Init Creds Folder** Github *Service*
- 8 **SSH: Export Workflows** Ssh *Service*
- 9 **JS: Route Import Data** Code *Logic*
- 10 **SSH: Export Credentials** Ssh *Service*
- 11 **JS: Parse Workflow Export** Code *Logic*
- 12 **Switch: Workflows vs Creds** Switch *Logic*
- 13 **JS: Parse Creds Export** Code *Logic*
- 14 **Split: Workflows** Split Out *Logic*
- 15 **Merge: WFs & Creds** Merge *Logic*
- 16 **Split: WF Items** Split Out *Logic*
- 17 **Split: Cred Items** Split Out *Logic*
- 18 **Split: Credentials** Split Out *Logic*
- 19 **Convert: All WFs to JSON** Convert To File *Service*
- 20 **Loop: Single WF** Split In Batches *Logic*
- 21 **Convert: Combined Data** Convert To File *Service*
- 22 **Convert: WF for Import** Convert To File *Service*
- 23 **Convert: Cred for Import** Convert To File *Service*
- 24 **Loop: Single Cred** Split In Batches *Logic*
- 25 **Convert: All Creds to JSON** Convert To File *Service*
- 26 **JS: Prep All WFs Payload** Code *Logic*
- 27 **Convert: Single WF to JSON** Convert To File *Service*
- 28 **JS: Prep Combined Payload** Code *Logic*
- 29 **SFTP: Upload WFs to /tmp** Ftp *Service*
- 30 **SFTP: Upload Creds to /tmp** Ftp *Service*
- 31 **Convert: Single Cred to JSON** Convert To File *Service*
- 32 **JS: Prep All Creds Payload** Code *Logic*
- 33 **GitHub: Push All WFs** Github *Service*
- 34 **JS: Prep Single WF Payload** Code *Logic*
- 35 **GitHub: Push Combined File** Github *Service*
- 36 **SSH: Exec Import Workflow** Ssh *Service*
- 37 **SSH: Exec Import Credential** Ssh *Service*
- 38 **JS: Prep Single Cred Payload** Code *Logic*
- 39 **GitHub: Push All Creds** Github *Service*
- 40 **GitHub: Push Single WF** Github *Service*
- 41 **GitHub: Push Single Cred** Github *Service*

## How it's built

- **Starts on:** Someone submitting a form
- **Steps:** 41, with 1 branch, 2 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** FTP, GitHub
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

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

What starts it?

It starts on someone submitting a form.

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 41 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 41 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-and-credentials-with-githu)
- **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.

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

## Workflows like it

Also setup and learning, with the same services where possible, closest in size first.

- [**[n8n v^0.221.2] GitHub backup of workflows and credentials** 26 steps · GitHub](https://millionrounds.com/workflow/n8n-v-0-221-2-github-backup-of-workflows-and-credentials)
- [**INST - the n8n installer: deploy workflows with GitHub** 22 steps · GitHub](https://millionrounds.com/workflow/inst-the-n8n-installer-deploy-workflows-with-github)
- [**[n8n v^1.37.3] GitHub backup of workflows and credentials** 20 steps · GitHub](https://millionrounds.com/workflow/n8n-v-1-37-3-github-backup-of-workflows-and-credentials)
- [**Build your own GitHub MCP server** 15 steps · GitHub](https://millionrounds.com/workflow/build-your-own-github-mcp-server)
- [**GitHub webhook-based n8n workflow import template** 9 steps · GitHub](https://millionrounds.com/workflow/github-webhook-based-n8n-workflow-import-template)
