I am aware of some closed discussions on this topic, but there was no actual solution to this question.
I am working on a project, in which I had to solve this very issue (delete a full telegram chat history with a bot). Even though there is no definite “delete-all” node in N8N, there exists a workaround, that is quite logical, and I am sure many other people did it the same way I did, I just wanted to leave this solution here, for those that can’t figure it out on their own.
The workaround is quite simple. Telegram’s “send message” node always returns the following data:
$json.result.message.id, $json.result.chat.id
With these two data fields, we can just do an “insert into data table” action, to which we are basically storing all messages sent by our bot in a data table. Similarly, this can be done with on-message triggers, so we can also store messages that are sent by the users.
When we want to delete the “chat history”, we just have to get the data table in which we saved all the outgoing and incoming message ids per chat, and just perform a “delete-message” (there is a node for this) for each item.