Help with Looping to Query Documents in Batches on Firebase

Hello, how are you?

I have a workflow where, on a specific day of the month, I need to query a Firestore collection containing approximately 10,000 documents.

However, I can’t retrieve all 10,000 documents at once; I need to split them into batches of 100 queries.

I tried the loop below, but it didn’t work. Could someone help me create this loop, please?

The goal is to fetch data from Firestore to send payment reminder emails.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

I don’t think anyone can help you based on an image alone, sorry. Can you include the relevant part of the workflow here? (Copy the nodes from n8n, click the </> button above and paste in the workflow json).

That said, 10,000 is indeed a lot of documents. I’d consider using a sub-workflow to process the batches - the advantage of this is that it will release the memory when it’s done.

1 Like

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