orka.nodes.fork_node module

class orka.nodes.fork_node.ForkNode(node_id, prompt=None, queue=None, memory_logger=None, **kwargs)[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, prompt=None, queue=None, memory_logger=None, **kwargs)[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 – Logger for tracking node state.

  • **kwargs – Additional configuration parameters.

async run(orchestrator, context)[source]

Execute the fork operation by creating parallel branches.

Parameters:
  • orchestrator – The orchestrator instance managing the workflow.

  • context – Context data for the fork operation.

Returns:

Status and fork group information.

Return type:

dict

Raises:

ValueError – If no targets are specified.