π Activate flow from any
How you tell ComfyUI what order to run things
- Trigger
- Flow
ComfyUI decides execution order by following data wires: a node runs when its inputs are ready. That's a beautiful model 95% of the time, and a complete pain the other 5%, when you have nodes that must run before other nodes but share no data at all. FlowNodes' answer is "flow" - a fake connection that only exists to force an order - and this node, "π Activate flow from any," is where a flow starts.
The mechanism is almost comically simple. The code:
def node(self, **kwargs):
return (None,) # Flow is just a hack to get the executions in the wanted order.
A flow is a FLOW-typed value that is always None. The value is meaningless; the wire is the point. When you connect a flow wire from one node's Flow output to another node's Flow input, ComfyUI sees a data dependency and schedules them in that order. You're manufacturing a dependency that the actual data doesn't have.
What this node does
It produces a Flow output and asks for almost nothing. The one optional input is Trigger, typed * - connect anything you like (or nothing). If you do connect something, the flow only starts once that upstream value exists, which is a neat way to anchor "start here" to some real condition like a model being loaded. Its input is optional precisely so you can also use it as a bare starting point: no wires in, one flow out, and everything downstream of that flow wire runs in sequence.
The README frames the two uses of a flow:
- Feed the flow into a node's optional
Flowinput - the function nodes (Execute Python, Generic operation, Console print, Stack parameters) all carry one - to make that node run at a specific point. - Feed it into the π Merge flow (bottleneck) node to lock ordering and, crucially, to make a repeated flow repeat - pair it with a repeater node (the classic example is from pythongosssss's ComfyUI-Custom-Scripts) and you get a loop.
Why this is worth learning
Flow is the difference between "the graph happens to work" and "the graph does what I intend." The canonical FlowNodes example is a counter: it counts up one per run, and only works because nodes execute in a deliberate order rather than whatever order the cache happens to pick. The KB's own write-up on ComfyUI plumbing calls the caching engine "aggressive" - it identifies output nodes and works backward, skipping anything it thinks didn't change. Flow wires are how you beat that when your logic genuinely cares about sequence. It's the same instinct as a context bus, but for order rather than bundling.
Install
Part of the FlowNodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/gitmylo/FlowNodes
# restart ComfyUI
or ComfyUI Manager β search FlowNodes β install. No Python dependencies, no model files. The pack is WIP - the flow styling it mentions in the README ("screenshot was taken before flow nodes got styled") is a sign of how young this is.
Troubleshooting
- "I connected a flow but nothing changed order" - check which node you connected it to. Only nodes with a
Flowinput participate; a flow wire into a stock KSampler goes nowhere because the socket doesn't exist. - Node won't accept the wire - the socket type is
FLOW, which only matches otherFLOWoutputs. TheTriggerinput on this node is the exception: it's*and accepts anything. - Flow into a loop feels infinite - that's the intended repeater pattern, but a flow merge placed inside the loop is what keeps it from being a runaway. Read the Flow-merge article before you build loops.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| Triggeropt | * | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Flow | FLOW | β |