Actions2
- Message Actions
Overview
This node allows sending messages to Telegram chats as a Telegram user. It is useful for automating communication by programmatically sending text messages to specific Telegram users or groups. Common scenarios include notifying team members, sending alerts, or integrating Telegram messaging into workflows.
For example, you can use this node to send a message to a chat identified by username or chat ID whenever a certain event occurs in your system, such as a new support ticket or a completed task.
Properties
| Name | Meaning |
|---|---|
| Chat | The target chat to send the message to. This can be a Telegram username (without '@') or a chat ID. |
| Message | The text content of the message to send. |
Output
The node outputs a JSON object with details about the sent message:
messageId: The unique identifier of the sent message.chat: The chat username or ID where the message was sent.message: The text content of the sent message.date: The timestamp when the message was sent.success: A boolean indicating if the message was sent successfully (alwaystrueon success).
No binary data output is produced by this operation.
Dependencies
- Requires an API authentication token credential for Telegram user access.
- Uses a helper class internally to authenticate and interact with the Telegram client.
- No additional external services beyond Telegram's API are required.
Troubleshooting
- Authentication failures: If the node cannot authenticate with Telegram, ensure that the provided API credentials are valid and have the necessary permissions.
- Invalid chat identifiers: Sending a message will fail if the chat username or ID is incorrect or inaccessible by the authenticated user.
- Operation errors: Errors during sending will throw descriptive messages like "Operation failed: ..." which usually indicate network issues, invalid parameters, or permission problems.
- Session management: The node attempts to manage session strings internally; if sessions expire or become invalid, re-authentication may be needed.
To resolve common errors, verify credentials, check chat identifiers, and ensure the Telegram account has access to the target chat.
Links and References
- Telegram Bot API Documentation (for general Telegram messaging concepts)
- n8n documentation on Creating Custom Nodes