I built an n8n workflow that reads incoming customer emails, looks up the order, and drafts a reply with Claude Haiku 4.5. Here's what it actually took to make it reliable.
The workflow has five parts: catch the email, pre-screen for spam and prompt injection, look up the customer and order, load your shop's policies, then write a draft and run a safety check before anything reaches a customer.
Version 1 passed its own safety check with two wrong drafts. One told a customer their parcel was "last scanned on Thursday at the sorting hub" โ the data said Friday. The AI took the customer's wording over the actual record. Confidence 0.95. The second promised "you should receive both the label and your replacement within the next few days" โ no policy gave a replacement timeline.
Version 2 added a prompt rule banning unsupported dates and timelines. It caught "Thursday" but the AI wrote "shortly" instead. "Shortly" wasn't in the rule.
Version 3 moved the date work into a Code node. It counts working days between the last tracking scan and the email's received date, writes a plain summary, and passes that to the AI as a fact. The safety check also flags "shortly", "soon", "as soon as possible". After that, every draft that passed was correct against the order data and policies.
Cost came out around $0.0023 per email โ about $0.23 per 100.
The lesson: prompt rules reduce mistakes; only the check in code caught the one the AI still made. Don't make the AI do date maths.
Full build is in my video, and the template is free: [video](https://youtu.be/f86WX0h5ohI) ยท [template](https://runsunattended.gumroad.com/l/jmgorl)
1 Like