Pipedream PostgreSQL steps in n8n
Updated 2026-10-21 · 3 min read · n8n: Postgres (Native n8n node)
PostgreSQL steps on Pipedream are mostly raw SQL: run a query, insert a row, react to a new row. n8n's native Postgres node covers all of that, and the custom-query action is converted automatically into that node rather than into an HTTP call.
The n8n side
Postgres node (n8n-nodes-base.postgres): Delete, Execute Query, Insert, Insert or Update, Select, Update. Select and Delete without conditions touch every row, so set conditions.
Postgres Trigger: two modes.
- Listen and Create Trigger Rule: on publish, n8n creates a database trigger and function for Insert, Update or Delete on a table, and removes them on unpublish.
- Listen to Channel: listens to an existing
NOTIFYchannel.
What maps where
Pipedream (app postgresql) |
In n8n | Status |
|---|---|---|
| Execute SQL Query (Execute Custom Query) | Postgres → Execute Query + Code node that returns all rows as $return_value |
automatic |
| Insert Row | Postgres → Insert | manual |
| Find Row, Find Row With Custom Query | Postgres → Select, or Execute Query | manual |
| Delete Row(s), Update Row | Postgres → Delete / Update | manual |
| New Row, New or Updated Row | Postgres Trigger, Listen and Create Trigger Rule | manual |
| New Row Custom Query | Schedule Trigger + Execute Query + dedupe | manual |
| New Column, New Table | Schedule Trigger + query on information_schema |
manual |
Code step with pg and this.postgresql.$auth |
Code node; pg listed as an npm package, connection fields as variables |
automatic, review |
Why the extra Code node? n8n's Postgres node outputs one item per row; Pipedream's step returned one array. Later steps written as steps.query.$return_value[0].email keep working because the gather node rebuilds that array. If you prefer n8n's item-per-row style, delete the gather node and update the expressions.
Credentials
Create a Postgres credential (method: database connection):
- Host, Database, User, Password, Port.
- SSL: Allow, Disable or Require. Managed databases (RDS, Neon, Supabase) usually need Require.
- Optional SSH Tunnel for private databases.
- Allow-list your n8n instance's outbound IP. If your firewall was open only to Pipedream's IP ranges, n8n will time out until you change it.
For the trigger, the user needs superuser, table ownership or the TRIGGER privilege, plus CREATE on the schema.
Typical migration: nightly report
Pipedream: Schedule (daily 7:00) → Execute SQL Query → Slack message with the totals. n8n after conversion: Schedule Trigger → Postgres (Execute Query) → Code (gather) → HTTP Request (Slack). One credential for Postgres, one for Slack.
Pitfalls
- Query parameters. Do not build SQL with string concatenation from expressions. Use
$1,$2and the node's Query Parameters option. The converter keeps your SQL as is; review any query that includes{{ }}values. - Big numbers. NUMERIC and BIGINT over 16 digits can come back wrong unless output as text.
- Dates. A
DATEcolumn comes back as an ISO datetime. UseTO_CHARif you need the plain date. Store timestamps in UTC. - IN lists. Dynamic
IN (...)lists need a specific syntax; see n8n's Postgres common-issues page. - NOTIFY limits. Channel payloads must be under 8,000 bytes and are sent only on commit; if nobody listens, they are lost. For reliability, send the row ID and query the row.
How to move your PostgreSQL workflows
- Export the workflows from Pipedream.
- Upload on /convert: the free report shows the converted queries and what to review.
- Download the n8n JSON: 1 workflow is free; full export: $3 per workflow, $19 minimum — coming soon.
Read the Pipedream to n8n guide, and check pg-based code steps in the code step checker. Related: Supabase, AWS S3, Google Sheets.
FAQ
- Does Execute SQL Query convert automatically?
- Yes. It becomes the native Postgres node with Execute Query and your SQL, plus a small Code node that gathers the rows into one array, the way Pipedream returned them.
- Is there a Postgres trigger in n8n?
- Yes. The Postgres Trigger either creates a database trigger for Insert, Update or Delete on a table, or listens to a NOTIFY channel. It needs TRIGGER privilege and CREATE on the schema.
- Why are my big numbers wrong?
- n8n's docs warn that NUMERIC and BIGINT values over 16 digits can lose precision unless you output them as text. Cast them in SQL.
- Can n8n reach a database behind a firewall?
- Yes. The Postgres credential supports an SSH tunnel and SSL modes Allow, Disable and Require. Allow-list the IP of your n8n instance, not Pipedream's.
Related
Sources
- https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.postgres/
- https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.postgres/common-issues/
- https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.postgrestrigger/
- https://docs.n8n.io/integrations/builtin/credentials/postgres/
- https://pipedream.com/apps/postgresql
- https://www.postgresql.org/docs/current/sql-notify.html