How to get all node executions into one
I have a telegram bot where I upload photos for processing my openai image analyzer. It works perfectly but when uploading multiple images each image creates a separate execution of the subsiquent nodes. In this case I end up getting a telegram response for each image that is uploaded.
I want to have the final step to return the results of all the images being processed. I’ve attemped adding in a code node to do this. I’m also adding the results into a supabase table and I’ve tried to retreive all the results and repond with that. This works but I still get a supabase query and respons for each photo.
From what I can tell the issue is that the entire workflow is independetly triggered from telegram for each image. For this reason it seems there is no way to know when all the images have been processed.
Telegram passes some json data with the message and includes a media_group_id and then an array of “photo”. When I look at my executions there are always four photos listed regardless of how many I send in which looks like this with four items listed in the photo array.
“media_group_id”: “13988859518461737”,
“photo”: [
{
“file_id”: “AgACAgEAAxkBAAMXaDiCt4drHz_gM8nGpo7W4PzN0oMAAoutMRv75cBF_2_h7P_syq4BAAMCAANzAAM2BA”,
“file_unique_id”: “AQADi60xG_vlwEV4”,
“file_size”: 822,
“width”: 51,
“height”: 90
},
If this listed the correct number of items one could look how many items are in supabase and compair to the number of photos in the message and then trigger the final result when they match. But this seems to be a problem from Telegram.
I’m wondering if anyone has any workaround ideas or alternative approches.
Please share your workflow
Information on your n8n setup
- n8nVersion: 1.94.1
- platform: docker (self-hosted)
- nodeJsVersion: 20.19.2
- database: sqlite
- executionMode: regular
- concurrency: -1
- license: enterprise (production)