Reuse and dynamic selection
The point of a Subflow is that it is written once and used many times. This page covers the three ways that reuse shows up in practice.
Reuse across Flows
The same Subflow can be used in any Flow, and more than once within the same Flow. There is one definition: editing the Subflow changes the behavior of every Subflow Node that references it.
That is the benefit and the risk in one sentence. Before changing a shared Subflow, check which Flows call it — a fix for one station will reach every station using the same Subflow.
Selecting a Subflow at runtime
Instead of naming a Subflow on the Node, a Subflow Node can take a String Variable holding a Subflow's UUID. Which Subflow runs is then decided while the Flow is running.
A Subflow's UUID appears in the URL while you have it open in the Subflow Editor:
http://192.168.3.1/subflow/0994c0e2-f43b-438f-87de-c3fcf1fd68cc/
Set the Variable from a Variable Node, or from a Dashboard with a Set Variable or Generic Button Widget.
This is how a single Flow serves several product variants: one Subflow per variant, and the operator picks the variant on a Dashboard.
When the Subflow is chosen through a Variable, RobFlow cannot know in advance how many outputs it will have, so you must set the Subflow Node's output count yourself. Choose enough outputs to cover every Subflow the Variable might name — a Subflow that triggers output 3 on a Node with only two outputs has nowhere to continue.
A Variable holding a UUID is opaque — nothing validates that the string still names an existing Subflow. If you delete a Subflow, search for its UUID before assuming nothing referenced it.
Nesting
A Subflow Node is only available in the main Flow, so a Subflow cannot call another Subflow. Composition happens in the main Flow: sequence several Subflow Nodes there rather than nesting.
In exchange, execution stays easy to follow — the main Flow shows every Subflow it will run, in order, on one canvas.
Exporting a Subflow
Exporting a Subflow bundles the entities it depends on, not just the Node graph:
- the Variables it references,
- its Modbus/TCP connections,
- its RobVision device connections,
- the Tool configurations it uses.
On import you resolve any collisions with what already exists on the target Robot, so importing a shared Subflow does not silently overwrite that Robot's own configuration.
The bundle carries connection definitions, not reachability. After importing on another Control Unit, check the Modbus and RobVision connections under Robot Configuration before running a Flow that uses them.
When to use a Subflow
Reach for one when:
- The same sequence appears in more than one place — a gripper open/close handshake, a home-and-verify routine.
- A section of a Flow has grown large enough that it obscures the overall structure.
- A behavior needs to vary per product or per station, selected through a Variable.
Do not reach for one when the sequence needs to run in parallel with something else — that has to stay in the main Flow. For grouping that is purely visual, a Documentation Group or a Reference Group may be what you actually want.