Telegram chatbot that remembers the last message

I’m trying to create a chatbot that works in a continuous flow.
Without having to go to the beggining of the workflow everytime.

I want to be able to chat with the user, back and forth (not AI stuff, though).

Afte asking for help here, I thought I could work with multiple triggers, but I can’t.

If I use multiples triggers, I get this error on every message sent by the user:

Telegram Trigger: 429 - {"ok":false,"error_code":429,"description":"Too Many Requests: retry after 1","parameters":{"retry_after":1}} - Too Many Requests: retry after 1```

When I disable the extra triggers, I get no error.
Here’s what I was trying to do:

Information on your n8n setup

  • n8n version: 1.27.3
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 22.04

Having only two different triggers also doesn’t work. One for normal messages and the other for callback queries.

The flow simply doesn’t get triggered.

hello @gmsalomao2

I don’t know if the Telegram trigger can retrieve all user’s chat history, but if not, you’ll need external storage to keep the user history (e.g. s3 bucket, n8n file, db entry, even workflow static data may work for small chats). And the logic would be:

  • trigger executed > workflow checks if there is any history for that user.
  • if the history present > do something
  • if not > initiate new dialog and save user response in the history

Two or more triggers in one workflow may not work due to the TG limitation
image

1 Like

Thank you. That’s what I feared hahah

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