Telegram Error Send a text message Bad request - please check your parameters

Hi,

I am building a Telegram bot + AI Agent workflow in n8n (v2.1.1 self-hosted).

Flow:
Telegram Trigger → AI Agent (Google Gemini Chat Model) → Send a text message

I am facing an issue in the Send a text message node. Telegram is returning this error:

Error:
Bad Request: chat not found (400)

I am using this expression for Chat ID:
{{$node["Telegram Trigger"].json.message.chat.id}}

The chat ID is clearly present in the input (it is a private chat), but the message still fails to send.
Parse Mode is set to HTML, and the message text is coming from the AI Agent output ({{$json.output}}).

I am confused about:

  • Why “chat not found” occurs even though the chat ID is correct

  • Whether there is a context or item mismatch after the AI Agent node

  • Or if the chat ID is not being passed correctly from the Telegram Trigger

Please help me understand:

  • The exact reason for this error

  • And the correct way / best practice to fix this issue when using AI Agent + Telegram in n8n

Thanks

the specific problem seems to be the **“chat not found”** error in the **Send a text message** node, despite having the correct chat ID.

javged Alam has already tried using the correct chat ID from the Telegram Trigger node.

he’s using n8n (v2.1.1 self-hosted) and the flow is:

```

Telegram Trigger → AI Agent (Google Gemini Chat Model) → Send a text message

```

the chat ID is being passed as `{{$node[“Telegram Trigger”].json.message.chat.id}}` to the **Chat ID** field in the **Send a text message** node.

let me know if that helps!