Back up and restore n8n Docker workflows and credentials with GitHub and SSH
Ready for 3.0What this workflow does
This workflow has 43 nodes and runs on a schedule (cron 0 10,22 * * *) (plus 1 other trigger). Along the way it connects GitHub.
How it runs
Trigger: On a schedule (cron 0 10,22 * * *) (plus 1 other trigger).
- Backup Configuration (Edit Fields (Set)): sets 4 fields: githubOwner, githubRepository, dockerContainer…
- Restore Configuration (Edit Fields (Set)): sets 1 field: dockerContainer
- Init Workflow Folder (GitHub): work with file
- Extract Binary Data (Code): runs custom JavaScript code
- Init Creds Folder (GitHub): work with file
- Export Workflows (SSH): uses SSH
- Extract JSON from Binary (Extract from File): extracts data from a file (from json)
- Export Credentials (SSH): uses SSH
- Parse Workflow Export (Code): runs custom JavaScript code
- Route Import Data (Code): runs custom JavaScript code
…plus 31 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (12)
- Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Schedule Trigger
n8n-nodes-base.scheduleTrigger - GitHub
n8n-nodes-base.github - SSH
n8n-nodes-base.ssh - Code
n8n-nodes-base.code - Split Out
n8n-nodes-base.splitOut - Convert to File
n8n-nodes-base.convertToFile - Merge
n8n-nodes-base.merge - Extract from File
n8n-nodes-base.extractFromFile - Switch
n8n-nodes-base.switch - Edit Fields (Set)
n8n-nodes-base.set - n8n Form Trigger
n8n-nodes-base.formTrigger
From the author
Quick Overview This workflow backs up all n8n workflows and encrypted credentials from a self-hosted Docker instance to a GitHub repository on a schedule, and provides a Basic Auth–protected form to restore workflows and credentials by importing uploaded JSON…