AcademyWorkflowsData and reporting

Run a SQL query on Postgres

Data and operations teams who want a starting point for querying Postgres from n8n.

  • Recommendedour rating
  • 5,514views on n8n
Open on n8n.io ↗

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

run-a-sql-query-on-postgres.json

Loading the file...

What it does

An n8n workflow that runs a SQL query against a Postgres database. It accompanies the documentation of n8n's Postgres node, so it works as a reference for how that node is used. Review the query and connection settings before running it.

Use cases

  1. 01See how a SQL query is set up in n8n
  2. 02Adapt the query to pull the rows you need
  3. 03Learn the Postgres node before building a workflow

Connects

Postgres

Questions about
Run a SQL query on Postgres.

What is Run a SQL query on Postgres used for?

Data and operations teams who want a starting point for querying Postgres from n8n. An n8n workflow that runs a SQL query against a Postgres database. It accompanies the documentation of n8n's Postgres node, so it works as a reference for how that node is used. Review the query and connection settings before running it.

How do I import Run a SQL query on Postgres 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 Run a SQL query on Postgres 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.