Step: Add Widget to Message
- Key:
add-widget-to-message - Category: Widgets
- Description: Attach a custom widget to the assistant response message and prefill its initial state.
Inputs
widgetId(select, required): Widget to attach from your workspace widgets.initialState(object, optional): Initial state passed to the widget. Values support template rendering and are normalized against the widget's initial state schema when one exists.
Outputs
messageWidgetId(string): ID of the created message widget record.widgetId(string): ID of the attached widget.widgetName(string): Name of the attached widget.initialState(object): Initial state stored for the widget.
Notes
- This step requires
responseMessageIdin the flow context, so it is intended for peer/chat executions. - Custom widgets are managed in workspace widget settings.
- Use
initialStateto prefill charts, tables, product cards, forms, or other interactive UI with data from previous steps.
Example Use Case
After an agent step retrieves a list of products:
- Use
add-widget-to-messagewith a product grid widget. - Set
initialState.productsfrom the agent output. - The user sees the text response and the interactive widget in the same message.

