Use case
Support Ticket Triage That Escalates Safely
Classify every ticket in seconds, let routine ones flow through, and pause urgent ones for a person to approve before a reply is sent.
- Stack Cognipeer Flows
- Pattern Flow · Support
- Read ~5 min
Overview
A support inbox fails all at once: a real outage arrives behind eleven password resets. Letting a model reply on its own is the part nobody signs off on. This flow classifies each ticket, routes it, and stops at a Human approval step before an urgent reply goes out. Every run is kept, so you can show later what was decided and when.
Enterprise module
Flows is the enterprise flows module. See Flows.
The shape of the flow
Start (title, body)
|
v
LLM (JSON answer: category, urgency, summary, suggestedReply)
|
v
Condition: urgency is "high"
|-- true --> Human approval --approved--> Send email --> End
| --rejected--> End
|-- false --> EndBuild it
Create the flow. Under Agents → your agent → Flows, choose New flow, surface Headless. On the Start node declare the inputs
titleandbody(andpriorityif the person filing it has an opinion).Classify with an LLM step. Set Response format to JSON and paste a JSON schema so the answer is an object you can branch on:
json{ "type": "object", "properties": { "category": { "type": "string" }, "urgency": { "type": "string", "enum": ["low", "normal", "high"] }, "summary": { "type": "string" }, "suggestedReply": { "type": "string" } }, "required": ["category", "urgency", "summary", "suggestedReply"] }Keep the System prompt short and restrictive: classify the ticket, never invent facts, and say so in the summary when there is too little information to judge urgency. Set the Prompt to the ticket text, for example
Title: {{ input.title }}andBody: {{ input.body }}. The parsed object is read assteps.<key>.output.json.If you only need a category to route on, the Classify step does it with a list of categories (an Id, a Label and When it applies for each) and a Fallback category; follow it with a Switch on
category.Branch. Add a Condition in Rules mode with one rule: Value is the urgency from the LLM step, Operator is equals, Compare to is
high. It continues on true or false.Put a person in front of the consequential path. On the true branch add Human approval. Write the Title and Details so the approver sees the category, the summary and the proposed reply. Choose the Approvers, set Time to decide and If nobody decides in time to Reject. Connect both outputs, approved and rejected, to different places: an approval whose two exits lead to the same step is not a gate.
Act on approval. After approved, add Send email (or a connector action for your helpdesk) with the suggested reply. After rejected go straight to End.
Declare the outputs on the flow panel:
category,urgency,summaryandsuggestedReply, each as a value template pointing at the LLM step.
Start it
- From your helpdesk: have it call the Flows API (
POST /flows/{idOrKey}/runs) with the ticket fields when a ticket is created. - Or expose the flow as a tool on a Smart Agent so a person can ask the agent to triage a ticket.
What happens at run time
A routine ticket runs straight through. An urgent one makes the run Waiting on the approval; the approver sees the request under Operate → Agent Observability → Flow runs and chooses Approve or Reject, with an optional comment. The wait is stored with the run, so it survives restarts and holds no resources. Open any run to see each step's input and output: that is the answer to "why did it decide that".
Pitfalls
- Free text cannot be branched on. Without the JSON schema the answer is prose and the condition never matches. Use JSON mode or Classify.
- A test run is a real run. The Send email step sends. While building, point it at a test mailbox. See Runs.
- Cognipeer has no event-counting step. To answer "how many tickets did we escalate last month", use the runs list (filter by Period and Status) or have the flow return the category and urgency as outputs and read them through the API.

