How to generate a json output with an ia agent

i want to make my ia agent generate a json code so how ? i try too much :frowning:

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:

You have to toggle the Require Specific Output Format switch in the node settings

Then connect a Structured Output Parser and give it an example JSON like this:

Keep in mind the AI can generate characters that break the json like ```
To fight this you might want to:

  1. Give it a strict prompt not to use special characters that might break the JSON
  2. Enable retries
  3. Enable error output and implement some kind of error handling process or at least send yourself a notification

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