> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured/common-issues.md).

# Common issues with Structured Output Parser in Duaer

Common Structured Output Parser issues in Duaer: connecting it, format mismatches, empty responses, and required fields.
## Expressions resolve to the first item <a href="#processing-parameters" id="processing-parameters"></a>

Structured Output Parser is a sub-node. Most nodes resolve an expression once per input item; Duaer calls a sub-node with the first item only. Given five names, {{ $json.name }} is always the first name.

To use a different value per item, put the expression in the root node (such as the AI Agent prompt), or run Loop Over Items first so each run gets one item.

## Connect it to an AI node <a href="#adding-the-structured-output-parser-node-to-ai-nodes" id="adding-the-structured-output-parser-node-to-ai-nodes"></a>

Turn on Require Specific Output Format in AI Agent or Basic LLM Chain. An Output Parser input appears under the node; connect Structured Output Parser there.

## Model output doesn't fit required format <a href="#model-output-doesnt-fit-required-format" id="model-output-doesnt-fit-required-format"></a>

The model returned invalid JSON or JSON that does not match the schema. You can:

- Turn on Auto-Fix Format so a mismatch triggers one more model call to fix it.
- Simplify the schema with fewer fields and less nesting.
- Set On Error to Continue in the root node Settings so one bad item does not stop the digital organization.

## The AI model returned an empty response to the Structured Output Parser <a href="#the-ai-model-returned-an-empty-response" id="the-ai-model-returned-an-empty-response"></a>

The model usually ran out of output tokens before writing the structured result. Shorten the prompt, raise the model’s output limit, or simplify the schema.

## Every field is required <a href="#all-properties-are-required" id="all-properties-are-required"></a>

With Schema Type set to Generate From JSON Example, every field in the example is required. For optional fields, use Define using JSON Schema and list only the mandatory ones under required.

## Format AI Agent output <a href="#structuring-output-from-agents" id="structuring-output-from-agents"></a>

Structured Output Parser shapes the final output only, not intermediate steps. For a fixed format in between, put an example or schema in the AI Agent System Message.

If parsing inside AI Agent keeps failing, let the agent answer freely, then pass the answer to a [Basic LLM Chain](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm.md) with the parser attached.
## Questions

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

In the Duaer Structured Output Parser, set Schema Type to Define using JSON Schema and list only mandatory fields under required.

