A 7-person reporting team. 12 data sources. Weekly board presentations. By Monday at 7am, every stakeholder had a tailored, context-aware summary in their inbox — assembled by an n8n workflow and GPT-4o. Nobody sent it. Nobody even reviewed it before it went out. Here's exactly how it works.
"The best automation isn't the one that does what humans do. It's the one that does what humans were too burned out to do properly."
The Problem We Were Solving
Our client — a mid-market e-commerce company — had a dedicated analytics and reporting function. Three full-time analysts and four supporting roles. Their weekly output: a 40-page PDF that most executives didn't read and a 20-minute Monday standup that usually ran over 45 minutes.
The core dysfunction: data was available in near-real-time, but insight delivery lagged by a week. By the time the report landed, decisions had already been made on gut feel. The automation didn't just replace people — it made the reports actually useful by making them timely and personalized.
Data Sources Connected
The workflow ingests from 12 sources via API or webhook. Here's the full stack:
- Shopify — orders, revenue, AOV, refunds, product performance
- Google Analytics 4 — sessions, conversions, channel attribution
- Google Search Console — impressions, clicks, ranking movements
- Meta Ads Manager — spend, ROAS, campaign performance by audience
- Google Ads — keyword performance, Quality Score changes, wasted spend
- Klaviyo — email revenue, list growth, flow performance
- Gorgias — support ticket volume, resolution time, CSAT scores
- Inventory management system — stock levels, reorder alerts, slow movers
- Stripe — subscription metrics, MRR, churn
- Ahrefs API — DR changes, backlink acquisition, keyword ranking shifts
- Internal database — custom KPIs via PostgreSQL webhook
- Competitor price monitoring — custom scraper output via webhook
The n8n Workflow Architecture
The workflow runs on a self-hosted n8n instance. It triggers every Sunday at 11pm via a Cron node. Here's the high-level flow:
Phase 1: Data Collection (11pm–1am)
All 12 API nodes fire in parallel using n8n's parallel execution. Each node has error handling with a fallback to cached data from the previous week. If an API returns an error, the workflow logs it but continues — a missing Gorgias block doesn't kill the Shopify analysis.
Data is normalized into a consistent JSON schema by a Code node running JavaScript. This normalization step is what makes the AI analysis reliable — GPT-4o sees consistent field names regardless of which source the data came from.
Phase 2: AI Analysis (1am–3am)
The normalized data is split by department: Revenue, Marketing, Operations, SEO. Each department has its own GPT-4o call with a specialized system prompt written for that function's stakeholders.
Key prompt engineering decisions that made this work:
- Anomaly-first framing — the prompt explicitly asks for deviations from trend, not summaries of normal. If revenue is on track, the AI says "on track" in one sentence and moves on.
- Action orientation — every insight must be paired with a recommended action. Observations without actions are discarded.
- Confidence flagging — the AI is instructed to flag when it's inferring from limited data vs. when the signal is strong. This prevents false confidence in weak signals.
- Week-over-week context — we pass the previous week's summary alongside current data. This lets GPT-4o identify trends that only become visible over multiple periods.
Phase 3: Report Assembly (3am–4am)
Department summaries are assembled into a structured report by a second GPT-4o call acting as an editor. Its job: remove redundancy between departments, identify cross-functional implications (e.g., a paid media spend increase causing a spike in support tickets), and write an executive summary for the CEO.
The output is a clean HTML email template — not a PDF. We learned early that PDFs don't get read. A well-formatted email with clear sections, colour-coded indicators (green/amber/red per metric vs. target), and embedded sparkline charts gets a 94% open rate within the first hour of delivery.
Phase 4: Personalized Distribution (4am–7am)
The final stage uses a stakeholder database in Airtable. Each stakeholder has a profile: role, department, KPIs they own, preferred level of detail (executive vs. operational), and any custom metrics they've flagged as high priority.
A final GPT-4o pass filters and reorders the report content for each recipient. The CEO gets a 2-page executive view with the 5 most important actions. The head of paid media gets the full marketing section plus relevant operational context. The supply chain manager gets inventory and ops only.
Personalization isn't a nice-to-have — it's what determines whether your automation gets used or ignored. Generic reports get deleted. Relevant ones get acted on.
The Cost to Run It
People always ask about API costs. Here's the real breakdown for a weekly run covering all 12 sources and 15 stakeholders:
- GPT-4o calls (analysis + assembly + personalization): ~$1.20 per run
- n8n self-hosted: $0 (included in existing server)
- API calls: all sources offer free or included tier for this volume
- Total: under $1.50/week vs. $35,000/month for the reporting team
The payback period was under 48 hours after deployment.
What Didn't Work the First Time
This wasn't a smooth build. Three major failures before the system worked reliably:
- Token overflow — passing all 12 data sources to a single GPT-4o call exceeded context limits and produced degraded output. Solution: department-level splitting with separate calls.
- Hallucinated metrics — GPT-4o occasionally invented plausible-sounding numbers when data was ambiguous. Solution: adding a validation step that cross-checks any mentioned metric against the source data before the report goes out.
- API rate limits at scale — firing all data collection nodes simultaneously hit rate limits on 3 of the 12 sources. Solution: staggered retry logic with exponential backoff per node.
Replicating This for Your Business
This architecture isn't client-specific. The pattern — collect, normalize, analyze by domain, assemble, personalize, distribute — works for any business with regular reporting needs. The key variables to customize are the data sources, the stakeholder profiles, and the analysis prompts for your specific KPIs.
If you have 3 or more people spending time on weekly reporting, this automation has a meaningful ROI on day one. If you want help scoping and building it, reach out — this is a standard engagement for us.