Skip to main content
After each node finishes, Fabro must decide which edge to follow to the next node. This decision is deterministic by default — given the same outcome and context, Fabro always picks the same edge. Nodes can opt into random selection for weighted-random tiebreaking instead. Understanding the transition logic helps you design workflows that route reliably.

How transitions work

When a node completes, it produces an outcome with a stage outcome (succeeded, failed, partially_succeeded, or skipped) and optional signals like a preferred label or suggested next node. Fabro evaluates the outgoing edges in a fixed priority order:
  1. Condition match — Edges with a condition attribute are evaluated first. If one or more conditions match, the edge with the highest weight wins (lexical tiebreak on target node ID).
  2. Preferred label — If the node’s outcome includes a preferred label (e.g. from a human gate selection), the edge whose label matches is chosen.
  3. Suggested next — If the node suggests a specific next node ID, the edge pointing to that node is chosen.
  4. Unconditional fallback — Edges without conditions are considered last, again using weight then lexical tiebreak.
If no edge matches at all, the workflow halts with an error.

Edge attributes

Conditions

Edge conditions are boolean expressions evaluated against the stage outcome and run context. Conditions go in the condition attribute on an edge:

Available keys

Operators

A bare key with no operator is a truthiness check — it passes if the value is non-empty, not "false", and not "0":

Combining conditions

Use && (AND), || (OR), and ! (NOT) to build compound expressions. && binds tighter than ||:

Agent transitions

Agent and prompt nodes can influence which edge is taken by including a JSON object in their response with routing directives. Fabro scans the LLM output for the last JSON object containing any of these fields:
Fabro automatically scans LLM output for these JSON objects — no special configuration is needed. However, you do need to instruct the LLM to emit the JSON in your prompt. For example:
The LLM’s natural language response can contain other text — Fabro finds the last JSON object with a recognized routing field and extracts the directives from it.

Human gate transitions

Human gates use edge labels to present options to the user. The selected label becomes the preferred_label in the outcome, and Fabro matches it to the corresponding edge:
The [A], [R], [S] prefixes are keyboard accelerators — Fabro strips them when matching, so the user can type just the letter.

Unconditional edges

An edge without a condition attribute always matches. When a node has a single outgoing edge, it doesn’t need a condition:
When mixing conditional and unconditional edges, conditional matches take priority. An unconditional edge acts as the default fallback:

Weight tiebreaking

When multiple edges match (e.g. two unconditional edges), weight determines the winner. Higher weight wins:
If weights are equal, the edge with the lexicographically first target node ID is chosen. This makes the behavior fully deterministic.

Random selection

By default, tiebreaking between candidate edges is deterministic (highest weight, then lexical node ID). Setting selection="random" on a node switches to weighted-random tiebreaking for its outgoing edges:
In this example, path_a is chosen ~75% of the time and path_b ~25%. Edges with weight ≤ 0 are treated as weight 1. The cascade priority (conditions → preferred label → suggested next → unconditional) is unchanged — randomness only affects the pick-one-from-candidates step within each tier.
selection="random" cannot be combined with conditional edges on the same node. Validation rejects this combination because condition evaluation order would conflict with random selection. Use unconditional edges with weights instead.