Actions28
- Chat Actions
- File Actions
- Group Actions
- Message Actions
- User Actions
Overview
The Download File operation of the File resource in this custom n8n node allows you to download a file from Telegram using its unique file identifier. This is particularly useful when you need to retrieve files (such as documents, images, or other media) that have been previously uploaded or shared within Telegram chats, groups, or channels.
Common scenarios:
- Automating the retrieval of user-uploaded files for further processing.
- Archiving Telegram-shared documents into external storage systems.
- Integrating Telegram file downloads into business workflows (e.g., saving invoices, reports, or attachments).
Example:
You receive a file in a Telegram chat and want to automatically download it and process it in your workflow. By providing the file's ID, this node will fetch the file metadata or download link.
Properties
Display Name | Type | Description |
---|---|---|
File ID | String | Identifier of the file to download. This is required and should be obtained from previous Telegram API responses or triggers. |
Output
The output is a JSON object containing information about the requested file. The structure typically includes:
{
"id": "<file_id>",
"size": <number>,
"expected_size": <number>,
"local": <boolean>,
"can_be_downloaded": <boolean>,
"can_be_deleted": <boolean>,
"is_downloading_active": <boolean>,
"is_downloading_completed": <boolean>,
"downloaded_prefix_size": <number>,
"downloaded_size": <number>,
// ...other Telegram file metadata fields
}
- id: The unique identifier of the file.
- size: The total size of the file in bytes.
- expected_size: The expected size if known.
- local: Whether the file is available locally.
- can_be_downloaded: Indicates if the file can be downloaded.
- is_downloading_completed: True if the file has been fully downloaded.
- downloaded_size: Number of bytes already downloaded.
Note: The actual binary file content is not directly returned; instead, you receive metadata and status about the file. You may need to use additional steps to access the file content based on the returned information.
Dependencies
- Telegram API credentials: You must configure the
telePilotApi
credential in n8n with your Telegram API details (API ID, API Hash, and phone number). - External Service: Requires access to the Telegram API via the TelePilot integration.
- n8n Configuration: Ensure the node is properly authenticated and connected to Telegram.
Troubleshooting
Common issues:
- Invalid File ID: If the provided File ID does not exist or is incorrect, the node will return an error indicating the file could not be found.
- Session/Authentication Errors: If your Telegram session is expired or not authenticated, you may see errors like "Please login: https://telepilot.co/login-howto".
- Permission Issues: If the bot/user does not have permission to access the file, the download may fail.
- File Not Downloadable: Some files may not be downloadable due to Telegram restrictions or privacy settings.
Error messages and resolutions:
"Please login: https://telepilot.co/login-howto"
: Re-authenticate your Telegram account in n8n."Session was closed or terminated. Please login again: https://telepilot.co/login-howto"
: Your session expired; follow the login instructions."Invalid file ID"
: Double-check the File ID value; ensure it matches the one received from Telegram.