---
schema_version: "1"
id: 198f505bde16db7ab6af24d0a0873005fdcb2657bb64f281f26879359be87b37
title: Configure the Context Passing Framework for Agentforce
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/experience/264-0-0/support_context_passing_framework_config.md
canonical_url: https://help.salesforce.com/s/articleView?id=experience.support_context_passing_framework_config.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: fb0a36e025a7c4588c896d412d2c1aa729df22c7be00b6ef62eb740c6ce28655
description: Implement required components, including the User Interaction Context component and an Omni-Channel flow, to track critical user journey data. This framework maps pre-chat variables from your Experience Cloud site and securely delivers the context to your Agentforce Service agent.
products:
  - Experiences
release: "264"
---
# Configure the Context Passing Framework for Agentforce

Implement required components, including the User Interaction Context component and an Omni-Channel flow, to track critical user journey data. This framework maps pre-chat variables from your Experience Cloud site and securely delivers the context to your Agentforce Service agent.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Aura and LWR Experience Cloud Sites</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Enhanced Chat with the Einstein for Service, Einstein Platform, Community, Community Plus, or Agentforce Service Agent add-on</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Enterprise, Performance, Unlimited, and Developer Editions with Foundations or Agentforce 1 Editions. Access to some standard agent actions requires <a href="https://www.salesforce.com/agentforce/pricing/" target="_blank">additional add-on licenses</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d63328e75">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">To create and set up Experience Cloud site:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">Create and Set Up Experiences AND View Setup and Configuration</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">To customize or publish an Experience Cloud site:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">Create and Set Up Experiences AND View Setup and Configuration AND be a member of the
              site OR View Setup and Configuration AND be a member of the site AND have appropriate
              role-based site access</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">To create and manage Agentforce Service agents: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">Create and Set Up Experiences AND View Setup and Configuration AND be a member of the
              site OR View Setup and Configuration AND be a member of the site AND have appropriate <a href="https://help.salesforce.com/s/articleView?id=experience.networks_access_control_overview.htm&amp;language=en_US&amp;type=5" target="_blank">role-based site access </a></td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">To enable digital experiences:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">Customize Application</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">To set up this Enhanced Chat:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">Customize Application AND Modify Metadata Through Metadata API Function</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">To add the Embedded Messaging component to an Experience Builder site</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">Create and Setup Experiences</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">To set up Embedded Chat</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d63328e75 ">Customize Application AND Modify Metadata</td>

          </tr>
        </tbody>
      </table>

Before you begin, make sure you have these components and configurations in place.

- An Experience Cloud site built on either the Aura or LWR framework. See [Create an Experience Cloud Site](https://help.salesforce.com/s/articleView?id=experience.networks_creating.htm&type=5&language=en_US).
- Customer Community or Customer Community Plus licenses in your org. See [Experience Cloud User Licenses](https://help.salesforce.com/s/articleView?id=platform.users_license_types_communities.htm&type=5&language=en_US).
- An Enhanced Chat Embedded Service Deployment configured to pass hidden pre-chat variables. The variables must be named exactly as shown below:
    
    - lastViewedArticleId
    - lastSearchQuery
    - lastViewedTopicId (for Aura sites)
    - lastViewedNDCId (for LWR sites)
    
    See [Customize the Embedded Pre-Chat Form](https://help.salesforce.com/s/articleView?id=service.snapins_chat_customize_prechat_form.htm&type=5&language=en_US).
- An Agentforce Service agent configured with a custom action or multiple custom actions that can consume these specific context variables. This generally involves defining the variables as Input Variables within the agent action's configuration, which the Agentforce Service agent is designed to execute upon chat transfer. See [Use Context Variables in Messaging Conversations](https://help.salesforce.com/s/articleView?id=ai.service_agent_context_variables.htm&type=5&language=en_US).
- The Quick Chat or Embedded Messaging components set up in your Experience Cloud site. See [Embedded Messaging](https://help.salesforce.com/s/articleView?id=experience.rss_embedded_messaging.htm&type=5&language=en_US).
- User verification is enabled, and you have set the pre-chat variable frequency to Every Session. See [Set Up User Verification](https://help.salesforce.com/s/articleView?id=sf.user_verification_setup.htm&type=5&language=en_US).

1. **[Configure the User Interaction Context for Agentforce Component](https://help.salesforce.com/s/articleView?id=experience.support_context_passing_framework_ui_context.htm&release=264.0.0&type=5)**  
    The User Interaction Context for Agentforce Lightning web component is the core of the framework. It captures user interaction data and passes it to your Agentforce agent.
2. **[Set Up Enhanced Chat for Context Passing](https://help.salesforce.com/s/articleView?id=experience.support_context_passing_framework_enh_chat.htm&release=264.0.0&type=5)**  
    Set up your Enhanced Chat channel and Embedded Service deployment to accept and pass hidden pre-chat variables. These variables enable the User Interaction Context Lightning web component to function with your Agentforce Service agent.
3. **[Create Custom Fields on the Messaging Session Object](https://help.salesforce.com/s/articleView?id=experience.support_context_passing_framework_fields.htm&release=264.0.0&type=5)**  
    To use the context variables passed by the Context Passing framework in your Agentforce Service agent, create custom fields on the Messaging Session object. These fields will store the data coming from your Experience Cloud site.
4. **[Map Context Variables and Route Chat with Omni-Channel Flow](https://help.salesforce.com/s/articleView?id=experience.support_context_passing_framework_omni_flow.htm&release=264.0.0&type=5)**  
    Configure an Omni-Channel flow to map the pre-chat variables from the chat deployment to the custom fields on the Messaging Session object and route chats to your Agentforce Service agent.
5. **[Expose Context Variables in Your Agentforce Service Agent](https://help.salesforce.com/s/articleView?id=experience.support_context_passing_framework_variables.htm&release=264.0.0&type=5)**  
    To make the custom fields created on the Messaging Session object available to your agent, expose them as context variables in Agentforce Builder. This action establishes the direct data link required for your Agentforce Service agent to reference and utilize user journey data when executing actions and guiding responses.