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 to a specified chat or channel on Telegram. This is useful in scenarios where you want to automate file sharing within Telegram groups, channels, or direct chats, such as sending reports, images, documents, or other media files programmatically.

Practical examples include:

  • Automatically sending daily reports or logs as files to a team chat.
  • Sharing media files like PDFs or images to a Telegram channel for subscribers.
  • Distributing documents or presentations to specific users or groups without manual intervention.

Properties

Name Meaning
Chat ID The identifier or username of the target chat or channel (e.g., @username or -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 silently without notification (boolean).
- Caption A caption text to accompany the file.
- Parse Mode How to parse the caption text; options are: None, Markdown, or HTML.

Output

The output JSON object for the Send File operation contains:

  • success: Boolean indicating if the file was sent successfully.
  • messageId: The unique identifier of the sent message.
  • date: The timestamp when the message was sent.
  • filePath: The original file path or URL used to send the file.

This output confirms the successful delivery of the file and provides metadata about the sent message.

Dependencies

  • Requires an active Telegram API authentication token (API ID, API hash, and session string) configured in n8n credentials.
  • Uses the Telegram Client SDK internally to connect and interact with the Telegram API.
  • Network access to Telegram servers is necessary.
  • No additional external services are required beyond Telegram's API.

Troubleshooting

  • No credentials provided: The node will throw an error if the required Telegram API credentials are missing. Ensure that valid API credentials are set up in n8n.
  • File not found or inaccessible: If the file path or URL is invalid or unreachable, the operation will fail. Verify the file location and permissions.
  • Invalid Chat ID: Using an incorrect or unauthorized chat/channel ID can cause errors. Confirm the chat ID or username is correct and accessible by the authenticated user.
  • Network issues: Connectivity problems with Telegram servers may cause timeouts or failures. Check network connectivity and retry.
  • Unsupported file types or size limits: Telegram imposes limits on file sizes and types; exceeding these may result in errors.
  • Silent option not working: If notifications still appear despite setting silent, verify Telegram client settings and permissions.

If the node encounters an error during execution and "Continue On Fail" is enabled, it will return an error object with the message and operation name instead of stopping the workflow.

Links and References

Discussion