Skip to main content
Use a user activity node to define interactive steps in your agentic workflow where users provide or receive information in one of two ways:
  • 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.
To add a user activity node to your agentic workflow, start by creating a 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 with activity(), 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.
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".
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.
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.
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.
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.
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.
Displays a message to the user without collecting input. Use text to inject flow variables into the message.
string
required
Internal name of the field.
string
Message text shown to the user. Supports variable substitution using {flow.input.*} and {flow.private.*} expressions.
Here is an example that shows how to use activity():
Python

Multi-turn conversations (Legacy)

You can also collect or deliver one piece of data at a time using the field() 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.
Here is an example that shows how to use field():
Python

Forms user activity

To prompt for multiple pieces of data in a single turn, call form() 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 with form(), 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:
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".
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.
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.
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.
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.
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.
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.
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.
Creates a message output field to display text to the user.Parameters:
string
required
Internal name of the field.
string
Display label for the field.
string
Message text to display.
Creates a field output to display dynamic values.Parameters:
string
required
Internal name of the field.
string
Display label for the field.
any
Value to display, passed as a DataMap.
Creates a list output field to display tabular data.Parameters:
string
required
Internal name of the field.
string
Display label for the field.
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.
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.
Creates a file download field.Parameters:
string
required
Internal name of the field.
string
Display label for the field.
any
File to download, passed as a DataMap.
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.
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.
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.
Here is an example that shows how to use 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:
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.
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.
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.
Here is an example that shows how to configure dynamic forms:
Python