❗ Chat Trigger or Webhook executes on page load – even before user sends message (embedded @n8n/chat)

Hi! I’m using the @n8n/chat widget on my website with the embedded mode and a chatbot workflow built in n8n.

The problem:

Each time a user loads the page (even without opening or interacting with the chat), the Chat Trigger (or even plain Webhook) node fires immediately and consumes an execution.

This happens even though:

  • I’m using startOnLoad: false
  • I removed initialMessages
  • I only send messages via onStart() after the user clicks “Get Started”
  • I’ve also tested loadPreviousSession: false – but still getting executions on page load

Goal:

I want to trigger the workflow only after the user actually sends their first message, not before.

What I’ve tried:

  • Chat Trigger with and without memory
  • Switched to Webhook node instead of Chat Trigger
  • onStart() instead of initialMessages
  • Tried to inspect the payload – it still fires on loadPreviousSession
  • Also tried filtering it in a Function node (based on action) – still counts as an execution

What I’m asking:

Is there a way to completely avoid any execution until the user sends a message?

Or alternatively:

  • Is there a flag to prevent even the loadPreviousSession call?
  • Is there a way to lazy-load the widget entirely?

Thank you in advance :folded_hands:
I’m building a product-facing AI chatbot and want to avoid burning execution units on page visits.

1 Like

Hello @aviorwork,

There is a setting for “Load Previous Session” make sure it is off. Then it wont trigger when the page is loaded.

  loadPreviousSession: false,

If this answer helped solve your issue, feel free to mark it as the solution so others can benefit from it too!

Best,

Robert

1 Like