Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

heroku-examples/heroku-agentforce-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 

Repository files navigation

This tutorial will guide you through configuring an Agentforce Action deployed to Heroku within your Salesforce org. This allows Agentforce agents to access powerful custom-coded actions written in Python and other languages, leveraging Heroku's fully managed and elastic compute service. By the end, you will be able to generate your own badge as shown below!

Image description

Step 1 - Deploy to Heroku

This tutorial provides examples in Java and Python for coding a basic Agentforce action. Complete the standard Heroku deployment instructions in one of the following repositories before progressing to the next step.

LanguageGitHub Repository
PythonGitHub Repository
JavaGitHub Repository

Step 2 - Publishing your Heroku App into a Salesforce org

💡Heroku AppLink:
These steps utilize generally availble features in Heroku and Salesforce. If you had joined the Heroku Integration pilot program please refer to these alternativeinstructions.

Image description

💡Salesforce Org Requirements:
Ensure you have access to Agentforce in your org by searching forAgents in theSetup menu. If not, you can obtain a freeSalesforce Developer Edition org here. Be sure to visitEinstein Setup to enable Einstein, the fresh the page and search forAgentforce Agents to enable Agentforce. Finally on the same page clickEnable the Agentforce (Default) Agent.

From the directory you completed the above deployment in, run the following commands.

💡Salesforce Org Requirements: Ensure you have access to Agentforce in your org by searching forAgents in theSetup menu. If not, you can create a temporary org by logging into Trailhead and creating a Playground per the instructionsat the top of this module (you do not need to complete the module). Once you have access to the org, locateEinstein Setup under theSetup menu andEnable Einstein, which will also enable Agentforce.

Add Heroku AppLink to your application.

heroku addons:create heroku-applink

Configure the application ID as follows:

heroku config:set HEROKU_APP_ID="$(heroku apps:info --json | jq -r '.app.id')"

💡jq utility:
If you do not have thejq utlity, runheroku apps:info --json manually and extract the value from theapp json structure output to the console.

Connect your Heroku application to the org you intend to configure Agentforce within.

heroku salesforce:connect my-org

Add Heroku AppLink Service Mesh buildpack to ensure incoming calls from the Salesforce org are authenticated correctly.

$ heroku buildpacks:add https://github.com/heroku/heroku-buildpack-heroku-applink-service-mesh

Import your applications and its API specification into the connected org, for Python useapi-spec.json.

heroku salesforce:publish api-spec.yaml --client-name BadgeService --connection-name my-org --authorization-connected-app-name BadgeServiceConnectedApp --authorization-permission-set-name BadgeServicePermissions

Lastly trigger a redeploy of the application to ensure the service mesh is running using the following commands.

git commit --allow-empty -m "empty commit"git push heroku main

Once complete check your application has been imported by searching forHeroku and thenApps under theSetup menu in your org.

Step 3 - Assigning Permissions

The above process createdBadgeService andBadgeServicePermissions permission sets to control access to your application from within the org. Search forPermisison Sets underSetup, locate these permission sets and clickManage Assignments to assign to your user.

Step 4 - Creating an Agentforce Action

  1. Search forAgent Assets under theSetup menu, and on theActions tab, clickNew Agent Action, selectingAPI as theReference Action Type. Then selectHeroku from theReference Action Category. In theReference Action search field, search forGenerate Badge. Your dialog should look like the following:

    Image description
  2. Complete defining the action as follows and clickFinish.

    Image description

Step 5 - Using Agent Builder

| Field | Text || ----- | ---- || `Agent Action Instructions` | Use this action in response to requests for a Heroku badge with a name on it. || `AgentActionRequestName Instructions` | Name to be placed on the badge. || `AgentActionResponseMessage Instructions` | This is the Heroku badge the user requested. |

  1. Search forAgentforce Agents underSetup.

  2. Click theAgentforce (Default) link at the bottom of the page to find theOpen in Agent Builder button.

  3. Click theDeactivate button in the top right of the screen if present.

  4. ClickTopics and theGeneral CRM topic. If theNew Version button is shown, click it.

  5. Click theTopic Configuration tab and append "Also including requests for badges." to the current contents of theClassification Description field. ClickSave.

  6. Click theThis Topic's Actions tab and selectAdd from Asset Library from theNew button dropdown.

  7. Complete the dialog as shown and clickFinish.

    Image description
  8. Finally, click theActivate button in the top right of the screen.

Step 6 - Testing your Action

  1. Open theAgent Builder forEinstein Copilot.

  2. In theConversation Preview, enterGenerate a badge for Astro

    You can, of course, change the name to your own and share your badge with your friends!

    Image description

Summary

Congratulations on deploying your first Heroku-powered Agentforce Action!

We are working to improve and simplify this process, so please follow this repository to stay informed on updates.

Need some inspiration on what to build?

The examples in this tutorial are intentionally simple, designed to give you a clear starting point for creating your own actions. We have also included fully developed actions below.

ExampleDemo VideoRelated Content
TheArchive Agent action demonstrates using Heroku to access and perform complex computations over unstructured archived data. It uses AI to interpret natural language requests from users to perform a wider array of dynamic calculations on the data.LinkImage descriptionBlog Code
With theCoral Cloud Collage Agent, we explore how Coral Cloud Resort invites its guests to browse and book unique experiences throughout their stay using Agentforce. With Heroku, we extend the agent's functionality to generate a personalized collage of each guest's adventures, showcasing how custom code deployed on Heroku can create dynamic digital media delivered directly within the Agentforce experience.LinkimageimageCode

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp