Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

This node integrates with the Telegram Client API to perform various messaging and chat management operations on Telegram. Specifically, the Send Message operation allows users to send text messages to a specified chat or channel by providing the chat ID or username and the message content.

Common scenarios where this node is beneficial include:

  • Automating notifications or alerts to Telegram channels or groups.
  • Sending updates or reminders to specific chats.
  • Integrating Telegram messaging into workflows for customer support or community engagement.

For example, you can use this node to automatically send a daily summary report to a Telegram group or notify a user about an event in real-time.

Properties

Name Meaning
Chat ID The target chat or channel identifier where the message will be sent. Can be a username (e.g., @username) or a numeric ID (e.g., -100xxxx).
Message Text The text content of the message to send.
Options Additional optional settings:
- Silent: Send message without notification.
- Caption: Caption text for media messages (not used in Send Message).
- Parse Mode: How to parse the message text; options are None, Markdown, or HTML.
- Limit: Maximum number of items to return (not applicable for Send Message).

Output

The output JSON object for the Send Message operation includes:

  • success: Boolean indicating if the message was sent successfully (true).
  • messageId: The unique identifier of the sent message.
  • date: The timestamp when the message was sent.
  • text: The text content of the sent message.

Example output JSON:

{
  "success": true,
  "messageId": 12345,
  "date": "2024-06-01T12:00:00Z",
  "text": "Hello from n8n!"
}

No binary data is output by this operation.

Dependencies

  • Requires a valid Telegram Client API credential including session string, API ID, and API hash.
  • The node uses the Telegram Client SDK internally to connect and interact with Telegram.
  • Network access to Telegram servers is necessary.
  • No additional environment variables are required beyond the provided credentials.

Troubleshooting

  • No credentials provided: The node will throw an error if the Telegram API credentials are missing or invalid. Ensure that the API key, session, and other required authentication details are correctly configured.
  • Operation not supported: If an unsupported operation name is provided, the node throws an error indicating the operation is not supported.
  • Connection issues: Network problems or incorrect API credentials may cause connection failures. Verify network connectivity and credential correctness.
  • Message sending errors: Errors such as invalid chat IDs, insufficient permissions, or malformed message text can cause failures. Check that the chat ID is correct and that the bot/user has permission to send messages there.
  • When continueOnFail is enabled, the node will output error details per item instead of stopping execution.

Links and References

Discussion