Okta Workflows How-To: Delete deactivated users

About the Author

Max Katz

Staff Developer Advocate, Okta Workflows

Max Katz is a Staff Developer Advocate for Okta Workflows. Max loves the no-code automation space and creating educational content. Before Okta, Max led the North America Developer Advocacy team at IBM. Before IBM, Max led developer advocacy for a cloud-based mobile app platform, Appery, helping it grow from zero to over 400,000 developers. Max regularly writes on his http://maxkatz.net blog. 

18 October 2022 Time to read: ~

A modern architectural space with tall columns casts dramatic shadows on the ground

Okta Workflows is a no-code platform for automating identity processes. The Workflows team holds weekly office hours during which they answer builder questions.

This blog post helps you get started with Workflows. Okta support does not assist with custom flow construction using this guide, as it falls outside the scope of standard support. You may need to adjust the flow(s) to meet your needs. For questions, attend community office hours or post on the community forum.

This blog post is based on a question during office hours: How do you delete deactivated users in Workflows?

Delete deactivated users in Okta

There are two steps and two flows to delete deactivated users:

  1. List deactivated users
  2. 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. You can start the flow on schedule or run it manually via the Run button):

Okta Workflows interface showing a "List Users with Search" card configured to filter for deprovisioned users. List deactivated users flow

The flow has the following steps:

Okta Workflows "List Users with Search" options dialog set to stream matching records. Streaming records to a 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)
Okta Workflows helper flow interface configured to delete a user by ID. Delete user flow

The helper flow has the following steps:

  1. 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, you are 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 you don’t have any in this example, it’s okay to leave it empty.
  2. The Okta – Delete User card deletes a user using its user ID.

Note: If you use the delete action on an active Okta user, the user will be deactivated, and a second delete action is necessary to delete the user.

Okta Workflows resources

About the Author

Max Katz

Staff Developer Advocate, Okta Workflows

Max Katz is a Staff Developer Advocate for Okta Workflows. Max loves the no-code automation space and creating educational content. Before Okta, Max led the North America Developer Advocacy team at IBM. Before IBM, Max led developer advocacy for a cloud-based mobile app platform, Appery, helping it grow from zero to over 400,000 developers. Max regularly writes on his http://maxkatz.net blog. 

Continue your Identity journey