Unable to connect "When chat message received" node to website chatbot — connection rejected error

Hello,
I am trying to embed the chatbot using the “When chat message received” node in n8n to my company website. The chatbot widget appears, but when I open it, I get a connection rejection error with a message referencing my username.
The exact error shown on the website is:
“The page myusername.app.n8n.cloud has rejected the connection.”
I have verified that:
The workflow is active.
The correct Chat URL is used.
Allowed Origins (CORS) include my domain (Url domain and URL subdomain).
The workflow is set to Embedded Chat mode.
Despite this, the connection is still rejected. I have also tried setting Allowed Origins to * but the issue persists.
Could you please help me understand why this connection is rejected and how to properly configure the node and webhook to allow embedding the chatbot on my website?
Thank you in advance for your support.
Best regards,
Julian.

Hey @onepeak_1 hope all is good. Welcome to the communityh.

When you try to send a message, are there any errors in the dev console in your browser?

Hello jabbson,

Thank you for the quick response and welcome message.

I checked the developer console in my browser while trying to send a message through the chatbot, and I am seeing the following error:

Failed to load resource: the server responded with a status of 403 (Forbidden) - https://onepeak.app.n8n.cloud/webhook/...

This error appears every time I try to interact with the chatbot embedded on my website.

Could you please advise what might be causing this 403 Forbidden error and how I can fix it?

Thank you in advance for your help.

Best regards,
Julian

Hey @onepeak_1

the next thing I’d try would be to take the chat webhook URL and try to open it directly in the web browser.

Hi jabbson,

When I open the chat URL directly (hosted), the UI loads fine.
When I embed the same URL in an iframe, I only see the text firstEntryJson.

Could you clarify:

  1. What’s the correct UI endpoint for embedding (vs. the JSON/engine endpoint)?

  2. Are there required headers/CSP or X-Frame-Options settings for iframes?

  3. Is there an official embed snippet or query param (e.g., ?embed=true) I should use, or a wrapper page expected?

Thanks!

The instructions are mentioned here.
Did you read them?

I have exactly the same problem. https://aiagent.gogreenhub.tech/webhook/b57480a6-70a3-404a-8465-1fd1025056ec/chat url for my chat and it is a simple chat application that has nothing complex. Any help will be appreciated.

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