Stop compiling your weekly business report by hand. Let automation pull the numbers, and let Claude write the narrative.
Every Monday morning, this workflow fetches last week's revenue from Stripe, pipeline data from Notion, and operational metrics from Google Sheets aggregates everything into a single structured dataset, hands it to Claude Sonnet 4 for executive analysis, and delivers a styled HTML report to your inbox before you've had your first coffee.
The workflow runs in five sequential stages:
1. Trigger & Date Setup
Fires every Monday at 08:00. Computes last week's date window in your configured business timezone using Luxon, outputting ISO timestamps, Unix epochs, and milliseconds so every downstream node speaks the same time format without conversion.
2. Data Collection
Fetches from three sources in sequence:
3. Aggregation
Normalises all three sources into a single structured item: gross and net revenue, refunds, transaction count, total and probability-weighted pipeline value, deal count by stage, and all operational KPIs. Every field has a safe fallback so missing data never crashes the report.
4. AI Executive Narrative
Passes the aggregated metrics to Claude Sonnet 4 with a structured prompt requesting three paragraphs: revenue performance, pipeline health, and operational highlights with a forward-looking observation. Temperature is set to 0 for consistent, professional tone on every run.
5. Report Build & Delivery
Assembles a styled HTML email with KPI cards, a pipeline stage breakdown table, and the AI narrative embedded inline. Sends via SendGrid, then fires a Slack message to your chosen channel with a one-line summary of net revenue and new deal count.
has_more is false, the report always reflects the full week, not just the first 100 chargesREPORT_TIMEZONE once and every date window, label, and timestamp respects your business timezone automaticallyN/A rather than crashing the workflowSTRIPE_SECRET_KEY environment variableNOTION_API_KEY and NOTION_DEALS_DB_ID environment variablesGSHEETS_SPREADSHEET_ID, GSHEETS_SHEET_NAME, and GSHEETS_LAST_ROW_RANGE environment variablesREPORT_EMAIL_FROM, REPORT_EMAIL_TO, and REPORT_ALERT_EMAIL environment variablesSLACK_CHANNEL_ID environment variableREPORT_TIMEZONE environment variable (e.g., Europe/Helsinki defaults to UTC if not set)Aggregate All MetricsClaude: Write Executive Narrative to change the number of paragraphs, the tone, or the specific metrics Claude should prioritizeBuild HTML Report to add your company logo, brand colors, or additional KPI sections