Use Salesforce Flow Builder to Update Lead or Contact Ownership from Drift Conversation Tasks


For some organizations, the owner of a Lead or Contact in Salesforce may change depending on which agent last interacted with the Lead or Contact. Ideally, when a site visitor has a conversation or meeting with a Drift agent, the ownership of the Lead or Contact in Salesforce would update to reflect the agent that last interacted with the Lead/Contact in Drift. However, the native Drift Salesforce integration cannot overwrite ownership on existing Leads or Contacts. For existing Leads/Contacts, ownership in Salesforce may not accurately reflect which agent last interacted with the Lead/Contact in Drift.


Using Salesforce FlowBuilder we can automatically update the ownership of any Lead or Contact when a Drift Conversation Task is appended to the Lead/Contact’s timeline via the native Drift Salesforce integration. The following is a general overview using FlowBuilder to resolve this issue. Please add to or otherwise modify this example to fit your organization’s unique needs.


This solution assumes the following:

  • The native Salesforce integration is connected and properly configured to send Conversation Activity to Salesforce with an associated record owner. The flows are triggered by the creation of a new Drift Conversation Task and will not work if the native integration is not active.

  • Lead ownership is expected to change for every conversation in Drift where the agent involved in the Drift conversation is different than the agent set as the record owner in Salesforce.

  • Agents in Drift also have user accounts in Salesforce.

  • No other automations are present that modify the Drift Conversation task or otherwise conflict with this flow.

  • Ownership should not be overwritten on the Lead or Contact if Drift hasn’t assigned an owner to the Conversation Task.

  • There are no duplicate records of the same type and email address (ie. two or more Leads with the same email address). If there are duplicate records of the same type, the Drift integration which creates the Task that triggers this flow will not always select the correct record.


The general concept of the flow is to first, fire whenever a new Drift Conversation Task is created. Then determine if the task has an owner other than the Integrations User. Drift will assign the following owner owner to the Conversation Task if any of the three selected conversation events have occurred:

  • Teammate with a scheduled meeting
  • Teammate who was last routed to the Conversation
  • Teammate who closed the Conversation

If none of these are true, Drift will assign the user who connected Salesforce to Drift as the owner. If the Integrations User is assigned as the Task owner, the flow will stop and Lead or Contact ownership will remain unchanged.

If there is a Drift owner assigned to the Conversation Task, the flow then checks if the Task is owned by a Contact. If yes, the Contact Owned by field is updated with the same identity as the Task owner. If no, the flow checks for a related Lead record. If a Lead record is found, the Lead owner field is updated with the same identity as the Task owner.


Begin by creating a new Flow in Salesforce FlowBuilder. Choose a Record-Triggered Flow for the flow type:

Configure the Start node to fire when a new Task is created for all Tasks with a Subject equal to “Conversation in Drift” (the subject given by all Conversation Tasks sent to Salesforce by the native Salesforce integration). Optimize the flow for Actions and Related Records.

Get Task Owner

Once the flow is triggered by a Drift Conversation Task, retrieve the owner assigned to the Task. The flow looks for the User who’s ID is the same as the Assigned to Id on the Task Object.

Check if Task Owner is the Integrations User

Once the User record is retrieved, determine if the record is the integrations user. This example uses the Salesforce Id of the Integrations User as a conditional check.

If the Task owner is the Integrations User, the flow ends. Otherwise continue.

Retrieve the Contact Record

Next, retrieve the Contact Record where the Task was appended. Note that we’re looking for a Contact with a Salesforce Id equal to the ID of the Conversation Task WhoId or {!$Record.WhoId}.

Check if a Contact Exists

Verify if the Task was attached to a Contact record.

Update Contact Ownership

If a Contact record was found, update its ownership.

Get Lead Record

If no Contact was found, retrieve the Lead record. Similar to the Contact record lookup, we’re looking for any Lead record where the ID equals the WhoId of the Drift Conversation Task.

Check if Lead Record Found

This is likely an unnecessary step as Drift will not create a Conversation Task without an associated Lead or Contact record but covers any edge cases where a task with the Subject of “Conversation in Drift” is created without an associated Lead or Contact. If no Lead is found, the Flow exits.

Update Lead Owner

If a Lead record is found, update its ownership.