Automated Workflow Backups to Google Drive
detail.loadingPreview
Automate daily backup of n8n workflows to Google Drive, manage retention, and receive Telegram notifications.
About This Workflow
This workflow automates the daily backup of your n8n workflows to Google Drive. It creates timestamped folders for each backup, saves workflow configurations as JSON files, and implements a retention policy to keep only the most recent seven days of backups, automatically deleting older ones. The user is notified via Telegram upon completion, with a link to the backup folder.
Key Features
- Daily Scheduled Backups: Automatically backs up workflows at a set interval (e.g., daily).
- Timestamped Folders: Creates uniquely named folders in Google Drive for each backup session (e.g.,
n8n-Workflow-Backups-YYYY-MM-DD). - JSON Workflow Export: Converts each n8n workflow into a JSON file.
- Google Drive Integration: Seamlessly uploads backup files to Google Drive.
- Automated Retention Policy: Deletes backup folders older than 7 days to manage storage space.
- Telegram Notifications: Sends alerts to a specified Telegram chat with backup status and a link to the created folder.
- Manual Trigger Option: Allows for on-demand workflow backups.
How To Use
Setup Steps
1. Trigger Configuration:
On clicking 'execute'(manualTrigger): For manual backups.Every Day(scheduleTrigger): Configure therule.intervalto set the daily backup schedule.
2. Backup Process:
Get DateTIme(set): Captures the current date and time.Create Folder with DateTime Stamp(googleDrive): Creates a new folder in Google Drive using the captured timestamp.Get Workflows(n8n): Retrieves all workflows from your n8n instance.Limit to 200(limit): (Optional, for testing) Limits the number of workflows processed.Loop Over Items(splitInBatches): Iterates through each workflow retrieved.Convert Workflow to JSON File(convertToFile): Converts each workflow into a JSON file.Save JSON File to Google Drive Folder(googleDrive): Uploads the JSON file to the newly created Google Drive folder.
3. Backup Management (Deletion of Old Backups):
Execute Once(noOp): This node acts as a point for the deletion logic to run independently or alongside the backup process.Search Folder Names(googleDrive): Searches for existing backup folders in Google Drive matching the naming conventionn8n-Workflow-Backups.Find Folders to Delete(code): A JavaScript function that sorts the found folders by name (descending) and selects all but the most recent 7 to be deleted.Delete Folders(googleDrive): Permanently deletes the identified older backup folders.
4. Notifications:
Complete Message(telegram): Sends a success message to Telegram, including the name and link of the newly created backup folder.
Important Notes:
- Ensure your Google Drive, n8n API, and Telegram credentials are correctly configured in n8n.
- The
n8n-Workflow-Backupsprefix is crucial for the deletion logic to identify correct folders. - Adjust the retention logic in the
Find Folders to Deletenode if you need to keep more or fewer than 7 days of backups.
Apps Used
Workflow JSON
{
"id": "34cfcee4-d7c2-4bef-8319-3cb3d204ece7",
"name": "Automated Workflow Backups to Google Drive",
"nodes": 17,
"category": "Data Management",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 34cfcee4-d7c2...
About the Author
Crypto_Watcher
Web3 Developer
Automated trading bots and blockchain monitoring workflows.
Statistics
Related Workflows
Discover more workflows you might like
Sync Google Drive Files with OpenAI Vector Store
Automatically syncs files from Google Drive to an OpenAI vector store, ensuring up-to-date embeddings for AI applications.
FileMaker Data Entry and Update
Workflow to create a record in FileMaker, then edit it with additional data.
Dynamically Create Airtable Tables for Webflow Form Submissions
Automatically create dedicated Airtable tables for each Webflow form and log submissions.