Copia de seguridad automatizada diaria del flujo de trabajo en Google Drive y limpieza
Este es unautomatización que contiene 32 nodos.Utiliza principalmente nodos como N8n, Filter, GoogleDrive, ConvertToFile, SplitInBatches. Copia de seguridad automatizada diaria de flujos de trabajo a Google Drive y limpieza
- •Credenciales de API de Google Drive
Nodos utilizados (32)
Categoría
{
"meta": {
"instanceId": "7de9c03c5df732f2294cfa53379db42b70689739afb5ed84c40dd844fed72f02",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "9a8eb9c2-a0c9-4f80-9c6c-5774802edc14",
"name": "Nota adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-1168
],
"parameters": {
"width": 352,
"height": 636,
"content": "## 🔄 Procesamiento por Lotes\n\n**Loop Over Items** itera sobre cada workflow obtenido de n8n.\n\nCada workflow pasa por dos rutas:\n1. **Ruta superior:** Limpieza de carpetas antiguas\n2. **Ruta inferior:** Conversión y guardado del backup"
},
"typeVersion": 1
},
{
"id": "080b0687-a519-41c7-8cee-55ca311c5522",
"name": "Nota adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
288,
-720
],
"parameters": {
"width": 300,
"height": 432,
"content": "## 📄 Conversión y Guardado\n\n**Convert to File:** Convierte cada workflow a formato JSON con formato legible.\n\n**Google Drive:** Guarda el archivo JSON en la carpeta de backup creada.\n\nEl nombre del archivo será: `[nombre-del-workflow].json`"
},
"typeVersion": 1
},
{
"id": "e804abef-76e2-400c-a216-c6ed051a548e",
"name": "Nota adhesiva5",
"type": "n8n-nodes-base.stickyNote",
"position": [
336,
-1216
],
"parameters": {
"width": 340,
"height": 464,
"content": "## 🧹 Limpieza de Backups Antiguos\n\n**Get folders:** Obtiene todas las carpetas de backup existentes.\n\n**Filter:** Excluye la carpeta actual (recién creada).\n\n**Delete folder:** Elimina permanentemente las carpetas antiguas para ahorrar espacio.\n\n⚠️ **Nota:** Los backups antiguos se eliminan automáticamente."
},
"typeVersion": 1
},
{
"id": "88016564-b3a2-4619-8804-94fd5a8cef19",
"name": "n8n1",
"type": "n8n-nodes-base.n8n",
"position": [
-464,
-720
],
"parameters": {
"filters": {},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"id": "LpZFBbXA3FYzNTY8",
"name": "n8n account"
}
},
"retryOnFail": true,
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "db19b42f-6573-4d18-821d-d9ae63a4fe1d",
"name": "Bucle sobre elementos1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-48,
-720
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "5d4fc25e-d535-4b4b-8c5d-890ce53e2684",
"name": "crear nueva carpeta1",
"type": "n8n-nodes-base.googleDrive",
"position": [
-752,
-720
],
"parameters": {
"name": "=Workflow Backups {{ $now.format('cccc t dd-MM-yyyy') }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultUrl": "https://drive.google.com/drive/folders/1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultName": "N8N"
},
"resource": "folder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "93ba9bf9-7232-4247-bb69-9bc643ce43e3",
"name": "Convertir a archivo1",
"type": "n8n-nodes-base.convertToFile",
"position": [
144,
-704
],
"parameters": {
"options": {
"format": true,
"fileName": "={{ $json.name + \".json\" }} "
},
"operation": "toJson"
},
"typeVersion": 1.1
},
{
"id": "44b739ab-cb61-4729-b49f-aaed42ddec4a",
"name": "Google Drive1",
"type": "n8n-nodes-base.googleDrive",
"position": [
384,
-448
],
"parameters": {
"name": "={{ $('Loop Over Items1').item.json.name + \".json\" }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $('create new folder1').item.json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "9b6bb07c-30e1-4649-acb6-f886ad65c288",
"name": "Activador programado1",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-1040,
-656
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 4
}
]
}
},
"typeVersion": 1.2
},
{
"id": "6d801bc0-93f6-4181-88bf-2f8e0135d0e6",
"name": "Filtro1",
"type": "n8n-nodes-base.filter",
"position": [
368,
-896
],
"parameters": {
"options": {
"ignoreCase": true
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "538fc29d-2693-4c62-9848-bdcaf8566909",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.id }}",
"rightValue": "={{ $('create new folder1').item.json.id }}"
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "699773cd-698c-4615-9903-848f5f9f3fa7",
"name": "eliminar carpeta1",
"type": "n8n-nodes-base.googleDrive",
"onError": "continueRegularOutput",
"position": [
560,
-896
],
"parameters": {
"options": {
"deletePermanently": true
},
"resource": "folder",
"operation": "deleteFolder",
"folderNoRootId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "LyM4iZs87sZ5FP8C",
"name": "HTA"
}
},
"typeVersion": 3
},
{
"id": "eb1ead32-9668-4fb6-862b-1ab72247daae",
"name": "Obtener carpetas1",
"type": "n8n-nodes-base.googleDrive",
"position": [
144,
-896
],
"parameters": {
"filter": {
"folderId": {
"__rl": true,
"mode": "list",
"value": "1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultUrl": "https://drive.google.com/drive/folders/1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultName": "N8N"
},
"whatToSearch": "folders"
},
"options": {
"fields": [
"id"
]
},
"resource": "fileFolder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "a4f48d76-3f4a-4f18-9c91-d1acdb528996",
"name": "Nota adhesiva7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1184,
-864
],
"parameters": {
"width": 280,
"height": 344,
"content": "## ⏰ Trigger Automático\n\n**Se activa todos los días a las 4:00 AM**\n\nPuedes modificar la hora según tus necesidades en la configuración del Schedule Trigger."
},
"typeVersion": 1
},
{
"id": "dfd9be89-436e-4479-99d6-7deedb5db9c0",
"name": "Nota adhesiva8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-848,
-1024
],
"parameters": {
"width": 300,
"height": 480,
"content": "## 📁 Creación de Carpeta de Backup\n\n**Crea una carpeta nueva** en Google Drive con el formato:\n`Workflow Backups [día] [hora] [fecha]`\n\nEsta carpeta contendrá todos los workflows respaldados."
},
"typeVersion": 1
},
{
"id": "59023d6c-d08e-4d3d-999c-3ba67e2e15f4",
"name": "Nota adhesiva9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-528,
-1104
],
"parameters": {
"height": 532,
"content": "## 🔌 Conexión con n8n API\n\n**IMPORTANTE:** Para configurar las credenciales correctamente:\n\n- La URL debe ser: `Tu-URL/api/v1`\n- Ejemplo: `https://tu-instancia.n8n.io/api/v1`\n- Al crear las credenciales, verás el ejemplo exacto\n\n**Este nodo obtiene todos los workflows** de tu instancia de n8n."
},
"typeVersion": 1
},
{
"id": "56e3c0ce-d77d-4b2d-bbba-93637fa98aed",
"name": "n8n2",
"type": "n8n-nodes-base.n8n",
"position": [
2160,
-816
],
"parameters": {
"filters": {},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"id": "LpZFBbXA3FYzNTY8",
"name": "n8n account"
}
},
"retryOnFail": true,
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "997369a0-e77b-4cc8-bf12-8ab7eb1b3e8f",
"name": "Bucle sobre elementos2",
"type": "n8n-nodes-base.splitInBatches",
"position": [
2496,
-816
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "85d5f584-a0c6-48b1-93f4-6c5ba5dc7d40",
"name": "crear nueva carpeta2",
"type": "n8n-nodes-base.googleDrive",
"position": [
1888,
-816
],
"parameters": {
"name": "=Workflow Backups {{ $now.format('cccc t dd-MM-yyyy') }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultUrl": "https://drive.google.com/drive/folders/1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultName": "N8N"
},
"resource": "folder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "887aee74-330f-4170-93f2-0ddda5d52704",
"name": "Convertir a archivo2",
"type": "n8n-nodes-base.convertToFile",
"position": [
2720,
-816
],
"parameters": {
"options": {
"format": true,
"fileName": "={{ $json.name + \".json\" }} "
},
"operation": "toJson"
},
"typeVersion": 1.1
},
{
"id": "2d57c096-2d05-477c-bea8-aeb3aedbdfcb",
"name": "Google Drive2",
"type": "n8n-nodes-base.googleDrive",
"position": [
2944,
-528
],
"parameters": {
"name": "={{ $('Loop Over Items2').item.json.name + \".json\" }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $('create new folder2').item.json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "a3f33a72-7376-4a1e-8585-e0bc052c401b",
"name": "Activador programado2",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
1616,
-736
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 4
}
]
}
},
"typeVersion": 1.2
},
{
"id": "d995f52f-d70f-49ad-b467-2da9b343e275",
"name": "Filtro2",
"type": "n8n-nodes-base.filter",
"position": [
2944,
-1008
],
"parameters": {
"options": {
"ignoreCase": true
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "538fc29d-2693-4c62-9848-bdcaf8566909",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.id }}",
"rightValue": "={{ $('create new folder2').item.json.id }}"
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "b7a7f2b6-68d1-48b1-aed9-c008c655d087",
"name": "eliminar carpeta2",
"type": "n8n-nodes-base.googleDrive",
"onError": "continueRegularOutput",
"position": [
3152,
-1008
],
"parameters": {
"options": {
"deletePermanently": true
},
"resource": "folder",
"operation": "deleteFolder",
"folderNoRootId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "LyM4iZs87sZ5FP8C",
"name": "HTA"
}
},
"typeVersion": 3
},
{
"id": "9d40c609-886f-404c-8b43-f1909174d09f",
"name": "Obtener carpetas2",
"type": "n8n-nodes-base.googleDrive",
"position": [
2720,
-1008
],
"parameters": {
"filter": {
"folderId": {
"__rl": true,
"mode": "list",
"value": "1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultUrl": "https://drive.google.com/drive/folders/1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultName": "N8N"
},
"whatToSearch": "folders"
},
"options": {
"fields": [
"id"
]
},
"resource": "fileFolder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "2cfae624-9916-4aa7-ac7a-fc4e726139c2",
"name": "Nota adhesiva10",
"type": "n8n-nodes-base.stickyNote",
"position": [
1472,
-912
],
"parameters": {
"width": 280,
"height": 312,
"content": "## ⏰ Automatic Trigger\n\n**Runs every day at 4:00 AM**\n\nYou can modify the time according to your needs in the Schedule Trigger configuration."
},
"typeVersion": 1
},
{
"id": "538c9518-1ce8-4997-9bc8-e4e570c596e3",
"name": "Nota adhesiva11",
"type": "n8n-nodes-base.stickyNote",
"position": [
1776,
-1152
],
"parameters": {
"width": 300,
"height": 544,
"content": "## 📁 Backup Folder Creation\n\n**Creates a new folder** in Google Drive with the format:\n`Workflow Backups [day] [time] [date]`\n\nThis folder will contain all backed up workflows."
},
"typeVersion": 1
},
{
"id": "2a5683a7-2340-497b-85a8-fc10c84f77d7",
"name": "Nota adhesiva12",
"type": "n8n-nodes-base.stickyNote",
"position": [
2096,
-1216
],
"parameters": {
"width": 224,
"height": 596,
"content": "## 🔌 n8n API Connection\n\n**IMPORTANT:** To configure credentials correctly:\n\n- URL must be: `Your-URL/api/v1`\n- Example: `https://your-instance.n8n.io/api/v1`\n- When creating credentials, you'll see the exact example\n\n**This node fetches all workflows** from your n8n instance."
},
"typeVersion": 1
},
{
"id": "d0e33a4e-294b-4c7f-a476-61b93a16de5f",
"name": "Nota adhesiva13",
"type": "n8n-nodes-base.stickyNote",
"position": [
2464,
-1280
],
"parameters": {
"width": 400,
"height": 652,
"content": "## 🔄 Batch Processing\n\n**Loop Over Items** iterates through each workflow obtained from n8n.\n\nEach workflow goes through two paths:\n1. **Upper path:** Old folder cleanup\n2. **Lower path:** Backup conversion and saving"
},
"typeVersion": 1
},
{
"id": "d2419fcd-cb46-4cfe-920e-56b82a1cc02d",
"name": "Nota adhesiva14",
"type": "n8n-nodes-base.stickyNote",
"position": [
2896,
-816
],
"parameters": {
"width": 300,
"height": 416,
"content": "## 📄 Conversion and Saving\n\n**Convert to File:** Converts each workflow to JSON format with readable formatting.\n\n**Google Drive:** Saves the JSON file to the created backup folder.\n\nFile name will be: `[workflow-name].json`"
},
"typeVersion": 1
},
{
"id": "a6b308ed-af2b-437a-8e22-07ffc5d535d9",
"name": "Nota adhesiva15",
"type": "n8n-nodes-base.stickyNote",
"position": [
2928,
-1296
],
"parameters": {
"width": 340,
"height": 464,
"content": "## 🧹 Old Backup Cleanup\n\n**Get folders:** Retrieves all existing backup folders.\n\n**Filter:** Excludes the current folder (newly created).\n\n**Delete folder:** Permanently deletes old folders to save space.\n\n⚠️ **Note:** Old backups are automatically deleted."
},
"typeVersion": 1
},
{
"id": "5c59ff97-5705-4746-91dc-8da0b0ccf997",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1184,
-1536
],
"parameters": {
"color": 3,
"width": 1936,
"height": 1312,
"content": "# Español"
},
"typeVersion": 1
},
{
"id": "f477459f-73de-4390-8c36-4f5251fdaec0",
"name": "Nota adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1392,
-1536
],
"parameters": {
"color": 3,
"width": 2080,
"height": 1312,
"content": "# English"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"88016564-b3a2-4619-8804-94fd5a8cef19": {
"main": [
[
{
"node": "db19b42f-6573-4d18-821d-d9ae63a4fe1d",
"type": "main",
"index": 0
}
]
]
},
"56e3c0ce-d77d-4b2d-bbba-93637fa98aed": {
"main": [
[
{
"node": "997369a0-e77b-4cc8-bf12-8ab7eb1b3e8f",
"type": "main",
"index": 0
}
]
]
},
"6d801bc0-93f6-4181-88bf-2f8e0135d0e6": {
"main": [
[
{
"node": "699773cd-698c-4615-9903-848f5f9f3fa7",
"type": "main",
"index": 0
}
]
]
},
"d995f52f-d70f-49ad-b467-2da9b343e275": {
"main": [
[
{
"node": "b7a7f2b6-68d1-48b1-aed9-c008c655d087",
"type": "main",
"index": 0
}
]
]
},
"eb1ead32-9668-4fb6-862b-1ab72247daae": {
"main": [
[
{
"node": "6d801bc0-93f6-4181-88bf-2f8e0135d0e6",
"type": "main",
"index": 0
}
]
]
},
"9d40c609-886f-404c-8b43-f1909174d09f": {
"main": [
[
{
"node": "d995f52f-d70f-49ad-b467-2da9b343e275",
"type": "main",
"index": 0
}
]
]
},
"44b739ab-cb61-4729-b49f-aaed42ddec4a": {
"main": [
[
{
"node": "db19b42f-6573-4d18-821d-d9ae63a4fe1d",
"type": "main",
"index": 0
}
]
]
},
"2d57c096-2d05-477c-bea8-aeb3aedbdfcb": {
"main": [
[
{
"node": "997369a0-e77b-4cc8-bf12-8ab7eb1b3e8f",
"type": "main",
"index": 0
}
]
]
},
"93ba9bf9-7232-4247-bb69-9bc643ce43e3": {
"main": [
[
{
"node": "44b739ab-cb61-4729-b49f-aaed42ddec4a",
"type": "main",
"index": 0
}
]
]
},
"887aee74-330f-4170-93f2-0ddda5d52704": {
"main": [
[
{
"node": "2d57c096-2d05-477c-bea8-aeb3aedbdfcb",
"type": "main",
"index": 0
}
]
]
},
"db19b42f-6573-4d18-821d-d9ae63a4fe1d": {
"main": [
[
{
"node": "eb1ead32-9668-4fb6-862b-1ab72247daae",
"type": "main",
"index": 0
}
],
[
{
"node": "93ba9bf9-7232-4247-bb69-9bc643ce43e3",
"type": "main",
"index": 0
}
]
]
},
"997369a0-e77b-4cc8-bf12-8ab7eb1b3e8f": {
"main": [
[
{
"node": "9d40c609-886f-404c-8b43-f1909174d09f",
"type": "main",
"index": 0
}
],
[
{
"node": "887aee74-330f-4170-93f2-0ddda5d52704",
"type": "main",
"index": 0
}
]
]
},
"9b6bb07c-30e1-4649-acb6-f886ad65c288": {
"main": [
[
{
"node": "5d4fc25e-d535-4b4b-8c5d-890ce53e2684",
"type": "main",
"index": 0
}
]
]
},
"a3f33a72-7376-4a1e-8585-e0bc052c401b": {
"main": [
[
{
"node": "85d5f584-a0c6-48b1-93f4-6c5ba5dc7d40",
"type": "main",
"index": 0
}
]
]
},
"5d4fc25e-d535-4b4b-8c5d-890ce53e2684": {
"main": [
[
{
"node": "88016564-b3a2-4619-8804-94fd5a8cef19",
"type": "main",
"index": 0
}
]
]
},
"85d5f584-a0c6-48b1-93f4-6c5ba5dc7d40": {
"main": [
[
{
"node": "56e3c0ce-d77d-4b2d-bbba-93637fa98aed",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Avanzado
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Compartir este flujo de trabajo