Steps
Read the activation error, not the editor
The Postgres Trigger only works in a published workflow, and when it can't start, the message goes to the n8n log as
There was a problem activating the workflow: "…". In our tests n8n tried 5 times in about 15 seconds, then gave up. Worse, on the next two restarts it didn't try that workflow again, even though it still showed as published. So fix the cause below, then publish the workflow again (publishing an edited version did activate it in our test). Each published Postgres Trigger also keeps one database connection open for itself, so count them against your connection limit.Match the table name and schema exactly
The node quotes the names you give it, so case matters. A table created as
"Orders2"but typed asorders2failed withrelation "public.orders2" does not exist; typingOrders2worked. A table in another schema failed the same way (relation "public.invoices" does not exist) until we set Schema Name tosales. Pick both from the list when you can. A failed activation still left itsn8n_trigger_function_…function behind, which is harmless but worth cleaning up.Give the database user the rights to create a trigger
The node runs
CREATE FUNCTIONandCREATE TRIGGERon your table, so a read/insert user isn't enough. On PostgreSQL 15 and later nobody can create objects inpublicby default, and our app role failed withpermission denied for schema public. AfterGRANT CREATE ON SCHEMA publicit failed withpermission denied for table orders, because it only had SELECT and INSERT. Use the table owner in the credential, or create the trigger yourself and use Listen For: Advanced (next step).Using Advanced (LISTEN): write the channel in lower case
With Listen For: Advanced n8n only listens; your own trigger or app sends
pg_notify. n8n turns the channel name to lower case: withMyChannelit listened onmychannel.NOTIFY MyChannelreached it (Postgres lowers that too), butpg_notify('MyChannel', …)did not, whilepg_notify('mychannel', …)did. Use lower case everywhere. Dashes aren't allowed:my-channelfailed withChannel name must start with a letter or underscore and contain only letters, digits, and underscores. A JSON payload arrives as an object, plain text stays text.Know what fires, and when
One execution per row: a single INSERT of 3 rows gave 3 executions. Nothing fires for a rolled-back transaction, and a committed one fires at the commit (our insert waited 3 seconds for its commit). Update sends only the new row, with no old values, and Delete sends the deleted row. The whole row goes through
pg_notify, which has an 8,000-byte limit: a row with a 9,000-character text column made the app's own INSERT fail withpayload string too longand the row was not saved. On tables with big text or JSON columns, use Advanced mode with your own trigger that sends only the id.If it stopped firing with no error, restart n8n
When the listening connection dies, n8n doesn't notice. We killed the connection in Postgres and, separately, restarted the Postgres server: no log line, the workflow stayed published, and inserts after that never fired. Restarting n8n made it listen again. Events sent while nobody listens are lost: a row inserted while n8n was down never reached it after the restart. For changes you can't miss, keep a Schedule Trigger with a Postgres query for rows newer than the last run as a backup.
Clean up left-over triggers and fix already exists
When n8n stops normally with healthy connections, it drops its triggers and functions. After a kill, or a stop after the connection had died (
There was a problem calling "closeFunction" on "Postgres Trigger"), they stayed in the table, still sending notifications. With the default names that's fine: n8n replaced them on the next start. With your own Trigger Name and Function Name, the next activation failed withfunction "big_audit_fn" already exists with same argument typesuntil we turned on Replace if Exists. List left-overs withselect tgname from pg_trigger where tgname like 'n8n_trigger%'.
What we ran
On 23 October 2026 we published 12 small workflows (Postgres Trigger, then a No Op node) in n8n 2.43.7 (npm install, Node 24, Postgres Trigger node version 1) against a local PostgreSQL 17 server. We changed rows with psql, sent NOTIFY and pg_notify, killed connections, restarted Postgres, and started n8n six times, with normal stops and a kill in between, reading executions from the n8n database and the activation errors from the n8n and Postgres logs. 27 cases; every message below is copied from those logs.
| Setup | Result |
|---|---|
Insert trigger on orders, one row inserted | 1 execution. Output: channel n8n_channel_<node id>, payload as an object {"id": 1, "item": "pen", "qty": 2}, processId, length, name notification |
Update trigger, qty changed from 2 to 3 | 1 execution, payload is the new row only (qty 3), no old values |
| Delete trigger, row deleted | 1 execution, payload is the deleted row |
| One INSERT statement with 3 rows | 3 executions, one per row |
| INSERT inside a transaction that was rolled back | No execution |
| INSERT, then commit 3 seconds later | Execution started at the commit, not at the insert |
Table typed orders2, table created as "Orders2" | There was a problem activating the workflow: "relation "public.orders2" does not exist" |
Table typed Orders2 (exact case) | Activated, inserts fired |
Schema public, table invoices that lives in schema sales | relation "public.invoices" does not exist |
Schema sales, table invoices | Activated, inserts fired |
| Role with SELECT and INSERT on the table, no CREATE on schema public (Postgres 15+ default) | permission denied for schema public |
Same role after GRANT CREATE ON SCHEMA public | permission denied for table orders (creating a trigger needs more than SELECT and INSERT) |
Listen For: Advanced, Channel Name MyChannel, then NOTIFY MyChannel, 'plain text' | Fired; channel shown as mychannel, payload stays the text plain text |
Same, select pg_notify('MyChannel', '{"a":1}') | No execution (pg_notify keeps the capital letters) |
Same, select pg_notify('mychannel', '{"a":2}') | Fired, payload parsed to {"a": 2} |
Channel Name my-channel | Channel name must start with a letter or underscore and contain only letters, digits, and underscores |
| Insert trigger on a table, row with a 9,000-character text column | The app's own INSERT failed: payload string too long, row not saved |
Listening connection killed in Postgres (pg_terminate_backend) | Nothing in the n8n log, workflow still published, next inserts never fired |
| Postgres server restarted while n8n was running | All 7 listening connections gone, no log line, no executions until n8n was restarted |
| n8n stopped normally after the connections had died | There was a problem calling "closeFunction" on "Postgres Trigger" for each workflow; triggers and functions left in the database |
| n8n stopped normally with healthy connections | n8n dropped its triggers and functions |
| Activation that failed with relation does not exist | The n8n_trigger_function_… function was still created and left behind |
| n8n killed (kill -9), a row inserted while n8n was down | Triggers stayed in the table; that row never reached n8n, even after restart |
| n8n restarted after the kill, default trigger names | Activated without error (n8n replaces its own function and trigger), new inserts fired |
| Custom Trigger Name and Function Name left from an earlier run, Replace if Exists off | function "big_audit_fn" already exists with same argument types |
| Same, Replace if Exists on, published again | Activated, listening on the custom channel |
| A failing workflow at n8n startup | 5 attempts in about 15 seconds (Postgres log), then the error; on the next two n8n starts it was not tried again although it still showed as published |
Good to know
- The trigger, function and channel are named after the node ID (
n8n_trigger_93cf25e8_…), so copying a workflow gives it its own set. - Errors from the regular Postgres node (connection refused, password authentication failed, SSL, relation or column does not exist) are in n8n Postgres node errors; the credential is the same. Other database nodes: MySQL, Redis. Every message from our tests is in the n8n error message index.
What we didn't test
- The editor's test step (Execute step) listening, queue mode with several main instances, hosted Postgres (Supabase, Neon, RDS) and read replicas, SSL credentials, and how long a dead listener stays dead (we checked for about a minute).
Start from a working agent
FAQ
Why is my n8n Postgres Trigger not firing?
Check the n8n log for There was a problem activating the workflow. In our tests that came from a table name with the wrong case, the wrong schema, or a user without rights to create a trigger. If it worked before and stopped with no error, the listening connection died (for example after a Postgres restart): restart n8n.
What does permission denied for schema public mean in the n8n Postgres Trigger?
The credential's user can't create the trigger function in the public schema, which is the default on PostgreSQL 15 and later. Use the table owner, or create the trigger yourself and use Listen For: Advanced.
Why does my insert fail with payload string too long after adding an n8n Postgres Trigger?
The trigger sends the whole row through pg_notify, which is limited to 8,000 bytes. A row bigger than that makes your INSERT fail. Send only the id from your own trigger and fetch the row in n8n.
Does the n8n Postgres Trigger give old values on update?
No. In our test the Update event sent only the new row. If you need old values, write your own trigger that sends both and use Listen For: Advanced.
How do I fix function already exists with same argument types in n8n?
A function with your custom Function Name is left from an earlier run. Turn on Replace if Exists in Additional Fields, or drop the old function and trigger, then publish again.
Related guides
- n8n Supabase node errors: credentials, RLS and filter fixes, 41 runs
- n8n Data Table node not working: unknown column, types, upsert, 78 runs
- n8n Google Drive Trigger not working: not firing, activation errors and fixes
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes
- n8n HTML Extract not working: empty values, selectors and errors, 32 runs
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Gmail Trigger not working: not firing, silent errors and fixes