From 7cb6a2e55d6df5b4f20ad3a13a0e4916ccb9a5fb Mon Sep 17 00:00:00 2001 From: Isaac_Aracena Date: Thu, 16 Jul 2026 00:56:04 +0000 Subject: [PATCH] Subir archivos a "/" --- ...- Limpieza de temporales IR Nicaragua.json | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 GLM - Limpieza de temporales IR Nicaragua.json diff --git a/GLM - Limpieza de temporales IR Nicaragua.json b/GLM - Limpieza de temporales IR Nicaragua.json new file mode 100644 index 0000000..b3ed6bb --- /dev/null +++ b/GLM - Limpieza de temporales IR Nicaragua.json @@ -0,0 +1,163 @@ +{ + "name": "GLM - Limpieza de temporales IR Nicaragua", + "nodes": [ + { + "parameters": { + "rule": { + "interval": [ + { + "triggerAtHour": 2 + } + ] + } + }, + "id": "5db07430-0c71-417b-a5d3-3f3aa123051d", + "name": "Limpieza diaria 2 AM", + "type": "n8n-nodes-base.scheduleTrigger", + "typeVersion": 1.3, + "position": [ + 0, + 352 + ] + }, + { + "parameters": { + "url": "https://www.googleapis.com/drive/v3/files", + "authentication": "predefinedCredentialType", + "nodeCredentialType": "googleDriveOAuth2Api", + "sendQuery": true, + "queryParameters": { + "parameters": [ + { + "name": "q", + "value": "name contains 'TMP_IR_NIC_' and trashed = false" + }, + { + "name": "fields", + "value": "files(id,name,createdTime)" + }, + { + "name": "pageSize", + "value": "1000" + }, + { + "name": "orderBy", + "value": "createdTime" + } + ] + }, + "options": { + "timeout": 120000 + } + }, + "id": "b30e32d6-1080-43d2-a24a-0649b8ae9c38", + "name": "Buscar temporales IR antiguos", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [ + 240, + 352 + ], + "notesInFlow": true, + "retryOnFail": true, + "maxTries": 3, + "credentials": { + "googleDriveOAuth2Api": { + "id": "g23xdGLZRzBGqKgH", + "name": "Isaac - Google Drive" + } + }, + "notes": "Selecciona la misma credencial OAuth2 de Google Drive del workflow principal." + }, + { + "parameters": { + "jsCode": "'use strict';\nconst cutoff = Date.now() - 24 * 60 * 60 * 1000;\nconst files = Array.isArray($json.files) ? $json.files : [];\nreturn files.filter((f) => f.id && f.createdTime && new Date(f.createdTime).getTime() < cutoff).map((f) => ({ json: { fileId: f.id, name: f.name, createdTime: f.createdTime } }));\n" + }, + "id": "701b29aa-506a-45b8-b1f1-4eeff80326ee", + "name": "Filtrar temporales mayores de 24h", + "type": "n8n-nodes-base.code", + "typeVersion": 2, + "position": [ + 512, + 352 + ] + }, + { + "parameters": { + "method": "DELETE", + "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.fileId }}", + "authentication": "predefinedCredentialType", + "nodeCredentialType": "googleDriveOAuth2Api", + "options": { + "timeout": 120000 + } + }, + "id": "0be129cf-e394-4147-a083-c71b1b440fb0", + "name": "Eliminar temporales antiguos", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [ + 768, + 352 + ], + "notesInFlow": true, + "retryOnFail": true, + "maxTries": 3, + "credentials": { + "googleDriveOAuth2Api": { + "id": "g23xdGLZRzBGqKgH", + "name": "Isaac - Google Drive" + } + }, + "onError": "continueRegularOutput", + "notes": "Selecciona la misma credencial Google Drive." + } + ], + "pinData": {}, + "connections": { + "Limpieza diaria 2 AM": { + "main": [ + [ + { + "node": "Buscar temporales IR antiguos", + "type": "main", + "index": 0 + } + ] + ] + }, + "Buscar temporales IR antiguos": { + "main": [ + [ + { + "node": "Filtrar temporales mayores de 24h", + "type": "main", + "index": 0 + } + ] + ] + }, + "Filtrar temporales mayores de 24h": { + "main": [ + [ + { + "node": "Eliminar temporales antiguos", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": true, + "settings": { + "executionOrder": "v1", + "binaryMode": "separate" + }, + "versionId": "91bdbc93-f663-4f81-b412-fc3f305e8580", + "meta": { + "instanceId": "b4b77b17af092830e794eef639ce2f6d7daccf7eddc075060b03b3b6545aac70" + }, + "id": "4WrHnfh80M7Zewjw", + "tags": [] +} \ No newline at end of file