AI agent widget not functioning while n8n is hosted on AWS

I have successfully set up my AI agent on an AWS EC2 instance, and it is accessible via a web address. The agent functions correctly in the editor. However, when I embed the provided code for the chat widget on a test HTML page, the widget does not display the input text section, which typically happens when it cannot connect to the server or access n8n.

Interestingly, the widget works fine when I use the webhook URL of the workflow hosted locally on my machine.

While testing the webhook using Postman, I initially encountered an “Internal Server Error 500.” Upon checking the execution logs in n8n, the error originated in the “Window Buffer Memory” node, which displayed the message “No Session ID.” To resolve this, I added a session ID variable in Postman, and the agent began responding correctly, with outputs visible in Postman.

Despite the AI agent responding correctly when triggered through Postman, the chat widget is still not functioning properly.

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:
  Databse : Sql lite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Aws ec2

Upon resolving the issue, it was determined that the widget was unable to establish communication with the n8n server due to an incorrect webhook URL. The original URL,

http://thecloud.hopto.org:5678/webhook/6985fa0f-9a10-431d-9a15-418b24d9bb5f/chat

contained a redundant port number (:5678) that was not required, as the n8n server was hosted on the base URL http://thecloud.hopto.org. By modifying the webhook URL to

http://thecloud.hopto.org/webhook/6985fa0f-9a10-431d-9a15-418b24d9bb5f/chat

the issue was successfully resolved, and the chat functionality became available, responding as expected.

2 Likes

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