Respond to Webhook vs Respond to Chat

Hey, I’m not sure I understand this correctly but I think the “Respond to Chat” should work similar to “Respond to Webhook”?

In the first Node you set Respond/Response Mode and then add the Respond Node somewhere (?)

For Webhook it works fine, you can respond and do something else

For Chat, it hangs before the “Respond to Chat” Node with “Waiting for…” and never advances

I also tried using “Respond to Webhook” and with the Chat trigger it hangs the same way

Am I doing something wrong or is it a bug?

Thank you

Please share your workflow

Information on your n8n setup

  • n8n version: 1.105.2
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
1 Like

Hi @gibe

Respond to chat is a very new node. I tried running your workflow and it seems to work fine. It ran all the way though when I chatted.

The chat will also respond with the output of the last step if you don’t want to use respond to chat.

What is your use case? What do you want this flow to do?

:heart:If this response helped you, please click the heart to show that it is useful

Best,

Robert

Hi @rbreen

I noticed this problem when I was testing an AI → Home Assistant interaction, like asking something of the Agent, passing the response as a parameter to the HA node, and it does not return anything on success. So I added a Respond to Chat at the end, and it hung forever.

I could maybe create a Set node at the end with { "output": "ok" }, and it would work, but I don’t think that’s what I’m supposed to do (?)

For the “When chat message received” Response Nodes, it’s described that you can use Respond to Chat or Respond to Webhook, but both had the same behavior → they hang just before this node:

If I start with Webhook and use Respond to Webhook at any point, it returns the data to the Webhook and proceeds to the next node to do whatever. I’m not sure why I’m not seeing the same behavior with Chat using either of the two response nodes.

1 Like

@gibe

Not sure why yours doesnt work. It runs on my instance. For now, use a code node like this. it will respond with whatever you want it to say.

Here’s an image of it working on my instance.

:heart:If this response helped you, please click the heart to show that it is useful
:white_check_mark:If this response solved your issue, mark it as the solution to help the community

@rbreen

Thank you—I did try that before. If I leave When chat message as default and finish with a “text” or “output” message, it works, but I lose the option to return a message and then continue doing other stuff in the next nodes.

I’m not sure how much difference it makes, but have you tested my workflow on a self-hosted instance? I’m running it in Docker with n8n:next, and it updated today to v1.106.

1 Like

@gibe

I’d recommed using an AI Agent step instead of respond to chat node. It can keep the conversation going, and you can direct the agent what to say. What is your use case?

:heart:If this response helped you, please click the heart to show that it is useful

Ok I figured out what the problem was:

n8n runs on my internal network as n8n.home.arpa via nginx.

I hadn’t set the WEBHOOK_URL env var, so when I sent a chat message in my workflow, the browser tried to connect to:

ws://localhost:5678/chat?sessionId=abc&executionId=123

I’d looked at websockets before, but since n8n connects fine to:

ws://n8n.home.arpa/rest/push?pushRef=abc

without WEBHOOK_URL, it completely slipped by me.

It’s working fine now, but I left an issue open on GitHub because I’m not sure if it’s the intended behavior.

1 Like

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