One forwarded staffing order, parsed — before and after

The failure mode is almost never the AI step. It is what reaches the AI: a forwarded message where the useful request sits below a header block, or an HTML-only body that looks empty once you strip tags naively. Here is the logic, run on two real shapes.

Input 1 — HTML-only, forwarded

<div>---------- Forwarded message ---------<br>
From: <b>dana@northgatehotel.com</b><br><br>
We need <b>6</b> associates for <b>Saturday 15 November</b>,
start <b>6:00 AM</b> until 2:30 PM.<br>
Two must have food-handling certs.<br><br>Thanks, Dana</div>

Input 2 — plain text with a quoted reply chain

Need 3 people Monday Nov 17, 7am-3pm. Loading dock work.

--
Marco Buell
Bridgeline Events

On Thu, 13 Nov 2026 at 09:12, Chris <orders@…> wrote:
> Thanks for the request, we will confirm shortly.

The rules that do the work

StepWhy it matters
Convert <br> and block endings to real newlines before stripping tagsOtherwise every line collapses into one, and line-anchored rules silently stop matching
Cut the quoted history at the first On … wrote: / -----Original Message-----Keeps the new request and discards three rounds of old ones
For forwarding, read after the header block, then drop From:/Date:/Subject: linesA naive "cut at Forwarded message" leaves an empty body — the exact bug that makes an AI step return nulls
Headcount needs the noun: 6 associates, not "6"Dates and times are also numbers; a bare-digit grab picks the wrong one
Accept both 15 November and Nov 17Day-first and abbreviated forms both arrive from the same client list
Normalise whitespace lastCollapsing spaces before matching destroys the multi-space patterns you rely on

Actual output from running it

{
 "source": "html-forwarded",
 "sender": "dana@northgatehotel.com",
 "client_guess": "northgatehotel",
 "weekday": "Saturday",
 "associates": 6,
 "date": "15 November",
 "shift": "6:00 AM until 2:30 PM",
 "requirement": "Two must have food-handling certs",
 "kept_chars": 136
}
{
 "source": "plain-with-quote",
 "sender": "ops@bridgelineevents.com",
 "client_guess": "bridgelineevents",
 "weekday": "Monday",
 "associates": 3,
 "date": "Nov 17",
 "shift": "7am-3pm",
 "requirement": null,
 "kept_chars": 148
}
What still needs a human decision: "food-handling certs" is a requirement, not a field — send it to notes and flag it, do not invent a column. And a client guessed from the sender domain must be verified against the Clients board before an order is created; an ambiguous match should raise the blocked alert, never be guessed into a real order.

What happens next in the build

Have this exact problem? I repair the failing paths in existing Make/n8n scenarios and hand back a hardened version with acceptance checks. Diagnosis first if you prefer to keep it read-only.

perun.intelligence@gmail.com — Make and n8n automation.