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 messaging features. Specifically, for the Messages resource and the Edit Message Caption operation, this node allows users to modify the caption of an existing message in a Telegram chat.

This is useful in scenarios where you want to update or correct the caption of a photo, video, or other media after it has been sent, without sending a new message. For example, if you initially send a photo with a caption but later need to add more details or fix a typo, this operation can edit that caption directly.

Practical examples:

  • Updating product descriptions in a photo shared in a sales channel.
  • Correcting information in a media message sent to a support group.
  • Dynamically changing captions based on workflow data or user input.

Properties

Name Meaning
Chat ID The unique identifier for the target Telegram chat where the message exists.
Message ID The identifier of the specific Telegram message whose caption you want to edit.
Message Data JSON object containing the new caption and any additional parameters required by Telegram's editMessageCaption API method.

Output

The node outputs a JSON object representing the response from the Telegram Bot API after editing the message caption. This typically includes the updated message object with its new caption and related metadata.

If the operation fails, the output may contain an error message describing the issue.

No binary data output is involved in this operation.

Dependencies

  • Requires a valid Telegram Bot API token configured as credentials in n8n.
  • Requires a subscription or API key for the "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 internally.

Troubleshooting

  • Invalid Subscription or API Key: If the node throws an error about invalid subscription or API key, verify that your N8N Tools API credentials are correctly set and active.
  • Missing or Incorrect Chat ID / Message ID: Ensure that the Chat ID and Message ID correspond to an existing message in a chat accessible by your bot.
  • Malformed Message Data: The messageData property must be a valid JSON string matching Telegram's expected format for editing captions. Invalid JSON or missing required fields will cause errors.
  • Permission Issues: The bot must have permission to edit messages in the target chat. Lack of permissions will result in API errors.
  • API Rate Limits: Frequent edits might hit Telegram API rate limits; handle such errors by retrying after some delay.

Links and References

Discussion