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

AnveshKumar M
Tera Sage
Tera Sage

Hi @Aniko Hegedus ,

That's a great idea!!

 

I managed to do similar one, but instead of Script Action I used Sub Flow without "wait". The approval record and approvers will be passed to the sub flow, sub flow will trigger the approvals.

 

Once all the approvals are triggered, will check for the approval status using wait for condition on approval table for the record in question, until all approvals goes out of "requested" and if any reject found take appropriate action.

 

Thanks,

Anvesh

 

 

Thanks,
Anvesh

Hello @AnveshKumar M , I think you're solution is a very good idea too. In fact that was my last resort to try if this one doesn't work. 😄 Thanks for sharing.

Hi @AnveshKumar M 

If possible, please share screenshots of this solution. I am unable to get this. Would really appriciate your help.

Rachna S
Tera Guru

Hi guys,

 

Does this solution also work if you need just one (anyone) approver from each group to approve or reject ? I've tried this and it does create parallel approvals. However, none of the approval conditions seem to work for the scenario in which I need one user per group to approve. Any help would be much appreciated. Thanks