Edges in Pathway
[8 tools called]
Here’s an edge overview you can drop into user-facing docs (no code):
What an edge is: a directed connection from one node (
source) to another (target) with display metadata (label, optionaldescription) and an optional list of conditions. The type is alwayscustom(required for rendering).Basic fields:
id: unique per edge in the pathway.source: node id where the edge starts.target: node id where the edge points.data.label: short text shown on the edge.data.description(optional): longer helper text/tooltips.
Conditional routing (optional):
Each condition has
left,op,right, and an optionalLogicalOpto chain with the next condition.Supported operators:
==,!=,>,<,>=,<=,in,not in,contains,not contains.Evaluation is left-to-right; there is no operator precedence. The
LogicalOpon the first condition is ignored. Subsequent conditions are combined withand/orexactly in the given order.Values can reference extracted variables by name; when evaluating, variable names are substituted from the current call context.
How edges are picked at runtime:
From the current node, the system gathers all outgoing edges whose
sourcematches the current node id.It filters out edges that point to missing nodes.
If an edge has conditions, they’re evaluated in order; the first edge whose conditions resolve to true is selected. If no conditions are present, the edge is considered eligible by default.
Global nodes and implicit edges:
Nodes marked as global (
data.global.isGlobal=true) are implicitly reachable from any node. At runtime, the system adds synthetic edges from the current node to each global node using the global node’s label/description; these don’t need to be drawn manually.
Special placeholder: there is a
stayedge conceptually used as a placeholder for “remain on the current node” (labelstay, description “stay in the current node”) when needed.Usage guidance:
Use clear
labeltext to explain why a transition occurs.Keep conditions minimal; avoid long chains because evaluation is strictly sequential without parentheses/precedence.
Ensure
targetnodes exist; otherwise the edge is ignored.Prefer
in/containsfor lists and strings; use numeric operators for numeric comparisons.
Last updated