---
title: Auto-fixing Output Parser
description: Wraps another output parser and retries with a model when the output fails to parse
---

Wrap another output parser so a model repairs replies that fail to parse, instead of the run failing.

## 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](/nodes/builtin/ai/aidependencies/outputparser/structuredoutputparser/)) 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

* 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

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

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](/nodes/builtin/ai/aiagents/toolsagentnode/), [Q\&A Agent](/nodes/builtin/ai/aiagents/qanode/), [RAG Agent](/nodes/builtin/ai/aiagents/ragnode/), [Basic LLM Chain](/nodes/builtin/ai/aiagents/basicllmchainnode/), [Information Extractor](/nodes/builtin/ai/aiagents/informationextractornode/)
* **Base Parser** slot of [Auto-fixing Output Parser](/nodes/builtin/ai/aidependencies/outputparser/autofixingoutputparser/)

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

* **Model**: any chat model node, such as [OpenAI](/nodes/builtin/ai/aidependencies/llm/openai/) or [Anthropic](/nodes/builtin/ai/aidependencies/llm/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](/nodes/builtin/ai/aidependencies/outputparser/structuredoutputparser/) or [Item List Output Parser](/nodes/builtin/ai/aidependencies/outputparser/itemlistoutputparser/).

## Example workflow

1. [Get Selected Text](/nodes/extension/getselectedtext/) reads a highlighted job post, with **Output field name** `text`.
2. [Basic LLM Chain](/nodes/builtin/ai/aiagents/basicllmchainnode/) with **Prompt** `Extract the job details from: {{ $input.text }}`, and an [Ollama](/nodes/builtin/ai/aidependencies/llm/ollama/) model on its **Model** slot.
3. Auto-fixing Output Parser connected to the **Output Parser** slot of Basic LLM Chain.
4. On Auto-fixing Output Parser, connect a [Structured Output Parser](/nodes/builtin/ai/aidependencies/outputparser/structuredoutputparser/) to **Base Parser** with **JSON Output Example** `{ "title": "Designer", "company": "Acme", "remote": true }`, and an [OpenAI](/nodes/builtin/ai/aidependencies/llm/openai/) model to **Model**.

The local model does the work; OpenAI is only called when its reply needs repair.

## 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](/nodes/builtin/ai/aidependencies/outputparser/structuredoutputparser/) or [Item List Output Parser](/nodes/builtin/ai/aidependencies/outputparser/itemlistoutputparser/) 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

* [Structured Output Parser](/nodes/builtin/ai/aidependencies/outputparser/structuredoutputparser/): the usual base parser.
* [Item List Output Parser](/nodes/builtin/ai/aidependencies/outputparser/itemlistoutputparser/): a base parser for simple lists.
* [Basic LLM Chain](/nodes/builtin/ai/aiagents/basicllmchainnode/): one prompt, one parsed answer.
* [Tools Agent](/nodes/builtin/ai/aiagents/toolsagentnode/): an agent that also accepts an output parser.