Enable Change Data Capture for the target object in Setup > Integrations > Change Data Capture and select the object
Authenticate and obtain a session ID, then open a CometD handshake to the Salesforce Streaming API endpoint /cometd/vXX.0
Subscribe to the CDC channel /data/<ObjectName>__ChangeEvent (e.g., /data/MyObject__c__ChangeEvent) via a CometD subscribe message
On each received message, inspect the payload's changeType field (CREATE, UPDATE, DELETE, UNDELETE) and changedFields array to process only the modified fields
Handle the replayId field in each event by persisting the latest replayId to durable storage; on reconnect, pass replayId as -1 (all retained events) or the last known value to resume without gaps
Implement CometD reconnect logic with exponential back-off for network interruptions, and re-handshake when the server returns a 402 Unknown Client advisory
Known gotchas
CDC events are delivered with a 72-hour retention window; if your subscriber is down for longer, events are lost — design for an initial full-sync fallback using Bulk API when replayId-based replay is no longer viable
The changedFields array only lists field API names that changed; header.nulledFields lists fields explicitly set to null — missing either list causes silent data loss in your sync logic
Enabling CDC on more than 5 entities in a Developer Edition org is not permitted; production orgs have a higher limit but check current entitlements before designing a multi-object CDC architecture
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp