AI Agent to generate chart not working

AI Agent to create a Chart - Can’t get the chart to generate

JSON needs to be valid.

I’ve been using this template: n8n.io - Workflow Automation

And this template:
https://pararadigmops.app.n8n.cloud/workflow/hbKy0uGyN8DPTCtx

To figure out how to actually get the chart. I am instead adding an Airtable with data, that the agent can retrieve and then get the data needed for the chart. I keep on getting this error when I execute OpenAI - Generate Chart:

And this is the code in the body content:

Full workflow view here:

I’ve tried so many variations, but have no idea how to fix this! Any ideas?

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 @tgg,

Welcome to the community :tada:

Tip for sharing your workflow in the forum

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

Make sure that you’ve removed any sensitive information from your workflow and include dummy data or pinned data as much as you can!


I see that you’ve linked the workflow in your instance. Unfortunately, community members won’t be able to access that. Could you copy & paste your workflow or the HTTP Request node where you’re seeing this error?

From a quick look, in the first image it looks like you’re trying to pass a string query to a json parameter which is causing the error. Also, from the second image, it looks like you’re referencing the query content incorrectly, could you try {{ $json.query }} instead?

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