Rahsaz Telegram icon

Rahsaz Telegram

Sends data to Telegram

Overview

The "Send Document" operation of the "Message" resource in this Telegram node allows users to send documents to a specified chat or channel on Telegram. This operation supports sending documents either by referencing an existing file on Telegram servers (using a file ID), providing an HTTP URL for Telegram to fetch the document, or uploading a new file from binary data within n8n.

This node is beneficial when automating workflows that require sharing files such as PDFs, Word documents, spreadsheets, or any other document type with Telegram users or channels. For example, it can be used to automatically send invoices, reports, or user-generated content directly into a Telegram group or private chat.

Properties

Name Meaning
Chat ID Unique identifier for the target chat or username of the target channel (in the format @channelusername). Specifies where the document will be sent.
Binary File Boolean flag indicating whether the document to send should be taken from a binary field in the input data (true) or provided as a string reference like a file ID or URL (false).
Input Binary Field The name of the binary property containing the file data to upload. Required if "Binary File" is set to true.
Document When not using binary data, this is the document to send. It can be a file ID of a document already on Telegram servers or an HTTP URL for Telegram to fetch the document.
Reply Markup Additional interface options for the message. Options include: Force Reply, Inline Keyboard, None, Reply Keyboard, and Reply Keyboard Remove.
Force Reply Configuration for forcing a reply interface to the user, including options to selectively force reply from specific users only.
Inline Keyboard Defines an inline keyboard attached to the message, consisting of rows and buttons with customizable text and optional callback data, URLs, payment buttons, or inline query switches.
Reply Keyboard Adds a custom reply keyboard with rows of buttons that can request contact or location information from the user.
Reply Keyboard Options Options for the reply keyboard such as resizing, one-time display, and selective visibility.
Reply Keyboard Remove Options to remove the custom keyboard, optionally selectively for specific users.
Additional Fields Various additional parameters such as:
- Caption: Text caption for the document (0-1024 characters).
- Disable Notification: Whether to send the message silently without sound notifications.
- File Name: Filename to use when uploading binary data (required if sending binary).
- Parse Mode: How to parse text fields (Markdown, MarkdownV2, HTML).
- Reply To Message ID: If replying to a specific message, its ID.
- Message Thread ID: Identifier for forum topics.
- Thumbnail: JPEG thumbnail for the document (less than 200 kB, max 320x320).

Output

The node outputs JSON data representing the response from the Telegram API after sending the document. This typically includes details about the sent message such as message ID, chat information, date, and the document metadata.

If the document is uploaded from binary data, the node handles the file upload process transparently, and the output confirms successful delivery.

No binary output is produced by this operation.

Dependencies

  • Requires a valid Telegram API authentication token configured in n8n credentials.
  • The node uses Telegram Bot API endpoints to send messages and upload files.
  • If downloading files (not applicable here), additional HTTP requests may be made.

Troubleshooting

  • Missing File Name Error: When sending a document from binary data, if the file name is not set either in the binary property or manually via the "File Name" parameter, the node will throw an error. Ensure the binary data includes a filename or specify it explicitly.
  • Invalid Chat ID: Providing an incorrect or inaccessible chat ID or channel username will cause the Telegram API to reject the request. Verify the chat ID or username is correct and the bot has permission to send messages there.
  • Unsupported File Type or Size: Telegram imposes limits on file types and sizes. Sending unsupported formats or very large files may fail.
  • API Rate Limits: Excessive messaging may trigger Telegram rate limits; handle errors accordingly.
  • Incorrect Reply Markup Configuration: Misconfigured keyboards or reply markup options may cause the API to reject the message. Validate the structure of inline keyboards and reply keyboards.

Links and References

Discussion