Conversation Summary with Agentforce
Template Triggered Prompt Flow
This flow type will allow us to retrieve the messages from Microsoft Teams and use them in Prompt Builder. In this example, we will have the Flow pull the Chat Id from the Opportunity Record (where it was stamped earlier when the Create Group Chat action was used).
- From Salesforce Setup, navigate to Flows using either Quick Find or Process Automation > Flows. Create a Template Triggered Prompt Flow.
- Select Automatic Inputs for the Input Type.
- Choose Field Generation Template Capability for the Template Type
- Select the object (in our case Opportunity) that has the Id of the Group Chat previously created
- Open the Toolbox
- Click New Resource
- Choose Resource Type: Formula
- Provide an API name that you will use inside the List Messages action
- (optional) Add a description for this variable
- Choose Data Type: Text
- On the Flow Canvas, add a new Element
- Search for List Messages, select MS Teams - List Messages in Channel/Chat
- Label: Get Messages
- API Name: Let it autofill
- Bot: Select the bot that will be retrieving the messages
- Group Chat Id: Use the Formula that was created earlier.
- Set the toggle on, so that a single block of text is provided
Save and Activate the Flow.
Create Prompt Template
Now that we have a Flow that can retrieve messages from Teams, we can provide that information to a Prompt.
From Salesforce Setup, navigate to Prompt Builder, and create a new Prompt Template
- Prompt Template Type: Field Generation
- Name: Give it a name
- API Name: Let it autofill
- Object: Select the object (in our case Opportunity) that will house the summary
- Object Field: where the summary will be placed.
- Click Next
Using the Prompt Template Workspace, you will define your Prompt. Within the Prompt you can place the output of the Flow created above.
- Place the cursor where you want the Teams Messages text to appear within your prompt
- Using the Resource picker at the top, select Flows > (name of your Flow)
Here's a simple prompt example to get you started. Have you come up with a killer prompt you'd like to share? Let us know!
Summarize the following team conversation by providing: A brief summary of the discussion. Key action items assigned to team members, along with who is responsible. Major decisions made during the discussion. Here’s the conversation: FLOW OUTPUT Output should be formatted to be easy to read in a Salesforce Rich Text field.
Test (and iterate) on your prompt by using the Preview panel.
- Select a related record that has a Chat Id already stamped in your field
- (optional) adjust the Model used in the Configuration pane
- Click Save & Preview
Edit the Lightning Record Page
We now have our building blocks to add the magical button on the Lightning Record Page.
Begin by opening the Lightning Record Page you want to enhance with this feature.
- If you haven't already enabled Dynamic Forms, you will need to do so.
- Locate the Field you wish to store the summary and click on it to open the config panel to the side
- Select the Prompt Template that you just created
- (optional) Only display the field if there is a Chat Id stamped on the record.
Save and Activate the Lightning Record page, and give it a try!