I Built an AI Pipeline That Reads Support Emails and Drafts Replies (Here's What Actually Broke, and the Math on Whether It's Worth It)
Description and use
The pipeline automatically classifies and drafts support email replies, sending Slack notifications for human review. API cost is about $0.01 per email versus $1.67 for manual handling.
Problem
Small business owners spend hours answering repetitive support emails, many of which are variations of a few common categories.
Outcome
The pipeline cuts per‑email labor cost from ~$1.67 to ~$0.01 in API spend, while keeping human review. It handles routine high‑confidence cases automatically and routes ambiguous ones to human review, achieving a balanced automation ratio.
Workflow
- Pull unread Gmail messages via API
- Extract email body handling multipart/alternative and HTML fallback
- Classify with Claude using structured JSON schema (category, priority, intent, confidence, suggested_reply)
- Route to human based on category and confidence tier
- Generate draft reply in same API call
- Post Slack card with classification, draft, and assignee
- Mark email as read and record result in SQLite
- Human approves or edits draft in Gmail; no auto‑send
Evidence
The system prompt is about 3,100 characters (~840 tokens), sent on every call along with the email body. At Claude Sonnet's current pricing ($3/MTok input, $15/MTok output), a typical classification-plus-draft call - roughly 1,050 input tokens and 200 output tokens - costs approximately $0.0064 per email.
Industry surveys on support ticket handling time put a straightforward inquiry at somewhere between 3 and 8 minutes of staff time... one manually-answered routine email costs roughly $1.67 in labor.
- Record date: 2026-09-21T22:45:21.089Z