Flow Question: Withdraw Request in Middle of Flow

jmiskey
Kilo Sage

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

9 REPLIES 9

nityabans27
Giga Guru

Hi @jmiskey ,
According to me, 

You can handle this in Flow Designer without losing the deprovision step. Two approaches:

  • In the same Flow: After granting access, add a Wait for Condition on RITM state = Withdrawn (and Stage = Active Access Period) with a 31-day timeout. If Withdrawn → remove access immediately; if timeout → remove access as usual.

  • Separate Flow: Trigger on RITM state = Withdrawn, check Stage = Active Access Period, then call your “Remove from AD groups” action.

Best practice: put the removal logic in a reusable Subflow/Action so both paths call the same deprovision step.

This is just a suggestion which you need to try and test. 

If you find it useful please mark it helpful and accept it as solution.

With your "Same Flow" option, I do not see how Withdrawals during the approval state would be handled.  Can you explain in more detail how that would work?

jmiskey
Kilo Sage

OK, I was able to update step 4, the "Wait for" command.  Instead of waiting for a period of time, I have it now waiting for a condition, specifically, the State field changing to "Withdrawn", and adding the "Time Out Duration" option on that to include my 31 one day check.  That works perfectly - for that situation.

 

Now I need to address if it is withdrawn while it is in the approval stages.  I thought maybe I could use a second flow, but if I select "Record Updated" for my Trigger, I cannot select the sc_req_item table, and I can only have one Flow listed in the Flow field on the Catalog Item.

 

So I am not sure how I can add this second part.  Anyone have any ideas?

Why not call a sub flow inside it.
or

You can’t attach two Catalog Item flows, but you can add a record-triggered Flow:

  1. Create a new Flow → Trigger = Record Updated → Table = sc_req_item.

  2. Condition: State = Withdrawn.

  3. Add check: if approvals are pending, run cleanup/deprovision (ideally via a shared Subflow).

That handles withdrawals during approvals while your main Flow handles the Active Access Period.

As I already mentioned, I tried what you suggested in step 1 already. 

If you choose "Record Updated", you cannot select the "sc_req_item" table - it is not an option!

I am guessing maybe since they have the "Service Catalog" trigger option, they do not allow you to choose "sc_req_item" for Record Updated.