// case file 04 · AI automation

AI Operations Reporting

Pulls operations data from three sources on a schedule, computes the numbers in code, and has Claude explain them, then emails a digest you can question.

RoleSolo · workflow designTeamSoloTimelineSep 2026Stackn8n + Claude26KPIs computed in code
// 01 the problem

Ops numbers lived across a spreadsheet, an Airtable base and an API. Someone stitched them together by hand each period and wrote the commentary from memory.

// architecture
AI Operations Reporting · n8nactive
the model never does maths
  1. Schedule (trigger)
  2. Report config (step)
  3. Google Sheets (step)
  4. Airtable (step)
  5. HTTP source (step)
  6. Merge sources (step)
  7. Resolve period + normalise (step)
  8. Compute 26 KPIs: in code, not the model (step)
  9. Hash vs last run (step)
  10. Changed? (decision)
  11. Touch checked_at (store)
  12. Build Claude input (step)
  13. Claude insight: interprets only (AI)
  14. Parse insight (step)
  15. Write report (store)
  16. Write metrics (store)
  17. Write insight (store)
  18. Write clean records (store)
  19. Merge writes (step)
  20. Finalize run: the finish line (store)
  21. Email digest (output)
  22. Retry webhook (trigger)
  23. Ask webhook (trigger)
  24. Load report + insight + metrics (step)
  25. Build context (step)
  26. Needs model? (decision)
  27. Ask Claude (AI)
  28. Error response (failure)
  29. Workflow error (trigger)
  30. Format alert (step)
  31. Email operator (output)
// 02 how it works
  1. Step 01

    A schedule trigger reads Google Sheets, Airtable and an HTTP source, then merges and normalises records.

  2. Step 02

    The reporting period is resolved and 26 KPIs are computed in code. The model does no maths.

  3. Step 03

    Claude gets the computed metrics and writes the insight; the response is parsed before anything is stored.

  4. Step 04

    Report, metric rows and insight are written to Supabase, then a digest is emailed.

  5. Step 05

    A hash is compared with the last completed run; if nothing changed, it just stamps checked_at instead of re-running.

  6. Step 06

    A webhook lets someone ask a question about a report, answered from the stored report and metrics.

// numbers I’d defend
26KPIs computed in code
3sources merged
0maths done by the model
49nodes in the workflow
// 03 decisions that mattered
01

Numbers from code, words from the model

Claude gets a compact digest of the computed numbers plus data-quality flags, and interprets them. It never calculates.

02

Change detection before spend

If the sources haven’t moved since the last completed run, the Claude call and the writes are skipped entirely.

03

Every write is a stored artefact

Reports, metrics and insights land as rows, so any digest can be traced back.

// incident

Three writes, no finish line

The report, its metrics and its insight were written as three independent steps.

If one died halfway, a half-written report became the newest one, and nothing said so.

Fix: "This run is done" is its own deliberate finalisation step, and a report without it is never shown as current.

// 04 results
26KPIs computed in code
3data sources merged
0maths done by the model
// 05 takeaway

Let the model do language, not arithmetic.

n8nClaudeGoogle SheetsAirtableSupabaseGmailWebhooks
// what I’d do differently
  • List every failure class first (a bad row, a dead source, a source returning rubbish, the model down, a failed write, a failed email, a schedule that never fires) and give each its own behaviour and test before the happy path.
  • Keep every number and quality flag in code, and lock the prompt to interpret-only.
// artefacts
// contact

Let’s talk

Open to software engineering and AI automation roles, plus selective contract work. I read every message.

psst, click it
● DRAFT

Show me the copy-paste.
I’ll tell you if it should be a system.

01
02
How often?
03
Which tools?

Hiring? Tell me about the team.
I’ll tell you where I’d help first.

01
02
03
Timeline
04

You get a reply within 24 hours: whether it should be automated, what I’d use, and a rough timeline.

You get a reply within 24 hours.