# Case Study: AI Support Triage — AI Automation with n8n

Source: https://www.geekswithgeeks.com/en/n8n-ai-automation/wrap-support-triage

> Design a workflow that classifies support emails, drafts replies and asks a human before sending.

## Design choices

A **Gmail Trigger** receives new emails. A Code node strips signatures and clips long bodies to cap token cost. A **Text Classifier** routes to billing, technical or other. For billing and technical, an **AI Agent** with a read-only `get_order` tool and a policy search tool drafts a reply. The draft goes to Slack with **Approve/Reject** buttons; only on approval does a Gmail node send it. "Other" goes straight to a human queue. An **error workflow** alerts the team, and each run logs its category and token use.

## A complete AI workflow

A real automation combines a trigger, validation, AI steps, human approval and error handling.

![Four parts: intake, AI, approval, action.](assets/figures/n8n-ai-automation/section-8-map.svg) — Figure 8.1 — Intake, AI, approval and action.

## The workflow on one page

Each line maps to a section of this course.

```text
Gmail Trigger                                   (Sec 2)
  -> Code: clean + clip body                    (Sec 3)
  -> Text Classifier: billing | technical | other (Sec 4)
  -> AI Agent (tools: get_order, search_policy)   (Sec 4, 5)
  -> Slack: Approve / Reject draft                (Sec 6)
  -> Gmail: send reply (only if approved)         (Sec 6)
  -> other: human queue ;  failures: Error workflow (Sec 6)
Hosting: Docker Compose, HTTPS, git-backed JSON    (Sec 7)
```

**Quiz:** Why does the case study require approval before sending the reply?

- [ ] Emails cannot be sent otherwise
- [ ] Slack requires it
- [x] Sending is an outward action that is hard to undo and model output may be wrong
- [ ] It makes the model faster

*Answer:* Sending is an outward action that is hard to undo and model output may be wrong. A human check catches wrong or risky drafts before a customer sees them.
