
Scheduled jobs are a powerful feature in Salesforce that allow developers and administrators to automate time-bound processes like data cleanup, batch processing, email campaigns, and more. With the introduction of the Resume and Pause functionality for scheduled jobs, Salesforce has taken job orchestration and control to a new level.
In this blog, we’ll explore what scheduled jobs are, how the new Resume and Pause feature works, and how to use it via Apex syntax, along with real-world use cases.
What are Scheduled Jobs in Salesforce?
Scheduled jobs let you run Apex classes at specific times. You can schedule them using the System.schedule method or through the Salesforce UI under Setup > Scheduled Jobs. These jobs implement the Schedulable interface and contain an execute() method.
Example:
SampleScheduledJob.apxcglobal class SampleScheduledJob implements Schedulable { global void execute(SchedulableContext sc) { System.debug('Scheduled Job Executed'); } }
Scheduling this job:
String cronExp = '0 0 22 * * ?'; // Every day at 10 PM System.schedule('Nightly Job', cronExp, new SampleScheduledJob());
New Feature: Pause and Resume Scheduled Jobs
Before this feature, managing scheduled jobs was inconvenient. Once scheduled, you could only delete or let them run. With the Pause and Resume feature, Salesforce now gives you the ability to temporarily disable a scheduled job and resume it later without losing configuration.
This is particularly useful in:
- Deployment windows
- Data migrations
- System maintenance periods
- Avoiding partial runs during large changes
Pause and Resume in Apex – Syntax
As of the latest releases (Winter ’25+ / pilot), Salesforce provides experimental Apex syntax for pausing and resuming scheduled jobs programmatically.
Pause a Scheduled Job in Apex
You can pause a scheduled job using its Job ID from CronTrigger.