Some nodes need to share configuration. For example, the MQTT In and MQTT Out nodes share the configuration of the MQTT broker, allowing them to pool the connection. Configuration nodes are scoped globally by default, this means the state will be shared between flows.
A configuration node is defined in the same way as other nodes. There are two key differences:
categoryproperty is set to
<input>elements have ids of
In this example, the node acts as a simple container for the configuration - it has no actual runtime behaviour.
A common use of config nodes is to represent a shared connection to a remote
system. In that instance, the config node may also be responsible for creating
the connection and making it available to the nodes that use the config node. In
such cases, the config node should also handle the
to disconnect when the node is stopped.
Nodes register their use of config nodes by adding a property to the
array with the
type attribute set to the type of the config node.
As with other properties, the editor looks for an
<input> in the edit template
with an id of
node-input-<propertyname>. Unlike other properties, the editor
<input> element with a
<select> element populated with the
available instances of the config node, along with a button to open the config
node edit dialog.
The node can then use this property to access the config node within the runtime.