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

I have a tool bot with structured output parser, it has error output enabled and three retries set, like this:

Ocassionally it fails with the output format - most of time in the first attempt, which is corrected in second attempt. Then it makes the third attempt, also successful, and exits with the Error branch. I checked the output from the structured output parser attempt #2 and #3 and they’re both valid,

Am I missing something, or is it just a bug, that the fist attempt fail causes the whole response go through the error branch instead of the success branch?

What is the error message (if any)?

Model output doesn’t fit required format.

Please share your workflow

I can’t share the workflow, but there is the screenshot of log from the Error branch:

only the first parse attempt is failed:

but entire bot request exits with the Error branch:

Share the output returned by the last node

The output from tool bot is the same as input with added attribute:

“error”:
“Model output doesn’t fit required format”

Information on your n8n setup

It’s the self hosted on Docker 1.72.1 on Ubuntu with default DB.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @toszto

Can you please check if you’re still having the issue on the latest version?
I believe this is a bug that we fixed.

1 Like

I had the same problem. It turned out that the types of the fields did not match, for example a number was expected, but a null was returned. This resulted in Model output doesn’t fit required format..

After I put an Auto-fixing Output Parser between the Basic LLM Chain and the Structured Output Parser, the validation error appeared.

Hi, the problem is fixed in the newest AI bot mode. Previous version has to be deleted and recreated as newest.

I’m experiencing the same issue: “Model output doesn’t fit the required format.” After adding the “Auto-fixing Output Parser,” I think you might need to increase the “Max. Tries” to 7 or even 10.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.