N8N Tools Telegram icon

N8N Tools Telegram

Interact with Telegram Bot API

Overview

The node "N8N Tools Telegram" integrates with the Telegram Bot API, enabling automation workflows to interact with various Telegram resources such as messages, updates, chats, bots, files, inline queries, and callback queries. Specifically, for the Files resource with the Get File operation, this node retrieves metadata about a file stored on Telegram's servers using its unique Telegram File ID.

This operation is useful when you want to obtain information about a file (e.g., photos, documents, stickers) that has been sent or received via Telegram, such as its path on Telegram servers, size, or other metadata before downloading or processing it further.

Practical example:

  • A workflow that receives a message containing a file, extracts the file ID, and uses this node to get detailed info about the file to decide whether to download or forward it elsewhere.

Properties

Name Meaning
File ID The unique Telegram File ID identifying the file to retrieve information about.
Options Additional optional parameters in JSON format to customize the request (not specifically detailed for this operation).

Output

The output of the Get File operation is a JSON object containing the file metadata returned by the Telegram Bot API. This typically includes fields such as:

  • file_id: The unique identifier for the file.
  • file_unique_id: Unique identifier that is supposed to be the same over time and for different bots.
  • file_size: Size of the file in bytes.
  • file_path: Path to the file on Telegram servers, which can be used to download the file.

If the node supports binary data output (not explicitly shown here for this operation), it would represent the actual file content downloaded from Telegram.

Dependencies

  • Requires an active Telegram Bot API token credential configured in n8n.
  • Requires a valid subscription and API key for the external "N8N Tools API" service, which validates usage before forwarding requests to Telegram.
  • The node internally uses the Telegram Bot API endpoints via the "N8N Tools API" proxy.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error indicating invalid subscription or API key, verify that the API key credential for the external validation service is correctly set and active.
  • Unknown operation error: Ensure the operation selected matches the supported operations for the Files resource; "getFile" must be chosen.
  • File not found or invalid File ID: If the Telegram File ID is incorrect or expired, the Telegram API will return an error. Double-check the File ID value.
  • JSON parsing errors: Input properties like "Options" must be valid JSON if used; malformed JSON will cause failures.

Links and References

Discussion