[Make / OpenAI] Problem with aggregating multiple uploaded files into a single LLM analysis (iterator vs aggregator issue)

:bullseye: What is your goal?

My goal is to perform one single LLM analysis (OpenAI) over multiple documents, where:

-files are collected from different Google Drive folders,
-files have different types (PDF, DOC/DOCX, Excel),
-files are discovered at the very beginning of the scenario, using multiple router branches (based on folder / type),
-after collecting them, I want to move into a master branch that:
–uploads all files to OpenAI,
–and then triggers exactly ONE analysis request using all uploaded files together.

High-level logic I’m aiming for:

Search files (multiple folders)
→ Router (PDF/DOC | Excel | others)
→ Collect files
→ Upload each file to OpenAI
→ Close iteration
→ Aggregate ALL uploaded file IDs
→ Run ONE LLM analysis over all files

The LLM should:

-read all documents together,
-identify the master risk register (Excel),
-analyze PDF/DOC reports against it,
-and return a structured JSON result.

:thinking: What is the problem?

I’m stuck on how to correctly merge multiple iterator branches into a single LLM call.

Key issues I’m facing:

  1. Iteration vs single LLM call
    -Uploading files works only inside an iterator (one bundle per file).
    -But placing the OpenAI “Generate response / Assistant” module there causes the LLM to run once per file, which I must avoid.
    -I need the upload to iterate, but the analysis to run once, after all uploads are finished.

  2. Multiple branches at the beginning
    -Files are collected from different folders and branches first (PDF/DOC vs Excel).
    -Only later do I want to enter a master branch where everything is merged.
    -I’m unsure if this branching strategy is correct or if I should restructure the flow earlier.
    3.Aggregation problems
    I tried:

-Array Aggregator (from OpenAI Upload a file),
-Set Variable with map(),
-Data Store (one record per uploaded file + Search records).

:test_tube: What have you tried so far?

In all cases:

-aggregation technically works (I see multiple bundles),
-but the resulting structure is nested too deeply,
-mapping it into OpenAI file_ids or Code Interpreter resources fails,
-results are often null, empty, or only the first file is seen by the model.

4.OpenAI constraints

OpenAI expects:
-file IDs as clean strings (file-xxxxx),
-max length 64,
-no extra characters.

Aggregated results from Make often contain:

-collections instead of strings,
-keys mixed with metadata,
-or arrays that Make refuses to flatten cleanly.

Final effect

Even when aggregation reports IMTAGGLENGTH = 3,
-OpenAI sees only one file,
-or fails with “invalid file_id” / “expected string, got null”.

:camera_with_flash: Screenshots: scenario setup, module configuration, errors

I have run into this exact thing in Make; the trick is separating “upload runs per file” from “analysis runs once”.

What worked for me:

You can keep your router at the start, but make sure every branch ends by producing the same kind of output (basically a simple “file object”). Then you merge all of them into one list, iterate only for the upload, and only do the LLM call after you’ve aggregated the uploaded IDs.

The clean flow is usually:

Find files (from all folders) → build one combined list → iterator (uploads happen here) → array aggregator (collect uploaded file IDs) → one single LLM call

Two common mistakes that cause “model only sees one file”:

  • The LLM module is still sitting inside the iterator route (so it runs per file)

  • The thing being mapped into file_ids isn’t an array of strings

What you want to pass into the LLM step is literally:
["file-xxx", "file-yyy", "file-zzz"]

So right after the upload module, aggregate only the ID field (nothing else), then do a tiny “cleanup” step:

  • map only the ID

  • flatten if Make nested i

  • trim just in case

Quick check I always do: right before the LLM module, I join the IDs into a string (comma-separated). If I see:
file-aaa,file-bbb,file-ccc
…then I know the mapping is correct.

If you paste one sample output bundle from your Upload file module (just one file), I can tell you the exact field path to map so you stop getting “invalid file_id / expected string got null”.

1 Like