Hello everyone, I wanted to know if it’s possible to customize the outputs received in the “chat message received” trigger in order to have an additional column.
I would like to identify the users of my WordPress site to offer them a personalized experience. For that, I would need to retrieve their user IDs as an output to load the memory corresponding to each user.
This depends on whether you want to use the Hosted Chat or Embedded Chat option. Hosted chat would be a standalone chat interface provided by n8n and easy to setup, but if you want to integrate the chat functionality into your own website (e.g. Wordpress) I recommend choosing the Embedded option.
Embedded Chat
In embedded chat, you can include custom metadata (e.g. wordpress_id) directly in the createChat function when embedding the chat on your own webpage. The metadata can be any json object and that should get passed along in the Chat Trigger:
Hosted Chat
In a hosted chat, if you set an Authentication, the chat will pass on the user details in the metadata (e.g. if you select n8n User Auth you’ll see the n8n user details in the metadata like so: