National Commerce Docs
n8n flows

Scenario Backups

Automated daily backup of every n8n workflow to Google Drive as JSON, retaining the newest 365 daily folders.

Backs up every n8n workflow to Google Drive as JSON files once a day, keeping the most recent 365 daily folders and deleting anything older.

At a glance

  • Status: Active.
  • Trigger: Schedule (daily) plus a manual trigger.
  • Runs on: All workflows in the instance, once per day.
  • Talks to: Google Drive (folder create, search, delete, file upload) and the n8n internal API (workflow export).

How it works

  1. Get DateTime captures the timestamp.
  2. Search For Backup Folder looks for today's dated folder; Found Folder? reuses it, or Create Folder with DateTime Stamp creates a new one.
  3. Get Workflows fetches all workflows.
  4. Loop Over Items converts each workflow to a JSON file and saves it to today's Google Drive folder.
  5. On completion, it lists all backup folders, Find Folders to Delete sorts them descending and slices off everything beyond the newest 365, and Delete Folders removes them permanently.

Notes

  • Backups land in the "n8n Backups" Google Drive folder.
  • Retention is 365 days, despite a bundled sticky note that mentions 7 days.
  • A Telegram-notification step referenced in the sticky note was removed.

On this page