Scheduling Jobs
Most of the scheduling job endpoints use the Job Chain Process Flow.
The Job Chain Process Flow provides a solution for the execution of several workers (jobs) that have dependencies between them. For example, one job requires the completion of another job before beginning its execution.
Most scheduling endpoints accept a jobThreads parameter (or use the JobThreads property of the Job class) that controls the number of parallel workers the off-platform processing service uses to process the scheduled job items.
Important: Setting this parameter correctly can have a significant impact on batch processing throughput and duration.
| Setting | Value |
|---|---|
| Default (when omitted) | 5 workers |
| Maximum on production and full copy sandbox orgs | 25 workers |
| Maximum on other sandbox orgs | 3 workers |
Recommendation: Always set jobThreads to 25 to maximize throughput. The processing service automatically caps the value to the environment’s configured maximum (25 on production and full copy sandbox orgs, 3 on other sandbox orgs), so setting 25 is always safe.
The effective number of workers is: min(jobThreads, environment maximum, number of job items).
Several scheduling endpoints use the <namespace>.Job class to pass job parameters. This global Apex class contains the following properties:
| Property | Type | Description | Required |
|---|---|---|---|
| JobChainName | String | Unique name identifying the job chain. Typically includes a timestamp for uniqueness (e.g., ‘TPM_Calculation_Chain_’ + Datetime.now().getTime()). | Yes |
| JobName | String | Name of the specific job within the chain (e.g., ‘PromotionCalculation’, ‘AccountPlanCalculationBasic’). | Yes |
| BatchChainType | String | Type of the batch chain. Default: ‘default’. | No |
| JobThreads | Integer | Number of parallel workers. Default: 5 (applied by the backend if not set). Maximum: 25 (production and full copy sandbox) / 3 (other sandboxes). Recommended value: 25. | No (but strongly recommended) |
| JobModes | List<String> | Processing modes for the job. | No |
| Extra | Map<String, Object> | Additional job properties. | No |
Example:
-
Stops the running job chain worker for a sales org.
-
Begin Job Scheduling Transaction
Begin a scheduling transaction for a job in a job chain. The job either starts an open transaction (if the number of job items is not announced) that must be explicitly committed to, or communicates the expected number of job items to the off-platform system.
-
Commit Job Scheduling Transaction
Explicitly commit an open scheduling transaction for a job in a job chain.
-
Schedule Account Plan Calculation
Schedule calculation for account plans for the given account plan IDs, category IDs, and time range for a given KPI collection.
-
Schedule Account Plan Calculation V2
Schedules the calculation of account plans. Batch chains support editable account plans. It can schedule up to 500 account plan IDs for calculation.
-
Schedule Account Plan Category Calculation
Schedules one or multiple account plan categories for batch calculation. It accepts up to 1000 account plan categories and schedules them for calculation.
-
Schedule Adhoc Promotion Calculation
Schedules one promotion for off-platform calculation in an ad-hoc transaction.
-
Enqueues a given list of funds for batch calculation. The calculation result is transferred back to Salesforce via the KPI Upload once the calculation is finished.
-
Schedule Global Account Product List
Schedules a job to update the global account product list.
-
Schedule Promotion Calculation
Enqueues promotion jobs for batch calculation based on the promotion IDs.
-
Schedule Rate Based Funding Calculation
Schedules a collection of Rate Based Funding (RBF) Objects for calculation.
-
Performs off-platform data cleanup and reorganization. Promotions in Salesforce that are deleted, inactive, or cancelled are removed from off-platform data. Additionally, softly deleted measure data is hard deleted.
-
Schedules a data sync from Salesforce to the off-platform database.