Salesforce · Development
Asynchronous Triggers in Salesforce: When to Use Them (and When Not To)
Asynchronous triggers run on the ChangeEvent objects that Salesforce generates automatically through Change Data Capture. They can replace some @future or Queueable implementations — but they don't solve every use case, and knowing where they fit avoids painful rework later.
When they're not the right fit
External API calls — for example, validating an email address against a third-party system — aren't a good match for asynchronous triggers, since callouts aren't permitted inside a trigger context. Platform Events are the better tool for that job.
Where they work well
Internal data updates that stay entirely within Salesforce are the ideal use case — for example, recalculating a sales commission whenever an Opportunity changes. No external callout is involved, so the trigger context restriction doesn't get in the way.
Setting it up
- Enable the object in Change Data Capture settings — up to 5 objects are included before additional licensing is required.
- Implement your trigger logic on the object's
ChangeEventvariant (e.g.Opportunity→OpportunityChangeEvent), not the base object itself.
Example: recalculating commission on an Opportunity change
A typical use case: whenever an Opportunity's amount changes, an asynchronous trigger on OpportunityChangeEvent recalculates the commission (say, 5% of the amount) and updates the related commission record — entirely inside Salesforce, with no external call involved.
trigger OpportunityCommissionTrigger on OpportunityChangeEvent (after insert) {
List<Commission__c> commissionsToUpsert = new List<Commission__c>();
for (OpportunityChangeEvent event : Trigger.New) {
EventBus.ChangeEventHeader header = event.ChangeEventHeader;
// Only recalculate when the Amount field actually changed
if (header.changedFields.contains('Amount') && event.Amount__c != null) {
commissionsToUpsert.add(new Commission__c(
Opportunity__c = header.getRecordIds()[0],
Amount__c = event.Amount__c * 0.05
));
}
}
if (!commissionsToUpsert.isEmpty()) {
upsert commissionsToUpsert Opportunity__c;
}
}
Limitations to plan for
Trigger.newholds a maximum of 2,000 events per execution — design for batches, not single records.- Only the fields that actually changed are populated in the event payload — don't assume the full record is available.
- The change type (create, update, delete, undelete) has to be checked explicitly in your logic; it isn't handled for you.
Bottom line
Asynchronous triggers are a solid fit for internal, data-only automation that needs to react to record changes without the overhead of a full async job. The moment an external callout enters the picture, reach for Platform Events instead.
Building event-driven automation on Salesforce?
Talk to the team about choosing the right trigger pattern for your architecture.
Book a free strategy sessionor email sales@futurepulse.ai