Parallel approvals in flow designer - proposed solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 11:25 AM
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.
- I created a new script action that takes the records from the foreach action and add individual approvals one by one.
(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
Not very elegant, but a workaround.
Hope it will help someone
- 4,056 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 11:47 AM
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
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 01:21 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 03:10 AM
If possible, please share screenshots of this solution. I am unable to get this. Would really appriciate your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 06:21 AM
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