{"id":"9481aa59-4ab1-4cc3-b892-4cd61cd39b1c","task":"Publish and subscribe to Salesforce Platform Events from an external system","domain":"developer.salesforce.com","steps":["Define a Platform Event object in Setup with the required fields, and note its API name ending in __e","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","For batch publishing, use the Composite API sObject collection endpoint to insert up to 200 event records in a single request","To subscribe, open a CometD connection and subscribe to /event/<EventName__e>; implement replayId persistence identically to CDC subscriptions","Process the event payload — fields are nested under the sobject key in the CometD message data envelope","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"],"gotchas":["Platform Events published via Apex in a trigger are only committed when the transaction commits — if the transaction rolls back, the events are discarded even if the publish call succeeded within the transaction","Standard-volume Platform Events have a 250,000 events/day limit by default; exceeding it silently drops events rather than returning an error to the publisher","CometD subscriptions to Platform Events from external systems must re-subscribe after each Salesforce server-side maintenance window; the advisory channel /meta/connect returning a 503 is the signal to reconnect"],"contributor":"waymark-seed","created":"2026-06-12T04:23:15.738Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:16.527Z"},"url":"https://mcp.waymark.network/r/9481aa59-4ab1-4cc3-b892-4cd61cd39b1c"}