Overview
When using the Fin Messenger for Salesforce, if Fin can't answer, you can use "Hand-off to Salesforce agent" in your workflow. This creates a live chat in Salesforce for one of your agents to pick up, and the user continues the conversation seamlessly in the Fin Messenger. You can learn more about how Fin Messenger handles data in this guide.
Fin will push all People and Conversation data attributes that exist in the Fin platform into Salesforce. This data is not pushed to any Salesforce object – its passed via “routing attributes” during the course of a Salesforce Conversation, on these triggers:
Create conversation - When we initiate a conversation
Post in app message - Create a conversation entry
Upload a file
To map the data to fields on your Salesforce live chat, you'll need to use Flows. This article guides you through the full process.
Pre-chat data via routingAttributes
Salesforce expects pre-chat data via routingAttributes for Salesforce In-App Messaging. You can find Salesforce documentation for this here.
We generate a JSON that contains ALL user & conversation data and pass that into routingAttributes when making requests via the Salesforce In-App Messaging API. So when the Hand off to Salesforce Agent step is triggered you should see something similar to the JSON below come in as pre-chat data.
Example JSON
{
"_firstName": "John",
"_lastName": "Smith",
"_email": "john.smith.999@gmail.com",
"_subject": "Next",
"conversation_custom_data_Name": "John Smith",
"conversation_custom_data_Fin AI Agent: Preview": "false",
"conversation_custom_data_AI Tone of Voice": "Friendly", "conversation_custom_data_AI Answer Length": "Standard",
"conversation_custom_data_AI Pronoun Formality": "Let Fin decide",
"user_first_name": "John",
"user_last_name": "Smith,
"user_full_name": "John Smith",
"user_email": "email.john.999@gmail.com",
"user_user_id": "4a7a9b3d-951e-47d4-ae41-8e3f05a6969a",
"user_created_at": "",
"user_last_request_at": "2025-08-11 15:26:42 +0000",
"user_geoip_data_country_name": "United States",
"user_geoip_data_region_name": "Texas",
"user_geoip_data_city_name": "Dallas",
"user_geoip_data_timezone": "America/Chicago",
"user_browser_locale": "en",
"user_geoip_data_country_code2": "US",
"user_geoip_data_country_code3": "USA"
}
Note: We follow the below pattern when generating a parameter name.
If it’s a user attribute:
A standard system defined attribute is prefixed with user_*
If it’s a custom attribute created it will be prefixed with user_custom_data_*
Location data is a special case and is nested under user_geoip_data_*
If its a conversation attribute:
If it’s a standard system defined on it’s prefixed with conversation_*
If it’s a custom attribute it will be prefixed with conversation_custom_data_*
How to set up and use pre-chat attributes
Note: You might already have a flow set up and have already completed some of the steps below. In this case, you can skip to the steps that are appropriate for you.
1) Access Flows in Salesforce
A) Open the Service Setup |
B) Enter flows in the top search bar |
C) Select Flows / Process Automation |
2) Create a new flow
A) Create new flow |
B) Select start from scratch |
C) From the type select “Omni-Channel flow” and click create |
3) Create a new resource in your Flow
A) In the flow builder, Open the left hand pane and click on New Resource |
|
B) Create a new variable with the name recordId |
|
4) Add a new Route Work element in your Flow
A) Click the plus button and add a new Route Work element |
B) Set input values |
Add any label (e.g. route_to_queue)
|
C) In the newly open Queue section select the Support Queue that is set up with the Messaging Channel |
|
5) Save the Flow and Activate it
6) Update omni-channel routing settings
In the Omni-Channel Routing section change the following settings:
A) Change the Routing type to Omni-Flow |
B) For Flow Definition, select your recently created Flow |
C) For Fallback Queue, select the same Support Queue as you as you chose in step 4C above |
7) Add your custom parameters
In the Custom Parameters section add your custom parameters.
Most of the api names and variable names are derived from the name. For simplicity try to stick the same naming convention throughout the whole setup process (e.g. snake_case vs camelCase, etc.)
8) Add a parameter mapping
Once all of your custom parameters are added, we have to add a Parameter Mapping For simplicity use the same Flow Variable Name as the Parameter name
Custom parameters will have the same parameter API name and Channel variable name all throughout.
The default parameters have special names:
First Name
Last Name
Email
Subject
9) Add your parameters as Visible Pre-Chat fields
A) Navigate to the Embedded Service Deployments and select your deployment |
|
B) Open the Pre-Chat Form, and start adding your parameters as Visible Pre-Chat fields |
The default 4 fields are available in the dropdown on the right hand side
All Custom ones needs to be added through the Custom modal, where you need to select Text as the Field type to make the channel variables available
At the end it should look something like this |
10) Save the changes to the Pre Chat form
Remember: Publish the changes on the embedded service deployment page
Every change made to the Pre-Chat Form needs to be published as well, saving it only won’t take effect.
11) Check everything is configured properly
Depending on what you want to do with the pre chat attributes, there are multiple ways to go forward with this. We're going to cover the simplest way, which is to just display them on the Messaging Session object, to check if the whole flow is configured properly.
A) Open the Object manager by accessing it through the quick search |
|
B) In the object manager search for Messaging Session and open it, then navigate to the Fields & Relationships tab |
|
C) Add all the previously created parameters as custom fields to the Messaging Session Object |
Click on New, and select "Text" as the Data type
Enter the Label the same way as you’ve added to the parameters, and add a length
In the next step, check the "Visible" column for all
Save and repeat for all custom parameters previously added to the pre chat form |
12) In the Flows editor, add new variables for each of the custom parameters
A) Go back to the Flow editor (by going to Setup and searching for Flows) |
|
B) Once the Flow editor is open, on the left hand side panel add a new variable for each of the custom parameters |
You'll need the same names as the ones which appear in the Parameter Mapping’s Flow Variable Name column in step 8. |
C) Click on the plus icon right after the start of the flow and add an Update Records element |
|
D) Fill out the "Update Records" form |
|
E) Save as a New version of the Flow, and activate it |
13) Custom fields should be populated
If all went well, the custom fields should be populated with values now and they should appear on the Messaging Session’s details page.