{"name": "Monthly Financial Report Writer", "nodes": [{"id": "n1", "name": "First Monday Each Month", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.3, "position": [0, 0], "parameters": {"rule": {"interval": [{"triggerAtHour": 9, "mode": "everyWeek", "triggerAtDay": 1}]}}}, {"id": "n2", "name": "Fetch Monthly Data", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [224, 0], "parameters": {"method": "GET", "url": "https://YOUR_PROJECT.supabase.co/rest/v1/transactions?select=*&order=created_at.desc&limit=10", "sendHeaders": true, "headerParameters": {"parameters": [{"name": "apikey", "value": "YOUR_SUPABASE_ANON_KEY"}, {"name": "Authorization", "value": "Bearer YOUR_SUPABASE_ANON_KEY"}]}}}, {"id": "n3", "name": "Write Financial Report", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [448, 0], "parameters": {"method": "POST", "url": "https://api.anthropic.com/v1/messages", "sendHeaders": true, "headerParameters": {"parameters": [{"name": "x-api-key", "value": "YOUR_ANTHROPIC_API_KEY"}, {"name": "anthropic-version", "value": "2023-06-01"}, {"name": "content-type", "value": "application/json"}]}, "sendBody": true, "bodyParameters": {"parameters": [{"name": "model", "value": "claude-sonnet-4-6"}, {"name": "max_tokens", "value": "1500"}, {"name": "messages", "value": "=[{\"role\":\"user\",\"content\":\"Return ONLY JSON {executive_summary:string, revenue:string, expenses:string, profit_margin:string, highlights:string[], concerns:string[], next_month_outlook:string, full_report_html:string}. Data: {{ JSON.stringify($json) }}\"}]"}]}}}, {"id": "n4", "name": "Email Report", "type": "n8n-nodes-base.gmail", "typeVersion": 2.2, "position": [672, 0], "parameters": {"resource": "message", "operation": "send", "sendTo": "YOUR_EMAIL@company.com", "subject": "=Monthly Financial Report \u2014 {{ new Date().toLocaleDateString('en-US',{month:'long',year:'numeric'}) }}", "emailType": "html", "message": "={{ JSON.parse($json.content[0].text).full_report_html }}", "options": {}}, "credentials": {"gmailOAuth2": {"id": "YOUR_GMAIL_CREDENTIAL_ID", "name": "Gmail account"}}}], "connections": {"First Monday Each Month": {"main": [[{"node": "Fetch Monthly Data", "type": "main", "index": 0}]]}, "Fetch Monthly Data": {"main": [[{"node": "Write Financial Report", "type": "main", "index": 0}]]}, "Write Financial Report": {"main": [[{"node": "Email Report", "type": "main", "index": 0}]]}}, "settings": {"executionOrder": "v1"}}