Will scheduled job run exactly at the scheduled time or can there be delays?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 01:43 AM
Having known that scheduled jobs run asynchronously, my question is -
Will scheduled job run exactly at the scheduled time or can there be delays?
Say I have a continuous/periodic scheduled job to run every 5mins which will make an API call to external tool.
Will this job run EXACTLY every 5 mins and make that API call or can there be delays in triggering the API call when the instance load is high or worker threads are busy etc?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 04:54 AM
What are you trying to accomplish? It is impossible to predict when the load may be high and thus delaying the scheduled job with a couple of seconds. It all depends on what you are running, how many people are using the instance, how many integrations are running, etc. Why is it so important to have it run at every 5 minutes exactly and not at 5 minutes and 10 seconds?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 08:42 AM
@Mark Manders the integration is built to run every 5 mins and pull some data, its a business requirement. It will be a very lengthy and complex to explain it.
But in short words, when the job is not executed on exact time, there will be data loss. We suspected it could be because the execution did not run on time. We did not have the logging in place. That is why was checking if there is a way to find the reason was really because of the delay in execution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2025 01:40 AM
It sounds like a poorly setup integration that you only get 5 minutes worth of data, every 5 minutes. With any integration you always run the risk of system load being high and having some delay. Why not integrate against a staging table, put the data from the last 10 minutes in there, every 5 minutes and let ServiceNow transform maps update the data if necessary. If you are delayed, you will get it on the next run.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2025 03:29 AM
Hi @Mark Manders yes right, we are already in the process of redesigning 🙂
Meanwhile I was just checking out in community to get more insights on 'scheduled jobs'.