{
  "name": "Vorlux AI | DB Backup & Restore",
  "active": false,
  "nodes": [
    { "parameters": { "rule": { "interval": [{ "field": "days", "daysInterval": 1 }] } }, "id": "sched", "name": "Daily Schedule", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [220, 300] },
    { "parameters": { "url": "http://host.docker.internal:3010/api/admin/backup", "method": "POST", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ type: 'full', compress: true }) }}", "options": { "timeout": 120000 } }, "id": "create-backup", "name": "Create Backup", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [460, 300] },
    { "parameters": { "url": "http://host.docker.internal:3010/api/admin/db-health", "method": "GET", "options": { "timeout": 15000 } }, "id": "verify", "name": "Verify DB Health", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [700, 300] },
    { "parameters": { "mode": "runOnceForAllItems", "jsCode": "const backup = $('Create Backup').first().json;\nconst health = $input.first().json;\nreturn [{ json: { backupId: backup.id || backup.backupId, size: backup.size || 'unknown', healthy: health.healthy || health.status === 'ok', tables: health.tables || 0, timestamp: new Date().toISOString() } }];" }, "id": "summary", "name": "Build Summary", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [940, 300] },
    { "parameters": { "method": "POST", "url": "={{$env.DISCORD_OPS_WEBHOOK}}", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ content: '💾 **Daily DB Backup**\\nBackup ID: ' + $json.backupId + '\\nSize: ' + $json.size + '\\nDB Healthy: ' + $json.healthy }) }}" }, "id": "notify", "name": "Discord Notify", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [1180, 300] }
  ],
  "connections": {
    "Daily Schedule": { "main": [[{ "node": "Create Backup", "type": "main", "index": 0 }]] },
    "Create Backup": { "main": [[{ "node": "Verify DB Health", "type": "main", "index": 0 }]] },
    "Verify DB Health": { "main": [[{ "node": "Build Summary", "type": "main", "index": 0 }]] },
    "Build Summary": { "main": [[{ "node": "Discord Notify", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" }
}
