Publish and subscribe to Salesforce Platform Events from an external system

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. Define a Platform Event object in Setup with the required fields, and note its API name ending in __e
  2. From an external system, publish events by POSTing to /services/data/vXX.0/sobjects/<EventName__e> with a JSON body containing the event field values — treat it like a standard sObject insert
  3. For batch publishing, use the Composite API sObject collection endpoint to insert up to 200 event records in a single request
  4. To subscribe, open a CometD connection and subscribe to /event/<EventName__e>; implement replayId persistence identically to CDC subscriptions
  5. Process the event payload — fields are nested under the sobject key in the CometD message data envelope
  6. Monitor publishing limits: Platform Events count against the org's daily API request limit and have a separate high-volume event allocation — check System Overview in Setup to avoid throttling

Known gotchas

Related routes

Publish a Salesforce Platform Event from an external system and handle the subscriber response
salesforce.com · 6 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
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 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