Concept
A welcome route needs a signal. The signal decides which specialist receives the conversation. ABL supports three signals.
Start data is a value the channel passes as caller data, such as
session.entry_topic. Treat caller data from a browser as unverified. When the route has business impact, send the value from your own server.
Every HANDOFF target must be a local agent that the entry agent declares in its HANDOFF: section. Every target must exist in the project.
What happens at session start
- Eager start: no user message exists yet, for example when a Web SDK client connects. The welcome shows. The specialist becomes active but does not run. The user’s first message goes to the specialist.
- Lazy start: the first user message starts the session, for example over HTTP chat. The welcome does not show. The runtime forwards that first message to the specialist.
- Realtime speech-to-speech sessions never run the start-time handoff. The entry agent keeps the session.
- A matched branch welcome owns the start. In a FLOW entry agent, the entry step runs on the first user message.
- The specialist’s own
ON_STARTnever runs.ON_STARTruns once per session, for the entry agent only. - The route options come from the declared
HANDOFFentry, such asRETURN,PASS,SUMMARY, andON_FAILURE. TheDO:line names only the target. - A route without
HISTORYpasses the full conversation history by default.
Minimal working example
This example routes by entry topic at session start. Every case reaches a specialist, so no user is left without a route.entry_topic is project-local. Your channel must send it as caller data. The compiler reports ON_START_BRANCH_DO_ACTIVATED as an informational warning. It confirms that each DO: list runs at session start.
How it works
The runtime checks the branches in order. The first matching branch supplies the welcome and theDO: list. The ELSE branch matches when no earlier branch does. The welcome renders first. The HANDOFF then runs through the normal handoff path.
The specialist Claims_Agent shows its first reply only after the user sends a message. On a lazy start, that message is the one that started the session.
Common variations
Route from a menu choice
Use this when no start data exists and the user picks an option. The enum field accepts only the listed values. Other text fails validation.Billing_Agent from the minimal example. A button press with no matching handler becomes the user’s input. The input is the button VALUE, or the button id when VALUE is empty. The runtime checks a route WHEN after the user’s input, not during the startup steps.
Route with a condition on start data
Use a top-levelHANDOFF when one route depends on one start value. The route WHEN decides. It runs once at start, when no branch matched.
WHEN must be decidable from start data. A natural language condition or an intent.* value never matches at start. The same WHEN stays true for the whole session. A later turn can route to the specialist again. To make the route start-only, put the condition in a branch IF: and leave the route WHEN unset.
Verification
- Start a session with
entry_topicset toclaims. Expect the claims welcome. In the trace,dsl_on_start_branchshows the matched branch, thenhandoff, thendsl_on_start_handoffwithoutcome: executed,activation: awaiting_user, andstartMode: eager. - Send a first message. Expect
Claims_Agentto answer it. - Repeat with
billing. Then repeat with noentry_topic. ExpectGeneral_Service_Agent. - For the menu, click each button. Then type
billing. Then typeother. Expect the validation message forother. - For a blocked route, make the route
WHENfalse. Expect the entry agent to keep the session, withoutcome: blockedandreason: condition_false.
Production readiness checklist
- Define every target agent and declare it in the entry agent’s
HANDOFF:section. - Send start data from your server when the route has business impact.
- Keep an
ELSEbranch or a fallback agent for unknown values. - Set
ON_FAILUREon each route so a refused handoff shows the message you intend. - Use
ESCALATEinON_FAILUREonly when the project defines anESCALATEblock with a human-agent connection and routing. Without it, no person is reached. - Pass only the fields the specialist needs.
- Test each start value, each button, an unknown value, and a blocked route.
- Confirm the target channel delivers the
ON_STARTwelcome. The handoff still runs when the welcome is suppressed.