How to Auto-Classify and Route Support Tickets with AI in n8n
Use an LLM to tag incoming tickets by category and urgency, then branch the workflow to route each one to the right team automatically.
Manual ticket triage is slow and inconsistent. With an LLM and a Switch node you can read each incoming request, classify it into a fixed set of categories, and route it to the right place. The trick is forcing structured output so the rest of the workflow can branch reliably.
What you need
- A running n8n instance with an OpenAI credential
- A ticket source such as a webhook, form, or shared inbox
- Destinations for each route (different Slack channels, labels, or assignees)
Step 1: Capture the ticket
Add a trigger for wherever tickets arrive. A Webhook node is the most flexible: point your form or help desk at its URL and the ticket text lands in the workflow as JSON.
Step 2: Classify with structured output
Add an OpenAI node and instruct it to return strict JSON. Asking for JSON rather than free text means the next nodes can read fields directly instead of parsing prose.
Classify this support ticket. Respond with JSON only:
{ "category": "billing|technical|sales|other",
"urgency": "low|medium|high" }
Ticket:
{{ $json.body.message }}Step 3: Branch with a Switch node
Add a Switch node with one output per category. Set each rule to compare {{ $json.category }} against billing, technical, sales, and a fallback output for other. Each branch then leads to its own destination node.
Step 4: Add urgency handling
Inside the technical and billing branches, add an IF node that checks whether urgency equals high. On the true path, send an extra alert or mention an on-call person so the most pressing tickets are never buried.
Result
Each ticket is now read, tagged, and routed within seconds of arriving. High urgency technical and billing issues get an additional ping, and anything the model cannot confidently place falls through to a triage channel for a human to sort.
Watch related tutorials
32:08
21:45
34:10
26:40
32:15
40:20