
How Workflow Session State Works
1. Initialization
The workflow session state is initialized when a Workflow object is created. It can be an empty dictionary or pre-populated with initial state data.2. Access and Modification
Agents and teams can access and modify the workflow session state during task execution. This is typically done through methods or tools that interact with the state. Consider the following example-add_item
function which is passed as a tool to the Agent
modifies the workflow session state by adding an item to the shopping list.
The
workflow_session_state
is shared across all agents and teams within a workflow. This allows for seamless collaboration and data sharing between different components.