Content: 02218.zip (46.30 KB)
Uploaded: 15.01.2026

Positive responses: 0
Negative responses: 0

Sold: 0
Refunds: 0

$6.95
# Natural language database queries with automatic charting in chat

This workflow enables users to ask natural language questions about a SQL database and receive human-readable answers. If the data is suitable for visualization, a chart is automatically generated and included in the response. It simplifies data analysis without requiring SQL knowledge or manual chart creation.

## Who it´s for
- Business analysts who need quick access to database insights without writing SQL
- Sales managers querying performance metrics directly in chat
- Startup founders automating team access to live data
- Developers integrating AI assistants for database interaction

## What the automation does
- User sends a message in chat (e.g., "Which drinks are most popular?")
- The system uses LangChain and OpenAI to convert the query into valid SQL and executes it against PostgreSQL/Supabase
- Response is analyzed: single value returns plain text; multiple data points trigger chart generation
- OpenAI generates a structured Chart.js configuration using structured output
- Quickchart.io renders the config into an image
- Final response with text and optional chart is sent back to the chat

## What´s included
- Ready-to-use n8n workflow
- Trigger logic for chat messages or manual execution
- Integrations with OpenAI, PostgreSQL, Supabase, Quickchart.io, and HTTP API
- Basic setup and adaptation guide

## Requirements for setup
- n8n instance with workflow import capability
- Access to a PostgreSQL or Supabase database
- OpenAI API key
- Optional Quickchart.io API key for higher limits
- Configured HTTP node for external service communication

## Benefits and outcomes
- Accelerates data access without analyst involvement
- Eliminates the need to write SQL manually
- Automatically determines when visualization is needed
- Increases team engagement through a chat-based interface
- Lowers the barrier for non-technical users
- Supports explicit visualization requests (e.g., "draw a pie chart")

## Important: template only
Important: you are purchasing a ready-made automation workflow template only. Rollout into your infrastructure, connecting specific accounts and services, 1:1 setup help, custom adjustments for non-standard stacks and any consulting support are provided as a separate paid service at an individual rate. To discuss custom work or 1:1 help, contact via chat
No feedback yet