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, inline queries, callback queries, and updates. Specifically, for the Chats resource and the Unban Chat Member operation, this node allows you to unban a previously banned user from a Telegram chat.

This is useful in scenarios where you want to automate moderation tasks in Telegram groups or channels, such as automatically unbanning users after a timeout or based on external triggers.

Example use case:

  • Automatically unban a user after a temporary ban period expires.
  • Unban users who have been manually approved through an external system integrated with n8n.

Properties

Name Meaning
Chat ID The unique identifier of the Telegram chat (group/channel) where the unban will occur.
User ID The unique identifier of the Telegram user to be unbanned from the chat.
Options Additional optional parameters for the unban operation, provided as a JSON object.

Output

The output of the node is a JSON object representing the response from the Telegram Bot API for the unban operation. This typically includes a boolean true if the unban was successful or an error message if it failed.

The output is structured as:

{
  "json": {
    // Telegram API response for unbanChatMember
  },
  "pairedItem": {
    "item": <index_of_input_item>
  }
}

No binary data output is involved in this operation.

Dependencies

  • Requires a valid Telegram Bot API token configured as credentials in n8n.
  • Requires access to the "N8N Tools API" service for subscription validation via an API key credential.
  • The node makes HTTP requests to 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.

  • Telegram API errors:
    Errors returned by Telegram (e.g., user not found, chat not found, insufficient rights) will be passed through. Ensure the bot has appropriate admin permissions in the chat to unban members.

  • Missing required parameters:
    Make sure the "Chat ID" and "User ID" fields are correctly filled; these are mandatory for the unban operation.

  • JSON parsing errors in options:
    The "Options" property expects a valid JSON object. Invalid JSON syntax will cause failures.

Links and References

Discussion