Following up on my last topic, where @mahathir_lol suggested the Text Classifier instead of string matching. I used it for this build and it removed that whole problem.
The workflow: Gmail Trigger (unread only, test sender filter), Text Classifier with lead, support, newsletter and an “other” branch, a label per branch, then a Gemini node that drafts a reply and Gmail “create draft” with the thread ID. Nothing is sent automatically.
The run was green every time, but the drafts had four problems:
One draft offered a 15% discount nobody approved.
Every draft was signed [Your Name].
The recipient field was empty on every draft, because I picked the wrong “to email” option.
One manual run created two different drafts for the same customer.
Fixes: explicit rules in the draft writer’s prompt (no discounts, no promises, sign with the real name), the correct recipient option, an “AI Processed” label, and marking the email as read so it isn’t picked up twice.
I’d separate the mechanical checks from the promise checks. Missing recipient or a leftover [Your Name] can be rejected before creating the draft. For discounts and commitments, a second model saying ‘looks fine’ still isn’t proof that the offer is authorized. I’d give that check the approved policy or offer data and route anything unsupported to manual review.
One test I’d add is a paraphrase: ‘we can waive part of the fee’ instead of ‘15% discount’. That catches whether the check understands the commitment or just spots a keyword. Have you tried those cases against the revised prompt?
Not yet, and the paraphrase case is a great catch. My revised prompt only says “no discounts, no promises”, so “we can waive part of the fee” could easily slip through the same way the 15% did.
Splitting it the way you describe makes sense. The mechanical checks (empty recipient, any leftover [square bracket] placeholder) can be a plain IF node before the draft is created, no AI needed. For commitments I’ll give the checker the actual list of approved offers and route anything it can’t match to an “AI Needs Review” label instead of a draft.
One more case worth testing: an offer is on the approved list, but this customer isn’t eligible for it. For example, “10% off annual plans” shouldn’t pass for a monthly renewal. I’d include the offer’s conditions in the check and send missing eligibility data to review too. Otherwise the checker can recognize a real offer and still approve the wrong promise.