SEO audit workflow where the score can't be hallucinated — 12 deterministic checks in a Code node, AI writes only the narrative

I kept hitting the same wall with AI SEO auditors: ask GPT to audit a page and
it will confidently tell you there are two H1s when there’s one, or that the
meta description is 140 characters when it’s 210. The numbers are the part
you’d actually act on, and they’re the part the model is worst at.

So I split the job in two, and the split is the whole idea:

A Code node does the counting. Twelve deterministic pass/warn/fail checks
run on the fetched HTML — title length, meta description length, exactly-one-H1,
heading structure, word count, HTTPS, image alt-text coverage, canonical tag,
robots.txt, sitemap declaration — and computes a baseline score out of 100 from
real counts. No model involved.

The AI only writes the consultant part. It receives the finished check table
and writes the narrative: a rewritten title and meta description, a content
review, and five prioritised quick wins. The prompt explicitly forbids it from
re-counting anything — it has to trust the table. So the score is reproducible,
and the model does the thing it’s actually good at.

Some details that took the longest to get right:

  • Failure path. The HTTP node’s error output is wired, so a site that’s down
    or blocks the fetch sends the requester a polite failure email instead of
    silence. This was the difference between a demo and something I’d let a
    stranger use.
  • Audit history. Every run appends date, URL, score and failed checks to a
    Google Sheet, so you can watch a site improve across audits instead of getting
    a one-shot report.
  • The trigger is a form, which means it’s shareable — embed it as a lead
    magnet and every submission captures an email address alongside the audit.

11 nodes: Form trigger → HTTP request (with error branch) → Code (the twelve
checks + score) → OpenAI → email + Sheets log.

Free template here: Send on-page SEO audit reports with GPT-4o-mini, Gmail, and Google Sheets | n8n workflow template

The check list is the part I’d most like feedback on. Twelve felt like the
honest floor — what would you add? I’ve been going back and forth on Open Graph
tags and structured data, and whether an agency-style weighting (title and H1
worth more than sitemap declaration) is better than a flat score.