Skip to content

Batch Jobs

Roles:
Salesforce AdministratorDeveloper

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 NameWhen it runsPurpose
CadenceSchedulerRuns 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.
ActionProcessingBatchLaunched 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.
ActionCleanupBatchLaunched 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.
AssociationProcessingBatchChained 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 SchedulerRuns daily at 1 AM.Performs routine maintenance and cleanup outside the primary cadence-processing cycle.
Hourly Cleanup SchedulerRuns hourly.Verifies scheduling health and performs hourly maintenance tasks.
Dynamic Date ProcessingRuns hourly or daily, depending on configuration.Evaluates time-based sequence entry conditions.
Converted Lead CleanupRuns during cleanup cycles.Processes cleanup required for converted Lead records.
SequenceAssociationDripRuns daily at 1 AM.Processes queued Sequence Associations for Slow Drip sequences.

Primary v13 processing flow

The primary CadenceScheduler cycle is:

  1. CadenceScheduler runs.
  2. It checks ActionProcessingBatch and ActionCleanupBatch independently.
  3. 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.
  4. If eligible, ActionProcessingBatch starts and processes due Automatic actions.
  5. After ActionProcessingBatch completes, AssociationProcessingBatch is chained automatically.
  6. If eligible, ActionCleanupBatch also starts as its own batch for Manual-action housekeeping.
  7. CadenceScheduler schedules its next execution using the configured Sequence schedule interval.

Conceptually:

CadenceScheduler
├── ActionProcessingBatch
│   └── AssociationProcessingBatch
└── ActionCleanupBatch

The 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__c is 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
AssociationProcessingBatch

It 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.

Do not describe ActionProcessingBatch and AssociationProcessingBatch as two independently scheduled 30-minute jobs. In the new flow, CadenceScheduler launches ActionProcessingBatch, and ActionProcessingBatch chains AssociationProcessingBatch when it finishes.

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:

SetupCustom SettingsGS_Public_SettingsSequence 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.

Changing the Sequence Schedule Interval affects the frequency of Automatic action processing and Manual-action cleanup. The default is appropriate for most Salesforce orgs. Contact our Support Team before changing this setting if you are troubleshooting processing delays or Salesforce resource constraints.

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 NameStatusHistorical purpose
PerformLeadActionBatchDeprecatedLegacy processing for Lead sequences.
PerformContactActionBatchDeprecatedLegacy processing for Contact sequences.
PerformOpportunityActionBatchDeprecatedLegacy processing for Opportunity sequences.
PerformCampaignActionBatchDeprecatedLegacy 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.