When an Okta Event Hook is configured to trigger a workflow that uses an API Endpoint or Okta Event Card, if multiple events occur within a short time of each other, the events will be grouped and sent as a batch to Workflows.
When using an API Endpoint to trigger the workflow, only one execution of the workflow is started for the entire batch of events, and the workflow must be designed to account for the incoming payload, potentially including multiple events.
When using an Okta Event card to trigger the workflow, a separate flow will be triggered for each event in the batch. However, by default, batched events will execute like a List For Each with a concurrency of one. If any execution within the batch fails, all subsequent events remaining in the batch will not trigger a flow execution. If there are any long Wait operations within the flow, it may appear as if not all executions were triggered, as each execution is delayed until the execution for the previous event in the batch has finished before starting the next execution.
- Workflows API Endpoint Event Card
- Workflows Okta Event Cards
- Okta Event Hooks
- Okta Event Batching (Ongoing Event Delivery - "Events that occur within a short time of each other are amalgamated in the array, and each array element contains information on one event.")
This is expected behavior when using event hooks with Okta Workflows.
When using an API Endpoint triggered Workflow and multiple events are sent to the endpoint in a batch, only a single execution of the flow will be triggered, and the workflow must be designed to process each event in the batch.
When using an Okta Event card to trigger a workflow, rather than an API Endpoint, events may still get batched, but Workflows will start a separate flow execution for each event in the batch only after the previous item in the batch is done processing. This can be seen in the workflow history:
API Endpoint Invoked Workflow
The API Endpoint workflow must be designed to account for the incoming payload containing multiple events.
-
Create a Helper Flow with an input of type Object.
-
In this example, the input is named eventData.
-
-
In the API Endpoint workflow:
-
Add an Object Get card to retrieve the
data.eventsarray from the body of the API Endpoint event card.-
Ensure the Object Get card output is configured as a list of objects, as shown in the screenshot below.
-
-
Add a List For Each card to iterate through the list of events in the
data.eventsarray.-
Drag the output from the Object Get card into the list input of the List For Each card.
-
Select the Helper Flow created in Step 1. The eventData input will be exposed on the card.
-
Click the drop-down arrow on the
eventDataattribute and select Item.
-
-
-
Add logic to the Helper Flow to process each event accordingly. Each event's data will be passed into a separate execution of the Helper Flow.
Okta Event Card Invoked Workflow
To configure an Event card invoked flow to process the batched events as a list of events, similar to an API Endpoint flow, change the Run Mode to List of records:
- Change the Event Card to LIST MODE.
- Click the gear icon > select Runs when: Each Record.
- Change to List of records and click Confirm.
- Send the event card List output to a LIST - FOR EACH IGNORE ERROR with concurrency higher than 1 and less than 20.
- Send that Object to CALL FLOW - ASYNC to process the original flow actions.
