Chat embed returns JSON

Describe the problem/error/question

Hi, I created a chatbot and now i want it to run on my website. So I published the workflow and set the chatbot node to “embed”. It’s working, but the chatbot on my website returns JSON Code, not only the AI Answer (see image)

If I use the chat trigger in my workflow, it works fine.

N8n Self hosted with Docker on Digital Ocean, Version Version 1.52.2

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:

Hi @holgerkurtz92

Thanks for posting here and welcome to the community! :tada:

What does the end of your workflow look like? If you use a Set Node for example you can specify a key value with the name of either text or output and set it to the AI response. The Agent will then pick that up and return only the response text.

Here’s an example of what I mean:

2 Likes

Hi @holgerkurtz92. I encountered the similar problem. The chatbox output with {“response”:{ “text”:

Here’s what work for me. Below is the workflow I’m using

Embed below script in the website. Link to script ( @n8n/chat - npm (npmjs.com)

Replace ‘YOUR_PRODUCTION_WEBHOOK_URL’ with your chat URL

That should get rid of {“response”:{ “text”: . Let me know otherwise

1 Like

I will get you the code tomorrow I used to fix it.

Did anyone solve the problem?

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