How does 'respond to chat' work in n8n

Describe the problem/error/question

How can i use a respond to chat node? This is a simple workflow with respond to chat. However it seems to keep ‘waiting for input’

What is the error message (if any)?

None. just keep waiting for input. Even if i try to key in something at the chat, it still would not work.

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
{
  "nodes": [
    {
      "parameters": {
        "options": {
          "responseMode": "responseNodes"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        0
      ],
      "id": "425f382e-5c34-4675-97e9-02f4b8771d1c",
      "name": "When chat message received",
      "webhookId": "a9041730-e664-4fab-83cb-72209e0d5bdf"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        128,
        0
      ],
      "id": "ea806927-98a6-480c-8342-52c5647878b7",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": "gpt-4o",
        "options": {
          "responseFormat": "text",
          "maxRetries": 3
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "typeVersion": 1,
      "position": [
        80,
        272
      ],
      "id": "916f7643-86c0-4eec-9c62-84ddf803f608",
      "name": "Azure OpenAI Chat Model",
      "notesInFlow": false,
      "credentials": {
        "azureOpenAiApi": {
          "id": "rdrKsuai7rXisRq7",
          "name": "OpenAI GPT 4o"
        }
      }
    },
    {
      "parameters": {
        "message": "= {{ $json.output }}",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chat",
      "typeVersion": 1,
      "position": [
        480,
        0
      ],
      "id": "6563cfbf-3367-421f-8dfb-3e088f582174",
      "name": "Respond to Chat"
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "dad7b9cfb01707aabf7b89e241bccf6238c654f73e155afa17859e3c50dfd199"
  }
}

Share the output returned by the last node

No output when it is waiting for input.

But if i stop it, the output showed:

Information on your n8n setup

  • n8n version: Version 1.112.5
  • Database (default: SQLite): None
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: linux

Don’t execute the workflow from the last node, use open chat and type something inside and see if it works then :slight_smile:

Ya it is from open chat…

Actually, my bad, can you remove the respond to chat node, and in the trigger switch it to Respond mode - Last node

i will try on it

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