Hey everyone,
I’m running into a tricky issue with a multi-file upload workflow and would really appreciate some guidance
Setup
Users can upload multiple files via an On Form Submission node. The uploads can contain a mix of:
-
PDFs
-
PNGs / images
I then route them using an IF node:
-
PDF → PDF processing branch
-
PNG → image processing branch
Problem
When multiple files are uploaded at once, the IF node behaves incorrectly.
It seems to only evaluate the first file type and then applies that logic to all following items in the execution.
Example:
-
File 1 = PDF → goes into PDF branch
-
File 2 = PNG → still gets routed into PDF branch (incorrect)
So instead of evaluating each file individually, it looks like the condition is “carried over” or reused.
What it looks like internally
It also seems like n8n is “remembering” previous values during the loop/execution. Over time, both PDF and PNG references accumulate, and the IF node can no longer reliably distinguish the current file type.
Questions
-
What is the correct way to ensure that the IF node evaluates each file independently per item, especially in multi-file uploads?
-
Is there any way to clear internal state / loop memory / accumulated items inside a workflow step?
For example:-
resetting loop context
-
clearing previous binary references
-
preventing previously processed file types from influencing the next item
-
It feels like something is being stored across iterations, which eventually breaks the routing logic.
Would really appreciate any best practice or recommended pattern for handling mixed file types in batch uploads


