Subscribe to Salesforce Pub/Sub API events via gRPC to receive high-throughput Platform Events

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. Connect to the Salesforce Pub/Sub API gRPC endpoint at api.pubsub.salesforce.com:7443 using a gRPC client library in your language of choice
  2. Obtain a Salesforce access token and instance URL via the OAuth 2.0 JWT Bearer or Username-Password flow, then attach them as gRPC metadata headers (accesstoken, instanceurl, tenantid)
  3. Call the Subscribe RPC with a SubscribeRequest specifying the topic name (e.g., /event/MyEvent__e), the replayPreset (LATEST, EARLIEST, or CUSTOM), and a numRequested value per fetch batch
  4. Decode each FetchResponse: events are encoded in Apache Avro binary format using the schema fingerprint in the event; fetch the schema via the GetSchema RPC using the schemaId from the event
  5. Cache schemas by schemaId to avoid a GetSchema round trip on every event — schemas are immutable once published for a given fingerprint
  6. Acknowledge processed events by sending a new SubscribeRequest with the latest replayId to advance the subscription cursor and prevent redelivery

Known gotchas

Related routes

Subscribe to Salesforce Pub/Sub API gRPC streams to receive Avro-encoded Change Data Capture events for a custom object
developer.salesforce.com · 6 steps · unrated
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
Publish Salesforce Platform Events from Apex and subscribe to them in a Lightning component using the Streaming API
developer.salesforce.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ 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