Use caseReporting and analyticsWorkflow automation
A Monday KPI brief that explains last week's numbers instead of just charting them
An automated weekly KPI report for e-commerce and SaaS teams: figures computed in SQL from Shopify, GA4, ads and CRM, then explained in plain words in Slack.
A blueprint, not a client story. The business described is illustrative; the architecture, integrations and trade-offs are real, and this is how I would build it. By Ergini, .
The short version
An automated Monday brief for e-commerce and SaaS teams that explains what changed last week and why. Code pulls Shopify, GA4, ad platform, HubSpot and accounting data into one warehouse, computes every KPI in SQL and compares it with the right baseline. A language model writes a few short paragraphs using only those figures and the drivers the code detected. When tracking breaks, the brief says the data is incomplete. It posts to Slack at 07:00, and people own the definitions.
- Best for
- Founder-led e-commerce and SaaS teams whose numbers live in five tools, and whose Monday meeting starts by arguing about which one is right.
- Connects to
- Shopify, BigQuery or Google Sheets, GA4 and the ad platform APIs, HubSpot, Accounting and payments, Slack, n8n
- The AI does
- Writes a short, plain account of what moved and why, using only the figures and drivers the code hands it, and says openly what it cannot explain.
- People do
- Own the metric definitions, approve the first briefs against the source systems, and decide what to do about the week.
- Built as
- AI Workflow Automation, usually $3.5K - $12K
Five tools, four revenue numbers, one Monday meeting
Picture a direct-to-consumer apparel brand doing around EUR 8M a year, mostly through Shopify, with a small wholesale side in HubSpot. Three people own the numbers: the founder, an operations lead, and a freelance performance marketer. Every Monday morning the ops lead exports CSVs from Shopify, Meta and Google Ads into a master sheet, redoes the same lookups, and is the only person who can.
Then the meeting starts with reconciling. Shopify says revenue fell 9 percent, Meta reports its best week of the quarter, and GA4 shows conversion rate collapsing on Saturday. Twenty minutes go on deciding which number is real, and the meeting ends before anyone discusses what to do. The Looker Studio dashboard built last year is accurate, complete, and opened about once a month.
What the founder wants is three paragraphs: what changed, why, and whether any of it is a problem. That is an arithmetic job followed by a writing job, and the order matters. I compute every figure in SQL, check the data is complete, and only then let a model explain the week from what the code found. As one engineer put it in an n8n community thread about factory reporting, 'a wrong production report is worse than no report, because someone acts on it.'
A SaaS company has the same shape with different sources: MRR from Stripe or Chargebee, pipeline from HubSpot, activation from the product database, and a monthly investor update that otherwise means Stripe, then Sheets, then screenshots. Follow-up questions ('split that by channel') belong to a plain-English question box over the database.
Last Monday's brief, with the queries underneath
An illustrative brief for the brand above. The tool lines ran before the model wrote anything; the message is what the team read.
Slack, #weekly-numbers, Monday 7 September, 07:00
- load_week(iso_week: "2026-W36", tz: "Europe/Berlin")31 Aug 00:00 to 6 Sep 23:59, store time / five sources synced by 05:42 / last 28 days pulled again
- check_data_health(week: "2026-W36")GA4 weekend sessions 41% below baseline, Shopify orders normal / consent rate 12% since Fri 16:40, was 68% / conversion rate INCOMPLETE
- compute_kpis(week: "2026-W36", compare: ["prior_week", "same_iso_week_last_year"])net sales EUR 148,200 (-9% on week 35, -2% on week 36 of 2025) / 1,612 orders / AOV EUR 91.94 / ad spend EUR 31,500 / MER 4.7, 4-week average 4.8
- detect_drivers(week: "2026-W36")week 35 ran the end-of-summer sale / 3 linen shirt variants out of stock since Wed 14:10, 11% of net sales over the prior 4 weeks / platforms claim 93% of net sales / week 35 restated, EUR 2,870 of late refunds
KPI brief · Slack
Week 36 (31 Aug to 6 Sep): a normal week behind a noisy drop. Net sales were EUR 148,200, down 9% on week 35, which had the end-of-summer sale, and down 2% on the same week last year. Stock: the three best-selling linen shirt variants sold out on Wednesday afternoon. Over the previous four weeks they made up 11% of net sales. Shopify has no restock date. Ads: MER held at 4.7 on EUR 31,500 of spend (4-week average 4.8). Meta and Google together claim 93% of net sales, so their figures overlap and are not added up. Data incomplete: GA4 lost most weekend sessions after Friday's theme update, when consent rate fell from 68% to 12%. Conversion rate is not reported this week; Shopify orders were unaffected. Restated: week 35 net sales are EUR 2,870 lower than last Monday's brief said, after refunds processed this week. Drill down: sales by day, stock levels, ad spend by campaign.
- Posted without edits. At 07:20 the ops lead sent the consent banner problem to the developer.
The metric dictionary the brief is written from
Every figure comes from a definition agreed before the first run and implemented as a SQL model. The founder signs this table off, and the model never sees a metric outside it.
| Metric | Computed from | The rule, as the SQL applies it |
|---|---|---|
| Net sales | Shopify orders and refunds | Shopify's net sales components (gross sales minus discounts and returns, no VAT or shipping), but a return counts against the week its order was placed, and earlier weeks are restated. |
| Orders and AOV | Shopify orders | Paid orders only. Test orders and 100% discount orders for influencer seeding are excluded, because they distort average order value. |
| Contribution margin | Shopify, accounting, payment providers | Net sales minus cost of goods, shipping cost, payment fees and ad spend, with unit costs checked against the accountant's figures monthly. |
| Blended MER | Shopify net sales, total ad spend | Net sales divided by all ad spend. The headline efficiency figure, because it cannot double-count. |
| Platform ROAS | Meta and Google Ads | Each platform's own claim, with its attribution setting named. Never summed across platforms. |
| Conversion rate | GA4 sessions, Shopify orders | Orders divided by sessions. Withheld when the tracking check fails, because the denominator is then wrong. |
| Pipeline or MRR | HubSpot, or Stripe and Chargebee | Deals that changed stage this week, for a DTC brand's wholesale side. New, expansion, contraction and churned MRR, for a SaaS company. |
From Sunday midnight to the 07:00 post
Most of these steps are scheduled jobs and SQL. The model appears once, to write, and only sees what the earlier steps hand over.
01 Trigger · Scheduler
The week closes in store time
The ISO week ends at Sunday 23:59 in the store's timezone, not the server's. A scheduled job starts the run at 05:30 on Monday to allow for late syncs; plain cron works, as does an existing n8n instance.
02 System · Shopify, GA4, Meta, Google Ads, HubSpot
Pull the week, then the last four weeks again
Shopify, the GA4 export, Meta, Google Ads and HubSpot, all with read-only access. Recent days are fetched again because platforms keep revising them, and every load upserts on the source's record ID, so a rerun never counts an order twice.
03 Plain code · BigQuery or Sheets
Compute every KPI in SQL
One SQL model per metric in the dictionary, compared with the prior week and the same ISO week last year, 364 days back, so Mondays line up with Mondays. Easter, Black Friday and the brand's own sales come from a calendar table.
04 Decision
Is the data complete enough to explain?
Plain checks, run before any text exists.
- Every source synced and the cross-checks pass then the full brief
- A source is late, sessions fall while orders do not, or consent rate drops sharply then those metrics are marked incomplete and kept out of the narrative
- Shopify itself did not sync then no brief; the ops lead is told why and the run retries at 08:00
05 Plain code
Find what moved, and the causes the data can prove
Changes outside a metric's normal weekly spread are flagged, then checked against causes code can point to: a promotion, a stockout, a shift in ad spend, a price change, a large wholesale order, a restated week. Only those can be named.
06 AI model · Structured output
Write the brief
A model gets the KPI table, flags and drivers as JSON and writes 150 to 250 words to a fixed outline, returned through structured outputs. It may round figures but not calculate new ones, and a change without a detected cause is called unexplained.
07 Plain code
Check every number against the inputs
A validator matches each figure and each named cause in the draft to the inputs, allowing for rounding. A mismatch means one regeneration; a second mismatch sends the table and flags without the narrative.
08 Person
The ops lead releases it, for the first month
For four Mondays the brief reaches the ops lead at 06:30 with an approve button, to be checked against Shopify and the ad accounts. After that it posts on its own, and anyone can question a number in the thread.
09 Result · Slack API, email
Post at 07:00, and keep the evidence
Slack's chat.postMessage puts it in the channel with drill-down links, and the founder gets an email copy. The run log keeps every input, the draft, the validator's result and the final text.
Six ways a weekly number misleads
None of these is unusual. Each turns up within the first few months of any weekly report, and each is handled in code before the model sees anything.
Tracking breaks quietly
A theme update drops the consent banner's script, or a checkout change stops the purchase event, and GA4 shows a collapse that never happened. When sessions fall and Shopify orders do not, the problem is measurement, not demand, so those metrics are marked incomplete and nothing is explained from them.
Consent Mode fills gaps with estimates
In Consent Mode's advanced setup, Google tags send cookieless pings when a visitor declines, and GA4 and Google Ads model part of what is missing. The modeled share moves with consent rate, so the brief tracks consent rate from the privacy fields in the GA4 export and reports any change in it before reading anything into conversion rate.
Refunds arrive weeks later
Shopify's reports record a return on the day it is processed, so a week of returns looks like a slump. The brief books each return against its order's week, restates earlier weeks when refunds land, and says so, which is why its figure can differ from Shopify's by exactly the refunds.
Whose Monday is it?
Shopify, each ad account and GA4 can all use different timezones, which moves Sunday evening into the wrong week. Spend is pulled by the hour (Meta's API breaks it down by the advertiser's timezone) and re-bucketed into store time, and weeks follow ISO 8601, Monday to Sunday.
Two platforms claim the same sale
Meta credits purchases after clicks and, under common settings, after views; Google Ads and GA4 each apply their own model. Added up, they often claim more than paid media could have driven. The brief never adds them: blended MER is the headline, and each platform's figure is labeled as its own claim.
A story found in noise
Language models are good at making a 3 percent wobble sound meaningful. Here the model never decides what is significant: code flags only changes outside a metric's normal range, the prompt forbids causes that are not on the driver list, and the validator rejects anything that does not match.
Who owns which part of the brief
The AI model
Write the narrative from the KPI table and driver list
Turning a dozen figures and four flags into clear sentences is the part people rush on a Monday morning.
Suggest a type for each new discount code
SUMMER25 or ANNA10 needs a type (sale, influencer, service recovery) before promotions can be detected. The ops lead confirms it once.
Plain code
Pull and store data from every source
Scheduled API calls with retries, and upserts so reruns never double-count.
Compute KPIs and comparisons
SQL is exact, repeatable and reviewable. A model doing arithmetic is none of those.
Decide whether the data is complete
Cross-source checks are rules, and a rule cannot be talked into a confident story.
Detect changes and their provable causes
Only a cause the code can point to in the data may appear in the brief.
Check the draft's figures against its inputs
The cheapest guard there is against a misquoted number.
A person
Own the metric definitions
What counts as revenue is a business decision, signed off by the founder.
Decide what to do about the week
The brief explains. Budgets and stock orders stay with the people accountable for them.
Two weeks from kickoff to the first real Monday
One of the smallest builds on this site, and a good first project: useful from its first Monday, and low risk, because it reads data and changes none.
- Agree the metric dictionary with the founder: what counts as revenue, which orders are excluded, what a promotion is, and which week the business uses.
- Connect the sources with read-only credentials the business owns, and backfill two years so every week has a same-week-last-year.
- Write the SQL models and reconcile three past weeks against Shopify's own reports, until every remaining difference is one the dictionary explains.
- Break things on purpose: delete a day of GA4 data, duplicate a sync, shift a timezone, and confirm the brief says incomplete each time.
- Generate briefs for eight past weeks and have the ops lead mark each sentence right, wrong or pointless. Those marks become the evaluation set every later prompt or model change must pass.
- Go live with the ops lead approving four Mondays in a row, then let it post on its own.
Credentials, SQL and prompts live in the business's own accounts and repository, with a runbook, so the brief keeps running whether or not I stay involved. The LLM evaluation guide covers how an evaluation set like this is scored.
Is Triple Whale or Polar enough, or is your own brief worth building?
For a Shopify brand whose data sits in Shopify, Meta, Google and Klaviyo, look at the DTC analytics platforms first. Triple Whale and Polar Analytics connect those sources in a few clicks, each takes its own approach to attribution, and both now include AI features for questioning the data; Polar can also push insights into Slack. If your KPIs are the standard ones, a subscription will be cheaper and faster than a build, and I will tell you so.
The other cheap route is Looker Studio on a connector such as Supermetrics, plus someone who writes the commentary each Monday. It works while that person is careful and not on holiday. Its weak spot is the one this page is about: nobody checks that the data was complete before the story was written.
A custom brief earns its place when your sources or definitions are unusual: wholesale in HubSpot beside DTC in Shopify, a 3PL's stock feed, a SaaS product database, margin that depends on your accountant's cost of goods, or several stores in different currencies. It often runs next to a DTC platform rather than replacing it. Built as AI workflow automation, it is a small project, and the SQL, prompts and history stay yours.
How you would know it is working
A blueprint has no results to report, so here is what I would measure from the first week instead, on your own data.
- Minutes spent reconciling
- For four Mondays before launch and four after, time how long the meeting spends agreeing on numbers before it talks about actions.
- Corrections per brief
- Sentences the ops lead corrects in the approval month, each traced to a definition, a data problem or the prompt.
- Tracking problems caught
- Health-check alerts that turned out to be real, and how many days earlier they were found than the team would have noticed.
- Drill-down clicks
- Clicks on the brief's links, logged through a redirect. None at all means the brief answers everything, or the wrong questions.
- Validator rejections
- Drafts regenerated because a figure or cause did not match. A rise after a model or prompt change is a reason to roll that change back.
What a build like this costs
This is built as AI Workflow Automation, which runs $3.5K - $60K overall. A build like this one usually lands in the single-step flow tier: $3.5K - $12K, 1-2 weeks. The first working version runs on your real data well before the end of that window.
What it costs to run
Small. The model writes a few hundred words a week, so model costs are cents a month. The warehouse and any connector subscription cost more than the AI does, and at this data size BigQuery often costs little or nothing.
What moves the price
- How many sources, and how clean: Shopify plus two ad accounts is quick, a 3PL portal without an API is not
- Whether margin is in scope, which means reconciling cost of goods and payment fees with the accountant
- Several stores or currencies, each needing a conversion rule and one reporting currency
- How much history to backfill, and whether a warehouse already exists
- More than one audience: founder, marketing and board versions are three outlines and three validators
Who this is for
- Shopify brands with a few million to a few tens of millions in revenue and no analyst on staff
- Founders who get four different revenue numbers from four tools every Monday
- Ops leads who spend Monday morning exporting CSVs into a master sheet only they can maintain
- SaaS teams with MRR in Stripe or Chargebee, pipeline in HubSpot and activation in the product database
- Brands selling direct and wholesale at once, where no off-the-shelf dashboard shows both
Questions people ask about this
How do I automate Excel reports using AI?
Keep the arithmetic out of the model. Pull data from the source systems on a schedule, compute the KPIs in SQL (or in a Google Sheet, for small volumes), and have a language model write the commentary from the finished figures. The Excel file can still be one of the outputs. The mistake to avoid is asking a model to do the calculations.
How do I stop exporting CSVs into a master sheet every week?
Replace the exports with scheduled API pulls into one place: a warehouse such as BigQuery or, for small volumes, a Google Sheet the pipeline writes to. The lookups you redo every week become SQL joins that run on their own, and the finished table can still land in the master sheet if people like working there. The brief on this page is the step after that.
Can AI write a weekly business performance summary without making up numbers?
Yes, if it never calculates anything. Every figure here comes from SQL, the model only arranges and explains what it is handed, and a validator compares each number and each named cause in the draft with the inputs before anything posts. A draft that fails is regenerated once, then replaced by the plain table.
Is there an AI agent for Google Sheets that does this?
Gemini in Google Sheets can summarize and analyze a sheet you already have, which helps with one-off questions. It does not pull Shopify, GA4 and your ad accounts every Sunday night, check that the data is complete and post to Slack on a schedule. n8n with a Sheets node can handle the plumbing; the metric logic still needs a reviewable home.
How much does an automated weekly KPI report cost?
It is one of the smaller builds, usually one to two weeks, in the first tier of AI workflow automation shown on this page. Running costs are low because the model writes a few hundred words a week; the warehouse and any connector cost more than the AI. Extra sources, margin reporting and multiple stores are what move the price.
Sources
- n8n community thread on automated manufacturing reports
- Shopify Help Center: finance report definitions (net sales, returns by processing date)
- Google: consent mode overview (basic and advanced)
- Google Analytics: GA4 BigQuery Export schema (privacy_info fields)
- Meta Marketing API: ad account insights parameters and breakdowns