Hello,
There are two solutions that you can use.
Option 1
It is possible to check, with a PowerShell script, whether there are any Approval Requests where the target object of the Request is the User. However, it is impossible to check the type of the operation that is requested.
So, you can create a PowerShell script that will check whether there are any pending Approval Requests requesting operations on the target user. The script will return True if there are any Requests related to the user or False if there aren't any. Then, you can use the script in the If PowerShell script returns True condition to create a user deletion request only when there are no Approval Request where the user is the Target Object.
However, the disadvantage of such an approach is that a Request to delete the user will only be created when there are no pending Approval Requests where the user is the Target Object. Even if that Request requires to perform any operation, not only a Request to delete the user.
Option 2
Alternatively, you can use the following workaround. You can add one more action to your Scheduled Task and your Custom Command. This action should be added before creating a request to delete the user. This action will set a certain property of the user account (say, CustomAttributeBoolean1) to a certain value (say, True). CustomAttributeBoolean1 is an Adaxes virtual property that can store boolean (True/False) values. Adaxes virtual properties are not stored in AD, but you can use them as any other properties of AD objects. Thus, CustomAttributeBoolean1 will be used as a 'flag' that will tell that a user deletion request has already been created, and there's no need to create another one.
Then, you also need to add a condition to execute both the actions (setting CustomAttributeBoolean1) to True and creating a user deletion Request) only when CustomAttributeBoolean1 is not equal to True.
Finally, you will need to create a Business Rule executed after denying an Approval Request. That Business Rule will clear CustomAttributeBoolean1 for the user. This will clear the flag in case the Request to delete the user is denied, so that it would be possible to request deletion of the same user again in the future.
If any of the two solutions is OK with you, we will provide more details on how to implement it.