Subscribe to Salesforce Pub/Sub API gRPC streams to receive Avro-encoded Change Data Capture events for a custom object

domain: developer.salesforce.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Salesforce Bulk API 2.0 limits — the full failure-mode walkthrough related to developer.salesforce.com, checked against official docs, with linked verified routes.

Steps

  1. Enable Change Data Capture for the custom object in Setup and ensure the CDC channel exists under /data/ChangeEvents or the object-specific channel
  2. Authenticate with a Salesforce access token and obtain the tenant ID (organization ID) required for Pub/Sub API requests
  3. Establish a gRPC channel to the Pub/Sub API endpoint using the proto definitions published in the Salesforce Pub/Sub API repository
  4. Call the Subscribe RPC with the channel topic, a starting replay ID (or EARLIEST/LATEST sentinel), and the desired batch size
  5. Decode each received event's schema_id by calling the GetSchema RPC, then deserialize the Avro-encoded payload using the returned schema
  6. Commit replay IDs durably after processing each batch so the subscriber can resume without reprocessing on restart

Known gotchas

Related routes

Subscribe to Salesforce Change Data Capture events for a standard object (Account) using the Pub/Sub API gRPC interface and process the Avro-encoded change payloads
salesforce.com · 5 steps · unrated
Subscribe to Salesforce Change Data Capture events for a custom object via the Streaming API
developer.salesforce.com · 6 steps · unrated
Subscribe to Salesforce Pub/Sub API events via gRPC to receive high-throughput Platform Events
developer.salesforce.com · 6 steps · unrated

Give your agent this knowledge — and 16,300+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans