inject
Sends one message with a fixed payload each time you click its ▶ icon while the editor is connected to the board.
Properties
- payload type —
bool,numberorstring. Defaultbool. The output's type follows it, so the editor checks the wire against the input it feeds (see Wiring). - value — the value to send, read as the payload type (see
Typed values). Default
true.
Wiring
Input — none. inject is a source.
Output — a message with payload set to the value and topic set to an empty string.
Behavior
The ▶ icon and the rest of the node are separate click targets. The ▶ fires the node. A click anywhere else on the node opens its property panel, connected or not.
Each click sends one message. inject never fires on its own, neither on a schedule nor when the flow starts, so a
flow whose only sources are inject nodes does nothing until you click one. To send a message when the flow starts,
use startup. To send one repeatedly, use timer.
Errors
- The editor isn't connected. The console shows
[inject: connect to a device first -- clicking only fires while live]and nothing is sent. - The value isn't a number, with payload type
number. The deploy goes through; the click fails on the board with a[NODE_ERROR]naming this node andinject value 'abc' is not a valid number. See Reading a node error. - A node error in this node's chain stops the chain. See Reading a node error.