SCHED_PerformBatchedCallouts
Class · Group: Web Services
Learn it: Async Processing guide
global inherited sharing class SCHED_PerformBatchedCallouts implements SchedulableImplements: Schedulable
The SCHED_PerformBatchedCallouts class is a scheduled job responsible for processing batched API calls that are queued for outbound processing. This class retrieves a list of queued API calls, updates their status to indicate readiness for processing, and commits the updates to the database. This enables efficient handling and scheduling of multiple API requests.
Example
System.schedule('Process Batched Callouts', '0 0 0 * * ?', new SCHED_PerformBatchedCallouts());Methods
| Method | Description |
|---|---|
| global void execute(SchedulableContext context) | Executes the scheduled job, retrieving a list of API calls that are batched and ready for outbound processing, updating their status to indicate they are queued, and committing the updated records to the database. |
execute
global void execute(SchedulableContext context)Executes the scheduled job, retrieving a list of API calls that are batched and ready for outbound processing, updating their status to indicate they are queued, and committing the updated records to the database. This method allows for controlled and consistent processing of API callouts on a scheduled basis.
The save ignores record sharing, so the job moves every Batched call, whoever scheduled it. It writes only the status of each call and leaves every other field as it is.
A call whose save is refused anyway (for example by a validation rule) stays at Batched and gets its own error log entry, and one warning log entry says how many calls were not moved to Queued.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | SchedulableContext | relevant context |
Example
// Schedule the job to run every day at midnight to process batched API calls.
System.schedule('Process Batched API Calls', '0 0 0 * * ?', new SCHED_PerformBatchedCallouts());