Symptom
An agent with a structured output parser and memory works for the first turns, then fails schema validation. A later reply is { "output": { "response": "some answer" } } even though the schema expected { response: "string" }.
Evidence what you'll see
- Memory ends up holding
{ output: '{"output": {"user_key": "value"}}' }instead of the inner object. - The parser that fails is
N8nStructuredOutputParser.parse.
Why it happens
With memory on, the agent stored a value that was already wrapped in output, so the next turns copied that extra key. Pull request 19376 says getAgentStepsParser wrapped JSON that already had an output property.
Affected versions
n8n 1.88.0, Alpine Linux 3.21, Node.js 20.19.0, PostgreSQL.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
- A later turn matches the schema and is not
{ "output": { "response": "some answer" } }.
If it still fails
- The linked issue does not describe the extra
outputkey on1.112.3. A session that still holds the nested memory keeps feeding it back until that memory is cleared.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it