Build Route & Switch branches whose winning text or media value stays current through per-case returns, Result, List iterations, exposed App switches, and downstream Extract / Merge nodes.
Where: Flowgen → Add → Routing & Layout → Route & Switch
Key ideas
- Three inputs serve different jobs: Main input is the stream to pass by default. Check with accepts extra evidence such as QA. Pick by name is a text selector that can force a case from another node, an exposed group input, or a published App dropdown.
- Each route can return its own value: A normal case has a return input on the left and a door on the right. If nothing is connected to that case’s return, its door forwards the Main input; otherwise it forwards the case-specific text, image, video, audio, or other value.
- Result is the winning merge: result_out always means whichever door opened. Its wildcard socket can feed one downstream connection even when different cases return different media types.
- Override and conditions are one control: Auto lets ordered conditions decide. Selecting a case forces it. A wire on Pick by name takes control and locks the card selector so manual stale state cannot beat the wired value.
- Current runtime values survive repetition: List iterations resolve per-row Route overrides, per-case return ports, and Result without leaking the branch from a neighboring row. Transform connected downstream follows the actual winner and can expose a typed field or media URL.
Steps
- Connect the value that should continue through the decision to Main input.
- Connect QA, validation, or another evidence node to Check with when cases should inspect something other than the main stream.
- Add cases from narrowest to broadest. Edit each condition and name the case by outcome rather than by a generic number.
- For a normal route, optionally connect a case-specific value to that row’s return input; leave it empty when the main stream should pass through unchanged.
- Keep Otherwise last so unmatched values have an explicit fallback.
- For a bounded retry, change a case to Run again, choose an earlier anchor, and set the maximum from 1 to 5 instead of drawing a graph cycle.
- Leave Override on Auto for conditions, choose a case for a manual force, or wire/expose Pick by name when a node/App/list row should choose by case label or id.
- Connect Result to one downstream consumer when it should receive any winner; connect a specific case door only when the consumer belongs exclusively to that branch.
- When downstream shaping is required, connect Result to Extract / Merge. Confirm the panel says it follows the Router automatically, then create a correctly typed output.
- Test every case, Otherwise, override, media return type, and retry limit—including representative rows when the Route sits inside a List iteration.
Socket reference
- router_in / Main input — value passed when a case has no dedicated return.
- check_in / Check with — extra sources conditions can inspect.
- select_in / Pick by name — case id/label override.
- ret_<case> — value returned by one normal case.
- out_<case> — that case’s door.
- result_out / Result — whichever door opened.
Evaluation order
A valid Pick by name value forces its matching normal route. Otherwise cases evaluate from top to bottom and the first match wins. Otherwise is the final always-match fallback. The UI warns when an earlier broad case makes a later one unreachable.
List/App switch behavior
Expose Pick by name as a group input to produce a dropdown of the Route’s current cases in mini-app/published App surfaces. During a List iteration, each row’s override is isolated and media returns travel through exact runtime ports.
Transform handoff
Extract / Merge resolves the winning router value dynamically, labels the connection as a Router result, and recomputes when the winner changes. For media, create a typed image/video/audio output rather than relying on the neutral Value socket.
Tips
- Name cases with stable unique labels if they will be selected by an App or Items field.
- Prefer Result for a merged continuation and individual doors for branch-specific work.
- Normalize deeply nested evidence with Transform before writing several complicated Route conditions.
- Always include and test Otherwise.
Limitations and important notes
- A selector value that matches no current case does not invent a branch; conditions/fallback determine the result.
- Run again is capped and is not a general graph cycle.
- Different case return types make Result intentionally type-neutral; add Transform typed outputs when the next node needs a strict socket type.
Troubleshooting
The wrong case wins
Check ordered conditions and the Override/Pick by name value. Move narrower cases above broader matches and clear an unintended force.
The selector is locked
A node or exposed group/App control is wired to Pick by name. Change that source or disconnect it; the wire intentionally owns selection.
Result contains the main input instead of the generated branch value
Connect the generated value to that case’s return input. An empty return intentionally forwards Main input.
A media result fails to connect after Transform
Create a named Transform output with the concrete image/video/audio type and select the current URL/value; the main Transform Value socket is neutral.
One List row used another row’s branch
Verify the current source field is wired to Pick by name and rerun with current code. Row overrides and runtime media ports are isolated per iteration.
FAQ
Is Override a separate Manual mode?
No. Empty means Auto; a selected case is the force. A wired Pick by name uses the same underlying selection.
What is the difference between a door and Result?
A door exists for one case. Result is the single merged output for whichever case won.
Can cases return different media types?
Yes. Per-case doors reflect their return types; Result is neutral because its type can change with the winner.