(5/5)

Visualize your SQL Agent queries with OpenAI and Quickchart.io

Overview - This workflow aims to provide data visualization capabilities to a native SQL Agent. - Together, they can help foster data analysis and data visualization within a team. - It uses the native SQL Agent that works well and adds visualization capabilities thanks to OpenAI’s Structured Output and Quickchart.io. How it works 1. Information Extraction: - The Information Extractor identifies and extracts the user's question. - If the question includes a visualization aspect, the SQL Agent a

Workflow Structure (14 nodes)
100%
Langchain.chat Trigger
When chat message received
Langchain.information Extractor
Information Extractor - User question
Langchain.lm Chat Open Ai
OpenAI Chat Model
Langchain.agent
AI Agent
Langchain.memory Buffer Window
Window Buffer Memory
Langchain.text Classifier
Text Classifier - Chart required?
Langchain.lm Chat Open Ai
OpenAI Chat Model Classifier
Set
Set Text output
Set
User question + Agent initial response
Execute Workflow
Execute Workflow
Set
Set Text + Chart output
Execute Workflow Trigger
Execute "Generate a chart" tool
Http Request
OpenAI - Generate Chart definition with Structured Output
Set
Set response
Node Types:
default
trigger
http
transform
logic
Requires credentials

Prerequisites

Required Credentials (2)

OpenAI

Used by: OpenAI Chat Model, OpenAI - Generate Chart definition with Structured Output +1 more

Docs

Postgres

Used by: AI Agent

Docs

Complexity

Complex

Advanced features used. Requires n8n experience.

Setup time: ~35 min
Score: 48/100
Conditional Logic

When to Use This Workflow

Real-time Response

React instantly when events happen - new orders, form submissions, or API calls.

Zero delay between trigger and action for time-sensitive workflows.

Time Savings

Replace repetitive manual tasks with reliable automation.

Reclaim hours every week for higher-value work.

Error Reduction

Eliminate human error from routine processes with consistent automation.

Improve accuracy and reliability across your workflows.

workflow.json
{
  "meta": {
    "instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "50695e7f-3334-4124-a46e-1b3819412e26",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1260,
        560
      ],
      "parameters": {
        "model": "gpt-4o",
        "options": {
          "temperature": 0.1
        }
      },
...

Workflow Details

Nodes
19
Trigger
Event
Source
awesome
Added
Dec 4, 2025

Need Help?

Check out the official n8n documentation for detailed guides.

Related Workflows

BambooHR AI-Powered Company Policies and Benefits Chatbot

STEP 1: Retrieve company policies and load them into a vector store

Documentdefaultdataloader
Embeddingsopenai
Textsplitterrecursivecharactertextsplitter
Memorybufferwindow
50 nodesEvent
Curated

Build a Tax Code Assistant with Qdrant, Mistral.ai and OpenAI

Step 1. Download the Tax Code PDF [Read more about handling Zip Files](https://docs.n8n.io/integrations/builtin/core-nod...

Embeddingsmistralcloud
Documentdefaultdataloader
Textsplitterrecursivecharactertextsplitter
Http-request
38 nodesEvent
Curated

Building RAG Chatbot for Movie Recommendations with Qdrant and Open AI

Tool, calling Qdrant's recommendation API based on user's request, transformed by AI agent

Github
Embeddingsopenai
Documentdefaultdataloader
Textsplittertokensplitter
27 nodesEvent
Curated

AI Agent to chat with Airtable and analyze data

Replace Mapbox public key - <yourpublickey> in code

Lmchatopenai
Agent
Memorybufferwindow
Chat
41 nodesEvent
Curated

AI agent: expense tracker in Google Sheets and n8n chat

Save your expenses via chat message. LLM will parse your message to structured JSON and save as a new row into Google Sh...

Agent
Chat
Executeworkflow
Lmchatopenai
10 nodesEvent
Curated

AI-powered WooCommerce Support-Agent

Find WooCommerce User-ID User-ID is required to query past orders

Memorybufferwindow
Executeworkflow
Woocommerce
Http-request
40 nodesEvent
Curated