Actions30
- Chat Actions
- Custom Request Actions
- File Actions
- Group Actions
- Message Actions
- User Actions
Overview
This node, named "Telegram CoPilot," provides extensive integration with the Telegram API, enabling automation and interaction with Telegram accounts. It supports a wide range of Telegram operations such as user management, chat handling, message sending/editing/deleting, file operations, group management, and custom raw requests.
The Custom Request operation allows users to send arbitrary JSON-formatted requests directly to the Telegram API via this node, offering maximum flexibility for advanced use cases beyond predefined operations.
Common scenarios where this node is beneficial:
- Automating Telegram messaging workflows (sending text, audio, video, photos, files).
- Managing Telegram chats and groups programmatically.
- Retrieving detailed user or chat information.
- Handling Telegram login sessions within n8n workflows.
- Executing custom Telegram API calls not covered by standard operations.
Practical example:
- A workflow that sends a customized notification message with an attached photo to a specific Telegram chat.
- Fetching chat history from a group and processing messages automatically.
- Using the Custom Request operation to call a new or less common Telegram API method by providing the exact JSON request payload.
Properties
| Name | Meaning |
|---|---|
| Request (JSON) | The raw JSON string representing the Telegram API request to be sent in the customRequest operation. This must be a valid JSON object matching Telegram's API schema for the desired method. |
Output
- The output is a JSON array where each element corresponds to the result of the invoked Telegram API call.
- For the Custom Request operation, the
jsonoutput contains the parsed response from the Telegram API based on the provided JSON request. - The node can also output binary data when sending audio or voice messages, but this is not applicable for the Custom Request operation specifically.
- Typical output fields depend on the Telegram API method called and may include user info, chat details, message objects, status confirmations, etc.
Dependencies
- Requires a valid Telegram API authentication credential (an API key credential including apiId, apiHash, phoneNumber).
- Uses an internal connection manager to handle Telegram client sessions.
- Relies on the Telegram TDLib API via a client wrapper.
- Node environment must have access to the filesystem if sending local files (e.g., audio, photos).
- Debugging logs are enabled via the
debugpackage under the namespacetelepilot-node.
Troubleshooting
Common issues:
- Not logged in / Unauthorized errors: Occur if the Telegram session is not authenticated or has expired. Users must perform login using the login operation or ChatTrigger node before making other requests.
- Session closed errors: If the Telegram client session was closed unexpectedly, the node will prompt re-login.
- Invalid JSON input: The Custom Request JSON must be valid and correctly formatted; otherwise, parsing or API invocation will fail.
- File path errors: When sending files, ensure the specified local file paths exist and are accessible.
- API restrictions: Some Telegram API errors indicate permission issues (e.g., cannot send messages to certain chats), expired file references, or user restrictions on receiving media.
Error messages and resolutions:
"Please login: https://telepilot.co/login-howto"— User needs to authenticate their Telegram account first."File reference has expired. Please try again."— Refresh the file reference or upload the file anew."Cannot send messages to this chat. You may not have permission."— Check chat permissions or bot rights."Binary property ... does not contain a filepath"— Verify that the binary input data includes a valid file path."File size exceeds Telegram's limit"— Reduce file size or split content to comply with Telegram limits.
Links and References
- Telegram TDLib Documentation
- Telepilot Login Guide
- Telegram Bot API Reference (for understanding API methods)
- n8n Documentation (general node usage and credentials setup)