Trellis allows flows to pause and request data from the user (or system). This is done using Question Nodes with specific metadata.
Trellis does not render widgets (like Select Boxes or Date Pickers). Instead, it declares an Intent for input. The Host (CLI, Web App, Agent) is responsible for interpreting this intent and rendering the appropriate controls.
To create an input, use a node with type: question and add input_* fields in the frontmatter.
---
id: favorite_color
type: question
input_type: choice
input_options:
- Red
- Blue
- Green
input_default: Blue
transitions:
- to: next_step
---
# Favorite Color
Please select your favorite color from the list.
| Field | Type | Description |
|---|---|---|
input_type |
string |
The kind of data requested (e.g., text, choice, confirm). |
input_options |
list |
(Optional) Valid values for choice type. |
input_default |
string |
(Optional) Default value if the user skips. |
input_secret |
bool |
(Optional) if true, indicates sensitive input (passwords). |
The value provided by the user is available in the input variable during transition evaluation.
transitions:
- to: node_red
condition: input == "Red"
- to: node_blue
condition: input == "Blue"
When the Engine encounters a Question Node, it returns a ActionRequestInput action.
The standard trellis.Runner already implements listeners for these actions and renders:
choice: Using a list selector.text: Using a standard prompt.confirm: Using a Yes/No prompt.If you are building a custom integration, you need to handle the ActionRequestInput:
for _, act := range actions {
if req, ok := act.Payload.(domain.InputRequest); ok {
// Then pass the result to engine.Navigate(ctx, state, result)
}
}