Ask AI

Setting Up a Telegram Bot Trigger via Webhooks to Resolve Delay Issues

At the moment, Telegram triggers, when used as application triggers, do not operate instantly, which is often criticalโ€”especially for chatbots, where response speed is of utmost importance.

Thatโ€™s why Iโ€™m sharing a guide on setting up Telegram triggers via WebHook, completely eliminating any delay issues.

WebHook Setup Process

First, add a Trigger on Webhook node to your scenario.

Notion image

This node offers two WebHook versions:

  • Dev (for development and testing)
  • Prod (for autonomous operation)

Copy the Prod WebHook URL for further setup.

After this, the scenario must be deployed for the PROD WebHook to become active.

Next, add an HTTP Request node.

Notion image

To configure the WebHook, send a GET request to the following URL:

<https://api.telegram.org/bot{my_bot_token}/setWebhook?url={url_to_send_updates_to}>

Simply paste this URL into the URL field and replace the variables:

Notion image

Where:

  • {my_bot_token} โ€” your bot token from BotFather
  • {url_to_send_updates_to} โ€” your Prod WebHook URL

After sending the request, a successful response will look like this:

Notion image

Verifying WebHook Setup

To ensure the WebHook is working, send another request:

<https://api.telegram.org/bot{my_bot_token}/getWebhookInfo>

Example of a successful response:

{
 "ok": true,
 "result": {
   "url": "<https://www.example.com/my-telegram-bot/>",
   "has_custom_certificate": false,
   "pending_update_count": 0,
   "max_connections": 40
 }
}
Notion image

This method allows your Telegram bot to process updates automatically via WebHook rather than manually polling the API.


Now, your Prod WebHook will start receiving updates from Telegram.

Note: Telegram sends ALL updates, including message updates and other events. Therefore, it is recommended to configure more flexible filtering. On higher-tier plans, requests blocked by the first filter are nearly cost-free.

Did this answer your question?
๐Ÿ˜ž
๐Ÿ˜
๐Ÿคฉ