Retrieve the conversation summary and wrap-up code that Virtual Agent generates for a bot interaction
Every time a Virtual Agent bot transfers an interaction to a human agent, it creates an AI-generated summary for the agent so the agent can understand the context of the interaction and identify the core customer issue more quickly. When a Virtual Agent bot autonomously handles a customer interaction without agent escalation, it also automatically generates the conversation summary and applies a wrap-up code to the completed bot interaction.
To retrieve the conversation summary and the auto-assigned wrap-up code via the Genesys Cloud Public API, you can invoke the /api/v2/conversations/{conversationId}/summaries
endpoint based on the conversationId
.
To retrieve the conversation summary and wrap-up code as after contact work (ACW) data and send that data to Salesforce or another customer relationship management (CRM) system, complete the following steps:
Set up a workflow
- From the Architect home page, click or hover over the Flows menu and select Workflow.
- Click Add. The Create Flow dialog box opens.
- In the Name field, enter a unique name for the flow.
- (Optional) In the Description field, add a short sentence or phrase to describe this flow.
- Click the Default Language list and select the flow’s default supported language.
- Click the Divisions list and select the division in which to place the flow.
- Click Create Flow. The flow’s configuration page opens.
- Under Resources, click Data.
- As Genesys Cloud sends the input parameters to the workflow as a JSON object, under Add variable, configure an input variable named
jsonData
of type JSON.Note: The input parameters include the conversation summary, the reason for contact, resolution, wrap-up codes, contact ID, and so on. - From the task editor Toolbox, expand the Data category and drag an Update Data action below Start in the state editor.
- In the Name field, add a meaningful name to describe the item.
- Click next to Update Statements and select JSON.
- In the Enter variable name field, type the label to identify the variable on tasks. For example,
Flow.jsonsummary
. - In the Value To Assign field, click Expression Modes next to Click to add a JSON literal value.
- To get the conversation summary, add the expression
GetJsonObjectProperty(Flow.jsonData, "summary")
inline or click the Large Expression Editor button to open the Edit Expression Editor and build your expression. - Click next to Update Statements and select JSON.
- In the Enter variable name field, type the label to identify the variable on tasks. For example,
Flow.jsonwrapupcode
. - In the Value To Assign field, click Expression Modes next to Click to add a JSON literal value.
- To get the wrap-up codes, add the expression
GetJsonObjectProperty(Flow.jsonData, "wrapUpCodes")
inline or click the Large Expression Editor button to open the Edit Expression Editor and build your expression.
After these steps, continue to customize your workflow according to your organization’s business needs. For example, if you have previously set up a Salesforce Data action under Admin > Integrations > Actions to push data to your Salesforce APIs, configure a Call Data action in your workflow to push the data you retrieved earlier.
Set up a trigger
- Click Admin.
- Under Architect, click Triggers.
- Click Add Trigger.
- Enter a name and description for the trigger, and then click Add.
- Under Topic Name, select the
v2.bot.conversation.{id}.conversations.summaries
topic. - Under Workflow Target, select the workflow that you have set up for the data retrieval.
- Under Data Format, select Json as the data format in which the input parameters route to your workflow.
- (Optional) You can specify the conditions that must be met to invoke the trigger. For example, if you want Architect to trigger the workflow only when a specific Virtual Agent flow runs. To add a condition, click Add Condition.
- Under JSON Path, enter the attribute of the event schema that you want to compare. For example,
triggerSource
if you want to compare the flow id of the flow that generated a summary to the id of the specific Virtual Agent flow. - Under Operator, select an operator for comparing the JSON Path with the user-defined values. For example,
Equals (==)
if you want the flow id to match. - Under Value, enter the values according to the type of operator you selected. For example, add
{
"sourceId": "03d578c6-69dd-49dd-8331-a6d1e9303640",
"sourceType": "FLOW"
}
- Under JSON Path, enter the attribute of the event schema that you want to compare. For example,
- Select the timing configuration for the trigger.
- Click Create.
- To activate the trigger, switch the toggle to Active.
- Click Save.