
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 07:21 AM
Hello Gurus. Can someone please give me a COMPLETE and DETAILED solution for the following common problem?
I have a flow. In the flow various service catalog Tasks are automatically generated. And maybe while working on those tasks, some users MANUALLY generate some additional service catalog tasks.
At the end of the flow, if ALL TASKS ARE CLOSED, I want to update my sc_req_item state. I should do that, right?
Question
What is the Standard / Proper / Elegant way to achieve this? I'm having trouble finding a complete solution. I see a complex business rule here . I think it is an "After Update" business rule on the sc_task table... But WHY do I have to drop out of the Flow and use a Business Rule??? Then it seems like future developers will be wondering how items are magically getting closed.
Wouldn't it be better to have a Flow Action of some sort, so everything is clear and visible IN the flow? Has anyone created such an action, and if so, could you share please? Or if that is a bad way of doing things, can someone please explain WHY Flow itself cannot be used to model this? Thanks!!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 07:31 AM
Hi @G24,
Create a subflow.
Input: RITM (reference to sc_re_item)
Output : Active found True / false (default is true)
Action Look up Record on sc_task table, active is true, ritm is current ritm.
- If any active task found,
Create wait for condition, active of that task is false.
End flow
If no task found set Output Active found to false.
In your main flow after you have finished with your automic tasks and logic:
Create a do the following until.
Call the subflow in it.
Do the following until condition : subflow output Active found is false.
After that proceed with closing the ritm.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 11:51 AM
Building on what was proposed by @Peter Bodelier solution is as follows:
Create a reusable "Gather Task Status" SubFlow which can be reused and will either 1) WAIT on an unfinished task if one exists, or 2) Return a flag indicating that all tasks were in fact completed. I added some integers also, to indicate how many Complete, Incomplete, and Skipped tasks there were, but that is icing on the cake, and could be skipped.
The overall subflow looks like this:
The inputs and outputs look like this:
Individual flow actions look as follows:
The subflow is used inside of a regular Catalog flow as follows:
The details of those Flow actions are as follows:
Then at runtime, after all tasks are closed Closed Complete, Closed Incomplete, or Closed Skipped, like this:
The Catalog Item will be closed, like this. Woohoo! ...
Optional updating of comment field looks as follows:
The End. Please mark helpful if this helped you in some way!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2024 08:43 AM - edited 03-29-2024 08:44 AM
I must be missing something here as I tried to implement this and the 'Do the following' just kept looping until it hit some kind of maximum attempts and the Flow errored out.
What's preventing your solution from just constantly running as long as there is at least 1 active Catalog Task like mine is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 11:17 PM
Hi @Shane J
I have gone through this article. While I am trying this, I encountered with same issue as yours. 'Do the following' just kept looping until it hit some kind of maximum attempts and the Flow errored out.
Did you got any solution for this. Am I missing something here?
Please let me know if there is any solution.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2025 05:52 AM
@VullankiL We haven't made a habit of doing this in Flow like we did in Workflow so it took awhile to find an example, but I think the following series of steps works as of Vancouver (we're now on Xanadu). In the first screen shot, note the 3 second Wait for, if I recall correctly that prevented an issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 06:42 AM
An alternative solution is available in here.
https://www.trylearngrowrepeat.com/flow-designer-wait-with-ritm-closure-until-all-tasks-are-closed/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2024 05:46 AM - edited 09-11-2024 05:46 AM
Hi,
I can see a risk in the Flow proposed unless I'm mistaken. This flow will continuously runs as long as the tasks are pending right ? It will run on the platform scheduler and potentially clog up your queue and the other flows will be impacted.
Why not create a Flow that is triggered on the sc_task status update (similar to an "On Update" Business rule) so that when a Task is closed, it will check if there are still other tasks and if not, close the RITM. This would run quickly once when a task is updated instead of making a loop checking constantly if the task of a particular RITM is closed.
Regards,