this is my workflow Json.
{
"name": "Termination User ownership",
"description": "Test -Termination User ownership",
"modified": "2025-12-02T04:38:06.569977328Z",
"modifiedBy": {
"type": "IDENTITY",
"name": "Abhijit.Patil"
},
"definition": {
"start": "Get Identity 1",
"steps": {
"Compare Strings": {
"actionId": "sp:compare-strings",
"choiceList": [
{
"comparator": "StringEquals",
"nextStep": "HTTP Request 1",
"variableA.$": "$.trigger.newLifecycleState",
"variableB": "Terminated"
}
],
"defaultStep": "End Step - Success",
"displayName": "",
"type": "choice"
},
"End Step - Success": {
"actionId": "sp:operator-success",
"displayName": "",
"type": "success"
},
"End Step - Success 1": {
"actionId": "sp:operator-success",
"displayName": "",
"type": "success"
},
"Get Identity 1": {
"actionId": "sp:get-identity",
"attributes": {
"id.$": "$.trigger.identity.id"
},
"displayName": "",
"nextStep": "Compare Strings",
"type": "action",
"versionNumber": 2
},
"HTTP Request 1": {
"actionId": "sp:http",
"attributes": {
"authenticationType": "OAuth",
"jsonRequestBody": null,
"method": "get",
"oAuthClientId": "ClientId",
"oAuthClientSecret": "ClientSecret",
"oAuthCredentialLocation": "oAuthInHeader",
"oAuthScope": null,
"oAuthTokenUrl": "https://{ClientUrl}.identitynow.com/oauth/token",
"requestContentType": "json",
"requestHeaders": null,
"url": "https://{ClientUrl}.api.identitynow.com/beta/workgroups?filters=memberships.identityId%20eq%20%22{{$.getIdentity1.id}}%22",
"urlParams": null
},
"description": null,
"displayName": "",
"nextStep": "Send Email 1",
"type": "action",
"versionNumber": 2
},
"Send Email 1": {
"actionId": "sp:send-email",
"attributes": {
"body": "<p> </p>\n<p>{{$.getIdentity1.managerRef.name}}<br><br>{{$.getIdentity1.name}} has terminated. <br></br><br><Strong>Workgroup Description : </Strong><br><br><br></p>\n<p><!--ScriptorStartFragment--></p>\n<div class=\"scriptor-paragraph\"><!--ScriptorStartFragment-->\n<div class=\"scriptor-paragraph\">{{$.hTTPRequest1.body[*].name}}</div>\n<!--ScriptorEndFragment--></div>\n<div class=\"scriptor-paragraph\"><!--ScriptorEndFragment--></div>\n<div class=\"scriptor-paragraph\"><br><em>{$.hTTPRequest.body[].name}}\\n${workGroupList}\\n$workGroupList.getClass()\\n#foreach($workGroup in $workGroupList)\\n$workGroup\\n#end\"</em></div>",
"context": {
"accounts.$": "$.getAccounts.accounts",
"accountsArr.$": "$.hTTPRequest1.body[*].name",
"workGroupList.$": "$.hTTPRequest.body[].name"
},
"from": null,
"recipientEmailList": [
"{{ $.getIdentity1.managerRef.email}}"
],
"replyTo": null,
"subject": "User Terminated {{$.trigger.identity.name}}"
},
"description": null,
"displayName": "",
"nextStep": "End Step - Success 1",
"type": "action",
"versionNumber": 2
}
}
},
"creator": {
"type": "IDENTITY",
"name": "Abhijit.Patil"
},
"trigger": {
"type": "EVENT",
"attributes": {
"id": "idn:identity-lifecycle-state-changed"
}
}
}