function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MJ09MJ09 

In what order are Batch Apex jobs executed?

Can we assume anything about the order in which Batch Apex jobs are executed?

 

Imagine a user clicks a button that launches a Batch Apex job that will process 5000 records, in chunks of 500. While this Batch Apex job is chugging away, the user clicks another button that launches a different Batch Apex job that will process 2000 records, 100 per chunk. Can I be certain that all of the chunks for the first job will complete (all of the records will be processed) before the second job's first chunk begins? 

 

Thanks!

ErikOSnet0ErikOSnet0
Good question!  Are batch jobs serialized per user, per application, or can they run concurrently?
MegatronMegatron
No, there's no guarantee in the order of which they are executed.