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
Restore n8n workflows from GitHub

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

Learn how to Build this Workflow with AI:

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.


Restore n8n workflows from GitHub

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.