Skip to main content
The workflow session state is a powerful feature of the Workflows system that allows for the persistence and sharing of state information across different components of a workflow. This state is crucial for maintaining continuity in workflows that involve multiple tasks, agents, and teams. Workflow Session State

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-
In the example, the 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.
More Examples: