Flow Question: Withdraw Request in Middle of Flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
We have a pretty basic Catalog Item Flow that does the following:
1. Ask for Manager Approval
2. Ask for Data Owner Approval
3. Automatically add user to AD groups
4. Wait 31 days
5. Automatically remove user from AD groups added up in step 3
Note that step 4, we have set a Stage value of "Active Access Period".
We had the standard "Cancel Request" option on this Catalog Item, so users could cancel requests. However, if they were to cancel the request while it was in that 31 day "Active Access Period", the access that they were granted would NEVER get removed from the account, as step 5 would never happen.
We had similar situations in some of our old Workflows (using Workflow Editor). We replaced the "Cancel Request" button with a special "Withdraw Request" button, which just set the RITM to a State of Withdraw, and NOT deactivate the RITM. Then, our workflow had a main branch off the Begin button with a "Wait For State to be set to Withdraw", which would remove the access if that condition were ever met.
How can I accomplish the same thing using Flow Designer (I would love to continue to use the "Withdraw Request" button we created for this purpose)? Can something be built into my current Flow, or do I need to create a second Flow related to this RITM request? Note that access only needs to be removed if the Withdraw Request button is clicked while the Stage is "Active Access Period".
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
Can you try adding additional logic between step 4 and step 5 ?
REQ -> RITM -> Task. After 31 days wait, before you remove AD users from Group, check the state of RITM or any field based on which you would like to cancel the step 5 & end the flow. If the condition do not match, then go ahead and execute step 5.
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Either I am not understanding your recommendation, or I wasn't clear (or you misunderstood) my requirements. So let me try to explain it a different way.
Note that steps 3 and 5 are automated, and only take about one minute to run. Here is what I want to happen:
1. If they click "Withdraw" request before the second Aprpoval is completed, it can just close out the RITM (and make it inactive). So it acts like a normal "Cancel request" in this scenario.
2. If they click "Wirhdraw" request while the request is in that 31 day period (during the "Active Access Period"), it needs to not wait 31 days and IMMEDIATELY remove their access, then close.
I hope that clarifies things.
I thought I could amend the "Wait For" step that is waiting 31 days to say either way for 31 days OR wait until State changes to "Withdrawn", but that would only address situation #2 above, and not the situation where they click "Withdraw Request" before both Approvals are complete (where access has not been granted yet, so they can simply just close the RITM immediately).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi @jmiskey ,
In your flow, after the Wait for a duration of time action, add a Wait for Condition action.....
Configure it to monitor the state field of the Requested Item (RITM). Set the condition to trigger when the state changes to Withdrawn....
>> Configure the Condition: Set the condition to: state is Withdrawn....
Add a Branch to Handle Withdrawal...After the Wait for Condition action, add a Run Script action....
In the script, check if the RITM is in the Active Access Period stage. If it is, proceed to remove the user from the AD groups.....
if (current.stage == 'Active Access Period') {
// Code to remove user from AD groups
}
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
But I don't think that addresses situation 1 here: https://www.servicenow.com/community/developer-forum/flow-question-withdraw-request-in-middle-of-flo... where if they click the "Withdraw Request" button BEFORE it gets to that place in the workflow. Rmember - they could click this button at any time, not jusy while it is in the "Active Period Period".