- In a multi-turn conversation, where the user provides or receives one piece of data at a time
- Through a form, which prompts the user for several pieces of data in a single conversational turn
Note:User activity nodes support multi-language configurations. Define target languages in your agentic workflow code and manage translations through CSV export and import. For complete details, see Multi-language support.
userflow() object.
Parameters:
string
Internal node name.
string
Node name shown in the flow builder.
string
Title shown to the user in the chat. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions. Falls back to display_name when not set.Sequence[str]
List of users who own this user flow.
BaseModel
Input schema for the user flow.
BaseModel
Output schema for the user flow.
Multi-turn user activity
A UserActivity is a single-widget user interaction node. Each activity holds exactly one widget. This approach separates the internal node name from the label shown in the chat, and lets you inject flow variables into both the chat prompt and the display label.Variable substitution
You can use{flow.input.*} or {flow.private.*} expressions in label, agent_message, and text fields. These expressions are resolved when the interaction is rendered to the user.
activity() parameters
Call activity() on the userflow() object to create a UserActivity node. Then attach one widget using one of the widget methods on the returned node.
string
required
Internal name of the activity node.
string
Node name shown in the flow builder.
string
Description of the activity.
Widget methods
After you create an activity withactivity(), attach one widget by calling one of the methods below on the returned node.
The agent_message parameter is available on all input widgets. Use it to set the chat prompt shown to the user. It supports variable substitution.
text_input_field
text_input_field
string
required
Internal name of the field.
string
Label shown on the widget in the chat.
string
Chat prompt shown to the user above the widget. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.bool
Whether the field uses a single line. Set to
False to create a multi-line text area. Defaults to True.string
Placeholder text shown inside the input.
string
Help text shown below the input.
any
Default value for the field, passed as a
DataMap.string
Regular expression pattern for input validation.
string
Error message shown when the input does not match the regex pattern. Defaults to
"Input does not match the required pattern".boolean_input_field
boolean_input_field
string
required
Internal name of the field.
string
Label shown on the widget in the chat.
string
Chat prompt shown to the user above the widget. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.bool
Whether to display as a single checkbox. Set to
False to display as radio buttons. Defaults to True.any
Default value for the field, passed as
input_map.string
Label for the true option. Defaults to
True.string
Label for the false option. Defaults to
False.number_input_field
number_input_field
string
required
Internal name of the field.
string
Label shown on the widget in the chat.
string
Chat prompt shown to the user above the widget. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.bool
Whether the field accepts only integers. Set to
False to accept decimal numbers. Defaults to True.string
Help text shown below the input.
any
Default value for the field, passed as a
DataMap.any
Minimum allowed value, passed as a
DataMap.any
Maximum allowed value, passed as a
DataMap.date_input_field
date_input_field
string
required
Internal name of the field.
string
Label shown on the widget in the chat.
string
Chat prompt shown to the user above the widget. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.any
Default value for the field, passed as a
DataMap.any
Minimum date value for the allowed range.
any
Maximum date value for the allowed range.
bool
Whether the field supports selecting more than one date. Defaults to
False.datetime_input_field
datetime_input_field
string
required
Internal name of the field.
string
Label shown on the widget in the chat.
string
Chat prompt shown to the user above the widget. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.any
Default value for the field, provided through a
DataMap.any
Minimum allowed datetime or time value.
any
Maximum allowed datetime or time value.
UserFieldKind
Type of field, either
DateTime or Time. Defaults to DateTime.file_upload_field
file_upload_field
string
required
Internal name of the field.
string
Label shown on the widget in the chat.
string
Chat prompt shown to the user above the widget. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.string
Instructions for the file upload.
bool
Whether multiple files can be uploaded. Defaults to
False.int
Maximum file size in MB. Defaults to
10.List[string]
List of supported file extensions, such as
pdf and docx.Any
Minimum number of files. Valid only when
allow_multiple_files=True.Any
Maximum number of files. Valid only when
allow_multiple_files=True.activity():
Python
Multi-turn conversations (Legacy)
You can also collect or deliver one piece of data at a time using thefield() method on the userflow() object. This method combines the node name, widget type, and chat prompt into a single call.
string
required
Unique identifier for the node.
UserFieldKind
required
Type of user activity. Supported types:
Text, Date, DateTime, Time, Number, File, Boolean, Object, Choice.string
Display name for the node.
string
Description of the node.
string
required
Whether the node collects input from the user or sends output to the user.
any
Default value for the node.
UserFieldOption
List of predefined options with their labels and values.
bool
Whether the node accepts multiple values.
any
Minimum value or constraint.
any
Maximum value or constraint.
DataMap
Input mappings defined as a structured collection of
Assignment objects.dictionary
Dictionary for additional metadata or configuration.
field():
Python
Forms user activity
To prompt for multiple pieces of data in a single turn, callform() on the userflow() object to create a form node.
string
required
Internal name of the form.
string
Display name shown on the form.
string
Instructions text for the form.
string
Label for the submit button. Defaults to
Submit.string
Label for the cancel button. Set to
None to hide the button.Form fields
After you create a form withform(), add fields to it. Each field type accepts its own set of parameters. You can inject flow variables into a field’s label using {flow.input.*} and {flow.private.*} expressions. These expressions are resolved when the form is rendered to the user.
Supported field types:
text_input_field
text_input_field
Creates a text input field. Configure it as a single-line input or a multi-line text area.Parameters:
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.bool
Whether the field uses a single line. Set to
False to create a multi-line text area. Defaults to True.string
Placeholder text for the field.
string
Help text for the field.
any
Default value for the field, passed as a
DataMap.string
Regular expression pattern for input validation.
string
Error message shown when the input does not match the regex pattern. Defaults to
"Input does not match the required pattern".boolean_input_field
boolean_input_field
Creates a boolean input field. Render it as a checkbox or radio buttons.Parameters:
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether to display as a single checkbox. Set to
False to display as radio buttons. Defaults to True.any
Default value for the field, passed as
input_map.string
Label for the true option. Defaults to
True.string
Label for the false option. Defaults to
False.date_range_input_field
date_range_input_field
Creates a date range input field with start and end date pickers.Parameters:
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.string
Label for the start date field.
string
Label for the end date field.
any
Default value for the start date, passed as a
DataMap.any
Default value for the end date, passed as a
DataMap.any
DataMap that sets the minimum date constraint and maps to self.input.min_date.any
DataMap that sets the maximum date constraint and maps to self.input.max_date.date_input_field
date_input_field
Creates a date input field.Parameters:
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.any
Default value for the field, passed as a
DataMap.any
Minimum date value for the allowed range.
any
Maximum date value for the allowed range.
bool
Whether the field supports selecting more than one date. Defaults to
False.datetime_input_field
datetime_input_field
Creates a datetime or time input field.
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.any
Default value for the field, provided through a
DataMap.any
Minimum allowed datetime or time value.
any
Maximum allowed datetime or time value.
UserFieldKind
Type of field, either
DateTime or Time. Defaults to DateTime.datetime_range_input_field
datetime_range_input_field
Creates a datetime or time range input field with start and end pickers.
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.string
Label for the start value.
string
Label for the end value.
any
Default start value, provided through a
DataMap.any
Default end value, provided through a
DataMap.any
Minimum allowed value for the range.
any
Maximum allowed value for the range.
number_input_field
number_input_field
Creates a number input field.Parameters:
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.bool
Whether the field accepts only integers. Set to
False to accept decimal numbers. Defaults to True.string
Help text for the field.
any
Default value for the field, passed as a
DataMap.any
Minimum allowed value, passed as a
DataMap.any
Maximum allowed value, passed as a
DataMap.file_upload_field
file_upload_field
Creates a file upload field.Parameters:
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.string
Instructions for the file upload.
bool
Whether the field is required. Defaults to
False.bool
Whether multiple files can be uploaded. Defaults to
False.int
Maximum file size in MB. Defaults to
10.List[string]
List of supported file extensions, such as
pdf and docx.Any
Minimum number of files. Valid only when
allow_multiple_files=True.Any
Maximum number of files. Valid only when
allow_multiple_files=True.message_output_field
message_output_field
field_output_field
field_output_field
list_output_field
list_output_field
list_input_field
list_input_field
Creates a list input field to display tabular data.Parameters:
string
required
Internal name of the field.
string
Display label for the field.
bool
Whether the user can add rows.
bool
Whether the user can delete rows.
any
List of items to display, passed in a
DataMap.dict[string, str]
Mapping of source property names to table column labels. Only the mapped columns appear.
file_download_field
file_download_field
single_choice_input_field
single_choice_input_field
Creates a single-choice input field. Display options as a dropdown or as radio buttons.Parameters:
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.any
List of available choices, passed as a
DataMap.bool
Whether to display options as a dropdown. Set to
False to display as radio buttons. Defaults to True.string
Column name used for the display text in a dropdown.
string
Placeholder text for the dropdown.
any
Default selected value, passed as a
DataMap.dict[string, str]
Mapping of source property names to display labels for complex choice objects.
multi_choice_input_field
multi_choice_input_field
Creates a multi-choice input field. Display options as a multi-select dropdown or as checkboxes.Parameters:
string
required
Internal name of the field.
string
Display label for the field. Supports variable substitution using
{flow.input.*} and {flow.private.*} expressions.bool
Whether the field is required. Defaults to
False.any
List of available choices, passed as a
DataMap.bool
Whether to display options as a dropdown. Set to
False to display as checkboxes. Defaults to True.string
Column name for the display text in a dropdown.
string
Placeholder text for the dropdown.
any
Default selected values, provided as a
DataMap.dict[string, str]
Mapping of source property names to display labels for complex choice objects.
any
Minimum number of items the user must select.
any
Maximum number of items the user can select.
user_input_field
user_input_field
Creates a user selection field in the form.Parameters:
string
required
Internal name of the field.
string
Display label for the field.
bool
Whether the field is required. Defaults to
False.bool
Whether the user can select more than one person. Defaults to
False.any
Minimum number of users to select. Applies only when
multiple_users=True. Accepts an integer or a DataMap for dynamic configuration through expressions.any
Maximum number of users to select. Applies only when
multiple_users=True. Accepts an integer or a DataMap for dynamic configuration through expressions.form():
Python
Dynamic form input
Form fields can change based on user actions. You define the dependencies between user interactions and your tools to control dynamic behavior in the form. This includes progressive selection, showing or hiding widgets, and updating widget labels. Use the following methods to configure dynamic forms:visibility_behaviour_field
visibility_behaviour_field
Shows or hides fields based on conditions.
string
required
Unique identifier for this behaviour.
string
required
Field that triggers evaluation of visibility rules when its value changes.
list[dict]
required
List of visibility rules. Each rule specifies a condition and an
impacted_field that changes visibility.string
Display name for this behaviour.
label_behaviour_field
label_behaviour_field
Updates field labels based on conditions.
string
required
Unique identifier for this behaviour.
string
required
Field that triggers label evaluation when its value changes.
list[dict]
required
List of label rules. Each rule includes a condition and an
impacted_field whose label changes.string
Display name for this behaviour.
value_source_behaviour_field
value_source_behaviour_field
Populates a field using results from a tool. Supports a simplified API or a manual API.
string
required
Unique identifier for this behaviour.
string
required
Field that triggers the tool call when its value changes.
string
required
Field that receives values returned by the tool.
Simplified API parameters
string
Name of the tool to call, such as
get_states_or_provinces.string
UUID of the tool.
dict[string, string]
Mapping of tool parameters to field expressions, such as
country mapped to parent.field.country.any
Client instance that enables automatic retrieval of the tool schema.
Manual API parameters
string
Tool identifier in
name:uuid format.dict
Schema that describes the expected inputs for the tool.
dict
Mapping of input parameters to values or expressions used by the tool.
Common optional parameters
string
Display name for this behaviour.
Python

