Combining Inputs

Estimated reading time: 1 minute

The join function node combines two different inputs into a single output. This node combines outputs from multiple flows into a single message.

Create the Flow

To make a flow that combines two different inputs:

  1. Connect two input sources, such as Inject nodes, to a Join node and a Debug node. The following screenshot shows the final result:

  2. Double-click each Inject node and select string from the drop-down menu. For each node, enter any message that you want to combine with the other. Click Done.

  3. Double-click the Join node and select manual mode from the drop-down menu.

    Field information:

    Mode - Automatic mode makes assumptions about your flow, manual mode lets you configure settings specific to your flow.

    Combine each - Sets the msg property to combine. It is typically msg.payload..

    to create - Sets the data type for the output: a String, an Array, a key/value Object, or a merged Object.

    • joined using - Specific to String outputs. Sets the character to join the strings on. \n is a newline character that appears at the end of messages, this is ideal for most cases.
    • using - Specific to key/value Objects. Sets the part of the msg object to serve as the property key for the output object.

    After a fixed number of messages - Sets the amount of messages for the join node to receive before sending the combined output.

    After a timeout following the first message - Sets the amount of time (in seconds) to wait for messages after receiving the first one before sending the combined output.

    Join nodes will not send a message unless the msg.complete property is set. If needed, you can always set this property to true with a Function node.

  4. For this example, enter 2 for the After a fixed number of messages field. Click Done.
  5. Click both buttons to the left of the Inject nodes to view the output in the debug tab at the bottom of the flow screen.