DEV Community

Youngchan Kim
Youngchan Kim

Posted on Fully Autonomous

Making an LLM write a client email without letting it invent a single fact

An invoice reminder that gets an amount wrong costs you a client. A status update that says "we finished the migration" when the sheet says in_progress costs you the next retainer. And the usual advice — write a better prompt — fixes neither, because a prompt is a suggestion. A model with a blank to fill will fill it.

I spent this week building three n8n workflows that draft client email from a Google Sheet: a welcome email, a Friday status update, and a D+3 / D+7 / D+14 / D+21 invoice chase. This is the structure that made the output safe enough to use, which is not the same thing as the prompt.

1. Ban sentences instead of requesting quality

The system prompt contains a list the model may not produce:

  • "just checking in"
  • "I hope this email finds you well"
  • "as per my last email"
  • any deadline, discount or remedy that is not present in the input
  • any figure that is not present in the input

A banned-phrase list beats an adjective like "concise" for one reason: you can test it. Every draft that contains one is a countable bug, and the fix is one line in a text file.

2. The sheet is the only source of facts

The model never receives a paragraph of context. Each value arrives as a labelled slot, and the prompt is explicit that a slot it did not receive cannot appear in the output:

client: Northline Studio
invoice_no: INV-0142
amount_due: 2400.00 USD
days_overdue: 19
chase_stage: 3
pause_clause: new requests pause after D+14
Enter fullscreen mode Exit fullscreen mode

If amount_due is empty, the workflow never calls the model. It writes to be confirmed and flags the row. An empty input is not an invitation to write something plausible.

3. Make failure visible instead of plausible

The model returns JSON — subject, body, needs_human, reason — and a Code node checks it before any draft exists:

  • JSON parse fails → the draft is still created, with [NEEDS A HUMAN] in the subject
  • a banned phrase appears → same
  • a money-like pattern in the body that is not in the input → same, plus needs_review = yes on the row

The workflow is not trying to never fail. It is trying to fail as a subject line you cannot miss, instead of a confident sentence you might send.

4. Keep the send button human

Every output is a Gmail draft with the recipient already in the To field. Not because sending is technically hard, but because a final notice on day 21 is a business decision, not an email.

What this does not do

  • It does not invoice, track time, or store contracts. The sheet is the interface: a CSV export from Xero, QuickBooks or Harvest gets you in.
  • It does not read your inbox. If a client replied by phone, the draft will not know.
  • It cannot make a model imaginative and factual at once. It picks factual, and makes the rest visible.
  • It never sends anything on its own.

The tradeoff that does not appear in the demo

This is more work than a prompt: two extra nodes, a fixed output shape, a phrase list to maintain, and a needs_review column that a person has to actually look at. For a blog draft, skip all of it. For a sentence that can cost you money, the nodes are cheaper than the mistake.

If you want to poke at it

I packaged the three workflows, the sheet templates and a single-file client portal as one pack. The first five copies are free while I look for people who will tell me which column breaks first — a 100% off link, five redemptions, nothing asked of you:

https://opsforgeai.gumroad.com/l/agency-client-ops-pack/FREEAGENCY5

If you run something similar, I would like to know which guardrail you added that I missed.

Disclosure: this post was drafted with AI assistance. The failure modes above are from the workflows themselves — [NEEDS A HUMAN] in the subject and needs_review on the row are real nodes, not illustrations.

Top comments (0)