Summarise and Route Incoming Email with Human Approval
Classify new support email, draft a reply and route anything uncertain to a person before it is sent.
The problem
A shared inbox receives a mix of sales questions, support requests and spam. Manual triage is slow, and quick replies risk giving wrong information.
A form or mailbox trigger passes the email subject and body to an AI step that returns a category, priority and draft reply as strict JSON. The automation validates the JSON, creates a draft, and posts uncertain items to a review channel. Nothing is sent without approval.
Why human approval matters here
Customer email contains commitments. A model can draft a polite response, but it cannot know whether an exception is allowed. The automation should prepare the work and expose uncertainty, not make the promise.
Design the categories first
Write the categories your team actually uses, with a definition and a counter-example for each. "Billing", "technical issue", "sales", "spam" and "other" is usually enough to start. If a category is used for less than 2% of mail, merge it.
Make the output machine-readable
Ask for a JSON object with fixed keys. Validate it before use. A malformed response should create a review task, not a broken draft.
Tools and access
Tools
Credentials
- • AI provider API key
- • Email account OAuth connection
- • Slack bot token (optional)
Requirements
- A test mailbox you control
- Written categories and routing rules
- An approved data-handling policy for customer email
Build steps
Follow in order and test each step before connecting the next one.
- 1
Create a test mailbox and a review channel
Use a mailbox you own and a private Slack channel or shared label. Never test against live customer mail.
- 2
Write the classification prompt
Include category definitions, priority rules, the approved policy snippet and the required JSON shape. Tell the model to use "other" when unsure.
Return JSON only: {"category":"billing|technical|sales|spam|other","priority":"low|normal|high","confidence":0-1,"draft_reply":"...","needs_human_review":true|false} - 3
Add the trigger
In n8n, use the Gmail trigger with a label filter. In Zapier, use a new-email trigger scoped to the test mailbox.
- 4
Call the model with a timeout
Set a 30-second timeout and one retry. If both attempts fail, create a review item with the original email.
- 5
Validate and branch
Parse the JSON. If category is spam, label and stop. If confidence is below 0.75 or needs_human_review is true, post to review. Otherwise create a draft reply.
- 6
Test the unhappy paths
Send an empty body, a very long email, a non-English email and a prompt-injection attempt. Confirm each is handled without sending anything.
Test it before trusting it
Test input
Subject: Can I get a refund after 40 days? Body: I bought the annual plan on 2 March and my circumstances changed. The website says 30 days. Is there any flexibility?
Expected output
A JSON object with category "billing", priority "normal", confidence, a draft reply that states the policy without promising an exception, and needs_human_review set to true.
Troubleshooting
The model returns prose around the JSON
Require JSON only and validate with a schema. If parsing fails, route to human review rather than attempting to repair silently.
Everything is classified as urgent
Add explicit priority definitions and two labelled examples per category. Re-test on a balanced sample.
The draft invents policy details
Pass an approved policy snippet in the prompt and instruct the model to say when the answer is not covered.
Maintenance
Review the routing log weekly for misclassifications. Re-run the test set whenever you change the prompt or model. Keep the policy snippet under version control.