N8N Tools Telegram icon

N8N Tools Telegram

Interact with Telegram Bot API

Overview

This node enables interaction with the Telegram Bot API through various resources and operations. Specifically, for the Inline Queries resource and the Answer Web App Query operation, it allows you to respond to a Telegram Web App query by sending back a result object that the Telegram client can use to display or process the response.

Typical use cases include:

  • Responding to inline queries initiated from a Telegram Web App embedded in chats.
  • Providing dynamic content or actions based on user interactions within a Telegram Web App.
  • Integrating custom business logic or data retrieval to answer Web App queries seamlessly.

For example, when a user interacts with a Telegram Web App and triggers a query, this node can send back a structured result that the Telegram client will use to update the UI or perform further actions.

Properties

Name Meaning
Result The JSON object representing the Telegram Web App Query Result to be sent as a response.
Options Additional JSON options applicable to multiple resources including inline queries.

The Result property expects a JSON structure compliant with Telegram's Web App Query Result format. The Options property allows specifying extra parameters if needed (though not specifically used in this operation).

Output

The node outputs an array of items where each item contains a json field holding the response from the Telegram API after answering the Web App query. This typically includes confirmation of success or error details.

No binary data output is involved in this operation.

Example output JSON snippet:

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

This indicates the query was answered successfully.

Dependencies

  • Requires a valid Telegram Bot API token configured via credentials.
  • Requires an active subscription or valid API key for the external "N8N Tools API" service, which validates usage before forwarding requests to Telegram.
  • The node uses the Telegram Bot API endpoint https://api.telegram.org.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that your API key credential for the external validation service is correct and active.
  • Malformed JSON in Result property: Ensure the JSON provided in the "Result" input property is correctly formatted and matches Telegram's expected schema for Web App query results.
  • Unknown operation error: This node supports only predefined operations; ensure the operation name is exactly "answerWebAppQuery" for this resource.
  • Network or API errors: Check network connectivity and Telegram Bot API status if requests fail unexpectedly.

Links and References

Discussion