Automated workflow backup to Google Drive with smart cleanup
Ready for 3.0What this workflow does
This workflow has 13 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Google Drive.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- CONFIG - Set your variables here (Edit Fields (Set)): sets 2 fields: parentFolderId, backupsToKeep
- Create new backup folder (Google Drive): work with folder
- Get all n8n workflows (n8n): uses n8n
- Loop over each workflow (Loop Over Items (Split in Batches)): loops over the items in batches
- Start cleanup (run once) (Edit Fields (Set)): sets or maps fields
- Convert workflow to file (Convert to File): converts data to a file (to json)
- Search files and folders (Google Drive): work with file folder
- Upload workflow to Google Drive (Google Drive): uses Google Drive
- Sort and isolate old folders (Code): runs custom JavaScript code
- Loop over folders to delete (Loop Over Items (Split in Batches)): loops over the items in batches
…plus 1 more step. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (8)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Manual Trigger
n8n-nodes-base.manualTrigger - Google Drive
n8n-nodes-base.googleDrive - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - n8n
n8n-nodes-base.n8n - Convert to File
n8n-nodes-base.convertToFile
From the author
How it works This workflow provides a complete, automated backup solution for your n8n instance, running on a daily schedule to ensure your automations are always safe. Automatic cleanup: It first connects to your Google Drive to find and delete old backup…