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 chats, messages, bots, files, updates, inline queries, and callback queries. Specifically, for the Chats resource and the Set Chat Photo operation, this node allows you to set or update the photo of a Telegram chat by providing the chat ID and the new photo data.

This operation is useful in scenarios where you want to programmatically update group or channel photos based on events or triggers in your workflow. For example, you could automatically update a chat photo to reflect a special event, campaign, or status change without manual intervention.

Properties

Name Meaning
Chat ID The unique identifier for the target Telegram chat where the photo will be set.
Options Additional options as a JSON object to customize the request (optional).

Note: The provided properties JSON only lists chatId and options for the Chats resource, but the actual operation setChatPhoto requires a photo parameter (seen in the code). This photo parameter is expected to be provided in the node UI but was not included in the user-provided properties snippet.

Output

The output of the node is an array of JSON objects representing the response from the Telegram Bot API for the requested operation. For the Set Chat Photo operation, the output JSON typically contains a boolean true if the photo was successfully set, or an error message if it failed.

Example output JSON:

{
  "ok": true,
  "result": true
}

If the operation fails, the output will contain an error message describing the failure.

The node does not output binary data for this operation.

Dependencies

  • Requires a valid Telegram Bot API token configured as credentials in n8n.
  • Requires an active subscription and valid API key for the "N8N Tools API" service, which acts as a validation layer before forwarding requests to Telegram.
  • The node uses HTTP requests to communicate with both the N8N Tools API and the Telegram Bot API endpoints.

Troubleshooting

  • Invalid subscription or API key error: If you receive an error about invalid subscription or API key, verify that your API key credential for the N8N Tools API is correct and active.
  • Missing or incorrect Chat ID: Ensure the Chat ID is correctly specified and corresponds to a chat where the bot has permission to change the photo.
  • Missing photo parameter: The setChatPhoto operation requires a photo input; ensure you provide the photo data correctly in the node parameters.
  • Permission errors: The bot must have appropriate admin rights in the chat to change its photo. Lack of permissions will cause the operation to fail.
  • JSON parsing errors: Input fields like options must be valid JSON strings; malformed JSON will cause errors.

Links and References


If you need details on other operations or resources, please let me know!

Discussion