Integrating Heroku and the Salesforce Platform Overview
Last updated May 30, 2024
Table of Contents
You can integrate Heroku and the Salesforce Platform in several ways, and choosing among them comes down to understanding your requirements and the capabilities of each integration type.
This article describes, at a fairly high level, each type of integration; outlines its pros and cons; and points to documentation that can help you implement the integration.
Technique | Description | When to use |
---|---|---|
Heroku Connect | A bidirectional sync between data in a Salesforce org and data in a Heroku Postgres relational database. | You want unidirectional or bidirectional syncing—with eventual consistency guarantees—to a database accessible from a Heroku app. |
Salesforce Platform Events | An event-bus integration that allows Heroku apps to create events on Salesforce and subscribe to events published from Salesforce. | You want to build a Heroku app with a modern, high-throughput, low-latency, integration with the Salesforce enterprise messaging platform. |
Apex and Workflow callouts | You have an API built as a Heroku app and can call endpoints from Apex workflow or triggers. | You want REST API integration based on object updates in the Salesforce org. |
Calling the Salesforce REST API | Make calls on the Salesforce REST API from within your Heroku app. | You need access to more than just data on a Salesforce org—for example, you want to programmatically start an approval process. |
Heroku External Objects & Salesforce Connect | As part of Heroku Connect, expose data in Heroku Postgres within Salesforce orgs, allowing you to view, search on, and relate that data to other objects. | You want to contextually reference data residing in Heroku Postgres from a Salesforce org, without having to deal with the inefficiency of physically copying the data. |
MuleSoft | An Integration Platform as a Service (iPaaS) and marketplace for integrating disparate enterprise systems through their APIs, designing APIs, and managing API services and their life cycles. | You want to use a managed platform for building disparate API integrations, and connect them from a Heroku app. |
CRM Analytics | Connects data inside and outside of Salesforce with CRM Analytics for analytics. | You want to sync your Heroku Postgres data to CRM Analytics. |
Marketing Connector | A connector you can attach as an add-on to sync marketing data. | You want to sync Heroku data with Marketing Cloud. |
Slack | A custom Slack app deployed on Heroku. | You want to integrate Slack with your Salesforce org or relay messages in event-based architectures. |
Salesforce Data Cloud | A data platform that enables customers to organize and unify data across Salesforce and other external data sources. | You want to sync your Heroku Postgres data with your Salesforce Data Cloud instance so you can create unified customer profiles and act on your data. |
Heroku Connect
Heroku Connect is an add-on that synchronizes data between your Salesforce objects and a Heroku Postgres database that’s attached to your Heroku application. Using a simple declarative interface, you determine which Salesforce objects should sync with which Postgres tables, mapping object fields to table columns. Heroku Connect then continually monitors (depending on the sync directions) the org and the tables, ensuring that objects and rows are created as necessary. Read the Heroku Connect documentation to get started.
Salesforce Platform Events
You can architect apps using an event-driven approach with the Salesforce enterprise messaging platform. Platform Events provides a powerful technique for integrating internal components within a Salesforce app, or for integrating such components with external systems, such as Heroku apps. The architecture is suitable for large distributed systems because it decouples event producers from event consumers, simplifying the communication model in connected systems.
Heroku applications can behave as event producers, event consumers, or some combination of the two. See Publish and Subscribe to Salesforce Platform Events for implementation info.
Calling the Salesforce REST API
The Salesforce platform provides a comprehensive REST API that can be called from a Heroku application. The API provides OAuth 2.0 or session ID authentication, and allows you to query Object Metadata, create or modify records, execute SOQL/SOSL queries, and interact with approval processes.
See Using the Salesforce REST API with Heroku for more info.
Apex and Workflow Callouts
There are two primary methods for calling into a Heroku app with an API, based on an activity in Salesforce:
- Apex HTTP callouts for programmatically making REST calls.
- Workflow outbound messages for declaratively making SOAP calls.
Either way, the Heroku app receives a request with the event details payload, and then performs the action. See Make Apex and Workflow Callouts to Your API for more details.
Heroku External Objects and Salesforce Connect
Heroku External Objects is available as part of Heroku Connect. It provides an oData wrapper for a Heroku Postgres database that has been configured for use with Heroku Connect. This feature allows other web services to retrieve data from within the specified Heroku Postgres database using RESTful endpoints generated by the wrapper. Read/write support is available for tables only; writing to views is not currently supported.
Used in tandem with Salesforce Connect, the feature permits data in a Heroku Postgres database to be represented in a Salesforce deployment, where it can be viewed (including within Apex and Visualforce pages), searched, and related to other objects. It cannot be used in standard reports as the data is available by reference.
See Heroku External Objects with Salesforce Connect for implementation details.
MuleSoft
MuleSoft is an integration PaaS for creating complex, multi-system integrations and managing the full life cycle of APIs. MuleSoft abstracts away the complexity of backend systems and processes, front-ending them with scalable and governable APIs, which you can then invoke from within a Heroku app.
MuleSoft has:
- Pre-built connectors for rapid integration to hundreds of systems (including Salesforce, SAP, and on-premise databases)
- Integration templates and components for rapid workflow automation
- Full life cycle API management
- Integration analytics and governance tooling
It also lets you compose APIs, or produce APIs of your own, which can then be used from a Heroku application.
To learn more about this integration, see Connecting Heroku Data Services to MuleSoft.
CRM Analytics
CRM Analytics is a customer and business analytics platform that works with any data source. Connectors provide a way to connect data inside and outside of Salesforce, such as your Heroku data. See Heroku Postgres Connection to connect your database to CRM Analytics.
Marketing Connector
Softtrends Marketing Connector is an add-on that synchronizes data between Salesforce Marketing Cloud and Heroku Postgres or Apache Kafka on Heroku. See Marketing Connector for more info.
Slack
Slack has many features and apps that help you manage your workflow. Heroku ChatOps is one such app, which can help you stay on top of your deployment workflow.
The Slack platform also offers the Bolt SDK and the Block Kit UI framework so you can build custom apps to suit your needs. You can deploy your custom Slack apps on Heroku. See Slack’s documentation for deploying to Heroku to get started. You can also complete the Slack Block Kit Trailhead badge to get familiar with using the UI framework.
If you want a Slack app integrated with Salesforce, check out the Salesforce Slack Starter Kit. That repo walks you through how to handle authorization and set up the connection to your org.
Salesforce Data Cloud
Salesforce Data Cloud is a data platform that enables customers to organize and unify data across Salesforce and other external data sources. Data Cloud brings data together from disparate systems letting customers build personalized customer experiences, trigger data-driven workflows, and more.
With Data Cloud, you can:
- Use pre-built connectors to set up integrations to external systems including Heroku Postgres.
- Create unified profiles to get a complete view of your customers.
- Act on your data with Salesforce automation tools.
- Gather metrics and run analytics on customer engagement data.
To learn more about this integration, see Connecting Heroku Postgres to Salesforce Data Cloud.