Play a node once, even if the workflow runs multiple times

Describe the problem/error/question

Hi all! My first question and combat workflow.

I’m trying to make a bot for Telegram.

The point is that the user can send several photos in one message. I want the bot to send exactly 1 message after processing the photo, but it sends the number of messages equal to the number of photos.

Tell me, how can I send exactly 1 message?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

Why do you need the bot to send only one message?
Would it be possible to ask the user to send a message like “done” when they’ve finished uploading all the images? That way, the bot can wait and reply only once, after receiving that confirmation.

In telegram, a user can send multiple photos at a time. It’s more convenient to just send 5-7 photos and get a response than to click on a button.

Your option has a place to be, I’ll try to use it.

I also have a need to send a message to the user that the photos are being processed, that is, immediately after uploading the photo.

1 Like

So my question is, when the webhook gets called, do you get all images, or do they come in one by one? Because you can use a arragate node, to merge at end, and reply with details of all if thats the flow.

Could you show a past execution, like when it runs, what number do u see here on the connection?


As I understand it, I send several photos in one message, but the web hook is triggered for each photo separately

Maybe the solution would be to collect photos in a separate workflow and then transfer them to GPT?

Yes, and maybe catch the group of images by orginal message timestamp? I need to use telegram nodes more tbh, but if you can see multiple executions happening for each image, store into a table or db with img URLs, and userid, timestamp, and then call, then once the table or field states all messages, the next flow can trigger from this and retrieve all URLs etc.

You could setup a reply node, asking users if that all complete, and then proceed after confirmations etc.

I used slack, and this flow, asks multiple questions via timestamp etc.

You could potentially have a loop node, after the first webhook, and use a HTTP request node to telegram or a normal telegram node (not trigger) to call rest of the images?

Hope this helps

@Froot If asking the user to send a message like “done” when they’ve finished uploading isn’t an option in your case, then @King_Samuel_David already pointed you toward the other common solution :wink:

You’ll need to temporarily store incoming images in a data store, grouped by something relevant like the conversation ID or user ID (and maybe filtered by timestamp depending on how you want to define a session).

Could you share a bit more about your use case so we can help you choose the best approach?