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 “n8nold” folder and renamed with the correspond...
Template notes
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 “n8nold” folder and renamed with the corresponding date.
Backups older than a specified age are automatically deleted using a precise code-based verification. This ensures your cloud storage remains organized without manual intervention.
What's New in v5 (Optimized)
Lightning-Fast Search: Optimized Google Drive nodes with specific queries (name contains 'n8n') and limits. This prevents the workflow from scanning your entire Drive, reducing execution time from minutes to seconds. Dynamic ID Mapping: Updated the Code node to map folder IDs on the fly. The workflow now "remembers" IDs for n8nbackups and n8nold, allowing for seamless transitions even if folders are newly created. Modernized Loops: Fully migrated from legacy "Split In Batches" to the modern "Loop Over Items" architecture for better stability and readability. Smart Purge Logic: Uses a Javascript-based Code node (you can delete) to extract timestamps from filenames and strictly delete files older than 30 days. Auto-Healing Infrastructure: Intelligent check-and-create logic. If the system detects a missing folder, it creates it and immediately passes the new ID to the rest of the flow.
Prerequisites
Google Drive Account: OAuth2 credentials required. [Console Cloud Setup](https://console.cloud.google.com/apis/credentials/oauthclient/) n8n Version: Recommended v1.70.1 or higher (Required for modern Loop nodes). n8n API Key: Required for the "Get many workflows" node to fetch your local data. [API Key Guide](https://witmovil.com/where-to-create-the-api-key-in-n8n/) Permissions: Ensure the Google Drive API is enabled in your Google Cloud Project.
Configuration