Every support team has the same bottleneck: someone reads each incoming ticket, decides how urgent it is, and routes it to the right channel. It is repetitive, time-sensitive, and easy to get wrong at 2am. An AI agent can do this classification in seconds, consistently, around the clock.
In this tutorial, you will build a support triage workflow in Swrly that reads incoming tickets, assigns a priority from P1 to P4, and routes them to the appropriate Slack channel. The whole thing takes about 15 minutes.
What You Will Build
A 5-node workflow that:
- Receives support tickets via a webhook from your support form or helpdesk
- Runs an AI classifier agent that reads the ticket and assigns a priority (P1-P4)
- Evaluates the priority with a condition node
- Routes P1/P2 tickets to
#urgent-supportin Slack - Routes P3/P4 tickets to
#support-queuein Slack
By the end, new support tickets will be automatically triaged and routed to the right people without anyone manually reading and sorting them.
Prerequisites
- A Swrly account (free plan works)
- A Slack workspace with two channels:
#urgent-supportand#support-queue - Your Claude Code session token (paste it in Settings > API Keys)
- Slack integration connected in Settings > Integrations
- A support form, helpdesk, or any system that can send webhooks (Typeform, Intercom, Zendesk, or even a simple HTML form with a backend)
Step 1: Create the Swirl and Add a Webhook Trigger
Log into Swrly and click New Swirl from the dashboard. Name it "Support Triage Bot."
You will land on the visual builder with an empty canvas. Drag a Trigger node onto the canvas. Click it to open the configuration panel and set the trigger type to Webhook. Copy the generated webhook URL:
https://swrly.tech/api/v1/webhooks/trigger/wh_abc123def456
This URL is what your support form will POST to. The payload should include the ticket details. A typical payload looks like this:
{
"ticket_id": "TKT-4821",
"subject": "Cannot access billing dashboard",
"body": "I have been trying to access the billing page for the last 3 hours. Every time I click on Settings > Billing, the page shows a white screen. I am on the Enterprise plan and this is blocking our team from updating payment details before our renewal tomorrow.",
"customer_email": "ops@acmecorp.com",
"plan": "enterprise",
"submitted_at": "2026-04-03T14:32:00Z"
}
Point your support form's webhook to this URL. If you are using Zendesk, Intercom, or Freshdesk, check their webhook/automation settings to forward new tickets here.
Step 2: Add the Classifier Agent
Drag an Agent node onto the canvas and connect it to the trigger node by drawing an edge from the trigger's output port to the agent's input port. Name this agent Ticket Classifier.
Click the agent node to configure it. The system prompt is the core of this workflow. Here is one that works well:
You are a customer support triage specialist. You receive incoming
support tickets and classify them by priority.
Read the ticket subject, body, customer plan, and any other context
provided. Assign exactly one priority level:
- P1 (Critical): Service is down, data loss, security incident, or
billing blocked for Enterprise customers. Immediate action required.
- P2 (High): Major feature broken, significant degradation, or
billing issues for any paid plan. Response within 1 hour.
- P3 (Medium): Feature not working as expected, minor bugs, how-to
questions from paid customers. Response within 4 hours.
- P4 (Low): General questions, feature requests, feedback, free-tier
how-to questions. Response within 24 hours.
Consider the customer's plan when classifying. An Enterprise customer
reporting a broken feature is P2, not P3. A free-tier user asking a
how-to question is P4, not P3.
You MUST end your response with exactly one of these lines:
- "PRIORITY: P1"
- "PRIORITY: P2"
- "PRIORITY: P3"
- "PRIORITY: P4"
Before the priority line, write 2-3 sentences explaining your
reasoning. Reference specific details from the ticket.
Under Agent Settings, configure:
-
Max Turns:
3-- this agent does not need tools, it is doing pure classification based on the input text. Three turns is plenty of headroom. -
Accumulate Context:
enabled-- ensures the agent sees the full trigger payload. -
Output Format:
text-- the condition node will parse the output text for the priority string.
This agent does not need any MCP tools. It is a reasoning-only agent that reads the ticket content from the trigger payload and produces a classification. No external API calls required.
For the example ticket above (enterprise customer, billing page broken, renewal tomorrow), the agent would produce something like:
This is an Enterprise customer reporting that the billing dashboard
is completely inaccessible, with a renewal deadline tomorrow. The
combination of a broken core feature and time-sensitive business
impact for a top-tier customer makes this critical.
PRIORITY: P1
Step 3: Add the Condition Node
Drag a Condition node onto the canvas and connect it to the Ticket Classifier's output. This node decides which Slack channel receives the ticket.
Click the condition node and configure the rule:
-
Field:
output(the classifier agent's text output) -
Operator:
contains -
Value:
PRIORITY: P1
Wait -- that only catches P1. You need P2 as well. Here is the approach: set the condition to check if the output contains PRIORITY: P1 or PRIORITY: P2.
Since condition nodes evaluate a single rule, use the contains operator with the value PRIORITY: P1. Then add a second condition rule with PRIORITY: P2 and set the rule logic to OR.
Alternatively, you can use a simpler approach. Structure your agent prompt so that high-priority tickets output a specific keyword. Update the classifier prompt to also include this line:
After the PRIORITY line, add "ROUTE: URGENT" for P1/P2 or
"ROUTE: STANDARD" for P3/P4.
Then configure the condition node as:
-
Field:
output -
Operator:
contains -
Value:
ROUTE: URGENT
If the output contains "ROUTE: URGENT," the workflow follows the true branch (P1/P2). Otherwise, it follows the false branch (P3/P4). Clean and reliable.
Step 4: Add the Slack Integration Nodes
Now add two Integration nodes, one for each branch.
Urgent branch (true): Drag a Slack integration node and connect it to the condition's true output port. Configure it:
- Integration: Slack
-
Action:
slack_send_message -
Channel:
#urgent-support - Message template:
:rotating_light: *P1/P2 Support Ticket*
*Ticket:* {{trigger.ticket_id}}
*Subject:* {{trigger.subject}}
*Customer:* {{trigger.customer_email}} ({{trigger.plan}} plan)
*AI Triage Summary:*
{{ticket_classifier.output}}
_Please respond within 1 hour. Triage powered by Swrly._
Standard branch (false): Drag another Slack integration node and connect it to the condition's false output port. Configure it:
- Integration: Slack
-
Action:
slack_send_message -
Channel:
#support-queue - Message template:
*P3/P4 Support Ticket*
*Ticket:* {{trigger.ticket_id}}
*Subject:* {{trigger.subject}}
*Customer:* {{trigger.customer_email}} ({{trigger.plan}} plan)
*AI Triage Summary:*
{{ticket_classifier.output}}
_Triage powered by Swrly._
Notice that {{trigger.*}} pulls fields from the webhook payload, while {{ticket_classifier.output}} pulls the AI agent's classification output. The template resolver handles the variable substitution at runtime using slugified node labels.
Step 5: Test the Workflow
Click Save in the top bar. Before connecting real ticket sources, test the workflow end-to-end.
Click Save and Run and provide a test payload. Try a P1 scenario first:
{
"ticket_id": "TEST-001",
"subject": "Production API returning 500 errors",
"body": "All API endpoints have been returning 500 errors for the past 20 minutes. Our entire application is down. We are on the Enterprise plan and this is affecting thousands of users.",
"customer_email": "cto@bigcorp.com",
"plan": "enterprise",
"submitted_at": "2026-04-03T15:00:00Z"
}
Watch the execution overlay on the canvas. The trigger fires, the classifier agent thinks for a few seconds, the condition evaluates to true, and a message appears in #urgent-support. The whole run should complete in under 15 seconds.
Now test a P4 scenario:
{
"ticket_id": "TEST-002",
"subject": "How do I export my data?",
"body": "Hi, I am on the free plan and was wondering if there is a way to export my project data to CSV.",
"customer_email": "user@example.com",
"plan": "free",
"submitted_at": "2026-04-03T15:01:00Z"
}
This time the condition should evaluate to false, and the message lands in #support-queue. Check both channels to confirm the messages look correct and the template variables resolved properly.
Next Steps
Once the basic triage is working, here are some ways to extend it.
Add a database logging step. Insert an integration node before the Slack notifications that writes the ticket ID, priority, and timestamp to a Postgres or Airtable table. This gives you a triage audit trail.
Wire it to your ticketing system. Add integration nodes that call the Zendesk or Linear API to automatically set the priority field on the ticket. The AI classified it -- now the classification is reflected in your actual helpdesk.
Add an approval node for P1 tickets. For critical incidents, insert an Approval node between the classifier and the Slack notification. A team lead confirms the P1 classification before the urgent alert fires. This prevents false alarms from waking someone up at 3am.
Build a feedback loop. Track cases where a human overrides the AI's classification. Over time, refine your system prompt based on the patterns. If the agent consistently over-classifies free-tier issues as P3, tighten the prompt guidance for that case.
Add sentiment analysis. Extend the classifier prompt to also detect customer sentiment (frustrated, neutral, satisfied). Route frustrated customers to a senior support rep regardless of technical priority.
The core pattern here -- webhook in, AI classification, conditional routing, notification out -- applies to far more than support tickets. Use it for lead scoring, content moderation, alert triage, or any workflow where you need fast, consistent categorization at scale.
Top comments (0)