Merge
Combine up to eight inputs into one JSON object keyed by port, when any or all have arrived.
- Data
- Since 0.2.0
- merge
- combine
- join
- object
- json
- data
Merge gathers up to eight data values into one JSON object, { "a": …, "b": … }, keyed by the input each value arrived on.
What it does#
Each input a to h keeps its newest value. When Merge emits, value carries an object with one key per cabled input that has a value, and trigger fires once. A data input takes one cable, so Merge is also how several sources meet in one place.
When to use it#
Use it to build a JSON context for an LLM chat, to log several values on one line, or to collect readings before a Convert template turns them into a sentence.
Ports#
| Port | Direction | Signal | Lanes |
|---|---|---|---|
a | Input | Data (any) | 1 |
b | Input | Data (any) | 1 |
c | Input | Data (any) | 1 |
d | Input | Data (any) | 1 |
e | Input | Data (any) | 1 |
f | Input | Data (any) | 1 |
g | Input | Data (any) | 1 |
h | Input | Data (any) | 1 |
value | Output | Data (json) | 1 |
trigger | Output | Data (trigger) | 1 |
Parameters#
| Parameter | Label | Range | Default | Unit | Scale | Notes |
|---|---|---|---|---|---|---|
when | When | 0 to 1 | 0 | linear | Emit on every new input, or only once every connected input has a value. Choices: 0 Any, 1 All. |
When (when)#
Any emits whenever any input changes, with whatever values have arrived so far. All waits until every cabled input has a value, then emits on each change after that.
Tips#
- Only cabled ports appear in the object; leave unused letters free.
- Use All when the downstream node needs every field, for example a template with several pointers.
See also#
Convert, LLM chat, Console log, Data cables.
Help patches
Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.
1. Two values, one object
beginner Teaches: when
Merge combines a number and a colour into one JSON object keyed by port once both have arrived.
Connections as text
- Cron tick output connected to Random “number” trigger input
- Cron tick output connected to Random “colour” trigger input
- Random “number” value output connected to Merge a input
- Random “colour” value output connected to Merge b input
- Merge value output connected to Console log value input
- When All waits until every cabled input has a value; Any emits on each arrival.
Related nodes
- Convert Convert a value to another datatype, optionally picking a field or formatting a string; failures go to error.
- LLM chat Ask Anthropic, OpenAI or Gemini with your own vault key through the completion endpoint; text or JSON out.
- Console log Write each incoming value to the Console panel with a level and label, rate-limited.