I would like to close the workflow if the delay is exceeded by more than x days
I think that I understood your method and I seem to correspond to my need but when I put a following action END with as condition <WF_ACTIVITY_INST_OVERDUE_MINUTES>> 2 on my portal the action remains to be done while the delay of 2 minutes is exceeded . I thought the action disappeared and closed the workflow ???
You are correct - my method is not right since the condition will be evaluated once the action is closed. Just deleted my post.
One solution would be to add x days to the lead time and send prior overdue notifications to the users when deadline - x days is reached
For example if your deadline is 7 days and would like to close after 7 days past overdue:
Set the lead time to 14 days and send a prior overdue notification 7 days before the deadline:
Once the deadline is reached, you can trigger an action overdue transition which will close the request.