Skip to content

heroku-examples/df25-heroku-minihack-instructions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DF25 - Heroku at Camp Mini Hacks - Instructions

In this workshop, we're enhancing several agents with custom code written in languages of your choice, using Heroku and Heroku AppLink. This allows Apex, Flow, and Agentforce to perform complex, compute-intensive calculations on Heroku’s scalable managed infrastructure.

Note

The steps below do not require you to build or deploy the associated Heroku application, as this has already been done for you. However, if you want to review the source code for these actions later, you can do so through this repository.

Requirements

  • Access to a Salesforce Org with Agentforce enabled and the DF mini-hack objects and apps deployed.
  • Access to a Heroku environment enrolled in the 2025-dreamforce-mini-hack Heroku team.
  • The latest Salesforce CLI installed link.
  • The latest Heroku CLI installed link.
  • The latest Heroku AppLink CLI Plugin installed link.
  • The git CLI

Steps for All Agents

  1. Logging into Heroku and Cloning the Repository

    Log in to Heroku and confirm that you have access to the required Heroku team:

    heroku login
    heroku teams

    The heroku teams command should show 2025-dreamforce-mini-hack in your list of teams:

    Team                      Role         
    ────────────────────────  ──────────── 
    2025-dreamforce-mini-hack  collaborator            

    Clone this repository and change to the directory created:

    git clone https://github.com/heroku-examples/df25-heroku-minihack-instructions
    cd df25-heroku-minihack-instructions
  2. Connecting Heroku to Your Org You need to ensure that there is a permission set for Heroku Applink for your Salesforce org:

    1. Create a Permmsion Set "Manage Heroku AppLink"
    2. Under Systerm Permissions, enable "Manage Heroku AppLink"
    3. Assign the Permission Set to your user.

    Run the command below. When prompted, enter the username and password for your org and accept the required permissions prompt:

    Note: Make sure your Salesforce user has permissions for Heroku Applink

    heroku salesforce:connect my-org-yourname --app df25-minihack-actionservice     

    Replace yourname in the command above. For example, for Chris Wall, use my-org-cwall.

  3. Linking the Heroku Application with Your Org

    The action code uses Heroku AppLink to seamlessly access data within the org. Run the following command to link the Heroku app to your org:

    Note: Make sure that both the ActionsService and Actions Service Permissions have the Read permission set for User External Credentials (Object Settings -> User External Credentials -> Edit -> check Read).

    heroku salesforce:publish api-docs.yaml --client-name ActionsService --connection-name applink-org --app my-org-yourname --authorization-connected-app-name ActionsServiceConnectedApp --authorization-permission-set-name ActionsServicePermissions        

    As per the last step, be sure to edit my-org-yourname in the command above.

    Navigate to Heroku under Setup to confirm that the application has been linked.

    In the following steps, you will configure an Agentforce Action for one of the above operations.

  4. Grant Permissions to the Heroku Application

    Ensure the Agent user has permission to invoke the Heroku application imported above. Locate the ActionsService permission set and click Manage Assignments, then search for and add the EinsteinServiceAgent User user and assign.

Add an Action to the Koa Car Agent

This action evaluates real-time car valuations from industry sources (AutoTrader, Edmunds, KBB), assesses user credit status via finance APIs, and optimizes business margins while ensuring competitiveness. By leveraging Heroku’s scalable processing power, Agentforce-powered agents can make real-time financing decisions, delivering personalized finance offers within Salesforce.

  1. Creating an Agentforce Action

    To create an Agentforce Action, search for Agent Actions under Setup to navigate to the Agent Actions page. Click New Agent Action in the top right corner, select Flow, search for Calculate Finance Agreement, select the action, and click Next. Complete the checkboxes as shown below and click Finish.

  2. Adding an Action to an Agent

    Locate Agents under the Setup menu, click Koa Car Agent, and click Open in Builder. Click on the Topics tab and Koa Cars Sales Agent. In the This Topic's Actions tab, click New > Add from Asset Library. Search for Calculate Finance Agreement, select it, and click Finish.

  3. Testing Your Heroku Action

    Enter the following in Agent Builder:

    I want to buy a car with a $1,000 down payment, a max 5% interest rate, and a term over 3 years. Can you provide a competitive finance estimate?
    

    When the Agent requests further information enter the following:

    My email is [email protected]
    
    I like make Zig model M3
    
    I choose 1
    

Minihack Agent Setup

New Agent

Field Value
Name Koa Cars Dealership Agent
API Name Koa_Cars_Dealership_Agent
Role Your job is to help customers search for the cars and book a test drive. You also help customers to book service appointments.
Company Name Koa Cars
Company Description Koa Cars offers sales and service of the cars. Customers can search, book test drives, and purchase the cars. It also offers service and maintenance of the cars.
Agent User EinsteinServiceAgent (Use the existing Agent User)

New Topic

Field Value
Name Koa Cars Sales Agent
API Name Koa_Cars_Sales_Agent
Classification Description Helps customers search for the cars, book the test drive and provides finance agreement estimates.
Scope Your job is only to search for the cars and create a test drive on customers request or acceptance. Also provide finance estimates when requested.
Instruction 1 When a customer asks for a car, prompt them for any special features they are looking for such as model, mileage, color, cruise control, heating seat etc. Then, provide a list of available cars. If customer say any feature, provide a list of available cars.
Instruction 2 Ask for customer email to locate contact information and use get customer details by email action.
Instruction 3 First, check if a test drive is already booked for the customer for a specific car using the 'Retrieve Scheduled Test Drive' action. Get VehicleId from the selected car. If a test drive is already booked, display the test drive record details.
Instruction 4 You can use book test drive action to book a TestDrive. Get VehicleId from the selected car.

Minihack Troubleshooting

  • When attempting to connect the Salesforce Org to Applink and an Error: Invalid record message is shown in the terminal. Check to make sure the user for the Salesforce account has the Heroku AppLink Permission assigned in their Permission Set.

Permission Setup Error

  • If the Agent gives an error when attempting to run the CalculateFinanceAgreement endpoint, make sure that both the ActionsService and Actions Service Permissions have the Read permission set for User External Credentials (Object Settings -> User External Credentials -> Edit -> check Read).

Minihack Stretch Goals

Add an Action to the Astro Airlines Travel Agent

This action uses flight information from Salesforce and CO₂ emissions data to estimate the carbon footprint of a flight. Heroku integrates in real-time with environmental data APIs (ICAO Carbon Emissions Calculator, Google Flights API, IATA CO₂ Data), collates and queries flight data in memory, and calculates CO₂ emissions per route, traveler, aircraft type, and distance traveled.

  1. Creating an Agentforce Action

    To create an Agentforce Action, search for Agent Actions under Setup to navigate to the Agent Actions page. Click New Agent Action in the top right corner, select Flow, search for Calculate Carbon Footprint, select the action, and click Next. Complete the checkboxes as shown below and click Finish.

  2. Adding an Action to an Agent

    Locate Agents under the Setup menu, click Astro Airlines Travel Agent, and click Open in Builder. Click on the Topics tab and Travel Agent. In the This Topic's Actions tab, click New > Add from Asset Library. Search for Calculate Carbon Footprint, select it, and click Finish.

  3. Testing Your Heroku Action

    In Agent Builder, enter the following to invoke your action:

    I want to travel from SFO to LAX
    

    Agent lists the available flights for the user to choose.

    What is the total carbon footprint for flight 1?
    

Add an Action to the Trailblazer Outfitters Retail Agent

This action retrieves product information, including size and weight. It dynamically calls APIs of approved shipping companies, collates the shipping costs and timelines in memory, and returns them to Agentforce along with a recommendation.

  1. Creating an Agentforce Action

    To create an Agentforce Action, search for Agent Actions under Setup to navigate to the Agent Actions page. Click New Agent Action in the top right corner, select Flow, search for Calculate Shipping Options, select the action, and click Next. Complete the checkboxes as shown below and click Finish.

  2. Adding an Action to an Agent

    Locate Agents under the Setup menu, click Trailblazer Outfitters Service Agent, and click Open in Builder. Click on the Topics tab and Sales Assistant. In the This Topic's Actions tab, click New > Add from Asset Library. Search for Calculate Shipping Options, select it, and click Finish.

  3. Testing Your Heroku Action

    Enter the following in Agent Builder:

    I am looking for warm clothes?
    

    Agent responds with a list of options, enter the following:

    Can you recommend shipping options for item 1 so that I receive it within a week for under $50?
    

About

Instructions for the Heroku minihack at Dreamforce 2025

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published