How to aggregate data after multiple uploads without overwriting variables?

Hi you all,

I’m quite new to make and having an issue in my scenario. I get files from Google Drive, iterate through them, and upload them to the OpenAI API to use with my assistant. If it’s a PDF, I convert it first; otherwise, I upload it directly. After that, I aggregate the uploaded file IDs of each branch.

The problem is: each upload creates a separate operation in the Array Aggregator and then in the Set Multiple Variables module. As a result, the variable gets overwritten with each iteration. In the final router branch, when I try to retrieve all file IDs from both the PDF and non-PDF uploads, I end up with only one file ID instead of a full list.

Does anyone kniw how I can make sure that the Array Aggregator only sets the variable after all upload requests are complete—so I get a proper array with all file IDs?

Hi @ReiFel ,

Welcome to the Community.

You just need to put that bottom array aggregator after the “get multiple variables” module. The “get multiple variables” will then read the variable(s) produced by any “set multiple variable” modules and the array aggregator will then aggregate these into an array.