Skip to main content
Use this pattern when the first screen or first assistant turn should guide the user into the right specialist path.

Concept

Welcome routing turns the first interaction into a routing signal. The signal can come from a button, an entry-page value copied into session context, or the user’s first typed response. Once the signal is known, normal handoff routing should move the conversation to a specialist agent. Do not reference a specialist agent unless it exists in the project. A routing example is only operational when the target agents are defined and the value used in WHEN is actually collected or set.

Minimal working example

How it works

The welcome message presents choices. The flow gathers startup_choice. The handoff conditions use that same field. The specialist agents are included so the compiler and deployment can resolve the targets. startup_choice is declared both at the top level and inside capture_choice. Keep only the flow-step GATHER if the field is only ever collected inside that step; a top-level declaration is only needed if HANDOFF conditions must reference the field before the flow step that collects it has run in a given turn. When in doubt, declare the field once, in the flow step that actually collects it. Since neither HANDOFF example above declares HISTORY, each specialist now receives the full conversation history by default (the current platform default when HISTORY is omitted).

Common variations

Route from a known entry topic

If the channel integration already knows the entry topic, copy it into a session variable during startup and route with that value.

Verification

Test each startup choice and confirm the expected handoff target. In traces, inspect the startup response, the collected or set routing value, and the handoff event. Also test an unknown choice and confirm the user is asked to clarify instead of being routed incorrectly.

Common mistakes

Troubleshooting

If no route matches, verify that the variable in WHEN has the same name as the gathered or set value. If the compiler reports missing targets, define or import the specialist agents before validating the project.

Production readiness checklist

  • Define every target specialist agent.
  • Make every routing variable traceable to GATHER, SET, channel context, or tool output.
  • Add a fallback for unknown or ambiguous choices.
  • Pass only the fields the specialist needs.
  • Test each welcome option before publishing.