Edge
junjo.Edge
Kind: Class
SDK version: 0.64.0
Documentation channel: Next source preview
Signature
Section titled “Signature”Edge(tail: Node | _NestableWorkflow, head: Node | _NestableWorkflow, condition: Condition[StateT] | None = None)Represents a directed edge in the workflow graph.
An edge connects a tail node to a head node, optionally with a condition that determines whether the transition from tail to head should occur.
Edges are immutable graph-shape objects. Once constructed, tail,
head, and condition cannot be reassigned. Create a new Edge and
a new Graph when the workflow shape needs to change.
Constructor
Section titled “Constructor”Parameters
Section titled “Parameters”| Name | Type | Description | Default |
|---|---|---|---|
tail |
Node | _NestableWorkflow |
The source node of the edge where the transition originates. |
|
head |
Node | _NestableWorkflow |
The destination node of the edge where the transition leads. |
|
condition |
Condition[StateT] | None |
An optional condition that determines whether the transition from tail to head should occur. If None, thetransition is always valid. |
None |
Members
Section titled “Members”tail: Node | _NestableWorkflowPublic attribute.
head: Node | _NestableWorkflowPublic attribute.
condition
Section titled “condition”condition: Condition[StateT] | NonePublic attribute.
next_node
Section titled “next_node”next_node(store: BaseStore[StateT]) -> Node | _NestableWorkflow | NoneDetermine the next node in the workflow based on this edge’s condition.
Parameters
Section titled “Parameters”| Name | Type | Description | Default |
|---|---|---|---|
store |
BaseStore[StateT] |
The store instance to use when resolving the next node. |
Returns
Section titled “Returns”Node | _NestableWorkflow | None: The next node if the transition is valid, otherwiseNone.