Skip to main content

✨📊Multi-AI agent chatbot for Postgres/Supabase DB and QuickCharts + tool router

Workflow preview

Workflow preview
100%
✨📊Multi-AI agent chatbot for Postgres/Supabase DB and QuickCharts + tool router preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Multi AI Agent Chatbot for Postgres/Supabase Databases and QuickChart Generation Who is this for? This workflow is ideal for data analysts , developers , and business intelligence teams who need an...

Best for

  • Internal Wiki automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-base.postgrestool, n8n-nodes-base.executeworkflowtrigger, @n8n/n8n-nodes-langchain.toolworkflow, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.outputparserstructured, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Joseph LePage.

Original n8n.io source

1.1 Workflow description

Title
✨📊Multi-AI agent chatbot for Postgres/Supabase DB and QuickCharts + tool router
Workflow name
✨📊Multi-AI agent chatbot for Postgres/Supabase DB and QuickCharts + tool router

Multi-AI Agent Chatbot for Postgres/Supabase Databases and QuickChart Generation

Who is this for?

This workflow is ideal for data analysts, developers, and business intelligence teams who need an AI-powered chatbot to query Postgres/Supabase databases and generate dynamic charts for data visualization.

What problem does this solve?

It simplifies data exploration by combining conversational AI with database querying and chart generation. Users can interact with their database using natural language, retrieve insights, and visualize data without manual SQL queries or chart configuration.

What this workflow does

  1. AI-Powered Chat Interface:

    • Accepts natural language prompts to query databases or generate charts.
    • Routes user requests through a tool agent system to determine the appropriate action (query or chart).
  2. Database Querying:

    • Executes SQL queries on Postgres/Supabase databases based on user input.
    • Retrieves schema information, table definitions, and specific data records.
  3. Dynamic Chart Generation:

    • Uses QuickChart to create bar charts, line charts, or other visualizations from database records.
    • Outputs a shareable chart URL or JSON configuration for further customization.
  4. Memory Integration:

    • Maintains chat history using Postgres memory nodes, enabling context-aware interactions.

Workflow diagram showcasing AI agents, database querying, and chart generation paths.

Setup

  1. Prerequisites:

    • A Postgres-compatible database (e.g., Supabase).
    • API credentials for OpenAI.
  2. Configuration Steps:

    • Add your database connection credentials in the Postgres nodes.
    • Set up OpenAI credentials for GPT-4o-mini in the language model nodes.
    • Adjust the QuickChart schema in the "QuickChart Object Schema" node to fit your use case.
  3. Testing:

    • Trigger the chat workflow via the "When chat message received" node.
    • Test with prompts like "Generate a bar chart of sales data" or "Show me all users in the database."

How to customize this workflow

  • Modify AI Prompts
  • Add Chart Types
  • Integrate Other Tools

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 2 - Execute SQL Query

Type / Role
n8n-nodes-base.postgresTool - postgresTool
Config choices
Version 2.5

Block 3 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 4 - query_db_tool

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2

Block 5 - generate_quickchart_tool

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2

Block 6 - Create QuickChart

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - QuickChart Object Schema

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 8 - gpt-4o-mini

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 9 - gpt-4o-mini-2

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 10 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - 🤖Primary Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 12 - 🤖Secondary Postgres Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 13 - 🤖Secondary QuickChart Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 14 - 🔀Tool Agent Router

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 15 - Table Definitions

Type / Role
n8n-nodes-base.postgresTool - postgresTool
Config choices
Version 2.5

Block 16 - Postgres Chat Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryPostgresChat - memoryPostgresChat
Config choices
Version 1.3

Block 17 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 40 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow ✨📊Multi-AI agent chatbot for Postgres/Supabase DB and QuickCharts + tool router
Complexity advanced
Nodes 40
Categories Internal Wiki, AI Chatbot
Author Joseph LePage
Published 05 Mar 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3090/3090.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does ✨📊Multi-AI agent chatbot for Postgres/Supabase DB and QuickCharts + tool router do?

Multi AI Agent Chatbot for Postgres/Supabase Databases and QuickChart Generation Who is this for? This workflow is ideal for data analysts , developers , and business intelligence teams who need an...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI Chatbot use case.