# I would like to close the workflow if the delay is exceeded by more than x days

**URL:** https://discuss.workflowgen.com/t/i-would-like-to-close-the-workflow-if-the-delay-is-exceeded-by-more-than-x-days/1573
**Category:** General WorkflowGen Discussion
**Created:** [February 12, 2020, 7:36pm UTC](https://discuss.workflowgen.com/t/i-would-like-to-close-the-workflow-if-the-delay-is-exceeded-by-more-than-x-days/1573 "2020-02-12T19:36:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![DUBARRY](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@DUBARRY](https://discuss.workflowgen.com/u/DUBARRY)
#### Post date: [February 12, 2020, 7:36pm UTC](https://discuss.workflowgen.com/t/i-would-like-to-close-the-workflow-if-the-delay-is-exceeded-by-more-than-x-days/1573/1 "2020-02-12T19:36:03Z")

</div>

I would like to close the workflow if the delay is exceeded by more than x days

---

<div class="post-metadata">

### Author: ![DUBARRY](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@DUBARRY](https://discuss.workflowgen.com/u/DUBARRY)
#### Post date: [February 13, 2020, 10:28am UTC](https://discuss.workflowgen.com/t/i-would-like-to-close-the-workflow-if-the-delay-is-exceeded-by-more-than-x-days/1573/3 "2020-02-13T10:28:08Z")

</div>

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 ???

 ![CaptureEcran](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/9cf175c377098b7389438a48bec51284d4cae7a9.png)

---

<div class="post-metadata">

### Author: ![eddy.daouk](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/eddy.daouk/32/672_2.png) [@eddy.daouk](https://discuss.workflowgen.com/u/eddy.daouk)
#### Post date: [February 13, 2020, 5:54pm UTC](https://discuss.workflowgen.com/t/i-would-like-to-close-the-workflow-if-the-delay-is-exceeded-by-more-than-x-days/1573/4 "2020-02-13T17:54:49Z")

</div>

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:

> [@How do I send reminder or prior overdue email notifications?](https://discuss.workflowgen.com/t/how-do-i-send-reminder-or-prior-overdue-email-notifications/362):
>
> Issue How do I send reminder or prior overdue email notifications? Background As of version 5.1.7, WorkflowGen provides the ability to send reminder email notifications. These are known as prior overdue notifications. You can define a hierarchy to handle prior overdue notifications by specifying additional notification conditions based on VBScript date/time calculation functions. In a process action, if you want to notify a user that an action will be late within a specified period of time, y…

Once the deadline is reached, you can trigger an action overdue transition which will close the request.

Regards,  
Eddy.
