DTO_ChangeEventHeader
Class · Group: Data Transfer Objects
global inherited sharing class DTO_ChangeEventHeaderA Data Transfer Object (DTO) exposing the supported subset of EventBus.ChangeEventHeader to Flow as a strongly-typed input variable. The platform header type is not Flow-addressable directly; this DTO mirrors its public fields with the @InvocableVariable + @AuraEnabled annotations required for Flow Apex-defined variables and invocable-action parameters. global is required so subscriber-namespace flows can reference the type cross-namespace. Stability contract: this is a stable additive subset of the platform header. New platform header fields added in future Salesforce releases are added here as new @InvocableVariable fields — never modified or removed — so existing subscriber flows remain compatible.
Since: 1.1
Example:
EventBus.ChangeEventHeader platformHeader =
(EventBus.ChangeEventHeader)records[0].get('ChangeEventHeader');
DTO_ChangeEventHeader flowHeader = new DTO_ChangeEventHeader(platformHeader);
// Pass flowHeader into a Flow interview as the <code class="explicitCode">header</code> variable.See Also: EventBus.ChangeEventHeader
Fields
| Field | Description |
|---|---|
| global List changedFields | The list of fields whose scalar values changed in this commit. |
| global String changeOrigin | The origin of the change — typically user/<userId> for user-initiated changes or a system identifier for platform-initiated changes. |
| global String changeType | The kind of change — CREATE, UPDATE, DELETE, UNDELETE, or GAP_* for replay-gap notifications. |
| global Long commitNumber | A monotonically increasing commit-ordering number used by the platform for replay sequencing. |
| global Long commitTimestamp | The commit time as Unix epoch milliseconds. |
| global String commitUser | The ID of the user (or System) that committed the change. |
| global List diffFields | The list of fields whose values differ from the prior commit (large / complex types only — most scalar field changes appear in changedFields). |
| global String entityName | The fully qualified API name of the source entity (e.g. |
| global List nulledFields | The list of fields whose values were nulled by this change. |
| global List recordIds | The list of source record IDs affected by this change event. |
| global Integer sequenceNumber | The ordinal position of this change within the transaction, starting at 1. |
| global String transactionKey | A platform-assigned identifier that groups all change events from the same atomic transaction. |
Methods
| Method | Description |
|---|---|
| global DTO_ChangeEventHeader() | No-arg constructor required by some Flow runtime entry points that instantiate Apex-defined variable types before populating fields. |
| global DTO_ChangeEventHeader(EventBus.ChangeEventHeader header) | Copy constructor — populates this DTO from a platform EventBus.ChangeEventHeader. |
Method Details
DTO_ChangeEventHeader
global DTO_ChangeEventHeader()No-arg constructor required by some Flow runtime entry points that instantiate Apex-defined variable types before populating fields.
DTO_ChangeEventHeader
global DTO_ChangeEventHeader(EventBus.ChangeEventHeader header)Copy constructor — populates this DTO from a platform EventBus.ChangeEventHeader. Field-by-field assignment so the DTO is fully detached from the platform instance and safe to mutate without affecting the original.
Parameters:
header(EventBus.ChangeEventHeader) - The platform header to copy from. Must not be null.
Field Details
changedFields
@AuraEnabled @InvocableVariable(description='The list of fields whose scalar values changed in this commit' label='Changed Fields') global List<String> changedFieldsType: List
The list of fields whose scalar values changed in this commit.
changeOrigin
@AuraEnabled @InvocableVariable(description='The origin of the change — typically user/<userId> for user-initiated changes' label='Change Origin') global String changeOriginType: String
The origin of the change — typically user/<userId> for user-initiated changes or a system identifier for platform-initiated changes. Useful for filtering self-initiated changes out of downstream logic.
changeType
@AuraEnabled @InvocableVariable(description='The kind of change — CREATE, UPDATE, DELETE, UNDELETE, or GAP_*' label='Change Type') global String changeTypeType: String
The kind of change — CREATE, UPDATE, DELETE, UNDELETE, or GAP_* for replay-gap notifications.
commitNumber
@AuraEnabled @InvocableVariable(description='A monotonically increasing commit-ordering number used for replay sequencing' label='Commit Number') global Long commitNumberType: Long
A monotonically increasing commit-ordering number used by the platform for replay sequencing.
commitTimestamp
@AuraEnabled @InvocableVariable(description='Commit time as Unix epoch milliseconds' label='Commit Timestamp') global Long commitTimestampType: Long
The commit time as Unix epoch milliseconds. Use to compare ordering of change events across transactions.
commitUser
@AuraEnabled @InvocableVariable(description='The ID of the user or System that committed the change' label='Commit User') global String commitUserType: String
The ID of the user (or System) that committed the change.
diffFields
@AuraEnabled @InvocableVariable(description='The list of fields whose values differ from the prior commit (large or complex types)' label='Diff Fields') global List<String> diffFieldsType: List
The list of fields whose values differ from the prior commit (large / complex types only — most scalar field changes appear in changedFields).
entityName
@AuraEnabled @InvocableVariable(description='The fully qualified API name of the source entity for the change event' label='Entity Name') global String entityNameType: String
The fully qualified API name of the source entity (e.g. Account, Foobar__c). Carries the standard / custom object name, not the Change Event suffix.
nulledFields
@AuraEnabled @InvocableVariable(description='The list of fields whose values were nulled by this change' label='Nulled Fields') global List<String> nulledFieldsType: List
The list of fields whose values were nulled by this change.
recordIds
@AuraEnabled @InvocableVariable(description='The list of source record IDs affected by this change event' label='Record Ids') global List<String> recordIdsType: List
The list of source record IDs affected by this change event. A single change event may carry multiple IDs when the platform batches changes for the same entity within a commit window.
sequenceNumber
@AuraEnabled @InvocableVariable(description='Ordinal position of this change within the transaction (starting at 1)' label='Sequence Number') global Integer sequenceNumberType: Integer
The ordinal position of this change within the transaction, starting at 1. A multi-entity transaction emits events with sequential sequenceNumbers.
transactionKey
@AuraEnabled @InvocableVariable(description='Platform-assigned identifier grouping change events from the same atomic transaction' label='Transaction Key') global String transactionKeyType: String
A platform-assigned identifier that groups all change events from the same atomic transaction. Use to correlate cascading changes across multiple entities.