Skip to main content

join

Join message sequences into arrays, objects, or concatenated strings.

Overview

The join node collects a sequence of messages and combines them into a single output message. It can build arrays, key-value objects, or concatenated strings. In auto mode it pairs with a preceding split node, while manual and reduce modes offer full control over how messages are accumulated.

Auto
Mode
Manual
Mode
Reduce
Mode
Timeout
Fallback

Properties

Property Type Default Description
mode string "auto" Join mode: "auto", "manual", or "reduce"
build string "array" Output type: "string", "array", "object", "buffer", "merged"
count number 0 Number of messages to collect before sending (0 = use msg.parts)
joiner string "," Joiner character when building strings
timeout number 0 Seconds to wait before sending incomplete group (0 = no timeout)
key string "topic" Property to use as key when building objects

Join Modes

Auto Mode

Pairs with a split node — uses msg.parts to reassemble

// split → process → join
// Automatically reassembles the
// original array/object/string
// using msg.parts metadata

Manual Mode

Collect N messages then output

// count: 5, build: "array"
// Collects 5 messages
// Outputs: [val1, val2, ... val5]

// msg.complete = true
// Forces early output

Reduce Mode

Apply a reducer expression across the sequence

// Like Array.reduce()
// Initial: 0
// Expression: $A + payload
// Accumulates sum across messages

Build as Object

Use msg.topic (or custom key) as property names

// key: "topic", count: 3
// msg1: topic="temp", payload=23
// msg2: topic="hum",  payload=65
// msg3: topic="pres", payload=1013
// → { temp:23, hum:65, pres:1013 }

Example: Collect and Average Sensor Readings

Collect 10 temperature readings into an array, then compute the average in a downstream function node.

// Join node configuration
{
  "mode": "manual",
  "build": "array",
  "count": 10,
  "timeout": 60
}

// 10 incoming messages over time:
// msg1.payload = 23.1
// msg2.payload = 23.4
// ...
// msg10.payload = 24.0

// Output (single message):
{
  "payload": [23.1, 23.4, 23.0, 22.8, 23.5, 24.1, 23.9, 24.5, 24.2, 24.0]
}

// Downstream function node:
// const avg = msg.payload.reduce((a,b) => a+b) / msg.payload.length;
// msg.payload = { "average": avg, "samples": msg.payload.length };

Example: Build JSON Object from Multiple Sources

Combine readings from three different sensor topics into a single JSON object for database storage.

// Join node configuration
{
  "mode": "manual",
  "build": "object",
  "count": 3,
  "key": "topic",
  "timeout": 10
}

// Three messages from different MQTT topics:
// msg1: topic="temperature", payload=23.5
// msg2: topic="humidity",    payload=65
// msg3: topic="pressure",    payload=1013.25

// Output (single combined message):
{
  "payload": {
    "temperature": 23.5,
    "humidity": 65,
    "pressure": 1013.25
  }
}

// If timeout (10s) expires before all 3 arrive,
// partial object is sent with available keys

Example: Concatenate Log Lines

Collect log entries and join them into a single string for batch upload.

// Join node configuration
{
  "mode": "manual",
  "build": "string",
  "count": 5,
  "joiner": "\n"
}

// 5 log messages arrive:
// msg1.payload = "[INFO] System started"
// msg2.payload = "[INFO] Connected to broker"
// msg3.payload = "[WARN] High memory usage"
// msg4.payload = "[INFO] Flow deployed"
// msg5.payload = "[INFO] Ready"

// Output:
{
  "payload": "[INFO] System started\n[INFO] Connected to broker\n[WARN] High memory usage\n[INFO] Flow deployed\n[INFO] Ready"
}

Common Use Cases

Sensor Fusion

Combine multiple sensor readings into a single data point

Batch Uploads

Collect N records before sending to a database or API

Data Windowing

Collect time-series samples for aggregation or analysis

Split/Join Pipelines

Reassemble sequences after per-item processing

Related Nodes