# What are the concurrency and maximum limit constraints associated with Scheduled Apex jobs in an org?

**Topic:** Apex · **Difficulty:** Medium · **Tags:** Apex, Asynchronous Apex, Scheduled Apex

Read it on the site: https://www.forcechallenges.com/interview-questions/what-are-the-concurrency-and-maximum-limit-constraints-associated-with-scheduled-apex-jobs-in-an-org

## Answer

**Basics:** Each call to `System.schedule` or each Schedule Apex entry creates a `CronTrigger` record. The platform caps the number of active ones at 100 per org, shared by all packages and developers.

**How it works:**
1. `System.schedule(name, cron, job)` creates a CronTrigger in state WAITING.
2. When it fires, state moves to ACQUIRED and EXECUTING, then returns to WAITING for recurring jobs, or the job is removed after a one-time run.
3. Schedules created by `System.scheduleBatch` also count.
4. Exceeding 100 throws a LimitException on the schedule call.

**Advanced / deep dive:** The limit is about count, not concurrency; running jobs also respect the batch/queueable limits of what they launch. To save slots, consolidate: one dispatcher Schedulable that reads Custom Metadata and launches the relevant batches. For sub-hourly frequency, avoid 4 jobs per hour per task; instead use one self-rescheduling queueable with a delay (`System.enqueueJob(job, delayMinutes)`, 0 to 10 minutes) or platform events. Managed-package schedules count against the subscriber org's 100. Monitor with `SELECT COUNT() FROM CronTrigger WHERE CronJobDetail.JobType = '7'` (JobType 7 is Scheduled Apex). The scheduled `execute()` itself runs with sync limits, so it should only start async work. Executions also count toward the daily async limit.

**Code / config example:**
```apex
Integer used = [SELECT COUNT() FROM CronTrigger WHERE CronJobDetail.JobType = '7'];
System.debug('Scheduled Apex slots used: ' + used + ' of 100');
```

**Hidden gotchas & must-remember points:**
- 100 is org-wide, including managed packages' schedules.
- One-time jobs free their slot after running; recurring ones never do.
- Abort by CronTrigger Id with `System.abortJob`.
- Cron-based schedules cannot run more often than the cron syntax and platform allow; verify minimum interval in docs.
- Deploying classes with pending scheduled jobs can be blocked.
- Jobs are owned by the scheduling user's context.

**Best practice:** Use one dispatcher job driven by Custom Metadata and audit the CronTrigger list regularly.

---
Source: ForceChallenges · last updated 2026-11-02
