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
Information Extraction:
The Information Extractor identifies and extracts the user's question.
If the question includes a visualization aspect, the SQL Agent alone may not respond accurately.
SQL Querying:
It leverages a regular SQL Agent: it connects to a database, queries it, and translates the response into a human-readable format.
Chart Decision:
The Text Classifier determines whether the user would benefit from a chart to support the SQL Agent's response.
Chart Generation:
If a chart is needed, the sub-workflow dynamically generates a chart and appends it to the SQL Agent’s response.
If not, the SQL Agent’s response is output as is.
Calling OpenAI for Chart Definition:
The sub-workflow calls OpenAI via the HTTP Request node to retrieve a chart definition.
Building and Returning the Chart:
In the "Set Response" node, the chart definition is appended to a Quickchart.io URL, generating the final chart image.
The AI Agent returns the response along with the chart.
How to use it
Use an existing database or create a new one.
For example, I've used this Kaggle dataset and uploaded it to a Supabase DB.
Add the PostgreSQL or MySQL credentials.
Alternatively, you can use SQLite binary files (check this template).
Activate the workflow.
Start chatting with the AI SQL Agent.
If the Text Classifier determines a chart would be useful, it will generate one in addition to the SQL Agent's response.
Notes
The full Quickchart.io specifications have not been fully integrated, so there may be some glitches (e.g., radar graphs may not display properly due to size limitations).
Related Templates
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
Automate Daily Keyword Research with Google Sheets, Suggest API & Custom Search
Who's it for This workflow is perfect for SEO specialists, marketers, bloggers, and content creators who want to automa...
Bulk Automated Google Drive Files Sharing and Direct Download Link Generation
This N8N workflow automates the process of sharing files from Google Drive. It includes OAuth2 authentication, batch pro...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments