This workflow corresponds to n8n.io template #4515 — we link there as the canonical source.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "uTDqvTnmDaTgRRu8",
"meta": {
"templateId": "2469",
"templateCredsSetupCompleted": true
},
"name": "AIAutomationPro Hourly Backup To Google Drive v1",
"tags": [
{
"id": "MqQ2zS7ixA8b0cmJ",
"name": "Tool",
"createdAt": "2024-11-15T19:27:51.756Z",
"updatedAt": "2024-12-30T09:58:18.482Z"
},
{
"id": "RHp83eTHbIpxlDCF",
"name": "Template",
"createdAt": "2025-01-03T16:24:28.562Z",
"updatedAt": "2025-01-03T16:24:28.562Z"
},
{
"id": "3rkMsCyNbu0QrC94",
"name": "Backup",
"createdAt": "2025-04-17T05:01:34.098Z",
"updatedAt": "2025-04-17T05:01:34.098Z"
}
],
"nodes": [
{
"id": "a2dd2041-2bea-4659-aab6-0b0dd0640f55",
"name": "Date Time",
"type": "n8n-nodes-base.dateTime",
"position": [
1400,
2200
],
"parameters": {
"options": {},
"outputFieldName": "now"
},
"typeVersion": 2
},
{
"id": "54e48154-26bd-49c0-a0b6-5c67ce3eab54",
"name": "Date & Time Format",
"type": "n8n-nodes-base.dateTime",
"position": [
1620,
2200
],
"parameters": {
"date": "={{ $('Date Time').first().json.now }}",
"format": "yyyy-MM-dd",
"options": {},
"operation": "formatDate"
},
"typeVersion": 2
},
{
"id": "5d3bad24-ef42-42f7-8a41-ca8fbad75b61",
"name": "Date & Time Hour",
"type": "n8n-nodes-base.dateTime",
"position": [
1840,
2200
],
"parameters": {
"date": "={{ $('Date Time').first().json.now }}",
"part": "hour",
"options": {},
"operation": "extractDate",
"outputFieldName": "hour"
},
"typeVersion": 2
},
{
"id": "a8e058b1-f438-470c-8a84-49cd168c8307",
"name": "Google Drive Backup Folder Every Hour",
"type": "n8n-nodes-base.googleDrive",
"position": [
2060,
2200
],
"parameters": {
"name": "=n8n_backup_{{ $('Date & Time Format').first().json.formattedDate }}_{{ $('Date & Time Hour').first().json.hour }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "0AKPPy6FuV32kUk9PVA",
"cachedResultUrl": "https://drive.google.com/drive/folders/0AKPPy6FuV32kUk9PVA",
"cachedResultName": "AI Automation Pro"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1bfYhgr3GiwFxvfPQiPB_I814Lsuv9tM3",
"cachedResultUrl": "https://drive.google.com/drive/folders/1bfYhgr3GiwFxvfPQiPB_I814Lsuv9tM3",
"cachedResultName": "Template - N8n Backup"
},
"resource": "folder"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "521f49b0-d349-4781-9a7e-3b0b33f77a5c",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
1280,
2120
],
"parameters": {
"color": 2,
"width": 2103,
"height": 296,
"content": "## Create N8n Backup Workflows Every Hour"
},
"typeVersion": 1
},
{
"id": "69baef8f-9074-4858-8d5e-751c7d980f34",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
1940,
2540
],
"parameters": {
"color": 2,
"width": 1003,
"height": 296,
"content": "## Delete N8n Backup Workflows Over The Past X Days"
},
"typeVersion": 1
},
{
"id": "665cc313-a152-4eea-98bc-a11cec81e97d",
"name": "n8n",
"type": "n8n-nodes-base.n8n",
"position": [
2280,
2200
],
"parameters": {
"filters": {},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "bb33fd37-6077-429e-b88d-44dce50df544",
"name": "Move Binary Data",
"type": "n8n-nodes-base.moveBinaryData",
"position": [
2500,
2200
],
"parameters": {
"mode": "jsonToBinary",
"options": {
"fileName": "={{ $json.name }}",
"useRawData": true
}
},
"typeVersion": 1
},
{
"id": "4926fe6f-ed1e-466c-b83c-fdea9a7ff08c",
"name": "Split In Batches",
"type": "n8n-nodes-base.splitInBatches",
"position": [
2720,
2200
],
"parameters": {
"options": {
"reset": false
},
"batchSize": 1
},
"typeVersion": 2
},
{
"id": "a511a9e2-6892-42c1-975e-50d30e11d37c",
"name": "Google Drive Upload Workflows",
"type": "n8n-nodes-base.googleDrive",
"position": [
2940,
2180
],
"parameters": {
"name": "={{ $('Split In Batches').item.binary.data.fileName }}.json\n\n",
"options": {},
"parents": [
"={{ $('Google Drive Backup Folder Every Hour').first().json.id }}"
],
"binaryData": true,
"authentication": "oAuth2"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "22a954ab-0b20-48a2-8bc6-fb5c7aa6c11a",
"name": "Date & Time Format 2",
"type": "n8n-nodes-base.dateTime",
"position": [
2280,
2640
],
"parameters": {
"date": "={{ $('Date & Time Subtract Coverage Period').first().json.newDate }}",
"format": "yyyy-MM-dd",
"options": {},
"operation": "formatDate"
},
"typeVersion": 2
},
{
"id": "3ae1beba-024f-4b57-b298-9b5c2347cb3d",
"name": "Google Drive Search",
"type": "n8n-nodes-base.googleDrive",
"position": [
2500,
2640
],
"parameters": {
"limit": 1,
"filter": {},
"options": {},
"resource": "fileFolder",
"queryString": "=n8n_backup_{{ $('Date & Time Format 2').first().json.formattedDate }}_{{ $('Date & Time Hour').first().json.hour }}"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "79591e71-6ee8-4a04-b798-318befcc37c3",
"name": "Google Drive Delete",
"type": "n8n-nodes-base.googleDrive",
"position": [
2720,
2640
],
"parameters": {
"options": {},
"resource": "folder",
"operation": "deleteFolder",
"folderNoRootId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Google Drive Search').first().json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "d01f220a-df90-4de9-b4a0-b588cc787e62",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
3160,
2180
],
"parameters": {
"amount": 3
},
"typeVersion": 1.1
},
{
"id": "7cc95066-a8a4-4cfe-9271-38b7da181eb6",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
840,
2120
],
"parameters": {
"color": 2,
"width": 303,
"height": 296,
"content": "## Backup Coverage Period"
},
"typeVersion": 1
},
{
"id": "f420f5e8-36e0-4db2-a033-2fab8361338f",
"name": "Settings",
"type": "n8n-nodes-base.set",
"position": [
940,
2200
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "84e8bbad-e48d-4a58-af4f-ca08938acc26",
"name": "Coverage Period",
"type": "number",
"value": 7
}
]
}
},
"typeVersion": 3.4
},
{
"id": "34a3af65-82ca-4c6d-a373-54ddea04229f",
"name": "Date & Time Subtract Coverage Period",
"type": "n8n-nodes-base.dateTime",
"position": [
2060,
2640
],
"parameters": {
"options": {},
"duration": "={{ $('Settings').first().json['Coverage Period'] }}",
"magnitude": "={{ $('Date Time').first().json.now }}",
"operation": "subtractFromDate"
},
"typeVersion": 2
},
{
"id": "34b988b7-0dcd-49cd-840c-13830a055e2d",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
620,
2200
],
"parameters": {
"rule": {
"interval": [
{
"field": "hours"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "8286b8b8-5c27-4722-9626-b388cc9ccc0a",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-300,
2080
],
"parameters": {
"width": 720,
"height": 2220,
"content": "## Hourly n8n Workflow Backup to Google Drive\n\nThis workflow provides a robust solution for automatically backing up all your n8n workflows to Google Drive on schedule (default to every hour). It creates a uniquely named folder for each backup instance, incorporating the date and hour, and then systematically uploads each workflow as an individual JSON file. To manage storage space, the workflow also includes a cleanup mechanism that deletes backup folders older than a user-defined retention period (defaulting to 7 days).\n\nFor more powerful n8n templates, visit our website or contact us at [**AI Automation Pro**](https://aiautomationpro.org/). We help your business build custom AI workflow automation and apps.\n\n## Feature highlights\n\n* Triggers on schedule (default to hourly). \n* Creates a \\`n8n\\_backup\\_YYYY-MM-DD\\_HH\\` folder in Google Drive. \n* Fetches all n8n workflows. \n* Saves each workflow as a JSON file to the new folder. \n* Deletes backup folders older than the 'Coverage Period' (default to 7 days).\n\n## Who is this for?\n\nThis template is designed for:\n\n* **n8n Administrators and Developers:** Who need a reliable, automated system to safeguard their workflows against accidental loss, corruption, or system issues. \n* **Proactive n8n Users:** Who want to maintain a version history of their workflows, enabling easy rollback to previous configurations if necessary. \n* **Organizations:** Seeking to implement disaster recovery and data integrity practices for their n8n automation infrastructure.\n\n## What problem is this workflow solving? / use case\n\nManually backing up n8n workflows is time-consuming and prone to human error. This workflow addresses these challenges by:\n\n* **Automating Backups:** Eliminates the need for manual intervention, ensuring consistent and regular backups of all your n8n workflows. \n* **Preventing Data Loss:** Safeguards your valuable automation work by creating secure copies in Google Drive. \n* **Version Control:** By storing hourly backups, it allows you to access and restore previous versions of your workflows. \n* **Storage Management:** Automatically removes old backups based on a configurable retention period, preventing excessive use of Google Drive storage.\n\n## What this workflow does\n\n1. **Scheduled Trigger:** Runs automatically every hour. \n2. **Timestamping:** Fetches the current date and hour to create a unique name for the backup folder. \n3. **Folder Creation:** Creates a new folder in a specified Google Drive location. The folder is named in the format: `n8n_backup_YYYY-MM-DD_HH`. \n4. **Workflow Retrieval:** Connects to your n8n instance via its API and fetches a list of all existing workflows. \n5. **Individual Backup:** Processes each workflow one by one: \n * Converts the workflow data to a binary JSON file. \n * Uploads the JSON file (named after the workflow) to the hourly backup folder in Google Drive. \n * Includes a short wait step between uploads to respect potential API rate limits. \n6. **Old Backup Deletion:** \n * Calculates a cut-off date based on the \"Coverage Period\" set in the \"Settings\" node (e.g., 7 days prior to the current date). \n * Searches Google Drive for backup folders (matching the naming convention) that are older than this cut-off date. \n * Deletes these identified old backup folders to free up storage space.\n\n## Setup\n\n1. **Import Template:** Upload the provided JSON file into your n8n instance. \n2. **Configure Credentials:** \n * **Google Drive Nodes:** You will need to create or select existing Google Drive OAuth2 API credentials for these nodes. \n * **n8n Node:** `n8n` (node that fetches workflows) Configure n8n API credentials to allow the workflow to access your instance's workflow data. \n3. **Specify Google Drive Backup Location:** \n * Open the **\"Google Drive Backup Folder Every Hour\"** node. \n * Under the \"Drive ID\" parameter: select it from the list or provide its ID. \n * Under the \"Folder ID\" parameter: select or input the ID of the **parent folder** in Google Drive where you want the `n8n_backup_YYYY-MM-DD_HH` folders to be created (e.g., a general \"n8n\\_Backups\" folder). \n4. **Set Backup Retention Period:** \n * Open the **\"Settings\"** node. \n * Modify the value for \"Coverage Period\" (default is `7`). This number represents the number of days backups should be kept before being deleted. \n5. **Activate Workflow:** Toggle the \"Active\" switch for the workflow in your n8n dashboard.\n\n## How to customize this workflow to your needs\n\n* **Backup Frequency:** Adjust the \"Rule\" in the **\"Schedule Trigger\"** node to change the backup interval (e.g., daily, specific times). \n* **Folder/File Naming:** Modify the expressions in the \"Parameters\" tab of the **\"Google Drive Backup Folder Every Hour\"** node (for folder name) or the **\"Google Drive Upload Workflows\"** node (for file name) if you require a different naming convention. \n* **Targeted Backups:** To back up only specific workflows, insert a \"Filter\" node after the **\"n8n\"** node to filter workflows based on criteria like name, tags, or ID before they reach the \"Move Binary Data\" node. \n* **Wait Time:** The **\"Wait\"** node is set to 3 seconds between uploads. If you have a very large number of workflows or encounter rate limiting, you might adjust this duration. \n* **Error Workflow:** The workflow is pre-configured with an \"Error Workflow\" setting (`KhpM42Ckgy6qgzCz`). Ensure this error workflow exists in your n8n instance, or update the setting to point to your preferred error handling workflow. This can be used to send notifications on failure.\n"
},
"typeVersion": 1
}
],
"active": true,
"settings": {
"errorWorkflow": "KhpM42Ckgy6qgzCz",
"executionOrder": "v0"
},
"versionId": "5dc4b523-d904-4977-b901-fa786fc024f6",
"connections": {
"n8n": {
"main": [
[
{
"node": "Move Binary Data",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Split In Batches",
"type": "main",
"index": 0
}
]
]
},
"Settings": {
"main": [
[
{
"node": "Date Time",
"type": "main",
"index": 0
}
]
]
},
"Date Time": {
"main": [
[
{
"node": "Date & Time Format",
"type": "main",
"index": 0
}
]
]
},
"Date & Time Hour": {
"main": [
[
{
"node": "Google Drive Backup Folder Every Hour",
"type": "main",
"index": 0
},
{
"node": "Date & Time Subtract Coverage Period",
"type": "main",
"index": 0
}
]
]
},
"Move Binary Data": {
"main": [
[
{
"node": "Split In Batches",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Settings",
"type": "main",
"index": 0
}
]
]
},
"Split In Batches": {
"main": [
[
{
"node": "Google Drive Upload Workflows",
"type": "main",
"index": 0
}
]
]
},
"Date & Time Format": {
"main": [
[
{
"node": "Date & Time Hour",
"type": "main",
"index": 0
}
]
]
},
"Google Drive Search": {
"main": [
[
{
"node": "Google Drive Delete",
"type": "main",
"index": 0
}
]
]
},
"Date & Time Format 2": {
"main": [
[
{
"node": "Google Drive Search",
"type": "main",
"index": 0
}
]
]
},
"Google Drive Upload Workflows": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Date & Time Subtract Coverage Period": {
"main": [
[
{
"node": "Date & Time Format 2",
"type": "main",
"index": 0
}
]
]
},
"Google Drive Backup Folder Every Hour": {
"main": [
[
{
"node": "n8n",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleDriveOAuth2Apin8nApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Imagine the sinking feeling: hours, weeks, or even months of meticulous work building your n8n workflows, suddenly gone. A server crash, an accidental deletion, data corruption, or an unexpected platform issue – and all your automated processes vanish. Without a reliable backup…
Source: https://n8n.io/workflows/4515/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
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 “n8n_old” folder and renamed with the corr
Code Itemlists. Uses stickyNote, moveBinaryData, googleDrive, itemLists. Scheduled trigger; 33 nodes.
I build automation workflows for n8n and Make. This ready-to-use workflow is designed to automatically export and back up all your n8n workflows to a designated Google Drive folder, organized by date.
This template provides an automatic backup solution for all your n8n workflows, saving them directly to Google Drive. It’s designed for freelancers, agencies, and businesses that want to keep their au
This workflow is perfect for n8n users who want to automatically backup all their workflows 💾 to Google Drive with zero manual effort. Perfect for teams managing multiple workflows or anyone who value