How to make telegram action "typing" work while AI agent processing

Hello,

I need help implementing the “typing action” in Telegram. The current issue is that the typing indicator only lasts for 5 seconds, while my AI agent takes 10–60 seconds to respond. I want the typing indicator to persist throughout the processing time so that users see it continuously until the response is ready.

Is there a way to achieve this?

Here’s what I’ve tried so far:

  • I connected a trigger from Telegram to both the AI agent and a “loop over items” node.
  • The loop node is also connected to Airtable to check the status in a table.
  • The idea was to have Telegram trigger both the AI agent and the loop node simultaneously. Once the AI agent finishes processing, it updates the Airtable status to “true,” which would then stop the loop.

However, this approach didn’t work as expected:

  • When Telegram is triggered, the AI agent starts processing first.
  • Once the AI agent completes its work and updates the status, only then does the “loop over items” node start executing.
  • As a result, the typing action doesn’t persist correctly during the AI agent’s processing time.

How can I ensure that the typing action in Telegram persists for the entire duration of the AI agent’s processing?

2 Likes

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hey @kiril_kogan

In this scenario where you need to run 2 or more branches in parallel, I would recommend trying the subworkflow approach.

This spins out the agent branch into it’s own separate execution allow the “typing” action loop to run in the current execution and importantly, at the same time.

2 Likes

I think the above mentioned is the correct solution, but I think you also might be able to put the “typing” action work flow above the main work flow (and also make sure it is connected before the main work flow) as I believe n8n runs branches from top to bottom and left to right.

3 Likes

Thank you for the answers! They were a huge help, and I was able to successfully implement the typing action.

2 Likes