Actions33
- Chat Actions
- Custom Request Actions
- File Actions
- Group Actions
- Message Actions
- User Actions
Overview
This node enables sending messages and files through Telegram using the TelePilot API. Specifically, the "Send Message with File" operation allows users to send a local file as a document attachment to a specified Telegram chat, optionally including a caption and replying within a message thread or to a specific message.
Common scenarios where this node is beneficial include:
- Automating the distribution of documents, reports, or media files to Telegram groups or individual chats.
- Integrating Telegram file sharing into workflows that generate or process files dynamically.
- Replying to specific messages or threads in chats while sending files, maintaining conversation context.
Example use case:
- A workflow generates a PDF report daily and uses this node to send the report file to a Telegram group chat with a caption describing the report.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The unique identifier of the Telegram chat where the file will be sent. |
| File Path | The local filesystem path to the file to be sent. |
| File Caption | Optional text caption to accompany the file in the message. |
| Reply to messageId | (Optional) Identifier of a specific message to reply to within the chat. |
| Reply to threadID | (Optional) Identifier of a message thread within the chat to send the file message into. |
Output
The node outputs an array of JSON objects representing the response from the Telegram API for the sent message. For the "Send Message with File" operation, the output JSON includes details about the sent message, such as message identifiers, chat information, and metadata about the uploaded file.
If the operation succeeds, the output contains the full Telegram message object confirming the file was sent. If there are errors, the output may contain error details explaining the failure.
The node does not output binary data directly; it sends files from local paths specified by the user.
Dependencies
- Requires a valid Telegram API authentication credential (an API key/token) configured in n8n.
- Access to the local filesystem to read the file at the specified path.
- The TelePilot Node Connection Manager handles communication with the Telegram API.
- No additional external services beyond Telegram are required.
Troubleshooting
- File Not Found: If the specified file path does not exist or is inaccessible, the node will fail. Ensure the file path is correct and accessible by n8n.
- Permission Errors: Sending files to certain chats may fail if the bot/user lacks permission. Check chat permissions.
- File Size Limits: Telegram imposes size limits on files. Large files may be rejected.
- Authentication Issues: If the Telegram session is not logged in or expired, the node will throw errors prompting re-login via the login flow.
- Caption Empty Handling: An empty caption string is converted to
nullbefore sending to avoid API issues. - Reply Identifiers: Providing invalid message or thread IDs for replies may cause errors.
Common error messages and resolutions:
"Please login": The Telegram session is not authenticated. Use the login node or flow to authenticate."File not found at path": Verify the file path exists and is readable."Cannot send messages to this chat": Check if the bot/user has write permissions in the target chat."File reference has expired": Retry sending the file; the file reference used by Telegram expired.
Links and References
- Telegram Bot API Documentation
- TelePilot Official Guide - Instructions for login and usage
- n8n Documentation - General info on creating and using nodes