Looping issue in the sub workflow

Describe the problem/error/question

Now have a parent workflow that loops over a list of websites. For each website, it calls a sub-workflow (using the Execute Sub-workflow node with “Run once for each item” and “Wait for Sub-Workflow Completion” enabled). The sub-workflow processes all relevant Google Sheets rows for that website in a loop and updates them. The problem:
Even though the sub-workflow processes all items correctly, the parent workflow does not wait for the sub-workflow to finish all its internal processing before starting the next iteration. As a result, multiple sub-workflow executions run in parallel, causing data overlap and race conditions. I want the parent workflow to wait until the sub-workflow has fully completed before moving to the next website, but this is not happening.

Please share your workflow

this is my main workflow:

and my subworkflow:

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.94.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via ( n8n cloud):
  • Operating system:

Hey @Chenatif_Mohamed ,

Hope this Linkedin post helps.

Even if Wait for Sub-Workflow Completion is enabled, if there are asynchronous operations within the sub-workflow (internal loops, HTTP requests, slow operations), it may complete “too early” from the perspective of the Execute Sub-Workflow node.

That is, the node considers execution complete when the main branch of the sub-workflow completes, even if internal processes are still running (for example, within the Loop Over Items node).

To avoid parallel execution within the sub-workflow:
-The Loop Over Items node is likely splitting its execution into parallel for each row.
-Make sure the loop is sequential, not parallel. And make sure there are no “double exits” or branches outside the loop.

Loop Over Items (sequential mode) ➝ Update Google Sheets ➝ Wait (optional)

Force the end of the sub-workflow. To ensure all internal logic completes, you can:

  • Add a Merge node (Wait Mode) at the end of the sub-workflow that merges all active branches.
  • Or use a Wait after the last relevant step, such as “Update Google Sheets,” connected directly to the exit node.

hi thank you for responde i am thinking of removing the subworkfow and made it drctly is that will be problem in the API call for google sheet or another things can happened

her what the update workflow look like:

1 Like

It is the best solution, it makes more sense, than having a subworkflow