Skip to main content

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

PropertyTypeRequiredDescription
promptstringNoCustom prompt for the choice
optionsobjectYesOption label to target mapping
freeformbooleanNoAllow unlisted responses (default true)
freeform_handlertargetNoWhat to do with freeform input
namestringNoHuman 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.