// guides · n8n error index

n8n "Model output doesn't fit required format": 35 tests, fixed

Why the n8n Structured Output Parser fails: the hidden output wrapper, required fields, misleading empty response error, Auto-Fix. Tested on n8n 2.43.7.

Updated 2026-10-25 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. How we tested, and what is real

    We ran 35 executions on n8n 2.43.7 with n8n execute: the Basic LLM Chain (version 1.9) and the AI Agent (version 3.1) with Require Specific Output Format on, the Structured Output Parser (version 1.3) and the OpenAI Chat Model (version 1.3). To get exactly the bad replies real models sometimes give (prose around the JSON, cut-off JSON, a wrong type), we pointed the OpenAI credential's Base URL at a small local stand-in that returns fixed texts. So the model's replies are scripted; n8n's parsing, prompts and error texts are real.

  2. n8n wraps your schema in "output"

    The format instructions n8n sends to the model ask for {"output": your schema}, mark every example field as required, set additionalProperties: false and say to include the markdown code fence. A good reply lands at $json.output.name, not $json.name. A fenced reply parsed fine.

  3. "Model output doesn't fit required format": the reply is not valid for the schema

    We got this for prose around the JSON, cut-off JSON, a wrong type ("thirty" for a number), a missing field, null, an array instead of an object, single quotes and a plain sentence. The error never says which. Turn Require Specific Output Format off once, run it, and read $json.text to see the raw reply.

  4. Every field in a JSON example is required

    With Generate From JSON Example, a missing field or a null failed the run. If a field can be empty, use Define using JSON Schema, put only the must-have fields in required and allow null with "type": ["number", "null"]. Extra fields the model adds are dropped without a warning, so add every field you want to keep to the schema.

  5. "empty response" when the reply is not empty

    In the Basic LLM Chain, a correct object without the output wrapper gave The AI model returned an empty response to the Structured Output Parser. A really empty reply gives the same text. In the AI Agent the unwrapped object worked; there, the same error appeared when the model called n8n's format_final_json_response tool with cut-off arguments. If you write your own prompt, ask for the output wrapper explicitly.

  6. One bad reply fails the whole batch

    With 2 items, one good and one cut off, the node failed and the good result was lost. With Settings > On Error > Continue (regular output), the good items parsed and the bad one came out as {"error": "Model output doesn't fit required format"}. Route those with an If node and retry them.

  7. Auto-Fix Format: needs a model, and in our run the Responses API off

    With Auto-Fix Format on and no model connected to the parser, we only got Error in sub-node Structured Output Parser. With a model connected and Use Responses API on (the default in the OpenAI Chat Model 1.3), n8n did send a retry and our stand-in answered with valid JSON, but the node still failed. With Use Responses API off, the same retry worked. We did not find the cause, so treat this as one test, not a rule.

  8. Cut-off JSON means the reply was too long

    Cut-off JSON gave the same generic error; the real reason, Unexpected end of JSON input, only appeared in the Auto-Fix retry prompt. Raise the model's maximum tokens or ask for fewer fields.

All test results

We ran 35 executions; some rows below group several. Left: what the model replied. Right: what n8n did (real). The replies came from our OpenAI stand-in (scripted, see the first step).

TestResult
Model replies {"output":{"name":"Ann","age":30}} (schema from the JSON example {"name":"Ann","age":30})Worked. Result at $json.output.name
Same reply inside a ```json code fenceWorked
"Sure! Here is the JSON: {...} Let me know if..." (prose around the JSON)Model output doesn't fit required format
JSON cut off halfway (reply hit the token limit)Model output doesn't fit required format; the real reason Unexpected end of JSON input only shows in the Auto-Fix retry prompt
age sent as "thirty"Model output doesn't fit required format
age missingSame error: every field of a JSON example is required
age set to nullSame error: null is not allowed unless the schema says so
Extra field city in the replyWorked, but city was silently dropped (also with a manual JSON Schema without additionalProperties)
An array of two objects when the example is one objectModel output doesn't fit required format
Single-quoted pseudo JSONModel output doesn't fit required format
A plain sentenceModel output doesn't fit required format
Correct object but without the output wrapper: {"name":"Ann","age":30}Misleading: The AI model returned an empty response to the Structured Output Parser
Empty replyThe AI model returned an empty response to the Structured Output Parser
Manual JSON Schema with required: wrong type, missing field, nullModel output doesn't fit required format each time
Require Specific Output Format on, but no parser connectedNo error; plain $json.text
Require Specific Output Format off, parser connectedParser ignored; plain $json.text
2 items: one good reply, one cut offThe whole node failed and the good item's result was lost too
On Error: Continue (regular output), 3 items good / cut off / goodItems 1 and 3 parsed; item 2 came out as {"error": "Model output doesn't fit required format"}
Auto-Fix Format on, model connected to the parser, Use Responses API on (default)n8n sent a retry with the parse error and our stand-in returned valid JSON, but the node still failed with Model output doesn't fit required format. Cause not isolated
Same, with Use Responses API turned off in the OpenAI Chat ModelAuto-Fix worked: the retry was parsed
Chat Completions (Responses API off) without Auto-FixSame results as with the Responses API: good reply ok, cut-off reply fails
Auto-Fix on but no model connected to the parserOnly Error in sub-node Structured Output Parser
AI Agent v3.1 + parser: good reply, fenced replyWorked
AI Agent: object without the output wrapperWorked here (the agent accepted it, unlike the Basic LLM Chain)
AI Agent: prose, cut-off JSON, wrong typeModel output doesn't fit required format
AI Agent: model calls the format_final_json_response tool n8n adds, with valid JSONWorked
AI Agent: that tool called with cut-off argumentsThe AI model returned an empty response to the Structured Output Parser

Checklist

Good to know

What we did not test

Real OpenAI or other model providers (all replies came from our stand-in), why Auto-Fix failed with the Responses API on, the Information Extractor node, the Item List Output Parser, a custom Auto-Fix prompt, streaming and the Chat Trigger, and whether a lower temperature or a stronger model reduces these errors.

FAQ

What does "Model output doesn't fit required format" mean in n8n?

The model reply could not be parsed against your Structured Output Parser schema: prose around the JSON, cut-off JSON, a wrong type, a missing field or null. Turn Require Specific Output Format off once to see the raw reply in $json.text.

Why does n8n say "The AI model returned an empty response to the Structured Output Parser"?

The reply was empty, or in the Basic LLM Chain the JSON was not wrapped in {"output": ...}, which n8n expects. In our tests a correct but unwrapped object gave this error.

Why is my Structured Output Parser result under output?

n8n wraps your schema in an output property. Read the fields at $json.output.fieldName.

How do I make a field optional in the n8n Structured Output Parser?

A JSON example makes every field required. Use Define using JSON Schema, leave the field out of required, and allow null with "type": ["string", "null"].

Why are some fields missing from the parser output?

Fields the model added that are not in your schema are dropped without a warning. Add them to the schema.

Why doesn't Auto-Fix Format fix the error?

It needs its own chat model connected to the parser. In our run it also failed with Use Responses API on in the OpenAI Chat Model and worked with it off.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.