Model output doesn't fit required format - Structured Output Parser

I’m using Output Parser in my AI Agent.

I have Auto Fixing enabled and I also kept the Retry On Fail option enabled in the Node AI Agent.

However, even with all these parameters enabled, I still occasionally receive the error:
“model output doesn’t fit required format”.

I found the posts below pointing out similar problems:

  1. Tool bot error with structured output parser even that a retry was successful

  1. JSON Output Parser - #8 by nso

In post 1. it was said that the problem was solved in current versions, but I still receive the error.

In Post 2. it was recommended to use Output Parser with LLM Chain and not in the AI ​​Agent.

What is N8N’s guideline on this?
Should we not use Output Parser with AI Agent, is it still unstable?

Information on your n8n setup

  • **n8n version: 1.88.0

Hi,

My 2 cents is to go with a basic LLM chain and a structured output parser. It just works.

Reg
J

Hello @maxT and @ria any updates on this?

Thank you in advance

Thaks @jcuypers,

That’s what i’m doing right now, but would like to know if it improved or not.

Hi, in my case the problem was that if agent had wrong format output on the first try, then the whole request failed even if it corrected the output on the retry. Any correct retry was ignored and there was next until max number of retries and whole output was failed. They fixed that. There is no guarantee that an agent would prepare the output in correct format. That depends on the prompt and the LLM model you use. IMO it’s n8n independent issue. The best you can do is take it into account and 1) simplyfy the output so it’s easier to prepare it valid 2) experiment with the prompt so the agent has straightforward criteria to build the output, and 3) retry failed attempts and monitor your agent success ratio so it doesn’t burn to much tokens failing.

That’s weird! In the same process, I will report an error in the structured output of agent, but my colleague can output it correctly when running it. …