Cold emails that don't invent facts: a write, review, code-gate loop in n8n

I kept getting AI-written outreach that sounded great but claimed things the company never said. A better prompt didn’t fix it. What fixed it was treating the model like an agent inside a harness and checking its output with plain code.

Here’s the pattern:

  1. Read the lead’s website (Jina Reader, so JavaScript-heavy sites work too).
  2. Write: the model returns the email in parts (greeting, intro, why-you, bullets, ask, sign-off) as JSON, built around one fact from the site.
  3. Review: a second chain gets the draft plus the same research and has to verify every claim, then score it.
  4. Gate: a Code node runs deterministic checks with no AI involved: word count, exactly one question, the real first name in the greeting, banned words and stock phrases, placeholders, “we” when there’s no agency name, comments about a broken website.
  5. If the gate fails, the exact failed checks are fed back into the reviewer, up to 3 rounds. Code then assembles the parts into a clean HTML email with your signature, so the layout never drifts.
  6. The result goes to the sheet and into Gmail as a draft. Nothing is sent automatically.

The detail that made the biggest difference: the reviewer sees the gate’s check results as input, so it knows exactly what to fix instead of guessing. In my tests it went from regular invented claims to 8 out of 8 clean drafts on my last test sheet.

I’ve attached a free starter workflow that does the single-lead version (read site, write, quick quality check) so you can try the idea in five minutes. The full sheet-to-Gmail version with the review loop is a paid template if anyone wants it ready-made: AI Outreach Writer for n8n: Researched Cold Emails, Drafted in Gmail

Happy to answer questions about the gate checks or the prompts.

As promised in the post, here’s the free single-lead version, plus what a finished draft looks like.

Test run with sample sender details. The why-you line comes straight from the lead’s own website.

How to try it

Copy the JSON below and paste it onto an empty n8n canvas (Ctrl+V). It reads one lead’s website, writes the email in the same format and runs a quick quality check. Connect an OpenAI or OpenAI-compatible credential to the “Brain” node, fill in “Your lead and offer” and click “Execute workflow”.

Prefer a download? Same workflow on Gumroad: Cold Email Starter (free)

If you try it, I’d like to hear which checks catch the most problems on your leads.