I've created a system that will loop through and create X number of sub-workflows, but I now need to have the 'master' workflow wait until all sub-workflows have completed.
I cannot have the workflow wait on each sub-workflow as they need to be run parallel to each other. (I cannot use a parallel action as I'm using a for loop.)
Is there anyway to achieve this?
I've attached the workflow in it's current state.
I would do it following way
- created a status column for child workflows in master list. if there is reasonable/definite amount of child workflows started it could be single status column per each workflow. if there are plenty of them resp. varying number of child workflow, I would created one status column with custom XML format where I would maintain how many child workflow has been started and status/return value for each workflow.
- configured child workflows to update that status column in master list
- moved all the logic past the child workflows are started to a separate workflow that would start on master list update. within the workflow I would check all the child workflow statuses and if all are completed I would advanced to respective handling logic or otherwise finished the workflow.
Im not sure what exactly is your business logic but you also might need to implement some 'safety' check so that you do not wait for child workflows forever or not to run final handling logic multiple times if item updates are possible after the logic already ran.