From 1a4717671310b3bfd9c1b538a3df89f910f6c678 Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Wed, 4 Feb 2026 22:07:20 -0500 Subject: [PATCH] fix(telegram): use HTTP Request for editMessageText with keyboards The n8n Telegram node's inlineKeyboard parameter doesn't work reliably with editMessageText operation. Switched to HTTP Request node calling Telegram API directly, which properly passes reply_markup. Changed nodes: - Send Confirmation Dialog - Send Stop Result - Send Expired Message Co-Authored-By: Claude Opus 4.5 --- n8n-workflow.json | 81 ++++++++++++++++------------------------------- 1 file changed, 27 insertions(+), 54 deletions(-) diff --git a/n8n-workflow.json b/n8n-workflow.json index c96e6ba..9b7ce85 100644 --- a/n8n-workflow.json +++ b/n8n-workflow.json @@ -4612,84 +4612,57 @@ }, { "parameters": { - "operation": "editMessageText", - "messageId": "={{ $json.messageId }}", - "chatId": "={{ $json.chatId }}", - "text": "={{ $json.text }}", - "replyMarkup": "inlineKeyboard", - "inlineKeyboard": "={{ JSON.stringify($json.reply_markup.inline_keyboard) }}", - "additionalFields": { - "parse_mode": "HTML" - } + "method": "POST", + "url": "=https://api.telegram.org/bot{{ $env.TELEGRAM_BOT_TOKEN }}/editMessageText", + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={{ JSON.stringify({ chat_id: $json.chatId, message_id: $json.messageId, text: $json.text, parse_mode: 'HTML', reply_markup: $json.reply_markup }) }}", + "options": {} }, "id": "http-send-confirm-dialog", "name": "Send Confirmation Dialog", - "type": "n8n-nodes-base.telegram", - "typeVersion": 1.2, + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, "position": [ 2440, 1400 - ], - "credentials": { - "telegramApi": { - "id": "I0xTTiASl7C1NZhJ", - "name": "Telegram account" - } - } + ] }, { "parameters": { - "operation": "editMessageText", - "messageId": "={{ $json.messageId }}", - "chatId": "={{ $json.chatId }}", - "text": "={{ $json.text }}", - "replyMarkup": "inlineKeyboard", - "inlineKeyboard": "={{ JSON.stringify($json.reply_markup.inline_keyboard) }}", - "additionalFields": { - "parse_mode": "HTML" - } + "method": "POST", + "url": "=https://api.telegram.org/bot{{ $env.TELEGRAM_BOT_TOKEN }}/editMessageText", + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={{ JSON.stringify({ chat_id: $json.chatId, message_id: $json.messageId, text: $json.text, parse_mode: 'HTML', reply_markup: $json.reply_markup }) }}", + "options": {} }, "id": "http-send-stop-result", "name": "Send Stop Result", - "type": "n8n-nodes-base.telegram", - "typeVersion": 1.2, + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, "position": [ 2440, 1500 - ], - "credentials": { - "telegramApi": { - "id": "I0xTTiASl7C1NZhJ", - "name": "Telegram account" - } - } + ] }, { "parameters": { - "operation": "editMessageText", - "messageId": "={{ $json.messageId }}", - "chatId": "={{ $json.chatId }}", - "text": "={{ $json.text }}", - "replyMarkup": "inlineKeyboard", - "inlineKeyboard": "={{ JSON.stringify($json.reply_markup.inline_keyboard) }}", - "additionalFields": { - "parse_mode": "HTML" - } + "method": "POST", + "url": "=https://api.telegram.org/bot{{ $env.TELEGRAM_BOT_TOKEN }}/editMessageText", + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={{ JSON.stringify({ chat_id: $json.chatId, message_id: $json.messageId, text: $json.text, parse_mode: 'HTML', reply_markup: $json.reply_markup }) }}", + "options": {} }, "id": "http-send-expired-msg", "name": "Send Expired Message", - "type": "n8n-nodes-base.telegram", - "typeVersion": 1.2, + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, "position": [ 2440, 1700 - ], - "credentials": { - "telegramApi": { - "id": "I0xTTiASl7C1NZhJ", - "name": "Telegram account" - } - } + ] }, { "parameters": {