logo

NJP

What happens when different users Execute Now the same Scheduled Job?

Import · Apr 14, 2016 · article

So here is the scenario. Lets say you have a scheduled job and 10 different users log into ServiceNow (that have rights to see the scheduled jobs) and they click the ExecuteNow button. What happens to the running of those scripts? Does it queue them to be ran in first come order? Does it run them all simultaneously if a worker thread is available to run them?

The answer is that it runs them simultaneously if a worker thread is available to run them. The ExecuteNow sets the next action date to 0 which tells the system (along with the state as Ready) to run this script when a worker become available.

image

If you don't want these two scripts running simultaneous in this multi-threaded format you will want to implement your scripting logic different. You could do a quick check in your script code check if another job of the same type is running before you run the bulk of your script.

View original source

https://www.servicenow.com/community/developer-blog/what-happens-when-different-users-execute-now-the-same-scheduled/ba-p/2284710