Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Agents fails due to "Invalid Delay time"



Two different agents fail after the agent complete their tasks. Agents fail during the scheduling of the next run time.

Scenario 1 - Agent  execution takes more than 24 hours to complete. Exception occurred directly after agent finished. This agent does not face this problem after every run.
Scenario 2 - Agent  execution takes more 12 hours to complete. Exception occurred directly after agent finished. This agent faces this problem after every run.

Error Messages

Scenario 1 - Exception at 20150428T131503.694 GMT: Invalid delay time: -18903353
Scenario 2 - Exception at 20150427T050027.501 GMT: Invalid delay time: -27397

Steps to Reproduce

Schedule the agent to run once daily. Observe the exception after every time the agent completes its task. It has to be restarted daily to run automatically at the scheduled time.

Root Cause

The second agent faces this issue due to a vagary in agent scheduling. The execution can occur slightly before the scheduled time. In case of an Agent scheduled to run daily and at exactly midnight, the agent can begin processing slightly before midnight.  If it finishes after midnight it will interfere with the algorithm used to schedule the next run.

For the first agent, the fact that the current execution took over 24 hours to complete made the "next run time" (which is calculated at the beginning of the process, and is checked against the current time at the end of the process) compute to a time in the past.


Alter the second agent to schedule for 5 minutes past midnight (so it will never begin processing in the prior day). Scenario 1 is an expected behavior (and is the best possible outcome for a daily agent whose processing takes more than 24 hours to complete).

Published June 12, 2015 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us