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

Hello, I am trying to accomplish the same without success.
I have a simple workflow for a little AI Assistant, it can take up to 1 min to answer with.
I wanted to persist the send_action in a loop until the end but it looks like the workflow is not running nodes in parallel.
Could you help me ?

ps: I had to cleanup the real workflow for the post

maybe using sub-workflows

Here is a parallel execution example:

1 Like

You need to use sub workflow exactly like [Jim Le] suggested

Hello, so i should move the main logic (ai, tool, etc.) in a subworkflow and keep the loop with the send action in the main workflow ?

If you want, though, it’s optional—you can include multiple workflows within a single one. Just copy the [Jim_Le] example workflow, play around with it, learn how it works, and then tailor it to your needs

2 Likes

Thank you, I got it working, I used airtable also since I had no idea how to share data from a workflow with another without an external solution.


I have the main workflow starting the subworkflow with all the logic, and then running the loop.

1 Like

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