Automation library · Setup and learning

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

41 stepsLarge: read it before trusting it with anything live
1Branch: places the flow splits
2Loops or waits
2Services it connects to

The flow

Starts it 2Logic 18Service 21

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

  1. 1Cron: Trigger BackupSchedule triggerStarts it
  2. 2Form: Upload Restore FileForm triggerStarts it
  3. 3Set: Backup DateSetLogic
  4. 4JS: Extract Binary DataCodeLogic
  5. 5GitHub: Init Workflow FolderGithubService
  6. 6Extract: JSON from BinaryExtract From FileService
  7. 7GitHub: Init Creds FolderGithubService
  8. 8SSH: Export WorkflowsSshService
  9. 9JS: Route Import DataCodeLogic
  10. 10SSH: Export CredentialsSshService
  11. 11JS: Parse Workflow ExportCodeLogic
  12. 12Switch: Workflows vs CredsSwitchLogic
  13. 13JS: Parse Creds ExportCodeLogic
  14. 14Split: WorkflowsSplit OutLogic
  15. 15Merge: WFs & CredsMergeLogic
  16. 16Split: WF ItemsSplit OutLogic
  17. 17Split: Cred ItemsSplit OutLogic
  18. 18Split: CredentialsSplit OutLogic
  19. 19Convert: All WFs to JSONConvert To FileService
  20. 20Loop: Single WFSplit In BatchesLogic
  21. 21Convert: Combined DataConvert To FileService
  22. 22Convert: WF for ImportConvert To FileService
  23. 23Convert: Cred for ImportConvert To FileService
  24. 24Loop: Single CredSplit In BatchesLogic
  25. 25Convert: All Creds to JSONConvert To FileService
  26. 26JS: Prep All WFs PayloadCodeLogic
  27. 27Convert: Single WF to JSONConvert To FileService
  28. 28JS: Prep Combined PayloadCodeLogic
  29. 29SFTP: Upload WFs to /tmpFtpService
  30. 30SFTP: Upload Creds to /tmpFtpService
  31. 31Convert: Single Cred to JSONConvert To FileService
  32. 32JS: Prep All Creds PayloadCodeLogic
  33. 33GitHub: Push All WFsGithubService
  34. 34JS: Prep Single WF PayloadCodeLogic
  35. 35GitHub: Push Combined FileGithubService
  36. 36SSH: Exec Import WorkflowSshService
  37. 37SSH: Exec Import CredentialSshService
  38. 38JS: Prep Single Cred PayloadCodeLogic
  39. 39GitHub: Push All CredsGithubService
  40. 40GitHub: Push Single WFGithubService
  41. 41GitHub: Push Single CredGithubService

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.