- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2019 01:48 AM
Say I have an async update business rule on a record and some script which runs after update of the record. Will order of execution of the script be maintained if the record gets updated for two successive updates of the same record with minimal time difference? Is it using a queuing mechanism to push work in the background? I understand that it moves the execution of the script to a different processing thread as per this article, but will a queue be maintained? Or will both the updates be made to run in parallel?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2019 09:42 PM
The order cannot be fully guaranteed as the scheduler contains multiple queues and all of your async BRs would be executed in different queues depending on its availability. If all of your async BRs are send to a single queue then it would be executed one after the other but this is not the case here.
You can see the list of all available schedulers in the stats.do page. By default, most instances have 8 scheduler worker queues.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2019 04:43 AM
adding one thread here. hope it will help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2019 01:19 PM
Hello Harshavardhan,
The question doesn't concern user experience. But rather, how the executions are scheduled. I have an async BR which executes a script on updating a particular table record. For eg. an async BR for an incident record on update. Once the incident record gets updated, the async BR would execute. Say, I update the same incident record in succession (about 10 times), would the 10 corresponding executions of the async BR happen in sequential order? Will the order be maintained for each update? Or would the 10 script executions happen in parallel or out of order?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2019 05:03 AM
If you are talking about after business rules, then you cannot compare its order of execution with another async BR. The after BR executes synchronously keeping the user on wait whereas the async goes to the scheduler. Depending on availability of the scheduler queue the async br may execute sooner or later. This also applies to your after BR, if it has a longer executing code like a bigger loop then it would also take time to execute. So you cannot determine the order correctly.
I would suggest you move your after BR changes in the async BR to control the order in which both of them are applied to your record. In this way you could make the required changes after or before your async changes.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2019 01:05 PM
Hello Allikutty,
No, I'm not talking about "after" BRs. I have an async BR which executes a script on updating a particular table record. For eg. an async BR for an incident record on update. Once the incident record gets updated, the async BR would execute. Say, I update the same incident record in succession (about 10 times), would the 10 corresponding executions of the async BR happen in sequential order? Will the order be maintained for each update? Or would the 10 script executions happen in parallel or out of order? We're taking about the a single async BR being executed twice or more times in succession.