@Bassem_Mohamed Below is the workflow to deny pending access request when it has crossed 30 days. However, it is not working in prod environment, but it is working in sandbox environment.
“name”: “Cancel Pending Access Requests”,
“description”: “Cancel Pending Access Requests which are older than 30 days.”,
“modified”: “2025-10-19T23:23:36.927240035Z”,
“modifiedBy”: {
“type”: “IDENTITY”,
“id”: “xxxxxxxxxxxxxxxx”,
“name”: “Kxxxxxx”
},
“definition”: {
“start”: “HTTP Request 1”,
“steps”: {
“End Step - Success 2”: {
“actionId”: “sp:operator-success”,
“displayName”: “”,
“type”: “success”
},
“HTTP Request 1”: {
“actionId”: “sp:http”,
“attributes”: {
“authenticationType”: “OAuth”,
“jsonRequestBody.$”: “”,
“method”: “get”,
“oAuthClientId”: “xxxxxxxxxxxxxxxxxxxxxxxx”,
“oAuthClientSecret”: “$.secrets.xxxxxxxxxxxxxx”,
“oAuthCredentialLocation”: “oAuthInHeader”,
“oAuthTokenUrl”: “https://xxxxxxx.api.identitynow.com/oauth/token”,
“requestContentType”: “json”,
“url”: “https://xxxxxx.api.identitynow.com/v3/access-request-approvals/pending”
},
“displayName”: “”,
“nextStep”: “Loop”,
“type”: “action”,
“versionNumber”: 2
},
“Loop”: {
“actionId”: “sp
iterator”,
“attributes”: {
“context.$”: “”,
“input.$”: “$.hTTPRequest1.body”,
“start”: “Compare Timestamps”,
“steps”: {
“Compare Timestamps”: {
“actionId”: “sp:compare-timestamps”,
“choiceList”: [
{
“comparator”: “TimestampLessThanXDay”,
“nextStep”: “Deny Access Request”,
“variableA.$”: “$.loop.loopInput.requestCreated”,
“variableB”: “30”
}
],
“defaultStep”: “End Step - Success”,
“displayName”: “”,
“type”: “choice”
},
“Deny Access Request”: {
“actionId”: “sp:reject-request”,
“attributes”: {
“approvalId.$”: “$.loop.loopInput.id”,
“comment”: “This request was automatically declined as it is over 30 days old.”
},
“displayName”: “”,
“nextStep”: “End Step - Success 1”,
“type”: “action”,
“versionNumber”: 1
},
“End Step - Success”: {
“actionId”: “sp:operator-success”,
“displayName”: “”,
“type”: “success”
},
“End Step - Success 1”: {
“actionId”: “sp:operator-success”,
“displayName”: “”,
“type”: “success”
}
}
},
“displayName”: “”,
“nextStep”: “End Step - Success 2”,
“type”: “action”,
“versionNumber”: 1
}
}
},
“creator”: {
“type”: “IDENTITY”,
“id”: “xxxxxxxxxxx”,
“name”: “xxxxxxx”
},
“trigger”: {
“type”: “SCHEDULED”,
“attributes”: {
“cronString”: “0 1 * * *”,
“dailyTimes”: [
“1969-12-31T19:30:00.000Z”
],
“frequency”: “daily”,
“id”: “idn:cron-schedule”,
“timeZone”: “Asia/Calcutta”
}
}
}
Any thoughts?