Pass a variable from webpage to workflow using chat message trigger?

Describe the problem

I use the chat message trigger embedded in a website.
When a user load the webpage, it has a cookie called “client_id”. I would like to be able to retrieve the client_id in my workflow.

The objective is to query a vector database filtering the documents to the ones concerning the client_id only.

The question

Is possible to pass an argument to the createChat function to retrieve it in the workflow ?

I have read the doc:

But nothing. There is a field called metadata, but there is not information about it, you forgot the field description.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @LucBerge,

I have had a chat with the team and the metadata option might be what you need, To use it you can input any json object you want and it will appear in the chat trigger node output ready to be used.

Thanks, it would be nice to complete the documentation

Hey @LucBerge,

Good point I will bring that up internally, I think we left it blank to show it could be anything but being more explicit there is probably best.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.