Connecting AWS EventBridge to Salesforce: A Bridge to New Capabilites

In today’s fast-paced digital landscape, seamless integration between cloud platforms and CRM systems is more important than ever. AWS EventBridge and Salesforce offer powerful tools to automate workflows, streamline data synchronization, and enhance customer experiences. By connecting AWS EventBridge to Salesforce, businesses can unlock a new realm of capabilities, from triggering real-time events based on customer interactions to automating sales processes across platforms. This integration empowers teams to react faster, make data-driven decisions, and create a unified approach to managing customer relationships. In this blog, we’ll explore how bridging AWS EventBridge and Salesforce can transform your business operations.

What is AWS EventBridge?

AWS EventBridge is a serverless event bus that allows you to ingest and route real-time data from various sources, including AWS services, third-party SaaS applications, and custom event producers. It enables event-driven architectures by letting you define rules that automatically react to events as they occur, triggering downstream processes or workflows. For Salesforce professionals, EventBridge can be a powerful tool to integrate with Salesforce, enabling real-time synchronization and automation of actions based on external events, such as customer interactions or system updates.

Example Use Cases for AWS EventBridge

Here are a few scenarios that demonstrate the power of integrating your CRM with AWS EventBridge:

  1. Automated Product Descriptions with AI: When a product is added or updated in Salesforce, AWS EventBridge can trigger a workflow that leverages Amazon Bedrock AI to generate enriched marketing descriptions. These AI-generated descriptions provide a helpful starting point for your marketing team.

  2. Real-Time Sentiment Analysis for Cases: When a ‘Case’ record is updated in Salesforce, the event triggers a workflow to send the case details to AWS for sentiment analysis. Once the analysis is complete, the sentiment score is automatically updated back in Salesforce.

  3. Image Processing for Work Orders: Photos added to a work order in Salesforce can be sent to AWS Lambda for automatic resizing. The resized images are stored in Amazon S3, and the corresponding URL is sent back to Salesforce, ensuring the work order has the properly sized images.

  4. Shopify Order Synchronization: A new order created in your Shopify store, which also integrates with AWS EventBridge, is instantly passed along to Salesforce, keeping your sales and fulfillment data in sync in real-time.

  5. Document Processing with Amazon Textract: When a customer uploads a PDF form to their Contact record in Salesforce, the file can be sent to Amazon Textract for automatic extraction of handwritten information. The extracted data is then used to update the relevant fields in Salesforce.

Step-by-Step Configuration

As with all things Salesforce, please perform these steps on your sandbox (or developer) instance as an experiment and to test your concept before promoting these items to your production environment.

  1. Create a Named Credential in Salesforce
    In your Salesforce instance, navigate to Setup > Named Credentials. Click the arrow next to the “New” button, and select “New Legacy”. Label it with your AWS region, and for the URL, enter the AWS ARN (Amazon Resource Name): arn:aws:<your-region>:<your-account-number>.

  2. Enable Change Data Capture
    Next, go to Setup > Change Data Capture. Change Data Capture captures events that occur in Salesforce, allowing them to be relayed to external services in real-time. If you’re not familiar with Change Data Capture, it’s worth reading up on how it enables real-time data synchronization. From this screen, select the object you want to track, then click “Save.”

  3. Set Up an Event Relay
    Once your objects are defined, go to Setup > Event Relays. This will configure the relay of your Change Data Capture events to AWS. Click “New Event Relay,” and name it “ChangeEvents.” On the next screen, select the Named Credential you created earlier. Then, choose “ChangeEvents” as your event channel. Leave the error recovery settings at their default values, and proceed through the summary to finalize the setup. Read more about how this will ‘relay’ our events to AWS here.

  4. Configure AWS EventBridge
    Now, switch over to AWS. Navigate to AWS EventBridge, and under “Integration” on the left-hand menu, select “Partner Event Sources.” If everything was configured correctly in Salesforce, you should see a “Pending” source waiting for approval. Select it, then click “Associate with event bus.” On the next screen, you can leave the defaults and save the configuration
    .Partner event source listing inside AWS
  5. Verify Event Bus Creation
    After associating the source, navigate to AWS EventBridge > Event Buses, where you should now see your custom Event Bus under the “Custom event bus” section.
    Listing of custom event buses inside AWS EventBridge.
  6. Create Rules for Event Processing
    With events flowing to AWS EventBridge, the next step is to define Rules, which filter inbound events based on specific criteria, and Targets, which route matched events to services like AWS Lambda, SQS, or CloudWatch Logs.
    • Click on the “ChangeEvents” event bus, scroll to the “Rules” tab, and select “Create Rule.”
    • In Step 1, name your rule. For example, if you’re interested in monitoring changes to Salesforce Cases (for sentiment analysis), label the rule accordingly. Ensure your partner event bus is selected before moving forward.

  7. Define the Event Pattern
    Next, select “AWS Events or EventBridge Partner Events” as the source. Scroll past the optional “Sample event” section, and focus on defining the Event Pattern.
    • Choose “Eventbridge partners” as the source and “Salesforce” as the partner.
    • Select “Case” as the EventType, which will populate the Event Pattern automatically. This pattern matches incoming messages that contain detail-type set to CaseChangeEvent, allowing the rule to filter only relevant messages.
      Define the eventbridge rule with the source pattern for ChangeEvent
  8. Assign Targets for the Event
    Select the target for the matched events. In this example, you can route the events to a CloudWatch Log for easy monitoring. You can also add additional targets, such as AWS Lambda or SQS, to process the events further.
    Defining an eventbridge rule target.
  9. Finalize the Rule
    Add tags for organizing resources (optional), and review the configuration before creating the rule.

  10. Activate Event Relay in Salesforce
    Return to Salesforce and go to Setup > Event Relays. Find your “ChangeEvents” relay, and activate it by setting its state to “Run.” After a few minutes, the relay status should change to “Running.”
    Activate event relay to send events to Salesforce
  11. Test the Configuration
    Now it’s time to test! Create a sample Case record in Salesforce. You should immediately see the event in your AWS CloudWatch Logs with the full event payload. If you’ve set up additional targets like an SQS queue or Lambda function, the message will appear there as well. Congratulations on completing the setup!
    Salesforce case change event in Cloudwatch logs.

Next Steps

So far, we’ve covered a basic example of relaying captured events to an AWS CloudWatch log, but there’s much more you can explore to expand your understanding of event-driven architectures between AWS and Salesforce (or other systems). If you’re ready to dive deeper on your own, here are some next steps to consider:

  1. Send Custom Platform Events to AWS: Leverage Salesforce’s Tooling API and Postman to send custom Platform Events from Salesforce to AWS EventBridge. This approach lets you define more granular, custom events based on your specific needs. You’ll need to create a custom channel and channel member, as there is no UI for this as of now. Once set up, you can select the new channel in the Event Relay screen, just as we used “ChangeEvents” earlier.

  2. Send AWS Events Back to Salesforce: Once your AWS service completes its processing, you can send the processed data back to Salesforce. Configure AWS EventBridge to route the finished event payload to Salesforce via the EventBridge API destination. This is especially useful for updating Salesforce records with results from AWS services, like sending sentiment analysis results from AWS Comprehend back to Salesforce.

  3. Explore Other AWS Services: AWS offers a wide range of services that can enhance your Salesforce data workflows. For example:
  4. Leverage Advanced EventBridge Features: Take advantage of other AWS EventBridge capabilities, such as Dead Letter Queues to capture undeliverable messages—helpful for diagnosing permissions or processing errors. You can also explore Event Pipes for transforming and filtering events or Scheduled Events to trigger actions at specific times.

By exploring these advanced options, you’ll unlock even more powerful integrations between Salesforce and AWS, enabling richer data-driven workflows and enhanced automation capabilities.

Conclusion

Amazon EventBridge is a powerful enabler of event-driven architectures, opening the door to new computing possibilities by seamlessly integrating Salesforce with the AWS platform. Its performance, cost-effectiveness, and support for bi-directional data flow between Salesforce and AWS unlock a wide range of enhancements to your CRM, ultimately driving greater value and improving customer experiences. Additionally, EventBridge’s extensive partner ecosystem allows you to connect Salesforce with numerous third-party systems, further expanding the integration capabilities of your Salesforce environment.

 

Kyle Ballard

I am software engineer based in Nashville, TN, with a passion for crafting innovative solutions. With extensive experience in Salesforce, Microsoft .NET, AWS, and serverless architectures, I try to blend technical expertise with a creative approach to problem-solving. Outside of work, I enjoy reading, exploring the outdoors, and staying curious about history and technology.