AI Agent to chat with Supabase/PostgreSQL DB
Configured with Agent, Chat Trigger, OpenAI Chat Model, Postgres Tool. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- AI & models
- Data store
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| When chat message received | Trigger | Chat Trigger | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| DB Schema | Data store | Postgres Tool | executeQuery |
| Get table definition | Data store | Postgres Tool | executeQuery |
| AI Agent | AI & models | Agent | See node parameters |
| Run SQL Query | Data store | Postgres Tool | executeQuery |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
openAiApipostgres
Workflow notes
Sticky Note3
Replace password and username for Supabase
Set up steps
Set up steps
Preparation
- Create Accounts:
- Configure Database Connection:
- Set up a PostgreSQL database in Supabase.
- Use appropriate credentials (
username,password,host, anddatabasename) in your workflow.
N8N Workflow
AI agent with tools:
- Code Tool:
- Execute SQL queries based on user input.
- Database Schema Tool:
- Retrieve a list of all tables in the database.
- Use a predefined SQL query to fetch table definitions, including column names, types, and references.
- Table Definition:
- Retrieve a list of columns with types for one table.
AI Agent to chat with Supabase/PostgreSQL DB
AI Agent to chat with Supabase/PostgreSQL DB
Made by Mark Shcherbakov from community 5minAI
Accessing and analyzing database data often requires SQL expertise or dedicated reports, which can be time-consuming. This workflow empowers users to interact with a database conversationally through an AI-powered agent. It dynamically generates SQL queries based on user requests, streamlining data retrieval and analysis.
This workflow integrates OpenAI with a Supabase database, enabling users to interact with their data via an AI agent. The agent can:
- Retrieve records from the database.
- Extract and analyze JSON data stored in tables.
- Provide summaries, aggregations, or specific data points based on user queries.
Sticky Note
Finetune the prompt of assistant
AI Agent to chat with Supabase/PostgreSQL DB
AI Agent to chat with Supabase/PostgreSQL DB
Purpose and structure
This folder contains the AI Agent to chat with Supabase/PostgreSQL DB workflow. Its executable nodes use agent, chatTrigger, lmChatOpenAi, postgresTool. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When chat message received
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Postgrestool/0656_Postgrestool_Stickynote_Send_Triggered.json MIT; preserve source notices.