Skip to main content

Fin Messenger: Map data using Salesforce Flows

Learn how to configure the Fin Messenger handoff to Salesforce agents using Flows and pre-chat attributes.

Updated over a month ago

When using Fin Messenger for Salesforce, if Fin can’t answer a customer’s question, you can add a Hand off to Salesforce agent step to your workflow. This creates a live chat in Salesforce for one of your agents to take over, allowing the user to continue their conversation seamlessly in Fin Messenger. You can learn more about how Fin Messenger handles data in this guide.

Fin automatically pushes all People and Conversation data attributes from the Fin platform into Salesforce. This data is not stored on any Salesforce object—it’s passed via routing attributes during the course of a Salesforce conversation when these events occur:

  • Create conversation – When a conversation is initiated.

  • Post in app message – When a new conversation entry is created.

  • Upload a file – When a file is shared in the conversation.

To map this data to fields on your Salesforce live chat, you’ll need to use Flows. This article explains the full setup 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 use pre-chat attributes in Salesforce Flows

Note: If you already have a flow set up, skip to the steps that apply to your configuration.

1. Access Flows in Salesforce

  1. Open Service Setup.

  2. Enter Flows in the top search bar.

  3. Select Flows under Process Automation.

2. Create a new Flow

  1. Click New Flow.

  2. Select Start from scratch.

  3. Choose Omni-Channel flow, then click Create.

3. Create a new resource

  1. In the Flow Builder, open the left-hand pane and click New Resource.

  2. Create a variable named recordId.

    • Ensure the name matches exactly.

    • Check Available for input, otherwise it won’t work.

4. Add a Route Work element

  1. Click the + button and select Route Work.

  2. Add a label (e.g. route_to_queue).

  3. For Record ID Variable, select the recordId variable.

  4. Choose Messaging as the Service Channel and Queue as the route type.

  5. Under Queue, select the Support Queue connected to the Messaging Channel.

5. Save and activate the Flow

6. Update Omni-Channel routing settings

Navigate to Setup > Messaging Settings > Omni-Channel Routing and update the following:

  • Routing type: Omni-Flow

  • Flow definition: Select your new flow

  • Fallback Queue: Same Support Queue from step 4C

7. Add your custom parameters

Add parameters under Custom Parameters.

Tip: Keep naming conventions consistent (snake_case or camelCase) throughout setup.

8. Add parameter mappings

For simplicity, use the same Flow Variable Name as the parameter name.
Default parameters include First Name, Last Name, Email, and Subject.

9. Add parameters as visible pre-chat fields

  1. Go to Embedded Service Deployments and open your deployment.

  2. Open the Pre-Chat Form and add parameters as visible fields.

  3. Default fields are listed on the right-hand side.

  4. Add custom fields through the Custom modal and select Text as the field type.

10. Save and publish changes

Important: Every change to the Pre-Chat Form must be published on the Embedded Service Deployment page. Saving alone won’t apply the updates.

11. Verify your configuration

To confirm that attributes are being passed correctly:

  1. Go to Object Manager.

  2. Open Messaging Session, then select Fields & Relationships.

  3. Add each parameter as a custom Text field and ensure all are visible.

  4. Save changes for each field.

12. Add variables for custom parameters in the Flow

  1. Return to Setup > Flows.

  2. In the Flow editor, create variables for each custom parameter using the same names as in your Parameter Mapping.

  3. Add an Update Records element:

    • Select Messaging Session as the object.

    • Filter by Id = recordId.

    • Map each parameter to its corresponding field.

  4. Save as a new Flow version and activate it.

13. Validate custom field population

If set up correctly, your custom fields will now populate automatically on the Messaging Session details page.


Conversation events for debugging

To confirm your Salesforce Flows are being triggered and completed successfully:

  1. View Conversation events to track when handoffs are initiated or completed.

The following events confirm Salesforce In-App Messaging handoffs:

  • Handoff initiated to Salesforce In-App Messaging

  • Handoff completed to Salesforce In-App Messaging

Use these to verify that the handoff is functioning correctly and troubleshoot any failed transitions.


FAQs

What data does Fin send to Salesforce during a handoff?

Fin sends all user and conversation data attributes as routing attributes when a handoff occurs. This includes standard system fields, custom data, and location data. The JSON payload you receive contains every available attribute, which can then be mapped through Salesforce Flows.

Does Fin store data inside Salesforce?

No. Fin does not store any data in Salesforce objects directly. All data is passed temporarily via routing attributes during the live chat session.

Why can’t I see my custom parameters in Salesforce?

If your parameters aren’t appearing:

  • Confirm that the parameter names in your Flow match those in the Fin routing attributes.

  • Check that each variable is marked Available for input.

  • Ensure you’ve published any changes to your Embedded Service Deployment (saving alone won’t apply them).

What happens if the handoff to Salesforce fails?

If the handoff fails, you’ll see it in Conversation events under Analyze > Conversations. Look for events labeled:

  • Handoff initiated to Salesforce In-App Messaging

  • Handoff completed to Salesforce In-App Messaging
    If the completion event is missing, review your Flow configuration or routing settings in Salesforce.

Can I test the handoff before going live?

Yes. You can trigger the Hand off to Salesforce agent step in a staging or sandbox environment to confirm that the Flow and field mappings work correctly before enabling it in production.

How do I know which attributes Fin includes in the JSON?

Fin follows a clear naming convention:

  • user_* for user attributes

  • user_custom_data_* for custom user attributes

  • conversation_* and conversation_custom_data_* for conversation attributes
    You can refer to the sample JSON in this article to see the expected structure.

Did this answer your question?