Actions12
Overview
The node interacts with the Telegram Client API to perform various chat-related operations. Specifically, the "Get Message History" operation retrieves the message history from a specified Telegram chat or channel. This is useful for scenarios where you want to analyze past conversations, archive messages, or trigger workflows based on historical chat data.
Practical examples include:
- Extracting recent messages from a support channel to analyze customer inquiries.
- Archiving chat history for compliance or record-keeping.
- Monitoring specific chats for keywords or patterns by fetching recent messages.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The identifier of the chat or channel from which to retrieve message history. It can be a numeric ID (e.g., -100xxxx) or a username starting with '@'. |
| Options | Additional optional parameters: • Silent: Not applicable for this operation. • Caption: Not applicable. • Parse Mode: Not applicable. • Limit: Maximum number of messages to return (default 100). |
Output
The output JSON contains the following structure:
{
"success": true,
"messages": [
{
// Each message object as returned by the Telegram Client API
}
]
}
success: Boolean indicating if the operation was successful.messages: An array of message objects representing the retrieved message history from the specified chat. Each message includes details such as message ID, date, sender, content, and other metadata as provided by the Telegram API.
No binary data is output by this operation.
Dependencies
- Requires an active Telegram Client API credential with valid session, API ID, and API hash.
- The node uses the Telegram Client SDK internally to connect and fetch messages.
- Network connectivity to Telegram servers is necessary.
- No additional environment variables are required beyond the configured credentials.
Troubleshooting
- No credentials provided: The node will throw an error if the Telegram Client API credentials are missing or invalid. Ensure that the API key/session information is correctly set up in n8n.
- Connection issues: If the node cannot connect to Telegram, verify network access and that the credentials have not expired or been revoked.
- Invalid Chat ID: Providing an incorrect or inaccessible chat/channel ID or username will result in errors or empty results. Double-check the chat identifier.
- Limit parameter: Setting an excessively high limit may cause performance issues or timeouts. Use reasonable limits according to your needs.
- Operation not supported: If the operation parameter is incorrectly set, the node will throw an unsupported operation error.