Skip to content

Edge

junjo.Edge

Kind: Class

SDK version: 0.64.0

Documentation channel: Next source preview

Edge(tail: Node | _NestableWorkflow, head: Node | _NestableWorkflow, condition: Condition[StateT] | None = None)

View source

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.

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, the
transition is always valid.
None

tail: Node | _NestableWorkflow

View source

Public attribute.

head: Node | _NestableWorkflow

View source

Public attribute.

condition: Condition[StateT] | None

View source

Public attribute.

next_node(store: BaseStore[StateT]) -> Node | _NestableWorkflow | None

View source

Determine the next node in the workflow based on this edge’s condition.

Name Type Description Default
store BaseStore[StateT] The store instance to use when resolving the next node.
  • Node | _NestableWorkflow | None: The next node if the transition is valid, otherwise None.