Overview
This node fetches new updates (messages and events) from a Telegram bot using the Telegram Bot API. It is designed to poll for new messages, edits, queries, and other update types that the bot receives. The node automatically manages the offset to ensure only new updates are retrieved each time it runs.
Common scenarios:
- Integrating Telegram bot messages into workflows for automated processing.
- Monitoring group chats or channels where the bot is present.
- Responding to inline queries, callback queries, or other interactive Telegram features.
- Logging or analyzing incoming Telegram updates in real-time.
Practical example:
A user can set this node to poll for new messages every few minutes, automatically confirm received updates, and then trigger further workflow steps such as sending notifications, storing messages in a database, or replying to users.
Properties
| Name | Meaning |
|---|---|
| Limit | Maximum number of updates to retrieve per execution. Accepts values from 1 to 100. |
| Timeout | Timeout in seconds for long polling (0-50). Higher values reduce the number of API calls by waiting longer for new updates before returning. |
| Auto Confirm Updates | Whether to automatically confirm received updates by updating the offset after fetching them. This prevents receiving the same updates repeatedly and is recommended. |
| Include Bot Messages | Whether to include messages sent by other bots in groups. Note: Due to Telegram server-side limitations, this may not work reliably in all cases. |
| Debug Mode | Enables debug information in the output, showing details about the API request and metadata about the updates received. Useful for troubleshooting and development. |
Output
The node outputs an array of items, each containing a json field with the Telegram update data:
- When updates are received, each item corresponds to one update object returned by the Telegram API. This includes message objects, edited messages, callback queries, inline queries, and other update types.
- If Debug Mode is enabled, additional
_debug_infofields are included in the output JSON, providing metadata such as:- The type of update (e.g., "message", "callback_query").
- Whether the message is from a bot.
- Chat type and sender username if available.
- If no new updates are available, the node outputs a single item indicating no new updates, including the last offset and timestamp.
- If Auto Confirm Updates is enabled, the node internally confirms updates by advancing the offset so they won't be fetched again.
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. - No additional external dependencies beyond standard HTTP requests.
Troubleshooting
No new updates received:
Ensure the bot has received new messages or events since the last run. Also verify that the offset is correctly managed (auto-confirm is recommended).API errors from Telegram:
Errors returned by the Telegram API will be shown with their description. Common causes include invalid bot token, network issues, or hitting Telegram rate limits.Including bot messages not working:
Due to Telegram server-side restrictions, including messages from other bots may not always work. This is a limitation of the Telegram API itself.Timeout too high or low:
Setting timeout too high may delay workflow execution; too low increases API calls. Adjust based on your use case.Debug mode output clutter:
Enable debug mode only when needed for troubleshooting, as it adds extra metadata to each output item.