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, optional description) and an optional list of conditions. The type is always custom (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 optional LogicalOp to chain with the next condition.

    • Supported operators: ==, !=, >, <, >=, <=, in, not in, contains, not contains.

    • Evaluation is left-to-right; there is no operator precedence. The LogicalOp on the first condition is ignored. Subsequent conditions are combined with and / or exactly 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 source matches 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 stay edge conceptually used as a placeholder for “remain on the current node” (label stay, description “stay in the current node”) when needed.

  • Usage guidance:

    • Use clear label text to explain why a transition occurs.

    • Keep conditions minimal; avoid long chains because evaluation is strictly sequential without parentheses/precedence.

    • Ensure target nodes exist; otherwise the edge is ignored.

    • Prefer in/contains for lists and strings; use numeric operators for numeric comparisons.

Last updated