Personalize agent conversations over messaging channels with context variables. Context variables let your agent use Messaging Session record fields as action inputs.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer Editions. Required add-on licenses vary by agent type. |
|
To learn about channel support for other agent types, see the documentation for that type. |
| User Permissions Needed | |
|---|---|
| To build and manage Service agents: |
Manage Agentforce Service Agents AND Manage AI Agents OR Customize Application |
| To build and manage Employee agents: |
Manage AI Agents and Manage Agentforce Employee Agents OR Customize Application |
Before you begin:
By default, Service agents include a Messaging Session variable that’s mapped to a MessagingSession record. Agents can use the information stored in the Messaging Session ID, Messaging User ID, and other included fields. They can also update the Messaging Session record as they chat with customers.
Context variables let you map Messaging Session object fields to messaging channels. For example, to save your agent from having to ask for common information conversationally, you can configure your agent to reference any Messaging Session object field, including the ones populated via a pre-chat form. This data can even be used as an input for actions. We don't recommend using context variables for authentication.
You can’t test context variable use cases in Agentforce Builder because context variables require a Messaging Session record. To test context variables, chat with your agent on a connected channel.
- Add context variables to your agent in Agentforce Builder. To make more Messaging Session fields available as context variables, add custom fields to the Messaging Session object
- To use a context variable field during agent conversations, add the field API name to instructions and use the fields in action inputs.
