{
  "name": "Vorlux AI | Deploy Pipeline",
  "active": false,
  "nodes": [
    { "parameters": { "httpMethod": "POST", "path": "deploy-pipeline", "options": { "responseMode": "lastNode" } }, "id": "webhook", "name": "Deploy Webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 2, "position": [220, 300] },
    { "parameters": { "url": "http://host.docker.internal:3010/api/system/build-info", "method": "GET", "options": { "timeout": 10000 } }, "id": "check-build", "name": "Check Build Status", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [460, 300] },
    { "parameters": { "mode": "runOnceForAllItems", "jsCode": "const build = $input.first().json;\nconst canDeploy = build.status === 'success' || build.healthy === true;\nreturn [{ json: { canDeploy, buildInfo: build, deployAt: new Date().toISOString() } }];" }, "id": "verify", "name": "Verify Build", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [700, 300] },
    { "parameters": { "url": "http://host.docker.internal:3010/api/system/health", "method": "GET", "options": { "timeout": 15000 } }, "id": "health-check", "name": "Post-Deploy Health Check", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [940, 300] },
    { "parameters": { "method": "POST", "url": "={{$env.DISCORD_OPS_WEBHOOK}}", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ content: '🚀 **Deploy Pipeline**\\nBuild verified: ' + $('Verify Build').first().json.canDeploy + '\\nHealth: ' + JSON.stringify($json.status || $json.healthy || 'unknown') }) }}" }, "id": "notify", "name": "Discord Notify", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [1180, 300] }
  ],
  "connections": {
    "Deploy Webhook": { "main": [[{ "node": "Check Build Status", "type": "main", "index": 0 }]] },
    "Check Build Status": { "main": [[{ "node": "Verify Build", "type": "main", "index": 0 }]] },
    "Verify Build": { "main": [[{ "node": "Post-Deploy Health Check", "type": "main", "index": 0 }]] },
    "Post-Deploy Health Check": { "main": [[{ "node": "Discord Notify", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" }
}
