This n8n workflow integrates an SQL agent with advanced visualization capabilities to enhance data analysis and reporting. It begins by connecting to a database, such as a PostgreSQL or MySQL instance or a SQLite file, allowing users to query data naturally through an AI-powered interface. When a chat message is received, an AI Agent processes the query, interacts with the database, and generates a human-readable response. A key feature is the Text Classifier, which assesses whether the response would benefit from a visual representation. If a chart is deemed helpful, the workflow triggers a sub-workflow that calls OpenAI’s GPT-4 model to generate a JSON definition for a Chart.js configuration, based on user input. This JSON is then sent to Quickchart.io to produce a visual chart, which is appended to the textual response. Otherwise, the response is sent as plain text. This setup is ideal for teams needing interactive data insights with integrated visualization, making data exploration more intuitive and engaging.
AI-Driven Data Visualization with SQL and Chart Generation
Node Count | 11 – 20 Nodes |
---|---|
Nodes Used | @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.chatTrigger, @n8n/n8n-nodes-langchain.lmChatOpenAi, @n8n/n8n-nodes-langchain.memoryBufferWindow, @n8n/n8n-nodes-langchain.textClassifier, executeWorkflow, executeWorkflowTrigger, httpRequest, set, stickyNote |
Reviews
There are no reviews yet.