orka.nodes.fork_node module
- class orka.nodes.fork_node.ForkNode(node_id: str, prompt: str | None = None, queue: List[Any] | None = None, memory_logger: RedisStackMemoryLogger | None = None, **kwargs: Any)[source]
Bases:
BaseNode
A node that splits the workflow into parallel branches. Can handle both sequential and parallel execution of agent branches.
- __init__(node_id: str, prompt: str | None = None, queue: List[Any] | None = None, memory_logger: RedisStackMemoryLogger | None = None, **kwargs: Any) None [source]
Initialize the fork node.
- Parameters:
node_id (str) – Unique identifier for the node.
prompt (str, optional) – Prompt or instruction for the node.
queue (list, optional) – Queue of agents or nodes to be processed.
memory_logger (RedisStackMemoryLogger, optional) – Logger for tracking node state.
**kwargs – Additional configuration parameters.
- async run(context: Dict[str, Any]) Dict[str, Any] [source]
Execute the fork operation by creating parallel branches.
- Parameters:
context – Context data for the fork operation, must include orchestrator.
- Returns:
Status and fork group information.
- Return type:
dict
- Raises:
ValueError – If no targets are specified or orchestrator is missing.