Actions12
Overview
This node acts as a client interface to the Telegram API, enabling various messaging and chat management operations within Telegram. It is useful for automating interactions such as sending messages (text, media, or files), replying to or forwarding messages, managing chat memberships, retrieving message history, searching messages, and deleting messages.
Practical examples include:
- Automatically sending notifications or alerts to a Telegram channel.
- Uploading media content like photos or videos to a chat.
- Fetching recent chat history for analysis or backup.
- Managing group membership by joining or leaving chats programmatically.
- Searching messages in a chat for specific keywords.
Properties
| Name | Meaning |
|---|---|
| Options | Collection of optional parameters: • Silent: Send message without notification (true/false) • Caption: Text caption for media messages • Parse Mode: How to parse message text; options are None, Markdown, HTML • Limit: Maximum number of items to return (for list operations) |
Note: The node supports multiple operations each with their own required properties such as Chat ID, User ID, Message Text, File Path or URL, Media Type, Message ID, To Chat ID, and Search Query. These are not listed here since the request was limited to the "Default" resource and operation, which corresponds to the provided "Options" property.
Output
The output JSON structure varies depending on the operation performed but generally includes:
success: Boolean indicating if the operation succeeded.- For message sending operations:
messageId: Identifier of the sent message.date: Timestamp of the message.textormediaType: Content details.
- For message history or search:
messages: Array of message objects retrieved.
- For chat members retrieval:
members: Array of chat participant objects.
- For user info:
user: Object containing user information.
- For message deletion:
deletedMessageId: ID of the deleted message.
- For forwarding messages:
originalMessageId,forwardedMessages,fromChatId,toChatId.
- For join/leave chat:
- Flags indicating success and the chat ID.
If binary data is involved (e.g., sending files or media), the node handles uploading but does not output raw binary data itself.
Dependencies
- Requires an API authentication token with Telegram Client API credentials including session string, API ID, and API hash.
- Uses the Telegram Client SDK internally to connect and perform actions.
- Needs network access to Telegram servers with WebSocket support enabled.
- n8n credential configuration must provide valid Telegram client credentials.
Troubleshooting
- No credentials provided: The node will throw an error if the required Telegram client credentials are missing. Ensure credentials are configured properly.
- Unsupported operation: If an invalid operation name is specified, the node throws an error indicating the operation is not supported.
- Connection issues: Network problems or invalid credentials can cause connection failures. Verify API ID, API hash, and session validity.
- File path or URL errors: When sending media or files, ensure the file path or URL is accessible and correct.
- Permission errors: Some operations require appropriate permissions in the target chat or channel (e.g., deleting messages, joining channels).
- Continue on Fail: If enabled, the node will continue processing subsequent items even if one fails, returning error details per item.
Links and References
- Telegram Client API Documentation
- Telegram Bot API (for general Telegram messaging concepts)
- Telegram Client SDK GitHub Repository (underlying library used)