Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

The node implements a Telegram client that interacts with the Telegram API to perform various messaging operations. Specifically, for the Send File operation, it allows sending any type of file (document) to a specified chat or channel on Telegram.

This node is beneficial in scenarios where automated workflows need to share files via Telegram, such as sending reports, images, PDFs, or other documents directly from an automation pipeline. For example, a business could automatically send daily sales reports as PDF files to a Telegram group, or a monitoring system could send log files when certain alerts trigger.

Properties

Name Meaning
Chat ID The target chat or channel identifier where the file will be sent. Can be a username (e.g., @username) or numeric ID (e.g., -100xxxx).
File Path Or URL The local path or a URL pointing to the file to be sent.
Options Additional optional settings:
• Silent: Send the message without notification (boolean).
• Caption: Text caption accompanying the file.
• Parse Mode: How to parse the caption text; options are None, Markdown, or HTML.
• Limit: Maximum number of items to return (not applicable for sending files but part of options collection).

Output

The output JSON object for the Send File operation includes:

  • success (boolean): Indicates if the file was sent successfully.
  • messageId (number): The unique identifier of the sent message.
  • date (timestamp): The date/time when the message was sent.
  • filePath (string): The original file path or URL used to send the file.

If the node supports binary data output, it is not explicitly shown here; the output focuses on metadata about the sent message.

Dependencies

  • Requires valid Telegram API credentials including an API ID, API hash, and a session string for authentication.
  • Uses the Telegram Client SDK internally to connect and interact with Telegram's API.
  • The node must be configured with these credentials in n8n before use.

Troubleshooting

  • No credentials provided: The node throws an error if Telegram API credentials are missing. Ensure credentials are set up correctly in n8n.
  • File not found or inaccessible: If the file path or URL is invalid or unreachable, sending will fail. Verify the file location and permissions.
  • Invalid Chat ID: Using an incorrect or unauthorized chat/channel ID will cause errors. Confirm the chat ID or username is correct and accessible by the authenticated user.
  • Network issues: Connection failures to Telegram API may occur due to network problems. Check internet connectivity and firewall settings.
  • Operation not supported: If an unsupported operation is selected, the node will throw an error indicating this.

To resolve errors, review the error messages returned in the output JSON under the error field when success is false, and adjust parameters accordingly.

Links and References

Discussion