Skip to main content

Back up self-hosted workflows to Google Drive daily with change detection

Workflow preview

Workflow preview
100%
Back up self-hosted workflows to Google Drive daily with change detection preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow creates a daily, automated backup of all workflows in a self hosted n8n instance and stores them in Google Drive. Instead of exporting every workflow on every run, it uses content has...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.googledrive, n8n-nodes-base.datatable, n8n-nodes-base.splitout

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Chandan Singh.

Original n8n.io source

1.1 Workflow description

Title
Back up self-hosted workflows to Google Drive daily with change detection
Workflow name
Back up self-hosted workflows to Google Drive daily with change detection

This workflow creates a daily, automated backup of all workflows in a self-hosted n8n instance and stores them in Google Drive. Instead of exporting every workflow on every run, it uses content hashing to detect meaningful changes and only updates backups when a workflow has actually been modified.

To keep Google Drive clean and predictable, the workflow intentionally deletes the existing backup file before uploading the updated version. This avoids duplicate files and ensures there is always one authoritative backup per workflow.

A Data Table is used as an index to track workflow IDs, hash values, and timestamps. This allows the workflow to quickly determine whether a workflow already exists, whether its content has changed, or whether it should be skipped entirely.

How it works

  • Runs daily using a Cron Trigger.
  • Fetches all workflows from the n8n API.
  • Processes workflows one-by-one for reliability.
  • Generates a SHA-256 hash for each workflow.
  • Compares hashes against a stored Data Table.
  • Deletes existing Google Drive backups when changes are detected.
  • Uploads updated workflows and skips unchanged ones.
  • Store new or updated workflows details in Data Table.
  • Filters workflows based on the configured backup scope (all | active | tagged ). Backs up all workflows, only active workflows, or only workflows matching a specific tag.
  • Applies the scope filter before hashing and comparison, ensuring only relevant workflows are processed.

Setup steps

  • Set the Cron schedule Open the Cron Trigger node and choose the time you want the backup to run (for example, once daily during off-peak hours).

  • Create a Data Table Create a new n8n Data Table with the title defined in dataTableTitle. This table stores workflowId, workflowName, hashCode, and DriveFiveId.

  • Configure the Set node In the Set Backup Configuration node, provide the following values: { "n8nHost": "https://your-n8n-domain", "apiKey": "your-n8n-api-key", "backupFolder": "/n8n/workflow-backups", "hashAlgorithm": "sha256", "dataTableTitle": "n8n_workflow_backup_index", "backupScope" : "",
    "requiredTag" : "" }

  • In the Set Backup Configuration node, choose how workflows should be selected for backup: all – backs up every workflow (default) active – backs up only enabled workflows tagged – backs up only workflows containing a specific tag If using the tagged option, provide the required tag name to match. { "backupScope": "tagged", "requiredTag": "production" }

  • Connect Google Drive credentials Authorize your Google Drive account and ensure the backup folder exists.

  • Activate the workflow Once enabled, backups run automatically with no further action required.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Daily Backup Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 2 - Set Configuration

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Get All n8n Workflows

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 4 - Prepare Workflow

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Workflow Exists?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 6 - Hash Changed?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 7 - Upload New Workflow Backup

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 8 - Upsert Workflow Records

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 9 - Split Workflows

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 10 - Process Each Workflow

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 11 - Generate Workflow Hash

Type / Role
n8n-nodes-base.crypto - crypto
Config choices
Version 1

Block 12 - Lookup Workflow in Data Table

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 13 - Delete Existing Workflow Backup

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 14 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Backup scope all?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 20 - Backup scope active?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 21 - If workflow active?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 22 - Backup scope tagged?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 23 - Config Validation

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

3. Summary Table

Workflow Back up self-hosted workflows to Google Drive daily with change detection
Complexity advanced
Nodes 23
Categories DevOps
Author Chandan Singh
Published 28 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/12242/12242.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Back up self-hosted workflows to Google Drive daily with change detection do?

This workflow creates a daily, automated backup of all workflows in a self hosted n8n instance and stores them in Google Drive. Instead of exporting every workflow on every run, it uses content has...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.