Where a node's values come from¶
A node function is called with one argument per thing it needs, and every one of them is declared somewhere you can see. There are two kinds.
Ports: what the graph carries¶
A port binds to a message name. Whatever last published that message is the value the node is called with, and the wiring follows from the name rather than from a line somebody drew.
with reading and setpoint as inputs and heat as an output.
Settings: constants of this node¶
A setting is a value that belongs to this node's code rather than to the graph: how many retries, which unit, how long to wait. It is typed into the node's Settings section, stored with the flow, and arrives as an argument like a port:
Because both arrive by name, a setting cannot share a name with a port — the node reports it rather than picking one.
Settings are part of the flow document, so changing one is an edit that gets published, not something that happens at runtime. A value that should change while the flow runs is a message, not a setting.
There is no global and no flow context. A constant several nodes need is a
node that provides it: one place it is set, an ordinary message out, and every
consumer visibly downstream of it.
Flow inputs: what arrives from outside¶
Some messages are not computed by any node in the flow — a dashboard control writes them, the API publishes them, a batch run passes them in. Declare those as the flow's inputs, with the value they start from:
Without that, the node reading setpoint waits for something nothing provides,
and the canvas says so. With it, the flow starts from 21.0 and whatever writes
the message afterwards takes over.
The canvas draws each one as a labelled endpoint feeding the nodes that read it, the same way it draws a dashboard tile or another flow — so a value never appears from nowhere. They are edited in the flow's own panel.
A batch flow's inputs are also its run parameters, and its outputs name what a run reports as its result; see Runs.
See also¶
- Flows, nodes and messages — how the graph is built from the names
- Keeping state in a flow — a value a node reads and writes
- Writing node code — the practical side