What This Workflow Does
This advanced automation creates a multi-AI agent system that serves as an intelligent interface between users and your Postgres/Supabase databases. It understands natural language queries, retrieves relevant data, and generates visual charts using QuickCharts - all through conversational interactions.
The workflow acts as a "tool router" that determines whether an incoming query requires database access, chart generation, or general AI assistance. This eliminates manual data extraction and visualization steps, allowing non-technical users to get insights from your databases instantly.
How It Works
1. Query Interpretation
The primary AI agent analyzes incoming messages to determine the user's intent. It classifies queries into database requests, chart generation needs, or general information questions.
2. Database Query Execution
For data requests, the workflow connects to your Postgres/Supabase database, executes the appropriate SQL queries (either pre-defined or dynamically generated), and retrieves the results.
3. Chart Generation
When visualization is needed, the system formats the data appropriately and sends it to QuickCharts to generate embeddable chart images that can be shared or displayed.
4. Response Assembly
The final response combines the relevant data, visualizations (when applicable), and explanatory text in a user-friendly format delivered through your preferred communication channel.
Who This Is For
This solution is ideal for:
- Data teams needing to provide self-service analytics to non-technical colleagues
- Product managers who want to embed data insights directly in their applications
- Customer support teams that need instant access to customer data during interactions
- Startups looking to add AI-powered analytics to their products without extensive development
Pro tip: Start with a limited set of pre-approved queries to ensure data security before expanding to more open-ended natural language processing.
What You'll Need
- An n8n instance (self-hosted or cloud)
- Postgres or Supabase database credentials
- QuickCharts API access
- AI provider API keys (OpenAI, Anthropic, etc.)
- Communication channel integration (Slack, Teams, etc.)
Quick Setup Guide
- Download and import the JSON template into your n8n instance
- Configure your database connection credentials
- Set up your QuickCharts and AI provider API keys
- Define your communication channel webhook
- Test with sample queries and refine as needed
Key Benefits
80% faster data access: Eliminates manual SQL writing and chart creation steps for routine queries.
Democratized analytics: Allows non-technical team members to get insights without specialized training.
Scalable self-service: Handles multiple concurrent queries without taxing your data team.
Consistent outputs: Standardizes how data is presented across your organization.
Embeddable visuals: Generated charts can be directly inserted into reports, dashboards, or customer communications.