<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00009a2vbsCAAOkta Identity EngineWorkflowsAnswered2024-04-03T16:09:08.000Z2023-09-06T10:26:57.000Z2023-09-07T09:04:53.000Z

SarahS.89561 (Customer) asked a question.

Dealing with amalgamation in Okta event hooks when deactivation users

I have created an event hook from Okta into Workflows for when a user is deactivated, if several users are deactivated at the same time, Okta can amalgamate that event for several users into one payload

 

So, Event Hook sends the below body

 

/help/servlet/rtaImage?refid=0EM4z000007EcGO

I need to be able to grab the user ID form the above so I can take action on each user, I need to extract the below

x.data.events[0].target[0].id

x.data.events[1].target[0].id

x.data.events[2].target[0].id

 

Can't seem to work out the best way to handle this

 

 

 


  • MatthewH.10249 (State of Iowa)

    Create a Helper Workflow that you call from your main Workflow that is called by the Event Hook using a "List - For Each" or "List - For Each - Ignore Errors" action card passing in the "x.data.events" array. In the Helper Workflow you can then evaluate each "x.data.event.target" value. If it is always the first element "[0]" you can just grab the value else you may have to do another loop using another "List - For Each" or "List - For Each - Ignore Errors" passing in the "target" array.

    Expand Post
  • TimL.58332 (Workflows)

    The above is spot on. Event Hooks in Okta will batch events if more than one occur at around the same time. Even if a single event occurs the "Events" is still a list of objects (it just has the 0 place in the list) so you always want to be pulling the events list of objects out.

     

    With the built-in event cards in Workflows this can cause some unexpected behaviors when "wait" cards are applied. Because those cards do the "For Each" of the resulting events list of objects behind the scenes & it functions at a concurrency of 1. So lets say a batch of 10 events occurs and you have a wait 1 minute in your flow the 10th event wont start processing until 9 minutes (wait) + regular processing time later. There are ways around it such as using a "Call Flow Async" to immediately pass the event data to a Helper flow to do the processing.

    Expand Post
  • SarahS.89561 (Customer)

    Hi Tim and @MatthewH.10249 (State of Iowa)​ 

     

    Thanks for that, one more question before I dive in, if I have an event hook set as per below, will it only batch events of type, eg. won't send a user activated in the same payload as user deactivated etc.

    image 

     

    Expand Post
  • SarahS.89561 (Customer)

    @TimL.58332 (Workflows)​ and @MatthewH.10249 (State of Iowa)​, I have done some testing and answered my own question, yes, it does batch different event types but that can be sorted with a List for each and an If/ElseIf statement

     

    Thanks for your help as always

This question is closed.
Loading
Dealing with amalgamation in Okta event hooks when deactivation users