Quick overview
This workflow manually restores n8n workflows from JSON backup files stored in a GitHub repository, recreates them via the n8n API, and tracks progress in an n8n Data Table to avoid reprocessing items during the same recovery run.
How it works
- Starts when you manually execute the workflow.
- Lists files in the root of the configured GitHub repository and filters to those that match the expected workflow-backup filename pattern.
- Reads previously restored workflow IDs from an n8n Data Table and builds a list of backup files that have not been restored yet.
- Processes each pending backup by downloading the JSON from GitHub’s Contents API using the raw response format.
- Cleans the workflow payload by keeping only n8n API-compatible workflow settings and prepares the workflow definition for import.
- Creates each workflow in the target n8n instance via the n8n API and writes a checkpoint row to the Data Table with the original workflow ID and name.
- After all pending backups are processed, deletes all rows in the control Data Table to reset it for a future restore run.
Setup
- Add GitHub OAuth2 credentials with access to the repository and set the repository owner, repository name, and GitHub API version in the configuration step.
- Add n8n API credentials pointing to the destination n8n instance where workflows should be restored.
- Create the n8n Data Table named in
control_table with string columns workflow_id and workflow_name.
- Ensure your backup files are stored in the repository root and follow the expected naming convention using the configured separator character.