Workflow/subflow - How do I set a "wait for all to close" condition.

tcotton
Giga Expert

I am working on a Workflow with several sub-flows. I need to set a condition that the main workflow is finished when all the subflows are complete.   There may be only 1 subflow, or several, that are triggered.  

2 REPLIES 2

Manjeet Singh
ServiceNow Employee
ServiceNow Employee

I think you can use a run script activity to close the parent task. Here is a post covering some best practices scenarios when using wait for conditions.



Tips for Using Workflow Condition Activities


David Christian
Kilo Guru

Use a Join at the end where all the concurrent execution paths come together.   Use this activity to cause a workflow to wait for all activities in multiple paths to finish before continuing.   Take a look at section 3 here: http://wiki.servicenow.com/index.php?title=Utility_Activities#gsc.tab=0



Here is a screen shot of where I combine 5 paths (some of them are overlapping in one arrow which is why you only see 3 incoming arrows).   What is interesting is that let's say you have an if statement at the very beginning.   If true then it goes to two paths.   If false it goes to three paths.   You can combine all into one join and it will only look for the either the two paths from the true "if" statement or the three paths from the false "if" statement.   In other words it automatically knows which branches to wait for to complete and which to not wait on.



find_real_file.png