AI Agents

AI agent to chat with Supabase PostgreSQL

11 nodes 208 146 Automatic trigger
Download

Workflow Description

An AI agent that interfaces with Supabase PostgreSQL database through natural language conversation. Users ask questions in plain text, and the agent queries the database intelligently, returning formatted results in real-time chat format.

How it works

  1. 1.Capture user message through Chat Trigger interface
  2. 2.Parse user intent using OpenAI's language model
  3. 3.Generate and execute appropriate SQL query via Postgres Tool
  4. 4.Retrieve results from PostgreSQL database
  5. 5.Format and deliver response back to user in conversation

Use cases

  • Query customer information and order history using conversational language
  • Extract analytics and generate reports from database without writing SQL queries

Requirements

  • Active Supabase project with configured PostgreSQL database
  • OpenAI API key with permission for chat completion models

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Chat Trigger OpenAI Postgres AI Agent

Details

Trigger Automatic trigger
Nodes 11
Apps 4
Views 208
Downloads 146

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (11)

/

Sticky Note3

Sticky Note

#1

Sticky Note5

Sticky Note

#2

Sticky Note6

Sticky Note

#3

Sticky Note7

Sticky Note

#4

When chat message received

Chat Trigger

#5

OpenAI Chat Model

OpenAI

#6

DB Schema

Postgres Tool

#7

Get table definition

Postgres Tool

#8

Sticky Note

Sticky Note

#9

AI Agent

Agent

#10

Run SQL Query

Postgres Tool

#11