choice Step
The choice step presents options to the user and routes based on their selection.
Syntax
Short Form
- choice:
"Email": continue
"SMS":
- done: "We will text you updates"
Full Form
- choice:
prompt: "How would you like to receive updates?"
options:
"Email": continue
"SMS":
- done: "We will text you updates"
freeform: true
freeform_handler: continue
name: "Delivery Preference"
Properties
| Property | Type | Required | Description |
|---|---|---|---|
prompt | string | No | Custom prompt for the choice |
options | object | Yes | Option label to target mapping |
freeform | boolean | No | Allow unlisted responses (default true) |
freeform_handler | target | No | What to do with freeform input |
name | string | No | Human readable step name |
Example With Variables
- choice:
prompt: "Your order total is ${{variables.order.total}}. Proceed?"
options:
"Yes": continue
"No":
- done: "Cancelled"
Card Display
Set display: card to render options as buttons in clients that support conversation cards.
- choice:
prompt: "How should we proceed?"
display: card
options:
"Approve": continue
"Reject":
- done: "Rejected"
Card button submissions are sent back through the Converse API as interaction.kind = "choice". The runtime uses the submitted option id directly and does not run LLM choice matching for that submit.