Skip to main content

Nightly n8n backup to Google Drive

Workflow preview

Workflow preview
100%
Nightly n8n backup to Google Drive preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Description This template creates a nightly backup of all n8n workflows and saves them to a Google Drive folder. Each night, the previous night's backups are moved to an “n8n old” folder and rename...

Best for

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

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.movebinarydata, n8n-nodes-base.filter, n8n-nodes-base.googledrive, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.merge, n8n-nodes-base.itemlists

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Nightly n8n backup to Google Drive
Workflow name
Nightly n8n backup to Google Drive

Description

This template creates a nightly backup of all n8n workflows and saves them to a Google Drive folder. Each night, the previous night's backups are moved to an “n8n_old” folder and renamed with the corresponding date.

Backups older than a specified age are automatically deleted using a precise code-based verification (this feature is active for 30 days by default, but is fully configurable).

What's New in v5

  • Modernized Loops: Replaced the legacy "Split In Batches" node with the newer and more efficient "Loop Over Items" node.
  • Smart Purge Logic: Now uses a Code node with Javascript (you can delete) to accurately calculate file age before deletion, ensuring only files strictly older than 30 days are removed.
  • Safety Checks: Implemented logic to verify if the "n8n_old" folder exists before attempting any purge operations to prevent errors.
  • Auto-Healing: The system now automatically creates the n8n_backups and n8n_old folders if they are missing.

Prerequisites

  • Google Drive account and credentials: Get from the following link. Link
  • n8n version: Recommended v1.70.1 up to v2.1.4 or higher (Required for "Loop Over Items" compatibility).
  • n8n API Key: Guide from the following link. Link (Required for the "Get many workflows" node).
  • Destination folders (Optional, as the script can now create them, but good to have):
  • “n8n_old”
  • “n8n_backups”

Configuration

  1. Google Drive: Update all Google Drive nodes with your OAuth2 credentials.
  2. n8n Connection: Open the "Get many workflows" node (formerly just "n8n") and select your n8n account credential (API Key).
  3. Schedule: Edit the Schedule Trigger node with the desired time to run the backup.

If you want to configure the auto-purge (delete old backups):

  1. The deletion logic is now handled in the "you can delete" Code node. You can edit the variable const THIRTY_DAYS_IN_MS in the code if you wish to change the 30-day limit.
  2. Enable the “PURGE DAYS” trigger and the subsequent nodes to activate this feature.
  3. Enable the workflow to run on the specified schedule.

Last updated

December 2025

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 - Sticky Note

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

Block 2 - Sticky Note2

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

Block 3 - Move Binary Data

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

Block 4 - Sticky Note3

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

Block 5 - Sticky Note4

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

Block 6 - IGNORE FILES

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 7 - Create n8n_backups

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

Block 8 - Create n8n_old

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

Block 9 - Sticky Note10

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

Block 10 - GET CURRENT FOLDER

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

Block 11 - Code

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

Block 12 - If n8n_old

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

Block 13 - If1 n8n_backups

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

Block 14 - GET CURRENT FOLDER CREATES

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

Block 15 - Merge mensage

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 2.1

Block 16 - GET CURRENT BACKUPS1

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

Block 17 - Sticky Note5

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

Block 18 - MOVE INTO OLD FOLDER

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

Block 19 - UPLOAD WORKFLOWS

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

Block 20 - Item Lists

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

Block 21 - LIST OLD BACKUPS

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

Block 22 - DELETE OLD BACKUP

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

Block 23 - Item Lists old

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

Block 24 - Sticky Note9

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

Showing the first 24 of 36 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Nightly n8n backup to Google Drive
Complexity advanced
Nodes 36
Categories DevOps
Author Jeyson Orozco
Published 18 Oct 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2469/2469.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 Nightly n8n backup to Google Drive do?

Description This template creates a nightly backup of all n8n workflows and saves them to a Google Drive folder. Each night, the previous night's backups are moved to an “n8n old” folder and rename...

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.