- Okta Workflows
There are two steps and two flows to delete deactivated users:
- List deactivated users.
- Send the users (via stream records) to a helper flow to be deleted.
List deactivated users
The list deactivated users flow finds all deactivated users and streams the users to a helper flow. Start the flow on schedule or run it manually via the Run button.
The flow has the following steps:
- The flow uses the Okta—List Users with Search card, with Status set to DEPROVISIONED, to find deactivated users.
- The card uses the streaming option to send records directly to the helper flow.
Delete user
This is a flow to delete a user.
When using the streaming option, the Helper Flow card must have the following two fields, or the flow will not work correctly.
- Record (type Object)
- State (type Object)
The helper flow has the following steps.
- The Helper Flow card has two inputs: Record and State (both must be Object types).
- Record: This is the current record passed to this helper flow. The current record has many attributes. For this example, if interested in the user’s ID (type Text), which is passed to the Okta—Delete User card to delete the user.
- The State parameter passes any additional attributes to the helper flow. Since there is none in this example, it is okay to leave it empty.
- The Okta – Delete User card deletes a user using its user ID.
If using the delete action on an active Okta user, the user will be deactivated and a second delete dser action is necessary to delete the user. For more information, please check Workflows docs.
