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,209 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 02:02 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 03:31 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 01:14 AM
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.
Don't forget that you have to add it OUTSIDE the foreach loop.
Hope it helps.
Aniko