{
  "name": "Vorlux AI | Weekly Business Report",
  "active": false,
  "nodes": [
    { "parameters": { "rule": { "interval": [{ "field": "weeks", "weeksInterval": 1 }] } }, "id": "sched", "name": "Weekly Schedule", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [220, 300] },
    { "parameters": { "url": "http://host.docker.internal:3010/api/finance/stats", "method": "GET", "options": { "timeout": 15000 } }, "id": "finance", "name": "Finance Data", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [460, 150] },
    { "parameters": { "url": "http://host.docker.internal:3010/api/analytics/dashboard", "method": "GET", "qs": { "period": "7d" }, "options": { "timeout": 15000 } }, "id": "analytics", "name": "Analytics Data", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [460, 300] },
    { "parameters": { "url": "http://host.docker.internal:3010/api/community/stats", "method": "GET", "options": { "timeout": 15000 } }, "id": "community", "name": "Community Data", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [460, 450] },
    { "parameters": { "mode": "runOnceForAllItems", "jsCode": "const fin = $('Finance Data').first().json;\nconst analytics = $('Analytics Data').first().json;\nconst community = $('Community Data').first().json;\nreturn [{ json: {\n  period: 'Last 7 days',\n  revenue: { total: fin.totalRevenue || 0, mrr: fin.mrr || 0, growth: fin.growth || '0%' },\n  traffic: { visitors: analytics.visitors || 0, pageViews: analytics.pageViews || 0 },\n  community: { members: community.totalMembers || 0, newMembers: community.newMembers || 0, engagement: community.engagementRate || '0%' },\n  generatedAt: new Date().toISOString()\n} }];" }, "id": "compile", "name": "Compile Report", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [740, 300] },
    { "parameters": { "url": "http://host.docker.internal:3010/api/reports", "method": "POST", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ type: 'weekly-business', title: 'Weekly Business Report', data: $json }) }}", "options": { "timeout": 15000 } }, "id": "save", "name": "Save Report", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [980, 200] },
    { "parameters": { "method": "POST", "url": "={{$env.DISCORD_OPS_WEBHOOK}}", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ content: '📊 **Weekly Business Report**\\n💰 Revenue: $' + $json.revenue.total + ' (MRR: $' + $json.revenue.mrr + ')\\n👁️ Visitors: ' + $json.traffic.visitors + '\\n👥 Community: ' + $json.community.members + ' members (+' + $json.community.newMembers + ' new)' }) }}" }, "id": "notify", "name": "Discord Notify", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [980, 400] }
  ],
  "connections": {
    "Weekly Schedule": { "main": [[{ "node": "Finance Data", "type": "main", "index": 0 }, { "node": "Analytics Data", "type": "main", "index": 0 }, { "node": "Community Data", "type": "main", "index": 0 }]] },
    "Finance Data": { "main": [[{ "node": "Compile Report", "type": "main", "index": 0 }]] },
    "Analytics Data": { "main": [[{ "node": "Compile Report", "type": "main", "index": 0 }]] },
    "Community Data": { "main": [[{ "node": "Compile Report", "type": "main", "index": 0 }]] },
    "Compile Report": { "main": [[{ "node": "Save Report", "type": "main", "index": 0 }, { "node": "Discord Notify", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" }
}
