
SarahS.89561 (Customer) asked a question.
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
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

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.
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.
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.
@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