orkes.graph.ConditionalEdge#
- class orkes.graph.ConditionalEdge(from_node, gate_function, condition, max_passes=25)[source]#
An edge that determines the next node based on the outcome of a gate function.
- Parameters:
from_node (NodePoolItem)
gate_function (Callable)
condition (Dict[str, str])
- __init__(from_node, gate_function, condition, max_passes=25)[source]#
Initializes a ConditionalEdge.
- Parameters:
from_node (NodePoolItem) – The node from which the edge originates.
gate_function (Callable) – A function that is executed to decide which path to take. The function’s return value is matched against the keys in the condition dictionary to determine the next node.
condition (Dict[str, str]) – A dictionary mapping the possible outcomes of the gate_function to the names of the next nodes.
max_passes (int, optional) – The maximum number of times the graph execution can traverse this edge. Defaults to 25.
Methods
__init__(from_node, gate_function, condition)Initializes a ConditionalEdge.