AcademyWorkflowsData and reporting

Chat with a PostgreSQL Database

Teams that need answers from a database without writing SQL, such as operations or analytics.

  • Recommendedour rating
  • 73,534views on n8n
Open on n8n.io ↗

Paste it straight onto an n8n canvas with Ctrl+V or Cmd+V.

chat-with-postgresql-database.json

Loading the file...

What it does

An n8n workflow that lets you ask questions about a PostgreSQL database in plain language. An AI agent reads the schema and table definitions, writes and runs the SQL query it needs, and sends the answer back in the n8n chat.

Use cases

  1. 01Ask how many orders came in last week
  2. 02Check a customer record without writing SQL
  3. 03Explore which tables and fields a database has

Connects

AI Agent · OpenAI Chat Model · Simple Memory

Questions about
Chat with a PostgreSQL Database.

What is Chat with a PostgreSQL Database used for?

Teams that need answers from a database without writing SQL, such as operations or analytics. An n8n workflow that lets you ask questions about a PostgreSQL database in plain language. An AI agent reads the schema and table definitions, writes and runs the SQL query it needs, and sends the answer back in the n8n chat.

How do I import Chat with a PostgreSQL Database into n8n?

Copy the workflow JSON from this page and paste it onto the n8n canvas with Ctrl+V or Cmd+V. Then connect your credentials in each node.

Is Chat with a PostgreSQL Database safe to use?

It passed our automatic scan for credential theft, hidden instructions and risky install commands. Third party open source software. Sabemos AI does not maintain it. Check the code and permissions before you connect it to company data.