Router
Overview
Sends the flow down the branches whose rules one value holds. Branches whose rules don’t hold do not run.
For example, train detectors on different frameworks and compare them with Compare object detectors. Wire its Winner framework output, such as yolo, into the Router and add two rules: equal to yolo and equal to deim. Each rule leads to its framework’s own predict node, which takes the Best Model ID from the comparison. A tie leaves the framework empty, so the run goes to Otherwise: connect a notification there, or nothing.
For a single yes/no check, a Condition is enough. The Router is for more outcomes.
Rules
Choose how the value is read, Text, Number, or Yes / No, once for the whole Router. When you wire the value from a number or yes/no output and no rule has a value yet, the editor picks the matching type for you. Each rule is one line: an operator and the value to compare with. The rules are the branches the Router can take; connect only the ones you need.
Edges
Each edge leaving the Router carries a chip with its rule: the value alone for an Equal to rule, such as yolo, or the condition in short, such as ≥ 1000, or Otherwise. Hover the chip to pick another rule. A new edge takes the first rule that has no edge yet, then Otherwise. When rules overlap, such as > 3 and > 5 for a value of 7, both branches run. Connect only the rules you need: when none of the rules that hold has an edge, the run goes to Otherwise, like a value no rule holds. With no Otherwise edge, the flow stops at the Router.
How it works
FAQ
What happens when the value is empty or can't be read?
No rule holds, except Is empty, and the run goes to Otherwise. The same goes for a value that doesn’t fit the type, such as abc compared as a number. The log says why.
What happens to the edges when I change the rules?
Changing or reordering rules keeps every edge attached. Deleting a rule leaves its edges with a red Pick a rule chip, and such an edge never runs until you pick a rule for it.
Inputs
Value the rules compare, usually wired from an earlier node’s output such as a winner’s framework, a score or a count. Key: VALUE.
Every rule the value holds sends the flow down its edges. Each edge leaving the Router belongs to one rule or to Otherwise. Flow variables aren’t accepted. Values come from VALUE. Key: RULES.
Outputs
The branches the run took, comma-separated - a rule’s value for an “equal to” rule, its condition otherwise - or Otherwise. Key: BRANCH.
JSON config
Machine-readable node interface for automation and advanced usage.