Automate n8n Workflow Backups with Google Drive

Save hours managing n8n workflow backups by automating their nightly storage on Google Drive. Automatically move, rename, and purge old backups with this targeted n8n workflow solution.
googleDrive
code
if
+7
Workflow Identifier: 2285
NODES in Use: Sticky Note, Filter, Google Drive, Code, If, Merge, Item Lists, Split In Batches, n8n, Move Binary Data

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This n8n workflow helps you save your workflow backups on Google Drive automatically.

It fixes the problem of messy backup files by creating two folders, saving new backups, moving old backups to another folder, and deleting very old backups after 30 days.

You get organized backups without having to do anything manually.


What You Need to Use This Workflow

  • Google Drive account with OAuth2 credentials set in n8n.
  • n8n instance with an API Key to fetch workflow data.
  • n8n version 1.67.1 or newer.
  • The workflow will create n8n_backups and n8n_old folders if missing.
  • Basic n8n knowledge and access to the editor.
  • Optional: Use a self-host n8n setup for full control.

How This Workflow Works: Inputs, Processing, Outputs

Inputs

  • Scheduled time trigger to start the backup.
  • Google Drive existing folders list.
  • Current workflows retrieved from n8n API.
  • Current backup files in Google Drive folder.

Processing Steps

  • Check for folders named n8n_backups and n8n_old. Create if not found.
  • Move existing backup files from n8n_backups to n8n_old.
  • Fetch all workflows from n8n.
  • Convert each workflow’s JSON data into a file and upload it to n8n_backups with clear names.
  • Delete backup files older than 30 days from n8n_old periodically.

Outputs

  • Two Google Drive folders for backups organized by age.
  • Latest workflow backups saved as JSON files.
  • Old backups archived separately.
  • Automatic cleanup of backups older than 30 days.

Beginner Step-by-Step: How to Use This Workflow in Your n8n Production

Step 1: Download and Import the Workflow

  1. Click the Download button on this page to get the workflow file.
  2. Open your n8n editor where you have workflows.
  3. Use the Import feature and choose “Import from File” to upload the downloaded workflow.

Step 2: Configure Workflow Credentials and Settings

  1. Add your Google Drive OAuth2 credentials in the imported workflow’s Google Drive nodes.
  2. Add your n8n API Key in the n8n node to allow fetching workflows.
  3. Check folder names or IDs if you want to customize; otherwise, keep default n8n_backups and n8n_old.

Step 3: Test and Activate

  1. Run the workflow once manually in the editor to confirm backups are created and folders made.
  2. Look at execution results to check for errors or missing files.
  3. When happy, activate the workflow to run on schedule automatically.

The workflow will run nightly or at your chosen interval to organize backups without your help.


Customizations You Can Make

  • Change backup timing by updating the Schedule Trigger node’s interval.
  • Adjust backup retention by changing the deletion time from 30 days to any number.
  • Change file naming in the Move Binary Data node with expressions for easier identification.
  • Add email alerts after backup or purge to get notified.
  • Add extra cloud storage options like Dropbox or AWS S3 to save backups in more places.

Troubleshooting Common Problems

File not found when moving backups

Check if file IDs passed to the move nodes are correct from the latest file list.

Backup folders not created

Verify the Code node correctly checks for missing folders and Google Drive create folder nodes are set up right with exact names.

Upload fails due to data format

Ensure the Move Binary Data node converts JSON data to binary correctly and names files properly before upload.


Pre-Production Checks

  • Confirm Google Drive credentials are authorized.
  • Make sure the n8n API Key has permission to list workflows.
  • Check Schedule Trigger nodes are set to active and run at right intervals.
  • Test by deleting backup folders and running workflow to see folders created anew.
  • Run a backup test and confirm files upload with correct naming.
  • Simulate purge by changing deletion time and verify old backups delete.

Deployment Guide

Activate the workflow once set up and tested.

Monitor runs via the n8n execution log to be sure backups and moves complete successfully.

The schedule triggers run backups and cleanups automatically, so no manual work is needed.

Add logging or alerts if wanted to track the backup status and errors.

Renew credentials when required; otherwise, it works with low maintenance.


Summary

✓ Saves time by automating backup creation and cleanup.

✓ Keeps backup files organized in separate folders.

✓ Deletes backups older than 30 days automatically.

→ Results in easy-to-find, up-to-date backups on Google Drive.

→ Prevents storage clutter and accidental data loss.


Frequently Asked Questions

The workflow can use Dropbox by replacing Google Drive nodes with Dropbox nodes and configuring them to match the Dropbox API.
The workflow uses a moderate number of API calls depending on the number of workflows and backup files, with batching to avoid rate limits.
Backup data is protected by Google Drive security. Using OAuth2 credentials and controlling Drive access keeps data private.
Check the Code node script for correct folder detection and confirm Google Drive nodes have exact folder names and credentials are valid.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free