Help: n8n workflow executing multiple times when user uploads multiple images

Problem: I have a Telegram bot workflow in n8n. When a user uploads multiple images (let’s say 3 images), all the nodes runs 3 separate times instead of processing all images together and running once.

What I want:

  • User uploads 3 images → All images get uploaded to Google Drive → AI Agent processes once → Send one response back

What’s happening:

  • User uploads 3 images → Image 1 uploads → AI Agent runs → Send response

  • Then Image 2 uploads → AI Agent runs again → Send another response

  • Then Image 3 uploads → AI Agent runs again → Send third response

So the user gets 3 separate bot responses instead of 1.

My current flow:

Telegram Trigger → Google Sheets lookup → If conditions → HTTP requests to get images → Upload to Google Drive → AI Agent → Response

What I’ve tried:

  1. :white_check_mark: Added Aggregate node after image upload - didn’t work, still runs multiple times

  2. :white_check_mark: Tried “Execute Once” setting on nodes - didn’t work

  3. :white_check_mark: Replaced Aggregate with manual Code node - still runs multiple times

  4. :white_check_mark: Removed Wait node (thought it was causing async issues) - still happens

The core issue: Each uploaded image seems to trigger its own separate workflow execution path, and I can’t figure out how to make n8n wait for ALL images to upload first, then continue with the rest of the workflow just once.

Question: How do I make n8n process multiple Telegram images as a batch and continue the workflow only once after all images are processed?

Any help would be greatly appreciated! :folded_hands:


Edit: I’m using n8n cloud, latest version. The Telegram trigger receives multiple photo objects when user sends multiple images, but each photo seems to spawn its own execution thread.

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

Hi @Iqrajaved, welcome to the community!

I think this is just how Telegram works, each sent message triggers the webhook, so you need to design your workflow accordingly..
Fortunately, if the user uploads multiple images (Group Items), you’ll receive a media_group_id in the response..
All images in the same group share this value, so you can aggregate them and upload to Google Drive together, That way, your AI agent can process them as one set of files. This approach is a bit more complex since it depends on handling `media_group_id` and may require some logic tweaks in your workflow.

The second, easier solution I suggest is to handle uploads via a form..
Using the built-in “Send message and wait for response” Telegram node, you can create a button that opens a form where the user uploads images, The workflow will wait until the form is completed, and then continue once the upload is finished.

image

Here is an example of how to use it, just send any message to trigger the workflow:

so by integrating this node into your workflow, I think you’ll be able to achieve what you want.

I hope this explanation makes the solution clear..

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