Assembling messages concatenates in declared port order
The node that joins several message sources into one list. Port order is the message order, and an unwired source adds nothing at all.
The rule
- A message-assembly node takes any number of dynamically declared message-typed inputs and flattens them into one message-typed output.
- The declared order of the inputs is the order of the messages.
- A connected list contributes each of its items in order; a connected single message contributes one item; an input that is unwired or carries no value contributes nothing; no placeholder is emitted for it.
What it means
The output order follows how the author declared the ports, not the order a
caller might expect from the port names or from wiring them up. Declare b
before a and wire both — b's messages come first regardless of what the
names suggest.
The other clause is the one a reader coming from a message-merging node would get wrong: an input port that is unwired, or carries no value, contributes nothing at all — no null placeholder takes its place in the output. A three-port assembly with the middle port unwired produces a two-item list, not a three-item list with a gap in it.
Example
Two ports declared in the order b, then a, each wired to one message:
{ "b": [{ "role": "user", "content": "second-declared-first" }], "a": [{ "role": "user", "content": "first-declared-second" }] }[{ "role": "user", "content": "second-declared-first" }, { "role": "user", "content": "first-declared-second" }]Three ports declared, the middle one left unwired:
{ "in_1": [{ "role": "user", "content": "a" }], "in_3": [{ "role": "user", "content": "c" }] }[{ "role": "user", "content": "a" }, { "role": "user", "content": "c" }]