Salesforce Framework
Asynchronous Job
Framework for building and monitoring multi-step asynchronous Apex processes.
Purpose
CMU’s integrations perform ordered work such as retrieving data, matching and validating records, applying updates, and reporting outcomes. Those steps need to run in sequence while remaining visible and traceable.
Implementation
The framework composes Batch and Queueable jobs into a defined sequence and logs each job as it runs. It can publish job status and progress through Platform Events and send a completion email summarizing duration, record counts, and errors across the chain.
Individual batch jobs define the records they handle in normal and full runs. A normal run targets records that need processing; a full run includes all eligible records. The framework uses the active run mode to select records and updates only records whose fields changed, minimizing unnecessary updates during high-volume processing.
public with sharing class ExampleBatch extends BatchJob {
public override Database.QueryLocator start() {
allRunWhere.isTrue('Is_Active__c');
normalRunWhere.isNull('Custom_Field__c');
return new QueryBuilder('Contact')
.selectField('Custom_Field__c')
.whereClause(jobWhere)
.getQueryLocator();
}
public override void execute(List<SObject> records) {
// Apply updates to custom field
// Only update changed records and log results
updateLogged(records);
}
}
Individual jobs can be run together in sequence by adding them to a job chain.
public static Id runChain() {
return new JobChain(ExampleLoadJobChain.class)
.publishEvents()
.addJob(new DownloadQueue())
.addJob(new MatchRecordsBatch())
.addJob(new ProcessRecordsBatch())
.addJob(new ValidateResultsBatch())
.execute();
}
The framework includes a Lightning component for monitoring job chain progress.

Production use
- Supports 85 production asynchronous Apex jobs.
- Used by finance, gift, payroll, student data, commencement, and scheduled maintenance processes.