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
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
Limitations
- No
$refin JSON schema — All definitions must be inline. Do not use JSON Schema$refreferences. - 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
descriptionfields 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
requiredto 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.