I would to use channel with triggers, in particular Posgresql triggers, to not listen all update events for example (otherwise, my workflow loops)
I was able to find the documentation on how to listen on the channel (it is easy), but no documentation on how to generate an event on th right channel for Postgresql
For example, how to make an update in Posgresql with a specific channel?
If you have information abour that, it will be great
Information on your n8n setup
**n8n version: 1.27.3
**Database (default: SQLite): Postgresql
**n8n EXECUTIONS_PROCESS setting (default: own, main): main
**Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
From what I understand a channel is just a named notification channel on a table so you may not need to change anything, Looking at the postgres documentation though they do mention a pg_notify option.
The channel name is set by the trigger node when it starts the listen, if you want to change the channel name you would need to do it in the trigger node then it will connect using the new channel name to listen for events.
It should be automatic as the event channel is notified by Postgres, As mentioned earlier though Postgres does seem to have a pg_notify() option that you might be able to use as well but for that you would to dig through the postgres docs as that is outside of n8n.
Does an insert on it’s own not notify the channel automatically? From what I understand there shouldn’t be a need to manually fire an event on a channel as Postgres should just handle it.
This is the sort of thing I would need to take your guidence on as I would assume you have the knowledge on how Postgres works, We just make the nodes that interact with the specification / api provided.
The idea of my question is not to find a tricky solution to send an event on a specific channel after an insert in Postgres, because there is no way for that. The goal is to add an option in insert, update, select, … of Postgres node to fire events without a painful way to write everything with our little fingers
For example, here we have a trigger which listen on MyTrigger channel. There are 2 nodes, one inserts data in database and the second fires an event
In the second node, I need to write all fields to fire a good payload, and it is painful because, the node need to be adapted on each situation, and it is frustrating because it could be done automatically
If, in the insert node, we have an option to select a trigger (because we know all triggers) or to write a trigger name (it is easier to implement), we could collect data from the insert node in a payload and fire an event like it is done in the second node
It will offer lot of possibilities to communicate between workflows on an easy way
I take it then that Postgres does not automatically just post these updates and what you are actually after here is a feature request to add the Notify option?
Finally yes, the question around the existence of a feature becomes a request for a new feature
In my mind, the biggest part of the work was done in the Postgres node, the Notify option should not be a big work - but I am perhaps wrong…