See llms.txt for all machine-readable content.

Back to Templates

Restore n8n workflows from GitHub JSON backups with Data Tables

Created by

Created by: Alvaro Pérez || junforever
Alvaro Pérez

Last update

Last update 15 hours ago

Categories

Share


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

  1. Starts when you manually execute the workflow.
  2. Lists files in the root of the configured GitHub repository and filters to those that match the expected workflow-backup filename pattern.
  3. Reads previously restored workflow IDs from an n8n Data Table and builds a list of backup files that have not been restored yet.
  4. Processes each pending backup by downloading the JSON from GitHub’s Contents API using the raw response format.
  5. Cleans the workflow payload by keeping only n8n API-compatible workflow settings and prepares the workflow definition for import.
  6. 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.
  7. After all pending backups are processed, deletes all rows in the control Data Table to reset it for a future restore run.

Setup

  1. Add GitHub OAuth2 credentials with access to the repository and set the repository owner, repository name, and GitHub API version in the configuration step.
  2. Add n8n API credentials pointing to the destination n8n instance where workflows should be restored.
  3. Create the n8n Data Table named in control_table with string columns workflow_id and workflow_name.
  4. Ensure your backup files are stored in the repository root and follow the expected naming convention using the configured separator character.