Resources · n8n integration

n8n Structured Output Parser nodeConfigure Structured Output Parser in n8n.

The n8n Structured Output Parser node turns a model's free text into a JSON object you can trust. You hand it a schema, it validates every response against that schema, and it retries once when the shape is wrong. Four parameters, one chat model to plug in, and downstream nodes stop guessing.

Verified Trustpilot reviews · AI, automation & growth agency

Why automate

What does the n8n Structured Output Parser node actually do?

The Structured Output Parser is a sub-node, meaning a node that never runs on its own: you attach it to an AI root node through the output parser port, and it shapes what that root node returns. Its job is narrow and useful. Instead of a paragraph of prose, the root node hands the rest of your workflow a JSON object whose fields you defined in advance, checked against a schema before anything downstream touches it.

Take a content pipeline. An AI Agent reads a raw brief and has to return a title, a hook, three hashtags and a target length. Without a parser you get a block of text and a regular expression to write. With default.jsonSchema filled in, the agent returns keys you can map straight into Google Sheets columns, one row per idea, no cleanup step in between.

Second case: routing. A support message goes through a chat model, which is the sub-node that actually talks to the provider, and the parser forces an answer shaped as a category, a priority and a short summary. An If node reads the category and sends urgent tickets to Slack while the rest go to a queue. The branch logic reads a field, not a sentence, so it stops breaking the day the model phrases things differently.

Third case: enrichment at scale. You loop over rows, ask a model hosted by OpenAI to classify each one, and turn Auto-Fix Format on so a malformed answer gets one more chance instead of failing the run. That second chance costs another model call, which the provider bills on its own terms.

When to prefer something else: n8n's own guidance is that structured parsing directly inside an agent is often unreliable. If your workflow uses an agent and the output has to be exact, pass the agent's answer to a separate LLM chain and parse it there. Results come out more consistent. And if you only need a specific shape for an intermediary step that feeds another AI tool, this node is the wrong tool: describe the response structure in the agent's System Message instead, with a schema or an example response as a template.

Known limits, worth knowing before you build. Expressions inside a sub-node always resolve to the first incoming item, so {{ $json.name }} returns the first name for all five items, not each in turn. The $refs syntax is not supported in Input Schema. The node is at version 1, and attaching it requires the Require Specific Output Format option to be enabled on the root node first. If you want a broader read before committing a stack, the n8n review covers what the platform does well and where it hurts.

Connections

What do you plug into it?

Cluster nodes work as a root node plus sub-nodes attached to its ports, one type of sub-node per port. This one sits on both sides: it consumes a chat model and it plugs into a root node.

Ports (what plugs in)

  • Chat Modelai_languageModelrequired

Output (what it plugs into)

  • Output Parserai_outputParser
01Chat ModelThe language model the parser calls when it has to repair an answer. It carries the provider credential, so nothing is authenticated on the parser itself.

The language model the parser calls when it has to repair an answer. It carries the provider credential, so nothing is authenticated on the parser itself.

Key parameters

  • Required : leave this port empty and the node cannot run.
  • OpenAI Chat Model or Anthropic Chat Model : the two most common picks when you already hold a key from either provider.
  • Google Gemini Chat Model or Ollama Chat Model : the second for a model running on your own machine.
Use cases
pick the same model family you use elsewhere in the workflow, so a schema that parses cleanly in testing keeps parsing cleanly in production.
02Output ParserThe port the parser hangs from. It shows up on the root node only after you enable Require Specific Output Format, then you click the attachment point to add this node.

The port the parser hangs from. It shows up on the root node only after you enable Require Specific Output Format, then you click the attachment point to add this node.

Key parameters

  • Required : a sub-node never executes alone, so an unattached parser does nothing.
  • AI Agent or Basic LLM Chain : the chain is the safer host when the shape has to hold.
  • AI Agent Tool or Auto-fixing Output Parser : the last one wraps this parser rather than replacing it.
Use cases
an agent that hands a validated object to an AI Agent Tool further down the chain.
Parameters

Which parameter defines the shape?

The Structured Output Parser node has 4 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.

01

JSON Example

jsonSchemaExample

What you see in n8n

Notes & use cases

Paste a sample response and n8n derives the schema from it. This is the fast path: you already know what the object should look like, so you describe it by showing it rather than by writing rules.

Key parameters

  • JSON Example : an example JSON object used to generate the schema.
Use cases
a first draft of a classification step, where you want a working object in two minutes and will tighten the rules later.
02

Input Schema

inputSchema

What you see in n8n

Notes & use cases

Here you supply the schema used for the function directly, rather than letting n8n infer one. Reach for it when a generated schema is too loose and you need the field types spelled out.

Key parameters

  • Input Schema : written in JSON Schema format; the $refs syntax is currently not supported, so inline every definition instead of pointing at it.
Use cases
an object with a nested list where each entry must carry the same typed keys before it lands in a database.
03

JSON Schema

jsonSchema

What you see in n8n

Notes & use cases

The strict option. Output is both structured and validated against what you write here, and the field is required, so an empty value blocks execution of the node.

Key parameters

  • JSON Schema : required, the schema the output is structured and validated against.
Use cases
an invoice summary where an amount has to be a number and a date has to be a date, because a wrong type downstream costs more than a failed run.
04

Auto-Fix Format

autoFix

What you see in n8n

Notes & use cases

Switch this on and a badly formed answer gets repaired instead of thrown away. n8n sends another call to the model, which the provider bills like any other, so it buys reliability rather than speed.

Key parameters

  • Auto-Fix Format : whether to automatically fix output that is not in the correct format.
  • Customize Retry Prompt : off, a default prompt handles the retry.
  • Custom Prompt : the retry template, which should include the {instructions}, {completion} and {error} placeholders.
Use cases
an overnight batch you would rather see finish with one extra call than stop at three in the morning.
Need help

Need help automating Structured Output Parser with n8n?

A person reads every message.

FAQ

Questions people ask next

01Is the Structured Output Parser node included in n8n?
Yes. It ships inside n8n's AI package, @n8n/n8n-nodes-langchain, which comes with n8n itself. There is nothing to install and no extra charge on the n8n side, whether you run n8n Cloud, the hosted offer, or a self-hosted instance under the Community Edition and its Sustainable Use license. A workflow behaves the same either way. The one cost that does exist sits with the model provider: OpenAI, Anthropic, Google or Mistral bill their own API calls under their own terms, and turning Auto-Fix Format on means one more of those calls when a response has to be repaired.
02What do you need to make it work?
Nothing to authenticate on this node. It has no credential and no Authentication selector, which is one less account to manage. What it does need is a chat model on its Chat Model port, and that sub-node carries the provider credential. It also has to be attached to a root node that accepts an output parser: enable Require Specific Output Format on the AI Agent, AI Agent Tool, Auto-fixing Output Parser or Basic LLM Chain, then click the output parser attachment point that appears and add this node there.
03What are the limits of the n8n Structured Output Parser node?
Three worth planning around. First, expressions behave differently in a sub-node: they always resolve to the first incoming item, so given five names, {{ $json.name }} returns the first one every time instead of each in turn. Second, the $refs syntax is currently not supported in the schema, so definitions have to be written inline. Third, the node structures the final output of an AI root node, not the intermediary output you pass to another AI tool or stage. The node is at version 1, and an older workflow may still show fewer options.
04What should you connect at minimum, and which sub-node is easiest to start with?
At minimum, one chat model on the Chat Model port and one root node to attach to. A chat model is the sub-node that talks to the provider; a port is the small connector under the node where a sub-node hangs. OpenAI Chat Model is the usual starting point because the credential is a single API key. On the root side, start with Basic LLM Chain rather than AI Agent: n8n's own guidance is that parsing directly inside an agent is often unreliable, and passing the agent's answer to a separate LLM chain gives more consistent results. Filling JSON Example first is faster than writing a schema by hand.
05n8n or Make for structured AI output?
It depends on where you want your data and how you want to pay. n8n can be self-hosted with Docker or npm, or used on n8n Cloud, and the workflow is identical in both cases, so prompts and model responses can stay on infrastructure you control. Make is hosted only, with no self-hosting option, and bills per operation, which is predictable when volume is stable and less so when a retry doubles a step. On visual logic, both draw the flow on a canvas. If your AI steps run in loops with retries, count the operations before deciding.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.