Parallel approvals in flow designer - proposed solution

Aniko Hegedus
Tera Expert

My requirement was to create parallel approvals on the basis of a list collector catalog variable. In other words, add a user to multiple groups and ask for approval from each of the group managers separately.
Unfortunately parallel approvals are not supported by flow designer. You might find some solutions by creating a catalog task and tick the „wait” box or use the „run in parallel” options, but with foreach these don’t work.

 

I managed to find one solution and share it with the community, maybe it’ll be useful for someone.

 

  1. I created a new script action that takes the records from the foreach action and add individual approvals one by one.

AnikoHegedus_0-1679509303259.png

(function execute(inputs, outputs) {

  var approvalGR = new GlideRecord("sysapproval_approver");
	approvalGR.initialize();
  	approvalGR.source_table = 'sc_req_item';
	approvalGR.document_id = inputs.ritm;
	approvalGR.sysapproval = inputs.ritm;
     approvalGR.approval_column ="approval";
    approvalGR.approval_journal_column ="approval_history";
	approvalGR.approver = inputs.manager;
	approvalGR.state = "requested";
	approvalGR.insert();  
   
})(inputs, outputs);

2. Step 1 will create the parallel approvals, however the flow does not wait for the approval, so we need to look the approvals up OUTSIDE of the foreach loop

3. Then iterate through the approvals and

4. Add a wait for condition

 

AnikoHegedus_1-1679509303262.png

 

 

Not very elegant, but a workaround.

Hope it will help someone

7 REPLIES 7

Hello Rachna,
This solution creates parallel INDIVIDUAL approvals (on the "sysapproval_approver" table). If you want to create group approvals then you need to use the "sysapproval_group" table.

Aniko

Vewake
Tera Contributor

Hello Aniko,

Thanks for this wonderfull share.

I'm on the same boat as you and trying to do parallel approval via flow designer. I'm missing something on step 2 "how to do a lookup approval record" majorly on how to fetch my previously created approvals. Do you mind sharing the flow screen shots so that I can inspire from that.

Thanks.

Hi,

Just add a Lookup records action to the flow. This should look up the sysapproval_approver table where the approval for is your original ritm that triggers the flow.

AnikoHegedus_0-1700817202241.png

Don't forget that you have to add it OUTSIDE the foreach loop.
Hope it helps.

Aniko