{ "name": "Bettersight — Monday Brief (6am)", "nodes": [ { "parameters": { "rule": { "interval": [{ "field": "cronExpression", "expression": "0 6 * * 1" }] } }, "id": "schedule-trigger", "name": "Schedule Trigger (Monday 06:00)", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [0, 0] }, { "parameters": { "method": "GET", "url": "={{ $env.POCKETBASE_URL }}/api/collections/tenants/records", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "filter", "value": "status = 'active' || status = 'trial'" }, { "name": "perPage", "value": "200" } ] }, "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth" }, "id": "list-active-tenants", "name": "List active tenants (PocketBase)", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [220, 0], "credentials": { "httpHeaderAuth": { "id": "pocketbase-admin-auth", "name": "PocketBase Admin Auth" } } }, { "parameters": { "fieldToSplitOut": "items" }, "id": "split-tenants", "name": "Split into items", "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [440, 0] }, { "parameters": { "batchSize": 1 }, "id": "loop-tenants", "name": "Loop Over Tenants", "type": "n8n-nodes-base.splitInBatches", "typeVersion": 3, "position": [660, 0] }, { "parameters": { "method": "POST", "url": "={{ $env.BETTERSIGHT_API_BASE_URL }}/internal/weekly-brief/{{ $json.id }}", "sendHeaders": true, "headerParameters": { "parameters": [{ "name": "X-API-Key", "value": "={{ $env.API_SECRET_KEY }}" }] } }, "id": "trigger-brief", "name": "POST /internal/weekly-brief/{tenant_id}", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [880, 0] } ], "connections": { "Schedule Trigger (Monday 06:00)": { "main": [[{ "node": "List active tenants (PocketBase)", "type": "main", "index": 0 }]] }, "List active tenants (PocketBase)": { "main": [[{ "node": "Split into items", "type": "main", "index": 0 }]] }, "Split into items": { "main": [[{ "node": "Loop Over Tenants", "type": "main", "index": 0 }]] }, "Loop Over Tenants": { "main": [ [], [{ "node": "POST /internal/weekly-brief/{tenant_id}", "type": "main", "index": 0 }] ] }, "POST /internal/weekly-brief/{tenant_id}": { "main": [[{ "node": "Loop Over Tenants", "type": "main", "index": 0 }]] } }, "active": false, "settings": { "executionOrder": "v1" }, "meta": { "description": "CLAUDE.md §13/§15 Monday morning brief — one Flask call per active tenant at 06:00 Monday. All rendering/sending logic lives in services/brief_service.py's send_weekly_brief(); this workflow only iterates tenants and triggers it. Not yet imported/run against a live n8n instance." } }