Telegram Trigger (long polling) Trigger icon

Telegram Trigger (long polling) Trigger

Starts the workflow on a Telegram update via long polling

Telegram Trigger (long polling) Trigger

AI-generated

Overview

This node acts as a Telegram trigger using long polling to start workflows based on various types of Telegram updates. It continuously polls the Telegram Bot API for new updates such as messages, edited messages, callback queries, chat member status changes, inline queries, polls, and more. When an update matching the selected types is received, it triggers the workflow with the update data.

Common scenarios where this node is beneficial include:

  • Automating responses or actions when receiving new messages or commands.
  • Handling user interactions via inline queries or callback buttons.
  • Monitoring chat membership changes or join requests.
  • Processing poll results or payment-related queries.
  • Reacting to message reactions or edits.

For example, you could use this node to automatically respond to customer inquiries in a Telegram chat, log channel posts to a database, or handle checkout queries in a Telegram-based shop.

Properties

Name Meaning
Updates The types of Telegram updates to listen for. Options include: All updates, Bot Chat Member Updated, Callback Query, Channel Post, Chat Join Request, Chosen Inline Result, Edited Channel Post, Edited Message, Inline Query, Message, Poll, Poll Answer, Pre-Checkout Query, Shipping Query, User Chat Member Updated, Message reaction, Message reaction count. Selecting "*" listens to all update types.
Limit The maximum number of updates to fetch per polling request. Must be at least 1. Default is 50.
Timeout The timeout in seconds for each long polling request to the Telegram API. Must be 0 or greater. Default is 60 seconds.

Output

The node outputs an array of JSON objects, each representing a Telegram update that matches the selected update types. Each object contains the full update data as received from the Telegram Bot API, including fields like update_id and the specific update content (e.g., message, callback_query, edited_message, etc.).

If multiple updates are received in one polling cycle, they are emitted together as separate items in the output array.

The node does not output binary data.

Dependencies

  • Requires a valid Telegram Bot API token credential configured in n8n.
  • Uses the Telegram Bot API endpoint https://api.telegram.org/bot<token>/getUpdates for polling updates.
  • No additional external dependencies beyond standard HTTP requests.

Troubleshooting

  • Error 409 Conflict: This error can occur if another process is already polling updates for the same bot token. The node handles this by ignoring the error during shutdown cleanup. To resolve, ensure only one instance of this trigger is running per bot token.
  • No updates received: Verify that the bot token is correct and the bot has appropriate permissions for the requested update types. For some update types (e.g., chat member updates), the bot must be an administrator with specific rights.
  • Timeouts or delays: The polling timeout controls how long the request waits for updates. Setting it too low may increase API calls; setting it too high may delay update processing.
  • Empty updates when selecting "*": Selecting all updates disables filtering on the API side, so the node filters updates locally. Ensure your workflow can handle all update types or specify particular update types to reduce noise.

Links and References

Discussion