Event-driven health integrations with Pub/Sub API and platform events
Key Takeaway
Use Pub/Sub API when an external publisher needs a final publish result confirming an event is stored in the event bus. Use Change Data Capture events to keep an external copy of records in sync as each change happens. Use a clone of the prebuilt "FHIR Subscription: Publish Platform Event" flow to notify subscribers at their own endpoints when a subscribed change occurs.
Event-driven integration lets Salesforce and outside systems tell each other about changes as they happen, so outside systems don't have to keep asking for updates, which is called polling. In Agentforce Health, platform events carry these notifications. One example is telling a provider that a care request needs more information. Pub/Sub API is the single API that external systems use to publish events, subscribe to events, and get event schemas.
Events instead of polling
Event-driven integration uses a publisher/subscriber model. One system publishes an instant notification message to the event bus, and subscribers receive it.
The publisher/subscriber model is more efficient than polling with SOAP API or REST API because polled data is only as fresh as the poll frequency. Frequent calls can also slow the server.
Inside Salesforce, Apex triggers, Process Builder, and Flow Builder can publish and subscribe to events. Pub/Sub API is what connects external systems to those same event streams.