Actions23
- Chat Actions
- Callback Actions
- File Actions
- Message Actions
Overview
This node operation answers a callback query sent from an inline keyboard in Telegram. When a user interacts with an inline button that triggers a callback query, this node sends a response back to Telegram to notify the client about the result of that interaction.
Common scenarios where this node is useful include:
- Confirming a user's selection or action triggered by an inline keyboard button.
- Displaying a notification or alert message to the user after they press a button.
- Redirecting the user to a URL upon pressing a callback button.
- Controlling how long the answer to the callback query should be cached on the client side.
Practical example:
- A bot presents an inline keyboard with options "Yes" and "No". When the user clicks "Yes", this node can send an answer to the callback query confirming the choice and optionally show a notification or alert.
Properties
| Name | Meaning |
|---|---|
| Query ID | Unique identifier for the callback query to be answered. This identifies which callback query the answer corresponds to. |
| Additional Fields | Optional extra parameters to customize the answer: • Cache Time: Maximum seconds the result may be cached client-side. • Show Alert: Whether to show an alert instead of a notification. • Text: Notification text (0-200 chars). • URL: URL to open on the client. |
| Reply Keyboard | (Not applicable for this operation) — property exists but not used here. |
| Reply Keyboard Options | (Not applicable for this operation) — property exists but not used here. |
| Reply Keyboard Remove | (Not applicable for this operation) — property exists but not used here. |
Output
The node outputs a JSON object representing the response from the Telegram API after answering the callback query. The structure typically includes a boolean result indicating success or failure, and possibly additional metadata returned by Telegram.
No binary data output is produced by this operation.
Example output JSON structure:
{
"ok": true,
"result": true
}
Dependencies
- Requires a valid Telegram Bot API key credential configured in n8n.
- Uses Telegram's
answerCallbackQueryAPI endpoint. - No other external dependencies are required.
Troubleshooting
- Missing or invalid Query ID: The
queryIdmust be provided and correspond to an active callback query. If missing or incorrect, the Telegram API will return an error. - Invalid additional fields: Providing unsupported or malformed additional fields (e.g., text longer than 200 characters) may cause errors.
- API authentication errors: Ensure the Telegram API key credential is correctly set up and has permissions to answer callback queries.
- Network issues: Connectivity problems with Telegram servers will cause request failures.
- Error messages: Common errors returned by Telegram include "Bad Request: query id invalid" or "Unauthorized". Verify input parameters and credentials accordingly.