[SalesForce] How many batches can I run in 1 schedulable class

I have 5 batch classes (implements Database.Batchable). I was able to add all of them in a single schedulable class (implement Schedulable) and schedule it successfully (code below). It worked.

My questions:

  • how many such batch classes can I keep adding to the below schedulable class without errors?
  • Are there any limitations?
  • What issues would I face?

Thoughts please

global class Schedulable_Notifications_ALL implements Schedulable 
{
    global void execute(SchedulableContext sc)
    {
        Batch_Notifications_1 batch1 = new Batch_Notifications_1();
        Batch_Notifications_2 batch2 = new Batch_Notifications_2();
        Batch_Notifications_3 batch3 = new Batch_Notifications_3();
        Batch_Notifications_4 batch4 = new Batch_Notifications_4();
        Batch_Notifications_5 batch5 = new Batch_Notifications_5();

        Database.executeBatch(batch1,10);
        Database.executeBatch(batch2,10);
        Database.executeBatch(batch3,10);
        Database.executeBatch(batch4,10);
        Database.executeBatch(batch5,10);

    }
}

Best Answer

  1. how many such batch classes can I keep adding to the below schedulable class without errors? (I think you can add upto 5 only in that way if you want to more you need to add them in flex queue)
  2. Are there any limitations? (5 active batch job limitation.)
  3. What issues would I face? Read this documentation for limits in Batch and issue you may face https://help.salesforce.com/apex/HTViewSolution?id=000176644&language=en_US