← All articles
Salesforce · Change Data Capture · Integration · Quick Reads

Salesforce CDC Enriched Fields: Why and When to Use Them

Change Data Capture tells an integration that a Salesforce record changed, but downstream systems often need context that did not change.

That is the problem CDC enriched fields address.

The External-ID Problem

Imagine Account has an immutable External_Id__c used to correlate Salesforce with another system.

A user updates Phone, but the external ID does not change. An integration still needs that external ID to route or reconcile the event.

Without enrichment, a design may be tempted to query Salesforce after receiving the event just to recover stable context.

Enrich the Change Event

For a CDC custom-channel member, Salesforce supports an enrichedFields configuration. Salesforce's documented guidance allows up to 10 enriched fields that are always sent in change events on that channel.

Conceptually:

AccountChangeEvent member
  enrichedFields:
    - External_Id__c
    - Region__c

Now the consumer can receive those selected values even when they were not the fields changed by the transaction.

Filter Fields Don't Need Duplication

Salesforce documents an important optimization: fields used in the channel member's filterExpression are automatically included in the change event.

If Region__c is part of the filter, don't spend an enriched-field slot merely to repeat it.

Good Enrichment Candidates

Useful enriched fields tend to be stable, high-value context:

  • external/correlation IDs;
  • routing keys;
  • tenant/business-unit identifiers;
  • parent identifiers needed downstream;
  • compact classification fields.

Enrichment is not an invitation to recreate the whole Salesforce record in every event.

Benefits

Enrichment can reduce:

  • follow-up Salesforce API queries;
  • latency between event receipt and downstream action;
  • coupling between the subscriber and Salesforce query APIs;
  • failure modes caused by "event received, lookup failed" workflows.

It can also make an event easier to process deterministically because the correlation data travels with the event.

Tradeoffs

The payload becomes richer, but the event contract also becomes more intentional. Adding fields indiscriminately increases payload and schema surface area.

The 10-field limit forces useful discipline: enrich what is necessary for processing, not everything that might someday be interesting.

Pub/Sub API Nuance

With Pub/Sub API, CDC events are delivered as Avro. Salesforce notes that deserialized Pub/Sub CDC events contain record fields including unchanged fields, where unchanged values can appear empty. Consumers must use header information such as changedFields and nulledFields to understand what actually changed.

That means an enriched value and a changed value are different concepts. Do not infer "field changed" merely because a value is available in the event.

References

CONTINUE READING

Explore closely related architecture, integration and implementation topics.