Actions6
- Message Actions
- Chat Actions
Overview
This node operation answers a callback query received from an inline keyboard button in a messaging context. When a user interacts with an inline button that sends a callback query, this node can send a response back to acknowledge or notify the user. It supports showing either a brief notification or an alert dialog, and allows caching the result client-side for performance.
Typical use cases include:
- Confirming a user's action triggered by an inline button.
- Displaying a short message or alert after a button press without sending a new message.
- Improving user experience by providing immediate feedback on interactive elements in chatbots or messaging apps.
Example: A bot asks a user to confirm a choice via inline buttons. When the user clicks a button, this node answers the callback query with a "Thank you for your selection!" notification or alert.
Properties
| Name | Meaning |
|---|---|
| Callback Query ID | The unique identifier of the callback query to answer (required). |
| Response Text | Optional text message to show to the user as a notification or alert (max 200 characters). |
| Show Alert | Boolean flag indicating whether to show an alert dialog (true) instead of a notification (false). |
| Cache Time | Maximum time in seconds (0–3600) that the result may be cached client-side. |
Output
The output is a JSON object representing the result of answering the callback query. It typically contains confirmation details from the messaging API about the success or failure of the operation.
This node does not output binary data.
Dependencies
- Requires an API key credential for authenticating with the Max messenger service.
- Depends on internal helper functions to create a bot instance and call the API to answer callback queries.
- No additional environment variables are explicitly required beyond the API authentication.
Troubleshooting
- Missing or empty Callback Query ID: The node will throw an error if the Callback Query ID is not provided or is empty. Ensure this ID is correctly passed from the previous node or trigger.
- Response Text length exceeded: If the response text exceeds 200 characters, an error is thrown. Keep the text concise.
- Cache Time out of range: Cache time must be between 0 and 3600 seconds. Values outside this range cause errors.
- API authentication issues: If the API key credential is missing or invalid, the node will fail to communicate with the messaging service.
- General API errors: Network issues or invalid callback query IDs may cause failures; check connectivity and validity of IDs.
To resolve errors, verify all required parameters, adhere to limits, and ensure valid credentials.
Links and References
- Max Messenger API Documentation (replace with actual URL)
- n8n documentation on Creating Custom Nodes
- Inline Keyboard and Callback Queries concepts in messaging bots (e.g., Telegram Bot API docs)