Skip to content

Merge

Overview

The merge node collects outputs from multiple upstream branches and combines them into a single JSON envelope, making them available as one value to downstream nodes. Use it whenever a workflow splits into parallel branches (e.g. two parallel lens nodes or battle_execute + vote_collector) and the results must be reunited before a downstream step. The merge behavior is controlled by the mode field: combine deep-merges objects by key, zip pairs array items by index, append concatenates arrays, and outer_join matches records on a shared key field. No credentials are required; the node operates purely on in-memory execution state.

Configuration

FieldTypeRequiredDescription
modeenumYesHow the multiple upstream inputs are combined. combine merges objects by key (last writer wins on key collisions). zip pairs items positionally — output length equals the shorter input. append concatenates arrays in arrival order. outer_join matches records across inputs using the value of mergeKey.
mergeKeystringNoThe field name used to match records when mode is outer_join (e.g. id or email). Ignored for all other modes. Referencing a key that exists in only one input produces empty matches rather than an error.
strategyenumNoEdge-level override for how multiple values arriving on the same parameter label are resolved before the node-level mode is applied. Options: last_write_wins (default), concat (newline-joined), array (JS array), json_object (keyed by source node ID). When omitted, the run-level default last_write_wins applies.

Inputs

PortTypeDescription
input_aanyFirst upstream branch. Accepts any IO type — text, json, array, object, battle_result, lens_result, etc.
input_banySecond upstream branch. Additional input ports are created automatically for each incoming edge — there is no fixed upper limit.
input_nanyNth upstream branch. Every inbound edge wires into the merge evaluation; the node waits for all connected upstream nodes to complete before executing.

Outputs

PortTypeDescription
mergedarrayThe combined result set produced by the selected merge mode. Downstream nodes typically reference $.merged to access the unified payload.
outputjsonFull output envelope containing the merged value alongside standard execution metadata. Use this port when the downstream node expects a plain JSON object rather than an array.

Example

json
{
  "nodeType": "merge",
  "config": {
    "mode": "combine",
    "strategy": "json_object"
  }
}