Looping inside a sub-workflow execution completed after the first batch is run

Hello. I am trying to optimize one of my complex workflows by putting the loop node into a sub-workflow. However, it does not work as expected.

In this test run, the parent workflow, data from Google Sheets includes 12 items in this example. 12 items are passed to the sub-workflow. The loop in the sub-workflow batch size is set to 6 per batch, but the sub-workflow completes execution after the first batch which is 6 items only.



This is the loop node record.


Below is a simplified example of my workflow.

I am curious if it is intended not to function within a sub-workflow. Alternatively, must I approach it like this: placing the loop node in the main workflow and adjusting the batch size here instead of operating within the sub-workflow?

Like this?

There are many steps in the loop, and I have 1,400 items to process everyday. I am considering whether placing the loop in a sub-workflow would improve performance.

Thanks…

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:

Hey @Blueli, Here is workflow and sub workflow that work for me.

1 Like

Then I will need to find out why mine does not work like yours :face_with_raised_eyebrow:
Thank you for testing out :pray:

*I made a mistake with variable passing, causing the sub-workflow to stop after the first batch.

2 Likes

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