Flow Designer - Creates a last task after all previous ones are closed

HudyssonPOntes
Tera Expert

Good evening, how are you? Please, I have a RITM that will have a random number of child tasks (which we will only know after the user submits the record producer). I need that when the user finishes all the child tasks of the RITM, one more last task is automatically created. The creation of all tasks is being done through the flow designer. Is there any way to solve this problem via flow designer? How could I do it? Thank you very much!

1 ACCEPTED SOLUTION

HudyssonPOntes
Tera Expert

I believe I have managed to solve it. For those who may need it:

In step 7 I search for the records in the table
In step 8 I do a foreach on the records from step 7
In step 9 I create the tasks with the parent defined as the RITM of my flow trigger, one for each record that was found in step 7
In step 10 I do a search for all the tasks of the current RITM
In step 11 I do a foreach on the records from step 10
In step 12 I do a "wait for condition" (in the example I did wait for condition where state = closed complete)
In step 13 I create the last task, which will be created after all the tasks found in step 10 have the state = closed complete


HudyssonPOntes_0-1746026442649.png

 

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@HudyssonPOntes 

are those random tasks a manual tasks or automated one?

If automated then in your flow you can create 1 more at the end

How will you determine how many tasks to create?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Good morning, how are you? The user will select an option in the record producer, and depending on that option, the flow will look up records in a table, searching for a specific type of record, and then the flow will create a task for each record found (depending on the type the user chose in the record producer, it may create more or less tasks, depending on how many records the flow found). The tasks are created automatically via flow, depending on how many records the flow found in the table. I need these tasks to be created and when the user finishes them all, at the end of everything, the flow will create another closing task. Thank you very much for your attention and willingness to help me.
HudyssonPOntes_0-1746018502897.png

 

HudyssonPOntes
Tera Expert

I believe I have managed to solve it. For those who may need it:

In step 7 I search for the records in the table
In step 8 I do a foreach on the records from step 7
In step 9 I create the tasks with the parent defined as the RITM of my flow trigger, one for each record that was found in step 7
In step 10 I do a search for all the tasks of the current RITM
In step 11 I do a foreach on the records from step 10
In step 12 I do a "wait for condition" (in the example I did wait for condition where state = closed complete)
In step 13 I create the last task, which will be created after all the tasks found in step 10 have the state = closed complete


HudyssonPOntes_0-1746026442649.png

 

@HudyssonPOntes 

Please mark your own response as correct and close the thread.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader