knoten / builtin / ai / aidependencies / outputparser
Auto-fixing Output Parser
Wraps another output parser and retries with a model when the output fails to parse
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Wrap another output parser so a model repairs replies that fail to parse, instead of the run failing.
What it does
Section titled “What it does”Auto-fixing Output Parser is not a step on its own: it has no output port and never runs by itself. You plug it into the Output Parser slot of an AI node, in place of the parser you would normally use.
It needs two nodes of its own: a base parser (for example Structured Output Parser) on Base Parser, and a chat model on Model. The base parser still decides the format. When a reply does not parse, this node sends the broken reply, the error and the format instructions to its model, asks for a corrected version, and parses that. It tries to fix a reply once; if the corrected reply also fails, the run fails.
When to use it
Section titled “When to use it”- The model usually returns good JSON but sometimes adds a stray sentence or a missing quote.
- You use a small or on-device model that is less reliable with formats.
- A failed run is costly, for example in a scheduled workflow nobody watches.
If the model gets the format wrong most of the time, choose a stronger model on the AI node instead: each fix is an extra model call.
Inputs and settings
Section titled “Inputs and settings”This node has no settings.
Everything is set on the two connected nodes: the format on the base parser, the fixing model on the model node.
Outputs
Section titled “Outputs”This node has no output port. It plugs into a slot on another node instead of passing items along.
- Output Parser slot of Tools Agent, Q&A Agent, RAG Agent, Basic LLM Chain, Information Extractor
- Base Parser slot of Auto-fixing Output Parser
The node it is plugged into returns the same data as with the base parser alone, for example an object in response.
Dependencies and credentials
Section titled “Dependencies and credentials”| Slot | Accepts | Connections |
|---|---|---|
| Model (erforderlich) | chat model | One node. |
| Base Parser (erforderlich) | output parser | One node. |
- Model: any chat model node, such as OpenAI or Anthropic. The model node holds the API key; this node has no credential of its own.
- Base Parser: the parser that defines the format, usually Structured Output Parser or Item List Output Parser.
Example workflow
Section titled “Example workflow”- Get Selected Text reads a highlighted job post, with Output field name
text. - Basic LLM Chain with Prompt
Extract the job details from: {{ $input.text }}, and an Ollama model on its Model slot. - Auto-fixing Output Parser connected to the Output Parser slot of Basic LLM Chain.
- On Auto-fixing Output Parser, connect a Structured Output Parser to Base Parser with JSON Output Example
{ "title": "Designer", "company": "Acme", "remote": true }, and an OpenAI model to Model.
The local model does the work; OpenAI is only called when its reply needs repair.
Common issues
Section titled “Common issues”- “Dependency model is required” or “Dependency parser is required”. Connect a chat model to Model and a parser to Base Parser. Both are required.
- “Model not found”. The model node on Model is not set up: open it and choose a model and its credential.
- “Base output parser not found”. The node on Base Parser gave no parser. Reconnect a Structured Output Parser or Item List Output Parser and check its settings.
- “Failed to parse” even with this node. The fixing model’s answer also failed. Simplify the base parser’s format, or connect a stronger model to Model.
Related nodes
Section titled “Related nodes”- Structured Output Parser: the usual base parser.
- Item List Output Parser: a base parser for simple lists.
- Basic LLM Chain: one prompt, one parsed answer.
- Tools Agent: an agent that also accepts an output parser.