Build Guide: Intent and Sub-Topic Routing
Quick links in this article:
In this guide, you’ll build a Workflow that uses AI to automatically detect the reason for contact (Intent) and a more specific Sub-Topic, then route the interaction to the correct queue.
We’re using Email as the inbound channel in this example, but this setup works for most message-based channels.
Want to see a demo before you get started? Check out the demo video here:
What This Workflow Will Do
Detect the Intent from the customer’s message (e.g., Tracking, Refund, Website Issues)
Identify a Sub-Topic based on the detected Intent (e.g., Damaged item, Checkout Errors)
Route the interaction to the appropriate queue
Store both the Intent and Sub-Topic in custom data fields for reporting and agent context
Before You Start
Before building your flow, you’ll need to:
Plan your intents and sub-topics, and identify queues
Create two custom fields to store detected values
Identify or create your trigger event
Let’s dive into each of those tasks below.
Plan your intents and sub-topics
Before you can start hooking things together in workflow, you need to decide how you want it to work!
Start by listing the common reasons your customers get in touch.
These are your Intents — things like:
Parcel Tracking
Website Issues
Return and Refund
Then break each intent into a few Sub-Topics to capture more detail, and finally, identify the queue(s) you’ll want to route to for each combination. For example:
Be sure to include a ‘fallback' queue, for when the AI is unable to identify an intent or sub-topic.
Intent | Sub-Topics | Queue |
---|---|---|
Parcel Tracking | Late, Chasing, Redelivery, Change Address | Email - Tracking |
Website Issues | Discount Codes, Checkout Errors, Stock | Email - Website |
Return and Refund | Damaged, Wrong Item, Doesn't Fit | Email - Returns |
No criteria met |
| Email - General |
Write down your plan (post-it-note sized!) or open a quick spreadsheet. Then, identify (or create) the queues you think you’ll need: Queue Setup
Create Your Custom Fields
You’ll need two new fields to store the results from the AI actions - be sure to add them to the data set you want to use so they’ll be visible on the interaction:
Intent – stores the overall reason for contact
Suggested values:Tracking
Website
Returns
Unknown
etc.
Sub-Topic – stores the more specific issue or context
Suggested values:Late
Chasing
Redelivery
Change Address
Discount Codes
Checkout Errors
Stock
Damaged
Wrong Item
Doesn’t Fit
Unknown
etc.
Create these fields as String (SingleSelect) types. That makes the data super reportable and clean, and easier to build Decision actions later. For more info on creating custom fields, check here: Defining Custom Data
Identify a trigger event
You’ll attach your flow to a Workflow event later — either an existing New Message Received or Response Received event, or a new one.
Important: Events are linked to specific channels or accounts — they’re not global.
In this example, we’re using an Email channel, so you’ll need to select or create a New Message Received event that’s mapped to your chosen Email account.
Head to Settings > Workflow > Events
to check which event applies to your use case — or create a new one for the right channel if needed.
Building the flow
With your planning, custom fields, and event ready, it’s time to build the flow itself.
Create a new flow
Head to Configuration > Workflow > Builder
and click Create Flow.
Give your flow a clear name and label — for example: "AI Routing".
Save early — and save often! (You can come back and edit the flow as you refine your logic.)
Once you’ve created your flow shell, you’re ready to start adding actions.
Create the interaction
If the interaction hasn’t been created yet in a previous flow (remember multiple flows can be attached to an event, and run consecutively from top to bottom!), you’ll need to start the flow by creating the interaction.
If that’s the case, at the very start of your flow:
Click the + button and add a Create Interaction action.
Set the Initial State to Queued
Select your default holding queue — this is where the interaction will temporarily sit before it's re-routed. Flows run near-instantly - so it’ll move swiftly on to the relevant queue!
(e.g. Emails Queue or a general queue)You don’t have to, but you could preset any data fields you like at this point - such as an Email field with the sender’s email address
Echo.Person.Email.Address
).We’re also assigning the data group we want to display to agents here.
This step ensures the interaction exists so the rest of your AI actions can run properly — you can’t analyse intent before the interaction is created.
In most setups, we recommend handling interaction creation separately using Find or Create logic in a dedicated flow. Then, use this AI Routing flow immediately after to handle detection and triage.
Extract Intent
Next, add the Extract Intent action to your flow. This is where the AI identifies the customer’s reason for contact — like Tracking, Refund, or Website Issue — and stores the result for use later.
You can leave the Message and Output Name fields as they are.
Now add each of your planned Intent categories one by one using the + Add button. These are the options the AI will choose from when trying to match the message to a reason.
One or two clear words per Intent is plenty for the AI to do what it needs to do! Our model is already trained on contact centre language and knows what to look for.
Split the Flow by Intent
Now that the AI is detecting intent, let’s build the logic to route each interaction based on the result.
Instead of building your Decision manually, use the built-in shortcut:
Go back to your Extract Intent action.
Click the Copy to Decision button at the bottom right of the action editor.
Open the Library panel and look for the new Decision it just generated.
Insert it into the flow directly after your Extract Intent action.
Rename the Decision to Split by Intent so it’s clear what this logic is doing.
Why rename? Keeping your Decisions clearly labelled helps when your flows get more complex, especially if you start layering sub-topic routing or handling multiple channels.
Once inserted, the Decision will already contain branches for each of your defined Intents, plus a No Criteria Met fallback for when the Intent is Unknown.
Route to queues
For each branch in your Split by Intent decision:
Add an Update Interaction action.
Select Update queue and map each branch to the corresponding queue from your routing plan
Select Preset Data.
Find and select your Intent custom field.
Enter the matching Intent label as a static value (e.g. “Parcel Tracking” for the Parcel Tracking branch).
(Optional): Relabel the action, too, to keep your Flow easy to scan. i.e. Routing: Tracking
Repeat this step for each branch in the flow.
Try copying and pasting the action, to save time finding the field and typing the label!
Why store it? Storing the Intent lets you use it in dashboards, reports — and even as Decision criteria in other flows.
Once done, every interaction will be routing into the appropriate queue and will carry a clean, standardised record of why the customer got in touch.
Add Sub-Topic Detection
Next, you’ll use the Extract Sub-Topic action to add nuance to your routing and reporting — giving the AI specific clues to detect why, in more detail, the customer is getting in touch.
This action needs to be added beneath each Intent branch. Each instance should contain the Sub-Topics relevant to that Intent only.
Why use prompts? Unlike Intent detection (which is a built-in AI skill), Sub-Topic detection relies on your guidance. A good prompt tells the AI exactly when that Sub-Topic should be used.
Here are suggested prompts for each of the example Sub-Topics used in this guide:
✨ Website Issues
Discount codes → “If the customer is trying to apply a discount code and it isn’t working.”
Checkout Errors → “If the customer is getting an error message when checking out.”
Stock Issues → “If the item the customer wants is out of stock.”
📦 Parcel Tracking
Late → “If the customer says their parcel hasn’t arrived on time.”
Chasing → “If the customer is asking for an update on delivery progress.”
Redelivery → “If the parcel was missed and they want it delivered again.”
Change Address → “If the customer wants to change the delivery address.”
🔁 Return and Refund
Damaged → “If the customer says the item arrived damaged.”
Wrong Item → “If the customer got the wrong item or size.”
Doesn’t Fit → “If the item doesn’t fit the customer or recipient.”
Add each Sub-Topic and its matching prompt into the Extract Sub-Topic action for that Intent.
Once completed, your AI will be able to detect not just the broad reason for contact — but the precise issue behind it.
Handle the No Criteria Met Branch
If the AI can’t confidently assign an Intent, the flow will land in the No Criteria Met branch of your Decision. What happens next is up to you — but there are two common approaches.
Option A: Route to a General Queue
If you want things quick and easy, simply add an Update Interaction action here that:
Presets the Intent field as “Unknown” (or “Other”, if you prefer)
Assigns the interaction to a generic “Catch-All” queue (like General Inbox)
This approach is fast, easy to maintain, and ensures the interaction still lands with an agent.
Option B: Add a Catch-All Sub-Topic Action
If you don’t mind your flow getting a bit more complex, then try this.
Add an Extract Sub-Topic action to the
No Criteria Met
branch.Paste in all the Sub-Topic pairs from your other Intent branches — yes, all of them! — into a single action.
Use the detected Sub-Topic to decide which Intent the customer probably meant, and route accordingly.
This effectively gives the AI a second shot at getting the routing right, using more specific language cues.
This is surprisingly effective. Sub-Topics are usually more concrete and guided than Intents, so even vague queries often match a Sub-Topic cleanly.
Add a custom Decision to group Sub-Topic values back into Intent categories.
In each branch, use
KeywordGrouper.Output
to check for your Sub-Topics.Group multiple Sub-Topics with OR conditions to reflect their shared parent Intent.
For example, your “Returns” branch might check if the Sub-Topic equals Damaged, Wrong Item, or Doesn’t Fit.
Once your Decision is set up, simply drag the matching branches to join the existing flow beneath the first Intent detection — that way, the interaction continues exactly as if Intent had been detected correctly the first time.
The new ‘No criteria met’ branch is where queries have failed to find Intent or a Sub-Topic. We’d recommend you add an Update Interaction action here that:
Presets the Intent field as “Unknown” (or “Other”, if you prefer)
Assigns the interaction to a generic “Catch-All” queue (like General Inbox)
Store the Detected Sub-Topic
You’ve already got your Extract Sub-Topic actions in place — now it’s time to store the results for reporting, visibility, and further routing if needed.
You’ve got two options here:
Option A: Structured, Reportable Approach (Recommended)
Copy to Decision from each Sub-Topic action.
Insert that Decision directly under the Sub-Topic action to split the flow by Sub-Topic.
Under each new branch:
Add an Update Interaction action.
Use Preset Data to map the Sub-Topic value to your Sub-Topic custom field.
Repeat this process for each Intent branch — you’ll end up with a small Decision + Update combo under each.
This method gives you:
Cleaner data
Easier-to-read reports
Consistent interaction tagging
Your flow at this point, should look look a bit like this:
Option B: Raw Output Storage (Faster, Less Flexible)
Alternatively, you can skip that final Sub-Topic split and just store KeywordGrouper.Output
directly in an open text field using a single Update Interaction action.
It’s quicker, but:
The data will be harder to filter or group
Agents won’t be able to easily correct/update it if needed
Final Step: Save, Publish and Attach to an Event
Once your flow is complete, it’s time to put it live.
✅ Save and Publish
Click Save to store your flow
Then click Publish to make it available for use
✅ Attach to a Trigger Event
Go to Configuration > Workflow > Events
Find the New Message Received event that matches your Email account (or create a new one)
Attach your Intent & Sub-Topic Routing flow to it
Your flow is now live and ready to go. Every new email will be routed based on intent and sub-topic — and your agents will get clean, structured data to work with before they even open the case.