Artisan IMG > SalesLoft (salesloft) (4e949938-8c50-47ce-83ea-75d29a2af9ef)
Artisan IMG > HubSpot (hubspot) (e4d5dcb5-2d04-460d-9091-e98e8c18e614)

Sync Salesloft People to HubSpot Contacts

Workflow
Sales
Intermediate

This is a 'Workflow' template which means that it is a single standalone workflow.

Some workflow templates can be modified to work with other workflow templates - e.g. to convert a data sync between two services from uni-directional to bi-directional

Overview
Copy

This workflow is a live sync between Salesloft People and HubSpot Contacts. It is triggered by any changes occurring in Salesloft, which are then synced to HubSpot.

It is set up to prevent duplicate notifications syncing in HubSpot and can be used for bi-directional syncing (if updates are made either in HubSpot or Salesloft).

It is designed to work in tandem with Sync Contacts Unidirectional HubSpot > Salesloft template or as a stand-alone unidirectional workflow (if updates are made in Salesloft only).

Connectors Used
Copy

The following connectors are used in this template. This is provided for reference only - there is no need to read through the linked connector pages, as all you need to know for this template is explained here:

End Result
Copy

The image below shows a synced contact in Salesloft and HubSpot :

Prerequisites
Copy

This workflow assumes the following:

  • You have API credentials set up with Salesloft and HubSpot.

  • (Optional but recommended) You have a custom field within HubSpot and Salesloft to hold the ID of the person/contact in the other system

Getting Live
Copy

In order to configure this workflow for use, simply:

Workflow logic
Copy

The overall logic of the workflow is:

Section 1 The trigger waits for Salesloft to notify Tray of contact creation or update.

Section 2 First, the workflow checks if a HubSpot ID (Custom Field) is available in Salesloft Person details. If available, then it is used to get the contact details from HubSpot. If it isn’t available, a second check is performed (explained in section 3).

Section 3 If HubSpot ID is not found, a second check is performed using email address. If available, then it is used to get the contact details from HubSpot.

Section 4 If no match is found in Section 2 and 3, the workflow concludes that this person does not exist yet in HubSpot and creates a new Contact.

If the contact match has been found, the workflow compares the values for the contact against their respective matches coming from Salesloft and updates the contact information in HubSpot accordingly.

Implementation notes
Copy

Add fallback value
Copy

The workflow uses a fallback value for the Has HS Id? step.

In this step, a null value is set as a fallback value for the 1st Value (HubSpot Contact ID) field.

This is necessary because if a field is empty in HubSpot, the API will return nothing at all, as if that field doesn't actually exist.

So a null value will be used if the HubSpot Contact ID is not found within the data received from the trigger and will save the workflow from failing.

Search contact details from HubSpot using HubSpot ID/Email.
Copy

To later decide within the workflow what action (create or update) needs to be taken in the Hubspot account, we need to know if the contact already exists in HubSpot.

If it exists, then the contact in HubSpot will be updated. If it doesn't, a new contact in HubSpot will be created.

The workflow requires the HubSpot ID or an Email address from the data received through the trigger to find the contact. If any one of these attributes exists in the trigger data:

  • The workflow searches for the contact in the HubSpot using it.

  • The contact details are then stored using data storage in the workflow's Set Contact step. Which are later fetched for further processing in the Get Contact step.

If none of the mentioned attributes is found, then the workflow terminates.

Build and compare HS and SL payload
Copy

Before updating the data in HubSpot, the workflow compares the new data received through Salesloft with the existing data from HubSpot.

If there is no difference between them, the workflow ends without performing any action. If a difference is found, the workflow updates the new information in HubSpot.

To do so, you need to create Salesloft and HubSpot payload by:

  • Choosing the fields you wish to be part of the payloads. Refer to Choose fields in the Getting live section.

  • Convert SL/HS ID type: converts the HubSpot and Salesloft IDs data type to number.

This will help ease the comparison of the HubSpot and Salesloft IDs in the Compare Payload to Payload step.

  • Build SL/HS Payload step: creates separate objects of key/value pairs for HubSpot and Salesloft fields using the Add key/value pairs operation.

This operation adds key/value pairs from the array list to a source object as properties and then returns a single object.

  • Compare Payload to Payload: The payload objects are then compared using the Equals operation.

The operation returns true if both the objects are the same, false otherwise.

Step-by-step breakdown
Copy

Section 1: Get Salesloft people details
Copy

Section 2: Search HubSpot contact details using HS ID
Copy

(Has HS ID? - True Branch)

Section 3: Search HubSpot contact details using Email
Copy

(Has HS ID? - False Branch)

Section 4: Create/Update contact in HubSpot
Copy