You will be able to write a classification prompt that returns one label from a list your workflow can route on.
When an automated workflow handles incoming messages, it usually has to sort them before it can act: one goes to bookings, another to billing, another to a person. If you ask an AI model something vague like "tell me what kind it is", you get free-text answers that change from one message to the next. They may be reasonable, but the next step in the flow cannot use them, because a branch in a workflow has to match an exact value. The answer is a classification step, an AI step that makes the model pick one label from a fixed list the workflow can route on.
Mei Ling handles enquiries for a tuition centre in Tampines (she and her messages are invented examples). Her first sorting prompt asked the model, roughly, to read an enquiry and say what kind it was. The wording of the answers varied every time. One said it looked like a parent asking about schedules. Others said "Scheduling enquiry" and "Schedule / timing question". Once the model wrote a three-paragraph analysis of a parent's anxiety about exams. Every answer was reasonable, and none of them could be used by the next step, because the model never gave the same answer twice.
Decide the labels first, before you write the rest of the prompt. Keep the list short, usually three to six labels. They must not overlap, and each one should lead to a different action in the flow. If two labels would be handled the same way, merge them. Give each label a short name with no spaces. Names like that are easier to route on and harder for the model to rephrase.
Then write a one-line definition and one example for each label. The definitions do the real work of classification, and one example per label often settles cases that a long definition leaves open. Working with AI assistants, lesson 2.1, "One good example beats a paragraph of description", explains why a single example carries so much weight.
Mei Ling rebuilt her prompt around a fixed list of five labels, each with a definition and an example:
trial: the parent wants to start lessons or book a trial. Example: a parent asking if their daughter can try a P5 science class next week. schedule: questions about class days, times or availability. Example: a parent asking if there are Saturday morning classes for Sec 2. fees: questions about cost, payment or discounts. Example: a parent asking the monthly cost for two subjects. concern: a complaint, a problem with a current class, or a withdrawal. Example: a parent saying their son finds the class too fast and is thinking of stopping. unsure: anything that does not clearly fit one of the above.
The fallback label, unsure, is the most important label on the list. Without one, the model has to put every message somewhere, so odd messages get forced into the nearest label. A parent asking whether the centre is hiring tutors gets labelled trial or schedule, and a job applicant then receives a confirmation email about class times. A fallback gives the model an honest answer for "none of these".
Tell the model plainly in the prompt to answer unsure if a message fits more than one label, fits none, or it is not confident. Then decide where unsure goes. It should always go to a person. In Mei Ling's flow, an unsure record gets a row in the sheet with the status "needs sorting" and a notification to her. She reads those, handles them by hand, and adds a new label later if a pattern appears.
The model's answer goes straight into the next step, so ask for exactly the shape that step can use. In chat, output format is a preference. Inside a flow, a wrong format breaks the next step. Working with AI assistants, lesson 1.3, "Set constraints and ask for the format you need", applies the same principle to chat.
If you need a single label, ask for the label alone: one word from the list with no other text. If you need more than one field back, for example the label and the child's level, ask for a small JSON object, which is a structured format with named fields. Tell the model the exact field names and the allowed values for each. For the Saturday class question, Mei Ling's flow would get back {"label": "schedule", "level": "Sec 2"}.
Many automation tools have a structured output option on their AI step, sometimes called a response format or output schema. It forces the answer into the fields you define. If your tool has it, use it, since it removes a whole class of formatting problems.
Put the incoming message at the end of the prompt, clearly marked as the message to classify, so the model does not mistake it for part of your instructions. Lesson 5.3, "Draft replies a person approves before sending", explains why the incoming message must be kept separate from the instructions.
Even with a tight prompt and structured output, the model will occasionally return something unexpected: a label in capitals, a trailing full stop, a label that is not on the list, or an empty answer if the step fails. Add a filter or branch after the AI step that checks the answer is exactly one of your labels. Clean the answer first if needed by trimming spaces and converting it to lower case. If the cleaned answer is one of the valid labels, route on it. Treat anything else as unsure and send it to a person, the same way as a genuine unsure.
The check costs nothing to add. Without it, failures tend to surface about a week later, when a parent asks why nobody replied.
In the activity below you will write a classification prompt for incoming enquiries in your own workflow: four labels plus unsure, each with a one-line definition and an example drawn from messages you have really received. Ask for an exact output shape, either a single label or a small JSON object, and add a check step after the AI step that sends any uncertain or invalid result to a person. Lesson 5.4, "Test the AI step on 20 real examples", will test it properly, so aim for clear rather than perfect.
Write a classification prompt for incoming enquiries with four labels plus unsure, each with a definition and an example.
Junxiong-WFG Organisation is an authorised representative of AIA Financial Advisers Private Limited (Reg. No. 201715016G).