Salesforce Developers Blog

Integrate Agents with Platform Events

Avatar for Tyson ReadTyson Read
Learn how agents can tap into the event-driven architectures in your org and integrate with external systems.
Integrate Agents with Platform Events
July 01, 2025

Event-driven architectures and the pub/sub pattern are powerful ways to deliver experiences that integrate multiple systems. These patterns allow you to build decoupled, asynchronous systems that span multiple services. They give your architecture the ability to gracefully and efficiently absorb spikes in traffic, process messages in near-real time, and evolve to take on new capabilities.

The real advantage to integrating agents via events is that you’re able to reuse the existing event-driven integration and automation that you’ve already built in your org and avoid scale bottlenecks. Async features, like Platform Events and Change Data Capture, help you side-step the sObject transaction limits that can pose a challenge for high-scale use cases.

In this post, we’ll show you how agents can tap into the event-driven architectures in your org and integrate with external systems.

Publishing events with agents

Agents can publish events to the Salesforce Event Bus via Apex and Flow. The way to implement this is by converting eventing triggers and flows that publish events into custom actions. After an agent has published an event to the Salesforce Event Bus via a custom action, all the exiting flows, Apex, LWCs, and external systems integrated via Pub/Sub API or Event Relay are able to subscribe to the events being published by your agents. Developer Advocate Philippe Ozil shows a great demo of this where a Pub/Sub API client consumes events published by an agent.

A diagram showing agents publishing events to the Salesforce Event Bus and subscribers receiving those events

Subscribing to events with agents

On the subscriber side, it’s a similar story. Agents can be invoked by a platform event-triggered flow or Apex. That means Agentforce can react to events that are published by flows and Apex inside your org and the external integrations that are publishing events via APIs like Pub/Sub API.

A diagram showing publishers like Apex and Flow publishing events to the Salesforce Event Bus and subscribing Apex and flows invoking agents

A good way to think about all this is that agents are really a natural extension of the eventing flows and Apex in your org. There’s an agentic layer that can extend the business logic you define via Apex and Flow with the generative and reasoning power of large language models (LLMs).

A diagram showing Agentforce and external agents publishing and subscribing to events

Multi-agent integration with events

Now that we’ve covered how Agentforce works with the Salesforce Event Bus, lets look at how you can integrate Agentforce with other agents via events. Of course, you have other options to integrate Agentforce with other agents. For example, if you have a synchronous use case, where your agent needs to interact with an external system or agent in real time, a great option is to skip events and expose that system with External Services. That said, if you are trying to handle tens or hundreds of thousands of transactions per minute, async event-driven integrations are a better pattern to use.

Let’s take a look at how you might build a multi-agent integration with Agentforce, Amazon Bedrock Agents, and Platform Events. Event Relay is a great option for event-driven integration with AWS. Customers use Event Relay as a no-code way to deliver events from the Salesforce Event Bus to Amazon EventBridge. EventBridge can then direct those events to AWS services like Lambda, S3, and Bedrock Agents. After Bedrock agents react to the events coming from Salesforce, they can drive custom apps in AWS or bring data back to update Salesforce.

Diagram showing agents in Salesforce and AWS integrated via Platform Events

Bring your agents on the bus

Exposing your event-driven flows and Apex to agents is a great way to bring the power of Agentforce to your existing integration and automation. The scale, reliability, and extensibility of the Salesforce Event Bus makes building async, event-driven agents a powerful pattern. Learn more about creating custom agent actions that publish and subscribe in our Help docs and see how you can get more out of your events.

Resources

About the author

Tyson Read is a Director of Product Management at Salesforce where he works on the Salesforce Event Bus.

More Blog Posts

Make Apex REST APIs Available as Agent Actions

Make Apex REST APIs Available as Agent Actions

Make Apex REST APIs available as agent actions that can be incorporated into your agents, enabling them to call your Apex REST APIs to leverage custom logic.March 27, 2025

Build Headless Agents with the Agent API

Build Headless Agents with the Agent API

Build headless autonomous agents with the Agent API to open the door to multi-agent experiences and complex integrations.April 15, 2025

Call Third-Party APIs with External Service Actions

Call Third-Party APIs with External Service Actions

Agents are powerful productivity tools, and External Service actions for agents are a simple and fast way to call third-party services from an agent.May 01, 2025