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
Savvy AdminSavvy Admin 

Both Apex Flex Queue and Scheduled Jobs used up

Hi all,

The system has batch call out APEX classes to sync Salesforce information with another Email sending provider, Active Campaign. Every time we insert or update a custom lead or custom opportunity, the system will call out the batch classes to communicate with Active Campaign so we can send proper emails to our customers.

Everyday we have a plenty of records to change on Lead and Opportunity. Occasionally, the system reaches the 100 limit for Apex Flex Queue. Therefore, I modified the code when the 100 limit for Apex Flex Queue has been reached, new tasks will be scheduled in Scheduled Jobs. However, today both the Apex Flex Queue and the Scheduled jobs limit have been reached, which means at the backend Salesforce queued 200 tasks in the system.

I would like to know whether there are people who have experienced the same situation and how they solved this problem. I believe the code has been optimised to its maximum capacity, but if you want to see my code, please tell me. One of the reasons I do not put my code here is that there are four batch classes and three triggers to execute the whole process. There would be too much to put on the forum.

Thanks,
Best Answer chosen by Savvy Admin
Savvy AdminSavvy Admin
As there isn't any reply so far, I am going to close it.

All Answers

Savvy AdminSavvy Admin
As there isn't any reply so far, I am going to close it.
This was selected as the best answer
Shristi AgrawalShristi Agrawal
Hi Savvy,
Currently I am facing the same issue of scheduled jobs limit exceeding 100. What was the solution for this issue?