Passing information back to main flow from subflow

STRNow
Tera Contributor

Hello,

 

Most of the information I'm finding here seems a little dated and I feel this is a pretty popular question but I'm not having any luck finding it.

 

We have a list of "projects" with multiple managers for each project. I have a catalog item where if their project is mentioned I needed to ask for individual approvals for each project mentioned. I found out that Flow Designer kept hanging as there is no wait bypass avaible for approval processes for these tasks so I created a subflow to create the tasks instead. This worked. I'm able to see each project get its own task created and all managers beinged askes for approval.

 

 Main flow:

Screenshot 2023-12-21 at 5.51.15 PM.png

 

Sub flow:

Screenshot 2023-12-21 at 5.52.01 PM.png

 

The problem now is that I have I want to be able to wait for all those tasks to be completed before continuing with my main flow, but I have no idea how to reference those tasks created back in my mainflow. How can I do that?

I've attached my diagrams for reference.

1 ACCEPTED SOLUTION

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
If I understood the problem correctly, what you need to do is to create a custom field on RITM table say "All tasks completed" and wait for this flag to be true in main flow.
You can check this flag after closure of each task with a onAfter BR and check if within the parent RITM all tasks got closed if yes mark this flag as true.



Thanks and Regards,

Saurabh Gupta

View solution in original post

9 REPLIES 9

Harish KM
Kilo Patron
Kilo Patron

Hi @STRNow why dont you use wait for condition Action? or check do in parallel logic below

 

https://docs.servicenow.com/bundle/tokyo-application-development/page/administer/flow-designer/conce...

Regards
Harish

STRNow
Tera Contributor

Hey Harish!

 

I tried both methods and what ends up happening is that it only creates 1 task and waits for the approval to finish before creating the next.

 

i tried a number of ways and this was the only way I was able to create all tasks simultaneously with approval processes being sent. 

Hi @STRNow When you create a TASK. did you try uncheck the wait checkbox as screenshot? Unchecking this option catalog task will not wait ,the flow will move forward

HarishKM_0-1703211095668.png

 

Regards
Harish

STRNow
Tera Contributor

Yes. It then proceeds to ask for an approval and doesn’t create the other tasks until I approve the current task that’s created. I need it to create all tasks simultaneously and ask for all approvals at the same time. If there’s a way I can achieve this without a subflow id love to do but I tried a number of ways and didn’t yield the results I was looking for.