
- 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
10-09-2023 12:40 PM - edited 10-09-2023 12:41 PM
@Peter Bodelier One thing that made me sad was that I had to create step 21 in my main FLOW. It seemed like step 22 was unable to utilize the values retrieved in step 19.
Is that normal / expected for the "Do the Following - X - Until" construct?
So steps 19 and 21 are basically the same thing. : (
(The step 19 Data Pills were all grayed out, and the Flow Designer would not let me drop them into step 22.)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 01:53 AM
Hi @G24,
You are using 21 because you cannot access 19 within 22 right?
I would create flow variables, and fill these in the for each, so you can access them in 22, without step 21.
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-10-2023 07:00 AM
Correct. And I was able to use Flow Variables, as you suggested, but unfortunately that adds another action, so I'm not saving any actions, but I do think the flow is a bit less confusing with the variables. So I changed it to this:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 07:10 AM
Indeed, it does need another action. It's a bit the same as actions within a if/else. You can't access them outside it.
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
05-08-2024 08:09 AM
I had to scroll up and down several times to piece it together. This is not a complaint, mind you - it just inspired me to add some more detail here in case it helps someone else. 🙂
In the original (awesome) flow diagram, the 'Update Requested Item Record' (step 22) was attempting to use values set in the 'Gather Task Status' Subflow, but was unable to access them because they're inside the Do... Until block.
The workaround above (which I'm replying to now) solves this by setting Flow Variables in step 23. This is my interpretation of how that Flow Logic looks:
In the 'Update Requested Item Record', then, rather than attempting to utilize the Subflow outputs to set State and add an Additional comment, you use the Flow Variables shown above instead, as they're accessible anywhere in the Flow.
Please hit that thumbs-up icon if this helps you!