Huashu Design
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
An n8n workflow with a chat agent that answers questions about a Postgres database, such as one on Supabase. It reads the table list and each table’s columns, writes SQL and runs it through three Postgres tools.
Chat agent that queries a Supabase or Postgres database is an n8n workflow in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.
Chat message
It starts when you send a message in n8n’s chat:
A plain-language answer drawn from the rows of your database, with the SQL that ran behind it
What you need before you start.
Language model
Runs the agent’s model, which picks the tools, writes the SQL and words the answer.
NeedsOpenAI API key
Database
Serves three tools: the table list, one table’s columns and the SQL the agent writes.
NeedsA Postgres login with host, database, user and password. A read-only user is safest
Checked by Mindket on 13 Nov 2026
This n8n workflow lets you ask a Postgres database questions in plain words. A chat agent with an OpenAI model has three Postgres tools. One lists the tables in the public schema. One returns the columns, types and foreign keys of a single table. The third runs whatever SQL the agent writes, so it can count, group and total rows before it answers. Six nodes do the work, beside three sticky notes.
People who need numbers from a Supabase or Postgres database but do not write SQL every day, such as founders, analysts and support leads. Skip it for data you cannot send to a model, or if you need to review each query first. The agent writes and runs its own SQL.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Startups | Founders | Ask for signups, revenue or churn from the app’s own tables | A founder asks how many people signed up last week. |
| Ecommerce | Store managers | Check orders and stock without opening a dashboard | A manager asks which five products sold most this month. |
| Customer support | Support leads | Count tickets or look up an account by plan | A lead asks how many open tickets each plan has. |
| Analytics | Analysts | Get a first answer, then rewrite the SQL by hand | An analyst asks for revenue by country and refines the query the agent ran. |
You need a little n8n and a database login: import a file, add two credentials and tell the agent about your tables.
Any n8n that can reach your database and OpenAI will run it. The answers appear in the chat.
Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Use a database login that can only read.
| Need | Detail |
|---|---|
| n8n | On n8n Cloud or on a server of your own |
| Postgres | A database the n8n server can reach: host, database name, user and password |
| OpenAI | An API key. The model node takes its default model |
workflow.json.DB Schema, Get table definition and Run SQL Query.OpenAI Chat Model.AI Agent and read its system message. Add notes about your tables there if a column’s name does not say what it holds.Ask in plain words, such as how many orders came in last week. The agent can list the tables, read the columns of the ones it needs, write a query and answer from the rows. Ask for counts and totals, since every row it fetches goes to the model.
| To change | Where |
|---|---|
| The agent’s instructions | The system message in AI Agent |
| The model | OpenAI Chat Model, which sets none in this file |
| What the lookups show | The public schema filter in DB Schema and Get table definition |
| How it writes SQL | The tool descriptions in Run SQL Query and Get table definition |
A store manager asks how many orders came in last week and which three products sold most.
The agent reads the table list, finds the orders table and its columns, and writes a query that groups order lines by product. The reply is a short answer in the chat. The query ran on your database, so check it in the chat’s log if the numbers matter.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. Here the agent sits in the middle, with its model and three tools plugged into it. Start with a question about one table, then open the chat’s log to read the SQL the agent wrote.
For experts. The tools are Postgres Tool nodes with a manual description. Run SQL Query takes its SQL from the model through $fromAI, and Get table definition does the same for a table name.
| Node | What it does | What to know |
|---|---|---|
DB Schema | Lists base tables in public from information_schema.tables | It cannot see other schemas |
Get table definition | Joins four information_schema views for each column’s name, type, nullability, default and foreign key | The model’s table name is placed straight into the query text |
Run SQL Query | Runs the SQL in the query field | Its description tells the agent to use ->> to read JSON values |
AI Agent | An OpenAI Functions agent with a three-line system message | n8n lists this mode as deprecated |
The agent can change data, not only read it, and its agent type is on its way out of n8n.
Run SQL Query runs whatever SQL the model writes, including inserts, updates and deletes. Connect with a database user that can only read, or point it at a copyGet table definition places the table name the model gives straight into its query text, so a read-only user also limits a hostile messageAI Agent with the current AI Agent and reconnect its model and toolsOpenAI Chat Model sets no model, so it takes the node’s own default, gpt-5-mini in n8n’s repository on 12 November 2026. OpenAI’s deprecations page, read that day, gives 14 January 2027 as the shutdown of gpt-4o and gpt-4o-mini, with gpt-6-luna as the replacement. If your n8n offers an older default, pick a model in the nodepublicAn n8n workflow with a chat agent that answers questions about a Postgres database, such as the one behind a Supabase
project. It lists the tables, reads the columns of the one it needs, writes SQL and runs it, with an OpenAI model behind it.
workflow.json: the workflow as n8n exports it, nine nodes, three of them sticky notes. It holds no credential. OneREADME.md: these notes.workflow.json.DB Schema,Get table definition and Run SQL Query.OpenAI Chat Model.AI Agent and read its system message, three short lines that cast it as a database assistant. Add notes aboutWhen chat message received takes your message, and AI Agent reads it from chatInput.DB Schema lists the base tables in the public schema.Get table definition takes a table_name from the model. It returns each column's name, type, nullability andRun SQL Query runs the SQL the model writes in its query field. Its description tells the agent to use the ->>AI Agent.OpenAI Chat Model, which sets none in this file.public, in DB Schema and Get table definition.Run SQL Query and Get table definition.Run SQL Query runs whatever SQL the model writes, including inserts, updates and deletes. Connect with a database userGet table definition places the table name the model gives straight into its query text. A read-only user limits what aAI Agent with the current AI Agent and reconnect its model and tools.OpenAI Chat Model sets no model, so it takes the node's own default, gpt-5-mini in n8n's repository ongpt-4o andgpt-4o-mini, with gpt-6-luna as the replacement. If your n8n offers an older default, pick a model in the node.public schema is listed. Tables in other schemas are not found by the two lookup tools.NOTICE.md 618 B README.md 4 KB workflow.json 6 KB
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
op7418 · Skill
Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.
alibaba · Kit
Reviews Git changes with an AI agent that reads files and searches the codebase, then writes comments tied to exact lines. It suits developers who want automat…