All nodes/AI/LLM

Structured Output LLM

Calls an LLM and returns the response strictly in JSON format according to a given schema (structured output). Used when you need typed output rather than free text. Requires an LLM via link_llm.

Structured Output LLM
LLMOutput
Message
System

Type in the graph: structured_output_llm

Exec

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
Structured Output LLM
LLM
Exit
  • Execute + Data
  • LLM
Press “Copy nodes”, open the editor and hit Ctrl+V on the canvas.

Runs as pasted

When to use it

Reach for this node when the model’s answer has to travel on as data rather than as text: splitting an email into fields, classifying a request, pulling out an amount and a date, producing a list of tags. The model must answer with an object matching your JSON Schema, so the next node receives a ready object instead of a string to parse. For free text in a chat use LLM Response; for a model that acts on its own use the AI Agent.

How it works

The schema goes in the “Structured output schema” field. Its fields are available downstream as {{ nodes.<id>.output.<field> }}, and the whole object travels along the edge. The default schema has a single string field result, so a freshly dropped node runs immediately; replace it with your own shape.

The top-level schema must be an object. An array or a scalar is wrapped automatically into an object with one value field, and the result then has to be read as {{ nodes.<id>.output.value }}.

Field descriptions are read by the model as instructions. One precise field description often does more than a paragraph in the system prompt.

The node does not stream: the answer arrives whole, once the model has finished it.

Common mistakes

  • The System port is wired but the prompt did not change. “System prompt source” defaults to “Template”, and a connected port is not read in that mode. Switch it to the connected System port, or to Auto.
  • Sending the object straight to Exit. The chat then shows JSON. If a human needs to read it, assemble the text with a Template node — or add a text field to the schema and let Exit show that.
  • An exotic schema. Not every model accepts pattern, format, oneOf/anyOf/allOf or deeply nested $ref. If the node fails saying no structured-output method worked, simplify the schema or change the model.
  • An empty result. The model returned a refusal instead of an object: check that the schema is an object at the top level and that the prompt really asks for those fields.

Inputs

PortWirePayloadNotes
LLMllmLLMlink_llm

LLM config from llm node (registry or workspace connection)

MessagemessageExecute + Dataexecute_datamessage

User message sent to the LLM

SystemsystemDatadata

System prompt override

Outputs

PortWirePayloadNotes
OutputoutputExecute + Dataexecute_dataobject

Configuration

FieldTypeDefaultDescription
Message Sourcemessage_sourcestringauto

auto -- use connected input if available, else template; connected -- always from edge; template -- always from template

Options: auto — Auto (connected input, else template), connected — Connected input, template — Template

User Message Templateuser_prompt_templatestring""

Used when source=template or no edge connected. Supports {{inputs.message}}, {{nodes.xxx.output.yyy}}

supports templates

System Prompt Sourcesystem_sourcestringtemplate

auto -- use connected system input if available, else template

Options: auto — Auto (connected System port, else template), connected — Connected System port, template — Template

System Promptsystem_promptstring""

System prompt template

supports templates

Structured Output Schemastructured_outputobject{"type":"object","properties":{"result":{"type":"string","description":"The m…

JSON Schema object the model must answer with; the top-level title is optional (it becomes the API tool name). Defaults to a single string 'result' field so a freshly dropped node runs — replace it with your shape.

Advanced
Use Chat Historyuse_chat_historybooleanfalse

Pass full chat history to LLM instead of only last message

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.

Ready-made examples using this node