Node : Send message and wait for response : message_id

Need for message_id

When using the telegram’s Sent and Wait for Response, it can only return the data sent from the user, not the message_id for this message.
So it’s impossible to delete this message after the user reply.

Did you have a question?

Can n8n dev team add the message_id for this node, so it can be erased once the user click?
Is there an alternative solution to erase this text once use click ?
Thank you

Hey, take a look at this:

The wait node creates a webhook upon the execution start of the entire workflow. You can add it to the button in the telegram message, so it fires when pressed. This will then allow the flow to continue with the message deletion.

In the last node, we reference the message ID from the first node (you might need to change the expression).

Hope this helps, feel free to mark this as Solution if it does :slight_smile:

1 Like

Thank you krisn0x, it helps a lot for the time being, even though within a long workflow it cannot easily erase the early workflow text from the telegram bot. It would be great if n8n team can add the option of “erasing message at the end of the workflow” directly into the native telegram nodes

Yes, indeed, it does not return the details of the Telegram message that was sent..
Instead, it only returns the form response data.

A workaround is to assume that the message_id is the previous_message_id + 1, but this only works if you send a normal message before using Send and Wait for Response

Thank you, would appreciate if you mark my workflow as Solution then :slight_smile:

Also, why would it be difficult to delete the message in a long workflow? If you use my approach you should have the message ID and you can reference it at any point for deletion. Do you have some other constraints in mind?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.