Part 1 — Build the flow
This is a three-part tutorial. By the end you'll have a real AI feature — a support-ticket classifier — built, callable from your code, and measured so it can't quietly regress. We'll carry one example the whole way.
What we're building. Support tickets come in as free text. We want each one sorted into a queue —
billing,technical,account, orurgent— automatically. In this part, we build the classifier in Workbench and publish it.
Why a classifier (and not an agent)
Our task always has the same shape: text in, one label out. That's a job for a classifier, not a tool-using agent. A classifier returns exactly one of your categories every time — the reliability your ticketing code depends on. Reach for an agent only when the flow needs to decide what to do; here it just needs to sort.
Build it
- Create a classifier flow
Open workbench.zerowidth.ai, sign in, and hit New flow → Classifier. You get the shape wired for you: text comes in, a model classifies it against your categories, one label comes out.
- Define the categories
Add your four categories, each with a short description of what belongs in it — this is the part that determines accuracy:
- billing — payments, refunds, invoices, chargebacks, subscription changes.
- technical — bugs, errors, outages, "it's not working."
- account — login, permissions, profile, and workspace changes.
- urgent — anything time-critical or high-severity, regardless of topic.
Write the descriptions like you're briefing a new hire on where the boundaries are. Vague categories ("other stuff") are the top cause of misfires.
- Test it on real tickets
Open the test pane and paste in real (or realistic) tickets. This is the same execution engine the API uses, so what you see here is what your code will get. A few to try:
- "Card declined twice but I was still charged." → should land in billing
- "The export button throws a 500 every time." → technical
- "Our whole team is locked out and a launch is in an hour." → urgent
Where it guesses wrong, tighten the category descriptions — that's the whole tuning loop for a classifier.
- Publish a version
When it's behaving, publish a version (call it
1.0.0). A published version is a frozen snapshot; in Part 2 we'll pin it so production runs exactly this, no matter how you keep editing the draft.
For the curious — what a classifier actually is
A classifier is a small flow the pattern editor generates for you, built out of ordinary nodes: an input for the text, a model, and a response-format constraint that forces the model to answer with one value from your category list (not free prose). That constraint is why the output is always exactly one of your labels — the model can't wander off into a sentence. The category descriptions you wrote are folded into the model's instructions. Convert the flow to custom and you can see and rewire all of it; see Flows & nodes.
You've got a working, published classifier. Next, we call it from code.