How to Loop Through XLSX in Batches While Keeping Binary File Intact in n8n?

Describe the problem/error/question

I’m trying to read a .xlsx file stored in Dropbox in batches of 200 rows using a dynamic range (e.g., A2:AC201, then A202:AC401, etc.).
My goal is to increment a batch variable by +200 on each loop iteration and merge it with the binary file to pass into the Extract from File node.

I’m using a Merge node to combine the file from Dropbox with the JSON containing the current batch.

However, I keep running into issues:

  • The binary file (data) is lost after the first loop
  • Or the range is not updated properly in later iterations
  • Or the Extract from File node throws an error about missing binary data

I’ve tried:

  • Merge in Choose Branch and Combine / Merge by Position modes
  • Set node with and without Keep Only Set
  • IF node with {{$itemIndex === 0}} to isolate the binary item
  • Manually reconstructing the range each time

But no setup seems to pass both the binary and updated batch data correctly through each loop.

What is the error message (if any)?

This operation expects the node's input data to contain a binary file 'data', but none was found [item 0]

Please share your workflow

Share the output returned by the last node

The Extract from File node does not receive the binary after the first execution.
The dynamic range (e.g., A2:AC201, A202:AC401) is calculated correctly, but the workflow breaks due to missing binary input.

Information on your n8n setup

  • n8n version: 1.86.0
  • Database: SQLite
  • n8n EXECUTIONS_PROCESS setting: own (default)
  • Running n8n via: Docker (self-hosted)
  • Operating system: macOS (tested locally via Docker)

hello @Angelo_Blot

What are you going to do with the extracted data?

Your iteration doesn’t work because your Merge node doesn’t have a binary data on the second+ loop, you have to retrieve it back with the Code node.

1 Like

Thank you :pray:! It worked perfectly!

What are you going to do with the extracted data?

→ I’ve connected a sub-workflow to create records in Airtable, and it’s working smoothly as well!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.