Skip to main content
Each node chooses which earlier outputs it receives with input_filter, and receives them in a form that depends on the node type.

Choosing inputs with input_filter

  • List node names. input means the workflow’s input messages.
  • Without input_filter, a node receives everything in memory so far.
  • The names are the names outputs are stored under: a node’s name, and for a referenced agent the agent.name from its own YAML (not the namespace/name reference).

What an agent receives

An agent’s role and instructions are its system prompt; the selected outputs arrive as the messages of the conversation. A JSON output from an earlier node arrives as JSON text; images and documents produced by a file download node arrive as media the model can see.

What a function node receives

A function node (any entry in function_nodes) turns its inputs into parameters:
  1. Each selected message is parsed as JSON. Messages that are not JSON (for example a plain-text workflow input) are skipped. The last selected message must be JSON, unless all the node’s parameters are prefilled.
  2. The parsed objects are merged, flat, in the order the nodes ran; a later key overwrites an earlier one.
  3. node_outputs is added: every parsed payload grouped by the node that produced it, { "<node>": [payload, …] }. A list, because a node can contribute several outputs (see ForEach).
  4. Variables are merged over the inputs.
  5. prefilled_params are applied last and always win.
So a function reading two upstream nodes can use either style:
Prefer node_outputs whenever a function reads more than one node. The flat merge silently overwrites fields that appear in both, such as id or status.

Worked example

With input_filter: [triage, load_customer], where triage returned {"category": "billing"} and load_customer returned {"customer": [{"id": "C-1", "plan": "Pro"}]}, and the run has variables: {"region": "EU"}, a function receives:

Prefilled parameters

prefilled_params fixes a function node’s arguments in the YAML:
Here datasource_id and query_id are fixed, while params comes from the output of customer_params. A common pattern is a small function that builds exactly the parameters the next node needs from variables and earlier outputs.

Turning variables into node inputs

Variables are plain values. When a node needs a structured argument, such as the params object of a query, add a function as the first step:
When a workflow starts with a function node, send JSON as the run’s input; "{}" is enough. A plain-text input is rejected by a function node.

What a node outputs