Automated Backup System for Automation Workflows - n8n Workflow

Implement a dual-redundancy backup system using this n8n workflow template. Automatically save all n8n workflow configurations to Google Drive and GitHub for secure version control.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

n8n Self-Hosters: Users managing their own n8n instance who require reliable disaster recovery plans.
DevOps Teams: Engineers needing structured version control (GitHub) for their critical n8n templates and configurations.


  • Automation Architects: Professionals seeking a robust and scheduled solution for backing up their complex n8n workflow assets.

Overview

Maintaining the integrity of your automation infrastructure is paramount. This robust n8n workflow provides a secure, reliable, and scheduled method for backing up every active n8n workflow in your instance. By leveraging the n8n API, this system exports each configuration and uploads it to two separate locations: Google Drive (for quick storage) and GitHub (for detailed version history).

This ensures redundancy and allows you to easily track changes using Git, treating your n8n workflow configurations like code. The included n8n trigger allows for scheduled execution, meaning your backup process runs automatically without manual intervention. This specific n8n workflow is a crucial tool for operational resilience.

How it Works

The entire process is initiated by an n8n trigger, either manually or via a schedule set to run every 12 hours.


  1. Configuration and Setup: The workflow starts by defining critical variables (GitHub repository details, Google Drive Folder ID, Telegram chat ID) in the Config n8n node. It then immediately uses the Google Drive n8n node to create a uniquely timestamped folder for the backup.

  2. Fetching Workflows: The Get All Workflows n8n node calls the local n8n API to retrieve JSON data for every active n8n workflow in the instance.

  3. Iteration and Processing: The Loop Over Workflows n8n node processes each workflow item individually. Each item is converted into a standard JSON file using the Convert to JSON File n8n node.

  4. Google Drive Backup: The JSON file is immediately uploaded to the newly created Google Drive folder.

  5. GitHub Version Control: A Code n8n node prepares the file path, sanitizing the workflow name and structuring the path (e.g., repopath/YYYY/MM/workflowname.json).

  6. Update or Create: The Check if File Exists n8n node attempts to retrieve the file from GitHub. An If n8n node determines if the file already exists in the repository. If it exists, the Update GitHub File n8n node commits the new version; if not, the Create GitHub File n8n node commits it for the first time. This ensures proper Git history.

  7. Completion and Notification: Once all workflows are processed, the system compiles a summary using the Final Summary n8n node and sends detailed notifications to Telegram and Discord, confirming the successful completion of the n8n workflow backup.

Installation Guide


  1. Import: Copy the provided JSON data and paste it into your n8n canvas using the 'New' button and selecting 'Import from JSON'.

  2. Credentials Setup:

Set up n8n API credentials for the Get All Workflows n8n node.
Configure Google Drive OAuth2 credentials for the Google Drive n8n node.
Configure GitHub OAuth2 credentials (with repository write permissions) for the GitHub n8n node.
(Optional) Configure credentials for Telegram and Discord n8n node services if you wish to receive completion alerts.

  1. Configure Variables: Open the Config n8n node and update the parameters with your specific details, including repoowner, reponame, gdrivefolderid, and your telegramchatid.

  2. Activation: Choose your preferred n8n trigger (Manual or Schedule) and activate the n8n workflow.

Node Details

Schedule Every 12 Hours / Manual Trigger: This n8n trigger initiates the entire backup sequence twice daily or on demand.
Config (Set n8n node): Centralizes all environmental parameters like GitHub repository path, owner name, and Google Drive target folder ID, making the n8n workflow highly portable.
Get All Workflows (n8n n8n node): Connects to the host n8n API to pull metadata and full JSON definitions for all active n8n templates.
Create GDrive Folder (Google Drive n8n node): Creates a unique, timestamped folder for the current backup iteration, ensuring backups are organized chronologically.
Loop Over Workflows (Split In Batches n8n node): Ensures that each individual n8n workflow is processed sequentially for both Google Drive and GitHub operations.
Prepare GitHub Data (Code n8n node): A critical custom-logic n8n node that sanitizes the workflow name for filename safety and calculates the exact file path structure for the GitHub backup (using year/month folders).


  • GitHub (Check if File Exists, Update, Create n8n nodes): These nodes manage the version control aspect. They check for the file's existence and either update the existing file (preserving history) or create a new file based on the item received from the n8n workflow.

Related n8n Workflows

Free

Nodes: 14 Nodes
Updated: December 26 2025
View all
Created by

Featured*