DocsConceptsSub-graphs
Sub-graphs
Functions, Macros and collapsed graphs: the three ways to reuse and organize logic into a sub-graph.
Functions
A Function is a named, reusable sub-graph you can call from anywhere in the flow (like
a subroutine).
- Press the + next to "Functions" in My Blueprint. A new function is created
with its own graph already seeded with two nodes: Input (entry point, with your
parameters) and Output (with your return values), joined by an execution wire. It
opens in a new tab and starts in rename mode.
- To add parameters (to the Input node) or returns (to the Output node), two
ways: (a) select the Input/Output node and use the pin editor in the Properties panel (+ to
add, inline rename, type via dropdown, × to delete), or (b) drag a wire from any pin on the
canvas and drop it directly on the Input/Output node — it automatically creates a matching
parameter/return, already wired.
- To call it: in My Blueprint, the icon next to the function's name inserts a
Call node in the active graph; or type its name in the palette (Space)
and pick the "Call" entry. The Call node always reflects the function's current
parameters/returns — if you edit its pins afterward, all its calls update themselves.
A function can return values: any data pin you add to the Output node becomes a data
output on the Call. And it has its own variable scope — see the
Variables page.
Macros
Created the same way as Functions (the + button next to "Macros" in My
Blueprint), with the same Input/Output node pair, the same pin editor and the same Call node.
Note
In this version, Functions and Macros run in exactly the same way: both are a call to
a sub-graph with a single output path ("Then"). The future design idea is for a
Macro to "expand" inline in the flow and be able to have several execution
outputs, but that behavioral difference isn't implemented yet — don't assume it.
The practical difference today is only: (1) it's a separate list in My Blueprint, to
organize your sub-graphs by intent; and (2) a Macro has no local variables —
promoting a pin to a variable inside a Macro always creates a global variable, unlike a Function.
Collapsed graphs
Select two or more nodes (not comments) and press G: LIA
creates a new sub-graph (hidden, unnamed) with the selected nodes inside, adds its own Input/
Output tunnels, converts any wire that crossed the selection boundary into a named parameter
or return, and leaves a single "Group" node in your original graph that acts as a
real Call into that sub-graph.
- Double-click the Group node to enter and view/edit its contents; a breadcrumb appears
at the top-left to go back to the parent graph.
- Double-click its title to rename it.
- Unlike a Function or Macro, a collapsed group doesn't show up in My
Blueprint's lists — it's anonymous and local to the graph where you created it,
can't be called by name from elsewhere, and deleting the Group node also deletes its
sub-graph (and any nested group inside it).
Caution
There's no "Expand" action yet to undo a collapse and return the nodes to
their original graph. If you make a mistake, use Ctrl+Z right
after, or enter the group and rebuild the nodes by hand.