Output Parser Structured

Parse LLM output into a structured JSON schema. No $ref in schema — use inline definitions.

Written By pvdyck

Last updated 21 minutes ago

Output Parser Structured

The Output Parser Structured node forces an LLM's output to conform to a JSON schema, producing reliable structured data for downstream nodes.

How It Works

You define a JSON Schema, and the node instructs the LLM to return output matching that schema. If the output doesn't conform, the parser can auto-fix by re-prompting the model.

Parameters

ParameterDescription
Schema TypeHow to define the output schema. Options include providing a full JSON Schema definition or specifying fields based on a JSON example.
JSON SchemaA JSON Schema object defining the expected output structure (types, properties, required fields).
Example (Optional)A sample JSON output to help the LLM understand the expected format.
Auto-FixWhen enabled, re-prompts the model if the output doesn't match the schema, sending the parsing error back for correction.

Schema Example

{  "type": "object",  "properties": {    "name": { "type": "string", "description": "Full name of the person" },    "score": { "type": "number", "description": "Relevance score from 0 to 100" },    "tags": {      "type": "array",      "items": { "type": "string" },      "description": "List of relevant tags"    }  },  "required": ["name", "score"]}

Connects To

Parent NodeDescription
AgentStructures the agent's final output (V2.1+).
Chain LLMStructures generated text output.
Information ExtractorAdditional validation on extracted data.

Limitations

  • No $ref in JSON schema — All definitions must be inline. Do not use JSON Schema $ref references.
  • Complex nested schemas may require a more capable model (e.g., GPT-4o, Claude Sonnet).
  • Very large schemas increase prompt size and token cost.

Tips

  • Add description fields to every property — they significantly improve output quality.
  • Provide an Example when the schema is complex; it helps the model understand the expected format.
  • Use required to ensure critical fields are always present.
  • Keep schemas as simple as possible — fewer properties means more reliable parsing.
  • Enable Auto-Fix for production workflows where consistency matters.

Related