Build a webhook event flow
Okta Workflows allows you to build event cards that support a webhook framework. This provides a near-real-time response to events occurring on a remote system. Building a webhook event depends on the features offered by the remote service API, and the goal of the event card.
You can use webhook event flows to build cards for your connector that trigger based on events such as user creation, file deletion, or reports of suspicious activity.
For more information on how webhooks work, see Webhook event cards.
Before you begin
-
You must be a super admin with access to Okta Workflows.
-
If you haven't already created a connector, follow these steps to create one:
-
From the Okta Workflows Console, click the App switcher icon and then the link for the Connector Builder console.
-
In Connector Builder, click the + icon to create a connector. Give your new connector a unique name and a useful description.
-
-
Ensure that the connector has the basic foundation and authentication elements provided through the tasks in the Get started quickly with the basics section.
Start this task
-
Click your new connector to open it in the main panel.
-
On the Flows tab, create a flow by clicking + New Flow.
-
Click Add event and from the Events choices, select Webhook Event.
-
Click Add Options to add any options you want to declare for the Webhook Event card.
-
Click Configure in the Webhook Registration section to open the webhook registration dialog.
-
In the Registration dialog, click Choose Flow to select registration and deregistration helper flows for the webhook event. If no helper flows exist, you can click Create new flow.
-
Registration Flow
When your user turns on a flow that contains your deployed webhook event card, the registration helper flow is triggered.
The registration flow registers the unique Event URL in the external service for your user's flow, so that the service knows where to send the webhook payload.
The Event URL is an auto-generated URL. This gets created when the user turns on their flow that contains this webhook event.
After selecting a registration helper flow you can map input fields to pass into it using the option fields present on your webhook event card. This enables you to use the same registration helper flow for multiple webhook event cards by passing in a different option from each webhook card.
The registration helper flow includes a return card with an object field called Registration Data. This object is used to store any reference needed when the Deregistration Flow runs.
-
Deregistration Flow
Similar to the registration flow, when your user turns off a flow that contains the deployed webhook event card, the deregistration helper flow is triggered.
Any information defined from the registration flow using the Registration Data output is available as input for the Deregistration Flow event card.
After selecting a deregistration helper flow, you can map input fields to pass into it using the option fields on your webhook event card. Similar to a registration helper flow, this enables you to use the same deregistration helper flow for multiple webhook event cards.
The deregistration helper flow doesn't include a return card.
-
Click Apply to confirm your registration and deregistration helper flows and their input mappings. Click the garbage pail icon if you need to remove a selected registration or deregistration helper flow.
For webhook event cards, the registration or deregistration flow must complete within 60 seconds or your user's flow won't turn on.
-
-
Click Add Outputs to configure the Return Outputs card for the webhook event flow.
-
In the Options dialog you can specify any outputs you want the webhook to return. Click Add group to create an output group.
-
Activate Enable Run mode if the webhook payload returns a list of records and you want to specify the execution mode for any flows that use this webhook event card. See Enable run mode for webhooks.
-
In the Static Output Group pane, provide a Group Name for this set of outputs. For each field that you want returned as output, provide a Label and select a Field Type and a Data Type from the dropdown menus. The preview card shows you how the return card appears.
-
Click Add group to add another output groups.
If the Enable Run mode option is active, the event card can only return one output group.
-
-
Click Apply to save the changes to your Return Outputs card.
-
Click the Save button in the toolbar and name the flow.