Batch Jobs
Guided Selling uses scheduled Apex and batch processing to evaluate participant state, process automatic actions, perform manual-action housekeeping, and run maintenance work at scale.
Since v13, the primary sequence-processing flow changed:
- ActionProcessingBatch now processes due Automatic actions only.
- ActionCleanupBatch handles housekeeping for due Manual actions that require system-side cleanup or evaluation.
- CadenceScheduler schedules both action batches according to the Sequence schedule interval.
- AssociationProcessingBatch runs as the next batch after ActionProcessingBatch rather than as a separately scheduled peer process.
Current batch jobs
| Job Name | When it runs | Purpose |
|---|---|---|
| CadenceScheduler | Runs according to the configured Sequence Schedule Interval. The default interval is 30 minutes. | Checks whether ActionProcessingBatch and ActionCleanupBatch are already running or due to run, starts each eligible batch, and schedules the next CadenceScheduler execution. |
| ActionProcessingBatch | Launched by CadenceScheduler according to the Sequence schedule interval. | Processes due, READY Automatic Participant Actions for Active Sequence Associations in Active Sequences. It handles automatic action execution and progresses successfully completed actions. |
| ActionCleanupBatch | Launched by CadenceScheduler according to the Sequence schedule interval. | Performs system-side housekeeping for due, READY Manual Participant Actions, including manual Task cleanup, criteria evaluation, communication opt-out cleanup, and delegation-only Email/SMS cleanup. |
| AssociationProcessingBatch | Chained after ActionProcessingBatch completes. | Evaluates Active and Paused Sequence Associations for Active Sequences and applies participant/association processing, including sequence exit and other association-state updates. |
| Cleanup Scheduler | Runs daily at 1 AM. | Performs routine maintenance and cleanup outside the primary cadence-processing cycle. |
| Hourly Cleanup Scheduler | Runs hourly. | Verifies scheduling health and performs hourly maintenance tasks. |
| Dynamic Date Processing | Runs hourly or daily, depending on configuration. | Evaluates time-based sequence entry conditions. |
| Converted Lead Cleanup | Runs during cleanup cycles. | Processes cleanup required for converted Lead records. |
| SequenceAssociationDrip | Runs daily at 1 AM. | Processes queued Sequence Associations for Slow Drip sequences. |
Primary v13 processing flow
The primary CadenceScheduler cycle is:
- CadenceScheduler runs.
- It checks ActionProcessingBatch and ActionCleanupBatch independently.
- If a batch is already running, or has run more recently than the configured Sequence schedule interval, CadenceScheduler does not start another copy of that batch.
- If eligible, ActionProcessingBatch starts and processes due Automatic actions.
- After ActionProcessingBatch completes, AssociationProcessingBatch is chained automatically.
- If eligible, ActionCleanupBatch also starts as its own batch for Manual-action housekeeping.
- CadenceScheduler schedules its next execution using the configured Sequence schedule interval.
Conceptually:
CadenceScheduler
├── ActionProcessingBatch
│ └── AssociationProcessingBatch
└── ActionCleanupBatchThe two action batches have separate running-state and last-run checks. This prevents overlapping instances of the same batch while allowing Automatic action processing and Manual-action cleanup to be managed independently.
ActionProcessingBatch
ActionProcessingBatch is not the general processor for every due Participant Action.
It selects Participant Actions that meet all of the following core conditions:
Action_Status__cis READY- The parent Sequence is Active
- The Sequence Association status is Active
- The expected execution date has arrived
- The Participant Action has not been converted to a manual action
- The underlying Sequence Action has Automatic activation
- Converted Lead associations are excluded from automatic processing
Eligible actions then pass through the automatic-action filtering and processing logic. Successfully completed actions also progress the participant to the next appropriate Sequence Action.
This distinction is important for troubleshooting: a due Manual action is not expected to be processed by ActionProcessingBatch merely because it is due.
ActionCleanupBatch
ActionCleanupBatch was added in v13 to separate Manual-action housekeeping from Automatic action execution.
It selects due, READY actions whose underlying Sequence Action has Manual activation and that require one or more system-side cleanup operations.
These include:
Manual Task cleanup
Due Manual Task actions are included so Guided Selling can reconcile and clean up task-related Participant Action state as needed.
Action criteria cleanup
Manual actions with configured action criteria can be evaluated by the cleanup process. This allows system-side criteria handling without routing the action through Automatic action processing.
Communication opt-out cleanup
ActionCleanupBatch checks the applicable participant opt-out fields and can process Manual actions that should not remain actionable because the participant has opted out:
- Call: Lead or Contact
DoNotCall - Email: Lead or Contact
HasOptedOutOfEmail - SMS: Lead or Contact
ringdna__HasOptedOutOfSms__c
This processing supports the Participant Action Opt Out outcome and prevents opted-out communication actions from remaining as normal actionable work.
Delegation-only Email and SMS cleanup
Manual Email and SMS actions owned by users who have only the Guided Selling delegation permission are included for cleanup.
This prevents delegated communication actions from remaining in an actionable state when the delegated owner does not have the broader permissions required to perform the action.
Association processing
AssociationProcessingBatch remains a distinct Apex batch class, but its place in the processing sequence changed.
It is chained directly after ActionProcessingBatch:
ActionProcessingBatch
↓
AssociationProcessingBatchIt evaluates Sequence Associations whose:
- Association Status is Active or Paused
- Parent Sequence Lifecycle Status is Active
- Parent Sequence exists
- Sequence owner is a licensed Guided Selling user
Association processing then evaluates participant and Sequence state and applies the required association updates.
Batch schedule
CadenceScheduler uses the configured Sequence Schedule Interval to determine when the primary action batches should run.
The default interval is 30 minutes.
The interval can be configured in:
Setup → Custom Settings → GS_Public_Settings → Sequence Schedule Interval
For each scheduled action batch, CadenceScheduler checks:
- Whether another instance of that batch is currently running
- When that specific batch most recently ran
- Whether the configured interval has elapsed
If the conditions are not met, CadenceScheduler skips starting another instance of that batch during that scheduler execution.
Legacy processing model
Earlier Guided Selling versions used older record-type-specific action batches and a processing model in which action and association work was documented as separate scheduled stages.
The following legacy batches are not part of the current v13 processing model:
| Job Name | Status | Historical purpose |
|---|---|---|
| PerformLeadActionBatch | Deprecated | Legacy processing for Lead sequences. |
| PerformContactActionBatch | Deprecated | Legacy processing for Contact sequences. |
| PerformOpportunityActionBatch | Deprecated | Legacy processing for Opportunity sequences. |
| PerformCampaignActionBatch | Deprecated | Legacy processing for Campaign sequences. |
In the current model, processing is organized by responsibility rather than by participant record type:
- Automatic Participant Actions → ActionProcessingBatch
- Manual-action housekeeping → ActionCleanupBatch
- Participant/association state → AssociationProcessingBatch, chained after ActionProcessingBatch
Disassociating participants
Sequence and participant updates can cause exit criteria to be evaluated synchronously, but scheduled association processing provides an additional path for evaluating participant state.
AssociationProcessingBatch processes Active and Paused associations in Active Sequences and can apply association changes when the participant should no longer continue through the Sequence.
This scheduled processing is particularly important when a participant record changes outside a normal Guided Selling interaction and the required association state has not already been updated synchronously.