Restore n8n Workflows from GitHub Automatically

Struggling to manually restore your n8n workflows from GitHub backups? This workflow automates the entire process, saving you hours and preventing duplicate workflows by syncing your GitHub repository with your n8n instance effortlessly.
github
n8n
merge
+5
Workflow Identifier: 1903
NODES in Use: Manual Trigger, Set, Sticky Note, No Operation, If, GitHub, n8n, Merge

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow restores workflow backups stored on GitHub straight back into n8n automatically. It solves the problem of manual download, decode, and import steps that take hours and cause duplicates. The result is new workflows appearing in n8n only if they don’t already exist, saving time and avoiding errors.

The workflow fetches a list of files from a GitHub repo folder, retrieves each file’s content, and converts it from base64 to JSON. Then it compares backup workflow names with existing workflows in n8n, skipping duplicates. Finally, it creates any missing workflows via the n8n API.


Who should use this workflow

Anyone who stores n8n workflow backups on GitHub and needs a fast way to restore those workflows in n8n without doing it manually.

This is useful for automation specialists who handle multiple critical workflows and want to avoid downtime or mistakes caused by copying workflows by hand.


Tools and services used

  • GitHub API: To list and retrieve workflow files stored as JSON backups.
  • n8n API: To get existing workflows and create new workflows programmatically.
  • n8n nodes: Including Set nodes for variables and workflow content processing.
  • Base64 decoding: To convert GitHub file content into JSON workflows.

How the workflow works (Inputs → Process → Output)

Inputs

  • GitHub repository information: owner, repo name, folder path containing backups.
  • GitHub API personal access token.
  • n8n API credentials to access workflow management.

Processing steps

  • List all files inside the GitHub folder using the API.
  • Fetch each workflow file content in base64 format.
  • Convert base64 content to JSON and extract workflow names.
  • Get all current workflows from n8n.
  • Extract only the existing workflow names from n8n.
  • Compare GitHub workflow names to existing names, filter out duplicates.
  • Check if each workflow already exists, skip if yes.
  • Create new workflows in n8n for missing ones using JSON content.

Output

New workflows imported into n8n only if they did not exist before, no duplicates created. Clear logs show workflows skipped or created.


Beginner step-by-step: How to use this workflow in n8n

Step 1: Import the workflow

  1. Download the workflow file from this page using the Download button.
  2. Open your n8n editor.
  3. Click on “Import from File” in n8n and select the downloaded workflow.

Step 2: Configure needed settings

  1. Go to the Globals (Set) node and update:
    • Your GitHub username in repo.owner.
    • The repository name in repo.name.
    • The folder path where workflow backups are stored in repo.path.
  2. Ensure you add GitHub API credentials in the GitHub nodes.
  3. Add valid n8n API credentials where the workflow calls the n8n API.

Step 3: Test and activate

  1. Click on the Manual Trigger node and run the workflow to test.
  2. Check logs for created or skipped workflows.
  3. If everything is okay, activate the workflow using n8n’s activate toggle.

Optionally, change the Manual Trigger node to a Cron node for scheduled restores.

For users running self-host n8n, this process works the same. Find help on self-host n8n setups for easier control.


Customization ideas

  • Change the GitHub folder path by editing repo.path in the Globals node to restore workflows from different folders.
  • Add a Function or Code node after workflow creation to log workflow names and IDs for audit or messages.
  • Replace the Manual Trigger node with a Cron node to schedule automatic restore routines.

Common issues and fixes

  • Problem: The GitHub file list node shows empty results.
    Cause: Wrong repo or folder path in Globals node.
    Fix: Double-check repo.owner, repo.name, and repo.path values and confirm files exist on GitHub.
  • Problem: Workflow creation fails with API auth error.
    Cause: Invalid or expired n8n API credentials.
    Fix: Update or re-enter n8n API credentials in the credential settings.

Summary of benefits

✓ Saves hours of manual workflow restoring work.
✓ Prevents duplicate workflows in n8n.
✓ Keeps backup restore process fast and simpler.
✓ Gives clear feedback about restored or skipped workflows.
✓ Easily configurable with GitHub and n8n credentials.


Frequently Asked Questions

Yes, update the GitHub owner, repository name, and folder path in the Globals node to match any repository.
Yes, each GitHub API request uses rate limit credits, so use a personal access token with sufficient quota.
Invalid or expired n8n API credentials cause authentication errors. Updating credentials fixes this.
Yes, all communication uses HTTPS with authenticated API keys ensuring data security.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free