# Filter on Identity Lifecycle State Changed Trigger

**URL:** <https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, sailpoint-identity-security\
**Created:** [August 5, 2025, 6:53pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589 "2025-08-05T18:53:47Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [August 5, 2025, 6:53pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/1 "2025-08-05T18:53:48Z")

</div>

I would like to set up a workflow that’s triggered when LCS changes from `"inactive"` or `"delete"` to `"active"` and I was hoping to use this relatively new trigger “Identity Lifecycle State Changed”. But I am not able to figure out the filter to be applied to limit the execution to the condition described above.

JSON Input from the trigger is in the format

```auto
{
  "identity": {
    "id": "ee769173319b41d19ccec6cea52f237b",
    "name": "john.doe",
    "type": "IDENTITY"
  },
  "oldLifecycleState": "preHire",
  "newLifecycleState": "active"
}

```

- What have you tried & What errors did you face (share screenshots)?  
 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/9/3/9367000c8adc2faae95a0a19b3c2186a6eedceab.png)

---

<div class="post-metadata">

**Author:** ![vkashat](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vkashat/32/9721_2.png) [@vkashat](https://developer.sailpoint.com/discuss/u/vkashat)\
**Post date:** [August 5, 2025, 7:59pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/2 "2025-08-05T19:59:57Z")

</div>

Does it behave different if you use double quotes instead of single quotes?

---

<div class="post-metadata">

**Author:** ![vkashat](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vkashat/32/9721_2.png) [@vkashat](https://developer.sailpoint.com/discuss/u/vkashat)\
**Post date:** [August 5, 2025, 8:08pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/3 "2025-08-05T20:08:07Z")

</div>

If that doesn’t make a difference, I might still try to use the Identity Attribute Changed trigger, I’ve had success using something like this:

```auto
$.changes[?(@.attribute == "cloudLifecycleState" && @.newValue == "terminated") && ($.oldValue == "inactive" || $.oldValue == "delete")]

```

---

<div class="post-metadata">

**Author:** ![vishal\_kejriwal1](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vishal_kejriwal1/32/10904_2.png) [@vishal\_kejriwal1](https://developer.sailpoint.com/discuss/u/vishal_kejriwal1)\
**Post date:** [August 5, 2025, 8:33pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/4 "2025-08-05T20:33:45Z")

</div>

check this

```auto
"filter.$": "$.changes[?(@.attribute == \"cloudLifecycleState\" && @.newValue == \"active\" && @.oldValue in [\"terminated\", \"inactive\"])]",

```

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [August 5, 2025, 10:44pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/5 "2025-08-05T22:44:24Z")

</div>

`$.changes[?(@.attribute == "cloudLifecycleState"`

is for `Identity Attributes Changed` trigger

---

<div class="post-metadata">

**Author:** ![kalyan\_dev32](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/kalyan_dev32/32/21870_2.png) [@kalyan\_dev32](https://developer.sailpoint.com/discuss/u/kalyan_dev32)\
**Post date:** [August 5, 2025, 11:56pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/6 "2025-08-05T23:56:43Z")

</div>

try this

```auto
$[?(@.newLifecycleState == 'terminated' && (@.oldLifecycleState == 'inactive' || @.oldLifecycleState == 'delete'))]

```

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [August 6, 2025, 12:51am UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/7 "2025-08-06T00:51:49Z")

</div>

Thanks @kalyan_dev32  
I cannot utilize `[?(@. )]` format as the input json is not an array.

---

<div class="post-metadata">

**Author:** ![kalyan\_dev32](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/kalyan_dev32/32/21870_2.png) [@kalyan\_dev32](https://developer.sailpoint.com/discuss/u/kalyan_dev32)\
**Post date:** [August 6, 2025, 3:33am UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/8 "2025-08-06T03:33:14Z")

</div>

Yes, the input is not an array. However, I’ve verified it with the event trigger filter, and it’s working as expected. Refer below screenshot.

 ![Screenshot 2025-08-05 at 10.30.04 PM](https://global.discourse-cdn.com/sailpoint/original/3X/a/b/abf3d90d1b68c68729203c37573e6a708870dca1.jpeg)

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [August 6, 2025, 12:28pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/9 "2025-08-06T12:28:12Z")

</div>

Thanks @kalyan_dev32

I am assuming there is a `$.` in the beginning of your filter string. It still does not work

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/2/6/26e0809a63436b576ac0bcd90501b9f032ac4d64.png)

Also, I am seeing this error in the workflow

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/5/f/5f15880edbbde2aeab5294c50836ace1d3ce7a46.png)  
 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/1/0/10518fd55789f7c1d241fd7396a3bd184f7e4783.png)

---

<div class="post-metadata">

**Author:** ![kalyan\_dev32](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/kalyan_dev32/32/21870_2.png) [@kalyan\_dev32](https://developer.sailpoint.com/discuss/u/kalyan_dev32)\
**Post date:** [August 6, 2025, 12:40pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/10 "2025-08-06T12:40:58Z")

</div>

I believe you should use this filter

```auto

$[?(@.newLifecycleState == 'terminated' && (@.oldLifecycleState == 'inactive' || @.oldLifecycleState == 'delete'))]

```

---

<div class="post-metadata">

**Author:** ![rohit\_wekhande](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/rohit_wekhande/32/28501_2.png) [@rohit\_wekhande](https://developer.sailpoint.com/discuss/u/rohit_wekhande)\
**Post date:** [August 6, 2025, 12:55pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/11 "2025-08-06T12:55:40Z")

</div>

Filter you can use.

```auto
$.changes[?(@.attribute == 'cloudLifecycleState' && @.oldValue == 'active' && (@.newValue == 'termPending' || (@.newValue == 'inactive'))]

```

---

<div class="post-metadata">

**Author:** ![ipobeidi](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ipobeidi/32/16000_2.png) [@ipobeidi](https://developer.sailpoint.com/discuss/u/ipobeidi)\
**Post date:** [August 6, 2025, 1:06pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/12 "2025-08-06T13:06:18Z")

</div>

Just use the identity one. Thats is what i would do.

---

<div class="post-metadata">

**Author:** ![UjjwalJain](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ujjwaljain/32/24704_2.png) [@UjjwalJain](https://developer.sailpoint.com/discuss/u/UjjwalJain)\
**Post date:** [August 6, 2025, 7:05pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/14 "2025-08-06T19:05:09Z")

</div>

@iamnithesh, Give this a shot, I recently worked on something similar.

$.[?( (@.newLifecycleState == ‘terminated’) && (@.oldLifecycleState == ‘prehire’ || @.oldLifecycleState == ‘active’) )]

---

<div class="post-metadata">

**Author:** ![udayputta](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/udayputta/32/14195_2.png) [@udayputta](https://developer.sailpoint.com/discuss/u/udayputta)\
**Post date:** [August 6, 2025, 8:05pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/15 "2025-08-06T20:05:17Z")

</div>

@iamnithesh you can validate/generate the filter using this endpoint.

> **[test-subscription-filter | SailPoint Developer Community](https://developer.sailpoint.com/docs/api/beta/test-subscription-filter)**
>
> The SailPoint Developer Community has everything you need to build, extend, and automate scalable identity solutions.

Even though it says to test subscription filter I usually use this to generate the filter that can be used in workflow trigger.

For your input if I use the below filter it says as valid

```auto
"filter": "$.[?((@.newLifecycleState == \"active\") && (@.oldLifecycleState == \"inactive\" || @.oldLifecycleState == \"delete\"))]"

```

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/4/6/46a19aab85bf40c1e369e6384298a30e11402e23.png)  
You can also play around by passing different values and see if the filter is working as expected or in your postman itself.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [October 5, 2025, 8:05pm UTC](https://developer.sailpoint.com/discuss/t/filter-on-identity-lifecycle-state-changed-trigger/164589/16 "2025-10-05T20:05:38Z")

</div>

Closed on October 5, 2025, 8:05pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
