N8N Tools Telegram icon

N8N Tools Telegram

Interact with Telegram Bot API

Overview

This node enables interaction with the Telegram Bot API, specifically supporting various operations grouped by resource types such as messages, updates, chats, bots, files, inline queries, and callback queries. For the Files resource with the Download File operation, the node downloads a file from Telegram using its file path.

Common scenarios for this node include automating the retrieval of media or documents sent to a Telegram bot, enabling workflows that process or archive these files automatically. For example, you could use it to download images users send to your bot and then upload them to cloud storage or analyze them with an AI service.

Properties

Name Meaning
File Path The Telegram file path string that identifies the file to be downloaded. This is typically obtained from a previous Telegram API call that returns file metadata.
Options Additional options in JSON format to customize the request (optional).

Output

The node outputs a JSON object representing the downloaded file data. This typically includes the file content or a link to the downloaded file depending on the implementation of the underlying Telegram API wrapper. If binary data is involved (e.g., actual file bytes), it would be included in the output's binary property, allowing further processing or saving within n8n.

Dependencies

  • Requires an API key credential for the Telegram Bot API.
  • Requires a subscription or valid API key for the "N8N Tools API" service, which validates usage before forwarding requests to Telegram.
  • The node uses an internal Telegram API wrapper class to perform the actual API calls.
  • No additional environment variables are explicitly required beyond the credentials.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that the provided API key credential is correct and active.
  • Unknown operation error: Ensure the operation selected matches the supported ones for the Files resource; otherwise, the node will throw an unknown operation error.
  • File not found or invalid file path: If the file path is incorrect or expired, the Telegram API may return an error. Confirm the file path is valid and was recently retrieved.
  • JSON parsing errors: Input properties like "Options" must be valid JSON strings if used; malformed JSON will cause failures.

Links and References

Discussion