Inconsistent output from OpenAI agent in Instagram reply workflow

Here’s a practical solution based on the search results:

- Avoid using Structured Output Parser with AI Agents, as it’s known to be unreliable ([n8n.io](https://n8n.io/workflows/4316-reliable-ai-agent-output-without-structured-output-parser-w-openai-and-switch)). Instead:

* Use a basic LLM Chain followed by Structured Output Parser ([community.n8n.io](Model output doesn't fit required format - Structured Output Parser))

* Or implement manual validation with a Switch node and retry logic ([n8n.io](https://n8n.io/workflows/4316-reliable-ai-agent-output-without-structured-output-parser-w-openai-and-switch))

Also ensure your system prompt clearly defines the expected JSON format.