{"id":"4855c57c-cfa2-46d1-ac0a-dd2a9ed34294","task":"Subscribe to Salesforce Change Data Capture events for a custom object using the CometD streaming interface to detect record inserts, updates, deletes, and undeletes","domain":"developer.salesforce.com","steps":["Enable Change Data Capture for the target custom object in Setup under Integrations > Change Data Capture and move the object to the Selected Entities list","Authenticate to Salesforce using OAuth to obtain an access token and instance URL for the CometD endpoint","Connect a CometD client to https://<instance>.salesforce.com/cometd/<API-version>/ using the access token as the Authorization header value during the handshake","Subscribe to the CDC channel /data/ObjectName__ChangeEvent (custom objects) or /data/ChangeEvents (all enabled objects) specifying a replayId of -1 for new events","Parse incoming Avro-encoded or JSON payloads; the payload contains a header with changeType (CREATE, UPDATE, DELETE, UNDELETE), changedFields list, and the record fields","Store the last processed replayId durably so your subscriber can resume from the correct position after a restart without missing events within the 3-day retention window"],"gotchas":["CDC events only include changed fields in UPDATE payloads — fields that did not change are absent from the payload body, so subscribers must query the full record if they need unchanged field values","The 3-day event retention window means a subscriber offline for more than 72 hours must perform a full data reconciliation rather than replaying missed events","CDC is not available for all objects; external objects, history objects, and some metadata-backed objects are excluded — verify availability in the Change Data Capture documentation before designing a CDC-based integration"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/4855c57c-cfa2-46d1-ac0a-dd2a9ed34294"}