Overview
This node connects to a Telegram user account and reads messages from specified Telegram channels. It is useful for workflows that need to monitor or process messages from Telegram channels, such as automating responses, archiving messages, or triggering actions based on new content in channels.
Typical use cases include:
- Fetching recent messages from a channel to analyze or store them.
- Monitoring channels for new messages since the last processed message ID.
- Handling newly joined channels differently by specifying if the channel is new.
Properties
| Name | Meaning |
|---|---|
| Channel Name | The name of the Telegram channel from which to retrieve messages. |
| Last Message ID | The ID of the last message received; used to fetch messages starting after this ID. |
| Is New | Boolean flag indicating whether the channel is new to the user (affects message retrieval logic). |
Output
The node outputs an array of items where each item's json property contains a result field. This result holds the messages retrieved from the specified Telegram channel according to the input parameters.
If an error occurs during processing an item and "Continue On Fail" is enabled, the output item will contain an error field describing the issue alongside the original data.
No binary data output is produced by this node.
Dependencies
- Requires a valid Telegram user API authentication setup including:
- A session string representing the logged-in Telegram user.
- An API ID and API hash obtained from Telegram's developer portal.
- Uses the
telegramandtelegram/sessionslibraries to interact with the Telegram API. - Requires n8n credentials configured with these Telegram user details.
Troubleshooting
- Missing or invalid credentials: The node throws an error if the session, API ID, or API hash are missing or incorrect. Ensure all credential fields are properly set.
- Connection issues: Network problems or invalid Telegram credentials can cause connection failures. Verify network access and credential validity.
- Channel not found or inaccessible: If the specified channel name does not exist or the user has no access, the node may fail to retrieve messages.
- Message retrieval errors: Errors during fetching messages are caught per item. Enabling "Continue On Fail" allows the workflow to proceed while logging errors for problematic items.
- Common error messages relate to authentication failure, invalid session, or inability to find the channel.