
In Flow Core, Exit does not refer to just one concept.
- The core Exit: the terminal node in a Flow graph, which also defines the boundary of a return point when used inside a subgraph.
- The FSM Exit: the exit phase of a state, used to place instructions that should run when leaving the state, or to execute an “exit entry” when the state is in Graph mode.
- Other things that are also named “Exit”: for example, the UI Pointer Exit event or the Exit output of a Time Window. These are not the Exit node itself.
The next two meanings are the ones that matter most, because they represent the two core Exit concepts in Flow Core.
The Exit node
The Exit node is essentially an explicit boundary that means “this branch ends here.”
- When created, it has only one input port, In, and no output port. Its default comment is “Exit point for this graph.”
- It is not the same as Abort. Abort means actively interrupting an entire chain, while Exit means the current path has reached its normal end. During runtime compilation, the Next of an Exit node is set to Invalid, which means it has no successor node.
- When execution reaches an Exit, the debug result is recorded as Exit, and the current path stops there. If there are still pending branches, the runtime will continue executing them. Reaching one Exit does not kill all parallel or queued paths.
In one sentence: Exit is closer to “return from this branch” than to “panic stop.”
Mechanism
The most important role of Exit is that it serves as the output contract of a Sub Flow Graph.
- A subgraph node scans all Enter and Exit nodes inside the subgraph and automatically generates the corresponding external input and output ports.
- The names of these ports come directly from the titles of the Enter and Exit nodes inside the subgraph. In other words, renaming an Exit node is effectively the same as renaming the output port that the parent graph sees.
- At runtime, each Exit inside the subgraph is assigned an index first, and the system then builds a mapping from subgraph exit index to parent output port index. When the subgraph finishes, the matched Exit determines which output port is activated in the parent graph.
- If the subgraph has no Exit, or if the parent graph does not provide the corresponding output port, the result will usually fall back to Invalid, and a warning will be issued.
So inside a subgraph, Exit is not just an optional end marker. It defines the interface by which the subgraph exposes its result to the outside.
UI