Flow Designer: Wait with RITM closure until all tasks are closed

I’m sure you know that scenario from your experiences as well. You are creating nice flows that are triggered by the Service Catalog and you add SCTASKs to a RITM with this flow. And usually at the end you close the RITM and set the Complete stage. But often additional tasks are added to the RITM manually for whatever process reason, and now the flow reaches its end and closes the RITM even though there are still open tasks.

In the past, I had this scenario very often and my solution for it was to get back to a workflow instead of a flow because it was easy to handle this scenario there. And then I used to call this workflow at the end of my flows just that they are not closing the RITM if there are any open tasks.

I came across this scenario again in the Community and wanted to tackle it with the flow designer now completely. My solution for this would be to create a “Do… Until” loop. Within this loop, I can do a lookup of all SCTASKs that are active and the parent is the RITM. For each of them, I do a wait condition until Active is false. My loop will go until the Lookup within the loop is 0. If I put this at the end of all my Service Catalog triggered flows it should work as expected.

What would be your solution for this? Feel free to share it as well in the community.

Leave a Comment