Embedded Chat: after page reload, tool calls/intermediate steps show up as AI messages (need to keep steps for analytics)

Hi everyone,

I’m using n8n Embedded Chat with Chat Trigger + AI Agent and tools.

Expected behavior

When I send a message, the agent calls tools correctly and the final assistant reply appears normally in the chat.

Issue

After I reload the page, the Embedded Chat loads the previous session history and all tool calls / intermediate steps are displayed as if they were assistant messages, often as large blocks of JSON/code.

So the live experience is fine, but on refresh/history restore the chat UI renders internal agent/tool data as chat messages.

I need to keep the intermediate steps logged for later analysis/debugging (tool inputs/outputs, reasoning steps, etc.). I just don’t want those steps to be persisted or rendered as end-user chat messages when the session is reloaded.

Here’s a short video showing the behavior: https://youtube.com/shorts/1-TCn_xcqjo

Hi @Daniel_Santos_solucx, welcome!

I’m able to reproduce this, sounds like a bug but I’m not sure,

I don’t think it’s supposed to expose the intermediate calls, which seems to happen only when loading the previous session,
The logic there seems to just loading the messages array, which contains human, ai, tool messages..

If you have the time, maybe report this on GitHub, It would be nice to know whether this is intentional or not…

1 Like