ParallelNode (since v3.0.0). It executes multiple child nodes concurrently when their operations do not depend on each other.
Use cases:
- Independent Validations - Running validation steps concurrently without dependencies
- Parallel Transformations - Applying independent transformations or checks simultaneously
- Performance Optimization - Reducing overall task completion time by leveraging parallelism
- Guardrails Processing - Running multiple guardrails or safety checks simultaneously
Node or AgentNode instances), add them to the NodeConfig in the WorkflowSchema using the concurrent_nodes parameter.
ConcurrentNode Class
Implementation Example
WorkflowSchema Configuration
How It Works
- Node Configuration - Configure the concurrent nodes in your WorkflowSchema by specifying them in the
concurrent_nodeslist - Concurrent Execution - When
execute_nodes_concurrently()is called, it creates coroutines for each child node and runs them simultaneously usingasyncio.gather() - Result Collection - All child nodes process the same
task_contextand can store their results independently usingtask_context.update_node() - Workflow Continuation - After all concurrent nodes complete, the workflow continues to the next node in the pipeline