---
schema_version: "1"
id: 7b9b114c174a6d9101930941f7e66530cdefacbd65565053833f8e6a1f03669f
title: Map Context Variables and Route Chat with Omni-Channel Flow
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_omni_flow.md
canonical_url: https://help.salesforce.com/s/articleView?id=experience.support_context_passing_framework_omni_flow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 72f886ea2d9f77cbaa10c405340655e45844b07872c1bec6cea02477cddb1eae
description: 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.
products:
  - Experiences
release: "264"
---
# Map Context Variables and Route Chat with Omni-Channel Flow

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.

### 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>

1. From Setup, in the Quick Find box, enter Flows, and then select **Flows.**
2. Click **New Flow**. From the New Automation screen, select **Omni-Channel Flow** under Frequently Used.
3. Click the **Toolbox** icon on the left-hand side to access the resource panel.
4. Click **New Resource** for each custom parameter for example, lastViewedArticleId.
5. Set Resource Type to **Variable**.
6. Set the API Name to match the custom parameter defined in your Messaging Channel exactly for example, lastViewedArticleId.
7. Set the Data Type to **Text**.
8. Under Availability Outside the Flow, check the box for **Available for Input** and then Click **Done**.
9. To update the messaging session record, click the **Add Element** button (+) between Start and End.
10. Select the **Update Records** element.
11. Set up the element to update the Messaging Session record that initiated the flow.
12. Map each of your new Input Variables to the corresponding Custom Field on the Messaging Session object. For example, map the flow variable {!lastViewedArticleId} to the custom field lastViewedArticleId\_\_c.
13. To route the chat, click the **Add Element** button (+) after the Update Records element.
14. Select the **Route Work** element and configure it to route the chat session to your Agentforce Service agent.
15. Click **Save**, provide a name, and then click **Activate** to make the Omni-Channel Flow available.