Is it possible for flow designer to dynamically generate multiple tasks in parallel?

Community Alums
Not applicable

Hi all, 

Does anyone know if it's possible to (and if it is, how) to get Flow Designer to dynamically generate tasks in parallel?

Here's the logical flow that I'm trying to achieve: 

  1. Lookup a bunch of records where sys_id is one of <big list> (the big list is dynamically generated in a previous step)
  2. For each of these, create a SCTASK, attach it to the RITM the flow is running on and attach an approval (that will be specific to the sys_id that the for each is running on)

The only way I've been able to make that work in flow designer so far is all the tasks are created sequentially, here's what I've done so far: 

find_real_file.png

Thanks all in advance

Mike

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Ok, the only way I figured out how to do this was to move some of it back to a workflow: 

 

So, effectively I use a For Each Item in Flow, call a workflow that generates approvals for the task I've just created (using WorkFlow Inputs to pass the SysID) and not "waiting" for each workflow to complete. I've then got a 5 minute wait (to let the tasks generate effectively) and we continue the flow from there. 

 

It's not clean, but it works. 

find_real_file.png

View solution in original post

12 REPLIES 12

DirkRedeker
Mega Sage

HI

I did not complete the example, but I think, it should work like shown below:

find_real_file.png

The important thing is, that you do NOT select "WAIT" for the task.

 

Let me know, if that answered your question, and mark my answer as correct and helpful, please.

 

Thanks & BR

Dirk

 

Community Alums
Not applicable

Hi Dirk

I've just realised that I haven't phrased the title of this very well at all. It's more the approvals for the task that cause a problem, as after the task is created, even if 'wait' is selected, it still pauses for the approval step, and therefore never hits the loop again to create the next task. 

It seems like in some way I need to spawn multiple threads for this to happen, but given that I don't know how many threads there are going to be, I'm not sure about the best way to achieve this in flow. 

 

Thanks
Mike

 

Community Alums
Not applicable

Ok, the only way I figured out how to do this was to move some of it back to a workflow: 

 

So, effectively I use a For Each Item in Flow, call a workflow that generates approvals for the task I've just created (using WorkFlow Inputs to pass the SysID) and not "waiting" for each workflow to complete. I've then got a 5 minute wait (to let the tasks generate effectively) and we continue the flow from there. 

 

It's not clean, but it works. 

find_real_file.png

Hi OK, understood. What about having one loop to create all tasks first, and then a second loop for the approvals?