AI Agent with charts capabilities using OpenAI Structured Output
Configured with Agent, Chat Trigger, Execute Workflow Trigger, HTTP Request, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- AI & models
- Data store
- Subworkflow
- Trigger
- Web / API
- Transform
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Window Buffer Memory | Data store | Memory Buffer Window | See node parameters |
| Generate a chart | Subworkflow | Tool Workflow | See node parameters |
| Execute "Generate a chart" tool | Trigger | Execute Workflow Trigger | See node parameters |
| OpenAI - Generate Chart definition with Structured Output | Web / API | HTTP Request | POST |
| Set response | Transform | Edit Fields | See node parameters |
| AI Agent | AI & models | Agent | See node parameters |
| When chat message received | Trigger | Chat Trigger | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
openAiApi
Workflow notes
Workflow: AI Agent with charts capabilities using OpenAI Structured Output
Workflow: AI Agent with charts capabilities using OpenAI Structured Output
Overview
- This workflow is a experiment to integrate charts into an AI Agent
- The AI Agent has normal AI conversation and can invoke a tool to integrate a graph in the conversation.
- It uses OpenAI Structured Output to generate a chart definition according to Quickchart specifications.
How it works
- Activate the workflow
- Start chatting with the AI Agent.
- When the AI Agent detects that the user needs a chat, it calls the tool
- The tool calls the sub-workflow with a query.
- The sub-workflow calls the HTTP Request node (calling OpenAI) to retrieve a chart definition
- In the "set response" node, he chat definition is added at the end of a quickchart.io url - the URL to the chart image. It is sent back to the AI Agent.
- The AI Agent uses this image in its response.
- For example, you can ask the AI Agent to generate a chart about the top 5 movies at the box office
Notes
- The full Quickchart.io specifications have not been integrated, thus there are some possible glitches (e.g due to the size of the graph, radar graphs are not displayed properly)
- This could be provided to any automation, not only AI Agents.
Generate a Quickchart definition
Generate a Quickchart definition
HTTP Request node
- Send the chart query to OpenAI, with a defined JSON response format - using HTTP Request node as it has not yet been implemented in the OpenAI nodes
- The JSON structure is based on ChartJS and Quickchart.io definitions, that let us create nice looking graphs.
- The output is a JSON containing the chart definition that is passed to the next node.
Set Response node
- Adds the chart definition at the end of a Quickchart.io URL (see documentation)
- Note that in the parameters, we specify the width to 250 in order to be properly displayed in the chart interface.
Chat Agent
Chat Agent
- This is agent is mostly here to demonstrate how to use the sub workflow.
- This is a basic agent with a tool "generate a chart"
- The tool calls the sub-workflow
- The sub-workflow responds with the Quickchart URL that is displayed in the conversation
AI Agent with charts capabilities using OpenAI Structured Output
AI Agent with charts capabilities using OpenAI Structured Output
Purpose and structure
This folder contains the AI Agent with charts capabilities using OpenAI Structured Output workflow. Its executable nodes use agent, chatTrigger, executeWorkflowTrigger, httpRequest, lmChatOpenAi, memoryBufferWindow, set, toolWorkflow. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Execute "Generate a chart" tool, When chat message received
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Http/1112_HTTP_Stickynote_Automation_Webhook.json MIT; preserve source notices.