Working with online chat and node chat

Describe the problem/error/question

Please share your workflow

This is how I installed chat on the site

<script src=""></script>

<link href="" rel="stylesheet" />
<script type="module">
    import { createChat } from '';

        webhookUrl: ''

It seems like I wrote in the code so that the history is stored. But for some reason, when the page is refreshed, the site changes sessionId

Okay, I understand that the first time you open a page, in theory you can somehow pull up the history from the database, but I don’t understand in what format the data should be returned to a request from a chat like loadPreviousSession

For chat mode you need to give {“output”:“{{ $json.body.chatInput }}”} in the last node

But it’s not clear from the documentation how to save adi sessions and load the history in what format. I understand that you need to give something like metadata, but in what format should you give the array of messages?

n the lower node the code Respond to Webhook1 was downloaded from here

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:
  • n8n version: 1.19.1
  • Database postgres:
  • n8n EXECUTIONS_PROCESS setting main:
  • Running n8n via Docker :
  • Operating system: Linux

Hey @mirrox,

The metadata can be any javascript you want but for chat history I would expect the memory nodes to be used as well which may help. It does look like this was raised as an issue internally the other day and was potentially fixed in 1.32.0 (fix(editor): Fix retrieving of messages from memory in chat modal by OlegIvaniv · Pull Request #8807 · n8n-io/n8n · GitHub) so an upgrade could be worth doing.