Link

The Link In and Link Out nodes are used to help Node-RED developers to organize their flows to make them easier to understand. The Link nodes can be used to connect two sets of Nodes but the connection is only shown when one of the nodes is selected. This allows developers to group nodes together that complete a specific function. The Link node will connect two groups together but visually it isn't apparent until one of the nodes is selected.

Examples

Connecting two groups of nodes

Node Documentation

Create virtual wires between flows.

Details

The node can be connected to any link out node that exists on any tab. Once connected, they behave as if they were wired together.

The wires between link nodes are only displayed when a link node is selected. If there are any wires to other tabs, a virtual node is shown that can be clicked on to jump to the appropriate tab.

Note: Links cannot be created going into, or out of, a subflow.

Create virtual wires between flows.

Details

This node can be configured to either send messages to all link in nodes it is connected to, or to send a response back to the link call node that triggered the flow.

When in 'send to all' mode, the wires between link nodes are only displayed when the node is selected. If there are any wires to other tabs, a virtual node is shown that can be clicked on to jump to the appropriate tab.

Note: Links cannot be created going into, or out of, a subflow.

Calls a flow that starts with a link in node and passes on the response.

Inputs

targetstring
When the option Link Type is set to "Dynamic target", set msg.target to the name of the link in node you wish to call.

Details

This node can be connected to a link in node that exists on any tab. The flow connected to that node must end with a link out node configured in 'return' mode.

When this node receives a message, it is passed to the connected link in node. It then waits for a response which it then sends on.

If no response is received within the configured timeout, default 30 seconds, the node will log an error that can be caught using the catch node.

When the option Link Type is set to "Dynamic target" msg.target can be used to call a link in by name or id.

  • If there is a link in nodes with the same id, it will be called
  • If there are two or more link in nodes with the same name, an error will be raised
  • A link call cannot call a link in node inside a subflow

link out