Build your agent
Branch
Sends the call down a different path based on a value, like an AI decision’s yes or no.
Type: conditional.
What it does
- Reads the first value named in
input_variablesfrom the call's state. - Compares it, as lower-case text with spaces trimmed, to each key in
mappings. A yes/no value reads as"true"or"false". - Goes to the matching path's step (or steps, if the path is a list).
- If nothing matches it takes the
defaultpath. With no default it follows itsnext, and with neither it stops there.
In the editor each path is a dot on the card; drag from it to the step it leads to. Paths show the step they go to.
Settings
Everything goes in the step's parameters. In the editor, click the step to open its settings.
input_variables{ name: type }- In the editor: Decide on. Something an earlier step decided, like End the call. Default:
{"hangup":"bool"}. mappings{ value: step | step[] }- In the editor: Paths. One path per answer. Connect each path to the step it leads to. Default:
{"true":"","false":""}.
Examples
Yes or no
End the call or keep listening:
{ "type": "conditional", "parameters": { "input_variables": { "hangup": "bool" }, "mappings": { "true": "goodbye", "false": "ask_for_input" } }}Several answers and a default
Route by intent:
{ "type": "conditional", "parameters": { "input_variables": { "intent": "str" }, "mappings": { "book": "booking", "cancel": [ "cancel_reply", "notify" ], "default": "ask_for_input" } }}