All nodes/AI/LLM

Messages

Assembles an array of messages (Messages) from several inputs. Only the number of Message input ports is set in the config. Any data input becomes a role=user message; if an incoming input is a Messages array, it is unpacked and inserted in place. Barrier: waits for all connected inputs.

Messages
Message 1Messages

Type in the graph: messages

An error branch can be enabled (expose_error_output) to handle failures on their own path.

Ports can be split into separate execution and data handles.

Try it

Minimal working workflow

Entry
Messages
Exit
  • Execute + Data
Press “Copy nodes”, open the editor and hit Ctrl+V on the canvas.

Runs as pasted

When to use it

This node assembles one conversation out of several inputs: a system instruction, a couple of question-answer examples, the history and the current question. Reach for it when the model needs a sequence of turns with different roles rather than a single one. A single turn is built by Message; if a plain string is enough, there is nothing to assemble — the LLM nodes accept it as a user turn. In an ordinary chat workflow the history arrives on its own: the LLM nodes have a “Use Chat History” toggle, and Chat History delivers it as a node.

How it works

The configuration holds only the number of ports — from 1 to 20, two by default. The ports are named Message 1, Message 2 and so on, and the result is assembled in port order, not in the order the branches happened to finish.

Every port accepts any value. A string or an object becomes a turn with role user; a ready message passes through unchanged; an array of messages is unpacked and spliced in place — which is how a whole history arrives over a single edge.

The node is a barrier: it waits for every connected port. Unconnected ports are simply skipped. If a port’s branch never ran — the untaken branch of an If, say — the barrier does not hang; there just is no message from that port.

Common mistakes

  • The LLM node sees only the last turn. LLM Response and Structured Output LLM take only the last message out of the array by default. To send the whole conversation, turn on “Use Chat History” on them. The AI Agent always takes the array whole.
  • The question is not last. The agent treats the last turn with role user as the prompt; if the array ends with a system or assistant turn, everything travels as context and no question is left. Put the current question in the last connected port.
  • Reducing the port count without removing the edges first. The extra ports disappear along with their inputs, the edges stay dangling, and the graph fails validation. Disconnect the edges first, then lower the counter.
  • Expecting the node to concatenate texts. The output is an array of turns with roles, not a single string. Joining texts into one paragraph is what a Template is for.

Inputs

PortWirePayloadNotes
Message 1msg_0Execute + Dataexecute_datamessage

Outputs

PortWirePayloadNotes
MessagesmessagesExecute + Dataexecute_datamessages

Configuration

FieldTypeDefaultDescription
Message portsport_countinteger2

Number of Message input ports

Shared fields

Every node has these three — the platform adds them, not the node author.

  • expose_error_output — When enabled, show an execution output to connect nodes that run if this step fails.
  • split_ports_in — Show separate execution and data input handles instead of one combined port.
  • split_ports_out — Show separate execution and data output handles instead of one combined port.