AI report analyst: code computes the metrics, the LLM only explains, a fact-check blocks invented numbers

I rebuilt a Make.com scenario from a course I took in n8n and changed one thing: the model never does arithmetic.

What it does: takes a client’s weekly ad/sales exports and produces a short monthly report for the business owner, with a check that no number in the text is made up.

Flow

  1. Clients table (status = to_analyze) → loop over clients
  2. Read the client’s CSV exports → aggregate
  3. Compute metrics (Code node): totals, first→last week change, CPC, conversion rate, cost per lead, booking rate; every week-over-week jump ≥25% is flagged as an anomaly
  4. Save (stage: metrics)
  5. LLM pass 1: pick the 3 anomalies that matter, each from a different file/campaign, and connect causes across files
  6. LLM pass 2: “if nobody acts” + one action to verify within 7 days
  7. LLM pass 3: plain-English report for the owner
  8. Fact-check (Code node): every number in the report must exist in the computed metrics, otherwise the row gets needs_review instead of ready
  9. Mark client done

Each step saves to a Data Table, so a failed AI call never loses earlier work.

Demo on made-up data: for a dental clinic the workflow found that time to first reply went from 2.4 h to 9.8 h in the same week bookings dropped 36.7%, and put “speed up first contact” as action #1. Fact-check passed.

Limits I ran into

  • The fact-check verifies numbers, not wording. A report can still call a metric “stable over the month” and skip a one-week spike, so a person should still read the text.
  • A local 7B model on CPU (Ollama) works but takes 4–13 min per call; one run hit the 15-min timeout. Use an API model for real use.

Workflow below: Data Tables instead of Airtable, local folder instead of Dropbox, any OpenAI-compatible model. Replace the YOUR_... ids after import.

Happy to answer questions about the fact-check node or the metrics code.

1 „Gefällt mir“

I really like the decision to keep the arithmetic outside the model. The fact-check step is also a nice touch, especially with the workflow saving each stage so a failed AI call doesn’t wipe out the calculations already completed.

1 „Gefällt mir“