// guides · n8n error index

n8n Postgres Trigger not working or not firing: 27 tests, fixed

Fix the n8n Postgres Trigger: relation does not exist, permission denied for schema public, payload string too long, function already exists, channel name case and triggers that silently stop after a database restart. 27 real tests on n8n 2.43.7 and PostgreSQL 17.

Updated 2026-10-23 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. 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.

  2. 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 as orders2 failed with relation "public.orders2" does not exist; typing Orders2 worked. A table in another schema failed the same way (relation "public.invoices" does not exist) until we set Schema Name to sales. Pick both from the list when you can. A failed activation still left its n8n_trigger_function_… function behind, which is harmless but worth cleaning up.

  3. Give the database user the rights to create a trigger

    The node runs CREATE FUNCTION and CREATE TRIGGER on your table, so a read/insert user isn't enough. On PostgreSQL 15 and later nobody can create objects in public by default, and our app role failed with permission denied for schema public. After GRANT CREATE ON SCHEMA public it failed with permission 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).

  4. 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: with MyChannel it listened on mychannel. NOTIFY MyChannel reached it (Postgres lowers that too), but pg_notify('MyChannel', …) did not, while pg_notify('mychannel', …) did. Use lower case everywhere. Dashes aren't allowed: my-channel failed with Channel 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.

  5. 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 with payload string too long and 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.

  6. 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.

  7. 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 with function "big_audit_fn" already exists with same argument types until we turned on Replace if Exists. List left-overs with select 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.

SetupResult
Insert trigger on orders, one row inserted1 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 31 execution, payload is the new row only (qty 3), no old values
Delete trigger, row deleted1 execution, payload is the deleted row
One INSERT statement with 3 rows3 executions, one per row
INSERT inside a transaction that was rolled backNo execution
INSERT, then commit 3 seconds laterExecution 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 salesrelation "public.invoices" does not exist
Schema sales, table invoicesActivated, 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 publicpermission 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-channelChannel 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 columnThe 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 runningAll 7 listening connections gone, no log line, no executions until n8n was restarted
n8n stopped normally after the connections had diedThere was a problem calling "closeFunction" on "Postgres Trigger" for each workflow; triggers and functions left in the database
n8n stopped normally with healthy connectionsn8n dropped its triggers and functions
Activation that failed with relation does not existThe n8n_trigger_function_… function was still created and left behind
n8n killed (kill -9), a row inserted while n8n was downTriggers stayed in the table; that row never reached n8n, even after restart
n8n restarted after the kill, default trigger namesActivated 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 offfunction "big_audit_fn" already exists with same argument types
Same, Replace if Exists on, published againActivated, listening on the custom channel
A failing workflow at n8n startup5 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

What we didn't test

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

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.