Build Custom Agentforce Actions with Heroku
Learn how to integrate Salesforce and Heroku using the Heroku AppLink Add-on
Introduction
Heroku is the AI Platform as a Service (PaaS) that offers managed computing and data services for deploying, managing, and scaling applications written with open languages. It supports Node.js, Python, Ruby, Java, .NET, Go, and PHP.
In this workshop, you will deploy a Java application to Heroku and integrate it with Salesforce using the Heroku AppLink Add-on.
The application provides an API using the OpenAPI 3 specification. This API exposes multiple REST services. The table below details each endpoint, its purpose, inputs, and outputs:
Agent | Endpoint | Description | Inputs | Outputs |
---|---|---|---|---|
Astro Airlines Travel Agent | POST /api/carbon/calculateCarbonFootprint | Calculates the carbon footprint for a given flight using real DEFRA 2023 factors and live Salesforce passenger data. | Request to calculate the carbon footprint of a flight, using its Salesforce record ID. | Response containing the carbon footprint summary for the flight. |
Koa Cars Agent | POST /api/finance/calculateFinanceAgreement | Processes a finance agreement based on car valuation, customer credit profile, business margin constraints, and competitor pricing. | Request to compute a finance agreement for a car purchase, including the Salesforce record ID of both the customer and the vehicle. | Response containing the calculated finance agreement. |
Trailblazers Outfitters Retail Agent | POST /api/shipping/calculateShippingOptions | Calculates the shipping options for a product given external data. | Request to determine shipping options for a product, including the Salesforce record ID of the product being shipped. | Response containing the calculated shipping options. |
Marketing Campaign Agent | POST /api/social/renderCard | Renders a custom social card for marketing campaigns. | Use the line1 and line2 properties to customize | Response from rendering social card contains base64 encoded png image. |
These services can be used as Custom Agentforce Actions, and will be used as the basis for the workshop.
Prerequisites
Please make sure you have the following before starting the workshop:
- Google Chrome or any modern web browser
- Git / GitHub (Optional if you want to deploy from the terminal)
- A Salesforce Org (Provided in this workshop)
- Heroku Account - You don't need to pay for services, access will be provided during the workshop
- Visual Studio Code (Optional if you want to modify the code)