add_callback() method and define the following parameters. The flow engine invokes callbacks when the specified events occur during an agentic workflow. The add_callback() method creates a FlowCallback object, appends it to the agentic workflow specification, and returns Self, enabling method chaining.
The tool identifier to invoke when the callback runs. Specify the tool in one of four supported formats:
tool_name, tool_name:tool_uuid, toolkit:tool_name, or toolkit:tool_name:tool_uuid.The list of events that trigger the callback during an agentic workflow.
The batching interval in milliseconds. When not specified, the server uses the default value.
Note:The
batch_interval parameter only applies to the following event types:ON_FLOW_STARTON_FLOW_ENDON_FLOW_ERROR
ON_TASK_MESSAGE and ON_TASK_WAIT, the callback is invoked immediately, and the batch_interval setting is ignored.Example
add_callback() to register one or more callback handlers in the agentic workflow specification. The flow engine invokes each callback when one of its configured events occurs.
The following example shows how to configure callbacks in an agentic workflow:
Python

