AutomationMart
Home/Browse/Back up and restore n8n workflows with GitHub sync
n8n

Back up and restore n8n workflows with GitHub sync

n8nn8n27 modulesv1.0
GitHub

n8n Workflows GitHub Manager > A comprehensive n8n workflow that provides complete bidirectional sync between your n8n instance and GitHub - automatically backs up all your workflows with intelligent change detection AND restores them when needed. This workflow combines two powerful features in one: Backup: Automatically detects new, edited, renamed, and deleted workflows in your n8n instance, then syncs them to GitHub with smart commit messages and an index tracking system. Restore: Easily

At a glance

Back up and restore n8n workflows with GitHub sync is a ready-made n8n workflow you import as a workflow JSON file β€” no build required. It connects GitHub. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
GitHub
Modules
27
Price
Free
Version
v1.0
Back up and restore n8n workflows with GitHub sync workflow diagram

About this workflow

n8n Workflows GitHub Manager > A comprehensive n8n workflow that provides complete bidirectional sync between your n8n instance and GitHub - automatically backs up all your workflows with intelligent change detection AND restores them when needed. This workflow combines two powerful features in one: Backup: Automatically detects new, edited, renamed, and deleted workflows in your n8n instance, then syncs them to GitHub with smart commit messages and an index tracking system. Restore: Easily restore all workflows from your GitHub repository back to n8n - perfect for disaster recovery, new instance setup, or environment cloning. --- How It Works πŸ”„ Backup Mode (Automatic) 1. Trigger: Runs automatically every day at 7 PM UTC (or manually when triggered via the Schedule Trigger). 2. Get/Create Index: Attempts to fetch index.json from your GitHub repository. If found β†’ Downloads and parses it. If not found β†’ Creates a new empty index file and waits 3 seconds for GitHub to process. 3. Fetch All Workflows: Retrieves all workflows from your n8n instance via the n8n API. 4. Smart Comparison: The "C,E,D Checker" (Create, Edit, Delete) analyzes differences: CREATE β†’ New workflow not in index. RENAME β†’ Workflow name changed (deletes old file, creates new one). EDIT β†’ Existing workflow (flagged for content comparison). DELETE β†’ Workflow removed from n8n but still in GitHub. INDEX UPDATE β†’ Triggered if any changes detected. 5. Route Actions: Switch node routes each action to the appropriate branch: Create Branch β†’ Creates new workflow files in GitHub. Edit Branch β†’ Performs smart edit detection: Fetches current file from GitHub. Compares GitHub version vs. n8n version (normalized JSON). Only commits if content actually changed (avoids timestamp-only updates). Delete Branch β†’ Removes workflow files from GitHub. Update Index Branch β†’ Updates index.json with latest mappings. 6. Commit Messages: Auto-generated with format: [Workflow Name] (Action) YYYY-MM-DD ⬇️ Restore Mode (Manual) 1. Trigger: Manually execute via the "When clicking 'Execute workflow'" manual trigger. 2. Set GitHub Details: Configure your repository owner and name. 3. List Workflow Files: Fetches all workflow JSON files from the workflows/ folder in your GitHub repository. If folder not found β†’ Workflow stops gracefully (ensure backup ran at least once first). 4. Loop Through Files: Sequentially processes each workflow file: Downloads the JSON content from GitHub. Creates the workflow in your n8n instance via the n8n API. 5. Sequential Processing: Handles one workflow at a time to prevent conflicts and respect rate limits. 6. Result: All workflows from GitHub are restored to your n8n instance. --- Requirements GitHub OAuth2 Credentials: Go to GitHub Developer Settings β†’ OAuth Apps β†’ New OAuth App. Set Authorization callback URL to your n8n instance URL (e.g., Copy Client ID and Client Secret. Add as OAuth2 credential in n8n (Credentials β†’ New β†’ GitHub OAuth2). GitHub Repository: Create a new repository (public or private). Note your username (repo owner) and repository name. n8n API Credentials: In your n8n instance β†’ Settings β†’ API β†’ Create new API key. Add as n8n API credential in the workflow. --- How to Use Initial Setup 1. Import the Workflow: Copy the provided JSON file. In your n8n instance β†’ click Import Workflow β†’ paste or upload the JSON. 2. Create GitHub Repository: Go to GitHub β†’ Create a new repository (e.g., n8n-workflows-manager). Leave it empty (no README, no .gitignore). 3. Set Up GitHub OAuth2: In n8n β†’ Credentials β†’ New β†’ GitHub OAuth2. Fill in: Client ID β†’ from GitHub OAuth App. Client Secret β†’ from GitHub OAuth App. Click Connect my account and authorize. 4. Set Up n8n API Credentials: In n8n β†’ Settings β†’ API β†’ Create new API key. Copy the key. In workflow β†’ Credentials β†’ New β†’ n8n API β†’ paste the key. Set Base URL to your n8n instance (e.g., 5. Configure Repository Details: Find both "Set Github Data" nodes in the workflow (one for backup, one for restore). Edit the assignments in each: repoowner: Replace "your-github-username" with your GitHub username. reponame: Replace "your-github-repository-name" with your repository name. 6. Connect Credentials to Nodes: Open each GitHub node (there are 8 total): Backup section: Create Index File, Get Download Url for Index File, Create New Files, Update Index File, Get Download Url for Github File, Delete Files, Edit Files Restore section: List Workflow Files Set Credential for GitHub OAuth2 to the one you created. Open the n8n API nodes (Get All Workflows, Create Workflow) β†’ Set Credential for n8n API to the one you created. Using Backup Mode 7. Test Backup: Click the "Schedule Trigger" node at the top of the workflow. Click "Test workflow". Monitor execution β†’ All nodes in the backup section should turn green. Check your GitHub repository β†’ Should see index.json and workflows/ folder with your workflows. 8. Activate for Auto Backup: Once tested successfully, toggle the workflow to Active. It will now run automatically every day at 7 PM UTC. Using Restore Mode 9. Test Restore (only after you have backups in GitHub): Click the "When clicking 'Execute workflow'" manual trigger node at the bottom. Click "Test workflow". Monitor execution β†’ All nodes in the restore section should turn green. Check your n8n workflows list β†’ All workflows from GitHub should now be present. 10. When to Use Restore: Setting up a new n8n instance. Recovering after data loss. Cloning workflows to another environment. Rolling back to a previous state (manually download older commits from GitHub first). --- Important Notes Smart Edit Detection: Uses normalized JSON comparison to avoid unnecessary commits when only timestamps change. Credentials: Credential IDs are included but not actual secrets. You must reconnect credentials after restore. Restored Workflows: Created as new workflows with new IDs in inactive state by default. File Structure: index.json tracks all workflows; workflows/ folder contains individual workflow files. Security: Use a private repository if workflows contain sensitive data. Credential secrets are never backed up. --- Customization Change Schedule: Edit "Schedule Trigger" node β†’ modify triggerAtHour (default: 19 = 7 PM UTC) File Path: Modify filePath in GitHub nodes to change storage location Notifications: Add email/notification nodes to get alerts on backup completion Selective Restore: Add IF nodes to filter which workflows to restore Multiple Repos: Duplicate workflow for separate prod/dev backups --- Author: Muhammad Anas Farooq

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n β†’ click the menu β†’ Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Create Basecamp2 to-dos from new GitHub issues

Every time a new issue is added to GitHub, Make will automatically create a new to-do on Basecamp2.

Free

AI chatbot call center: Taxi booking support (production-ready, part 7)

Workflow Name: 🫢 Taxi Booking Support Template was created in n8n v1.90.2 Skill Level: Mid Categories: n8n, Chatbot Stacks - Schedule Trigger node - Postgres node - AI Agent node - Google Calendar node - Execute Sub-workflow - If node, Switch node, Code node, Edit Fields (Set) Prerequisite - Sub-workflow: Demo Call Back (or your own node) Production Features - Scaling Design for n8n Queue mode in production environment - Customize Expired Booking Actions example - Multi-Language Design What this

Free

Send AI budget overspend alerts with Alephant AI Gateway and Gmail

Quick overview This workflow runs every 6 hours to check an Alephant AI Gateway virtual key’s budget usage and, when live usage meets or exceeds the threshold, sends a detailed overspend alert email via Gmail. How it works 1. Runs every 6 hours on a schedule. 2. Requests the current virtual key budget status from Alephant AI Gateway, including usage percentage, spend, and circuit-breaker mode. 3. Checks whether the data source is live and the budget usage percentage is greater than or equal to t

Free

Create GitHub issues from Pastebin pastes

This template lists your Pastebin pastes and create a corresponding GitHub issue for each one.

Free

πŸ€–πŸ§‘β€πŸ’» AI agent for top n8n creators leaderboard reporting

This n8n workflow is designed to automate the aggregation, processing, and reporting of community statistics related to n8n creators and workflows. Its primary purpose is to generate insightful reports that highlight top contributors, popular workflows, and key trends within the n8n ecosystem. Here's how it works and why it's important: How It Works 1. Data Retrieval: - The workflow fetches JSON data files from a GitHub repository containing statistics about creators and workflows. - It uses

Free

Zillow property scraper by location via Bright Data & Google Sheets

Google Maps Business Phone Number Scraper Using Bright Data API & Google Sheets Integration This template requires a self-hosted n8n instance to run. An automated workflow that extracts business information including phone numbers from Google Maps using Bright Data's API and saves the data to Google Sheets for easy access and analysis. πŸ“‹ Overview This workflow provides an automated solution for extracting business contact information from Google Maps based on location and keyword searches. Perfe

Free

Automate Instagram carousel creation with GPT-5, Nano Banana, and Blotato

Instagram Carousel & Caption Generator on Autopilot (GPT-5 + Nano Banana + Blotato + Google Sheets) Description Watch the full step-by-step tutorial on YouTube: Disclaimer (self-hosted requirement): This template assumes you have valid API credentials for OpenAI, Wavespeed/Nano Banana, Blotato, and Google. If using n8n Self-Hosted, ensure HTTPS access and credentials are set in

Free

Post AI videos to YouTube with Fal AI Veo3, Google Sheets, and YouTube API

Auto-Post Veo3 Videos on YouTube An automated workflow for creating Veo3 videos and posting them to YouTube. YT Tutorial: Workflow Overview The workflow is divided into three main phases: 1. Create Veo3 Video 2. Wait for Video Processing 3. Post on YouTube 1. Create Veo3 Video This phase handles the initial video creation based on user input. Type Prompt: A form trigger allows the user to input details for the video, including

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint β€” instant download
  • Setup guide PDF included
  • 5 downloads Β· valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

β‚Ή2,499/ session
3 hrs Β· video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free