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 Telegram. Specifically, for the Messages resource and Send Document operation, this node sends a document file to a specified Telegram chat.

This is useful in scenarios where you want to automate sending files such as PDFs, Word documents, spreadsheets, or any other supported document type to users or groups on Telegram. For example, a business could automatically send invoices or reports to clients via Telegram, or a support bot could deliver user manuals or guides upon request.

Properties

Name Meaning
Chat ID The unique identifier of the target Telegram chat where the document will be sent.
Document Data JSON object containing the Telegram document data parameters (e.g., file, caption).

The Document Data property expects a JSON structure that matches the Telegram Bot API's sendDocument method parameters, allowing customization such as specifying the document file, caption, parse mode, disable notification, reply markup, etc.

Output

The node outputs an array of JSON objects, each representing the response from the Telegram API for the document sent. The output JSON typically contains details about the sent message, including message ID, date, chat info, and document metadata.

No binary data output is indicated for this operation; the output is purely JSON describing the result of the send action.

Dependencies

  • Requires a valid Telegram Bot API token configured as credentials in n8n.
  • Requires a subscription and API key for the external "N8N Tools API" service, which validates usage before forwarding requests to Telegram.
  • The node uses HTTP POST requests to the Telegram Bot API endpoints via the helper class TelegramApi.

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 correct and active.
  • Malformed JSON in Document Data: Since the document data is parsed from JSON, ensure the input JSON is well-formed and matches Telegram's expected parameters.
  • Chat ID issues: Ensure the Chat ID is correct and the bot has permission to send messages to that chat.
  • Unknown operation error: This should not occur if the operation is set correctly to "sendDocument". If it does, check the node configuration.

Links and References


This summary focuses on the Messages resource with the Send Document operation as requested.

Discussion