How to Delete Deactivated Users in Workflows
Tags: nocode, workflows, okta, ipaas
Published: 2022-08-23 23:13:03

---
title: How to Delete Deactivated Users in Workflows
published: true
date: 2022-08-23 06:00:08 UTC
tags: NoCode,Workflows,Okta,ipaas
canonical_url: https://maxkatz.net/2022/05/05/how-to-delete-deactivated-users-in-workflows/
---

[Okta Workflows](https://www.okta.com/platform/workflows/) how-to guides are questions and answers from weekly community [office hours](https://calendly.com/oktaworkflows/group-office-hours-okta-workflows), MacAdmins [Workflows Slack channel](https://www.macadmins.org), and other places. Read all previous [how-to guides](https://maxkatz.net/okta-workflows-how-to-guides/).

{% embed https://dev.to/oktaworkflows/all-okta-workflows-how-to-guides-4nl9 %}

On to the question.

**_How to delete deactivated users in Workflows?_**

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

1. Get deactivated users (flow 1)
2. Send them (via stream records) to a helper flow to be deleted (flow 2)

The first flow looks like this (you can start the flow [on schedule](https://youtu.be/DDuIgY3Np2E) or run it manually via the **Test** button):

[![Get deactivated users flow](https://katzmax.files.wordpress.com/2022/05/workflows_howto_delete_users_get.png)](https://katzmax.files.wordpress.com/2022/05/workflows_howto_delete_users_get.png)
<figcaption>Get deactivated users flow</figcaption>

The flow uses **Okta – List Users with Search** card where **Status** is set to **DEPROVISIONED**. In the card’s **Options** , the **Result Set** is set to **Streaming Matching Records**. The [streaming option](https://help.okta.com/wf/en-us/Content/Topics/Workflows/learn/about-streaming.htm) directly streams each record to the selected helper flow.

[![Streaming Matching Records option](https://katzmax.files.wordpress.com/2022/05/workflows_howto_delete_users2.png?w=486)](https://katzmax.files.wordpress.com/2022/05/workflows_howto_delete_users2.png)
<figcaption>Streaming Matching Records option</figcaption>

The helper flow looks like this:

[![Delete user helper flow](https://katzmax.files.wordpress.com/2022/05/workflows_howto_delete_users_helper.png)](https://katzmax.files.wordpress.com/2022/05/workflows_howto_delete_users_helper.png)
<figcaption>Delete user helper flow</figcaption>

* * *

The Helper Flow card has two input: **Record** and **State** (both Object type) **Record** 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 **Okta – Delete User** card to delete the user. The **State** parameter is used to pass any additional attributes to the helper flow. You don’t have any in this example so it’s ok to leave it empty.

> **Note** : If you use the delete action on an active Okta user, the user will be deactivated and a second Delete User action is necessary to delete the user.
> 
> <cite><a href="https://help.okta.com/wf/en-us/Content/Topics/Workflows/connector-reference/okta/actions/deleteuser.htm" rel="nofollow">https://help.okta.com/wf/en-us/Content/Topics/Workflows/connector-reference/okta/actions/deleteuser.htm</a></cite>

📒 Have a question about Okta Workflows? Join the weekly community [office hours](https://calendly.com/oktaworkflows/group-office-hours-okta-workflows) to get help.