> For the complete documentation index, see [llms.txt](https://docs.distro.so/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.distro.so/guides/speed-to-lead.md).

# Speed to lead

Assign a new lead to an available rep, tell them in Slack, and escalate when nobody works it.

Speed to lead is how fast a new inbound lead hears from a rep. Response time grows while a lead waits for an owner, when the rep doesn't know it's theirs, and when nobody notices it was never worked. One Distro workflow assigns the lead, writes the owner, alerts the rep, then re-reads the record later and escalates if nothing changed.

This guide is for leads that don't book on the form: contact-sales forms, content downloads, trial signups, and records created in the CRM. When a lead can book, show the rep's calendar instead; see [Demo requests](/guides/demo-requests.md).

## At a glance

| Step        | Workflow step                                              | What it does                                             |
| ----------- | ---------------------------------------------------------- | -------------------------------------------------------- |
| 1. Start    | **Salesforce object created** (or **New form submission**) | Starts a run when the lead arrives.                      |
| 2. Enrich   | **Enrich Lead**                                            | Adds title, company size, and other context for the rep. |
| 3. Assign   | **Assign from Queue**                                      | Picks an available rep.                                  |
| 4. Own      | **Update Salesforce Record**                               | Writes the rep as owner.                                 |
| 5. Alert    | **Notify in Slack**                                        | Messages the rep directly.                               |
| 6. Task     | **Log Salesforce Task**                                    | Gives the rep a call task.                               |
| 7. Wait     | **Wait**                                                   | Gives the rep time to respond, for example 15 minutes.   |
| 8. Re-check | **Match Salesforce Record**                                | Reads the lead again.                                    |
| 9. Escalate | **Branch**, then **Notify in Slack** and a backup queue    | Alerts a manager and reassigns leads nobody worked.      |

## Before you start

| You need                                                          | Where                                                                                     |
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| Salesforce or HubSpot connected                                   | [CRM connections and identities](/data-and-integrations/crm.md)                           |
| Each rep's CRM user and Slack user under **Connected identities** | **Settings** › **Members** › **Identities**                                               |
| A queue whose routing profile counts **Records**                  | [Create and manage a queue](/routing/queues.md), [Routing profiles](/routing/profiles.md) |
| Slack connected                                                   | **Settings** › **Integrations**                                                           |

{% hint style="info" %}
Who counts as available is set on the queue's routing profile: out-of-office members are skipped by default, and **Skip busy members** also skips reps in a meeting. Working hours don't gate **Assign from Queue**, so a lead that arrives at night is assigned straight away.
{% endhint %}

## Build the workflow

This example assigns every new web lead in Salesforce to `Inbound AEs`, and escalates if the lead's status hasn't changed after 15 minutes.

{% stepper %}
{% step %}

### Start on new leads

Create a workflow and choose **Salesforce object created** with **Object** `Lead`. Under **Fields to include**, add `Email`, `LeadSource`, and `Status`. Under **Start only when**, add `LeadSource` **Equals** `Web`, so records your other workflows create don't start a second run.
{% endstep %}

{% step %}

### Enrich and assign

Add **Enrich Lead** with your chain and the lead's email. Add **Assign from Queue** with `Inbound AEs`.
{% endstep %}

{% step %}

### Write the owner and alert the rep

On **Assigned**, add **Update Salesforce Record** for the trigger's lead, with `OwnerId` set to the assignee's ID. Add **Notify in Slack** to the **Earlier assignee**, with the lead's name, company, and size from **Enrich Lead**.
{% endstep %}

{% step %}

### Add a task (optional)

Add **Log Salesforce Task** with `Subject`, `OwnerId` set to the assignee, and `WhoId` set to the lead's record ID. To start outreach too, add a sequencing step; see [Routed leads to sequences](/guides/sequences.md).
{% endstep %}

{% step %}

### Wait, then read the lead again

Add **Wait** for 15 minutes, then **Match Salesforce Record** on `Lead` with `Id` set to the trigger's record ID. The match reads Salesforce when it runs, so it sees what the rep changed.
{% endstep %}

{% step %}

### Escalate leads nobody worked

On **Matched**, add **Branch** with a branch `Not worked` where the matched lead's `Status` still **Equals** `Open - Not Contacted`. On it, add **Notify in Slack** to your manager and an escalation channel, then **Assign from Queue** with a different queue, such as `Inbound Backup`, and a second **Update Salesforce Record**. A second pick from the same queue could choose the same rep.
{% endstep %}

{% step %}

### Test and publish

Shorten **Wait** to 1 minute, **Simulate**, then set it back, **Publish**, and turn the workflow **On**.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
The re-check only works if reps change the status on first contact. Check a field the rep changes and the workflow doesn't; the owner is written by the workflow, so it proves nothing.
{% endhint %}

## Start from a form

With **New form submission**, check for the person first: **Match Salesforce Record** on `Lead` by email. On **Matched**, alert the current owner and stop. On **Not matched**, enrich, assign, and **Create Salesforce Record** with `OwnerId` set to the assignee, then use the created record's ID for the task and the re-check.

## HubSpot differences

|                   | Salesforce                            | HubSpot                             |
| ----------------- | ------------------------------------- | ----------------------------------- |
| Trigger           | **Salesforce object created**, `Lead` | **Hubspot record created**, Contact |
| Owner field       | `OwnerId`                             | `Contact owner`                     |
| Task              | **Log Salesforce Task**               | **Create HubSpot Engagement**, Task |
| Field to re-check | `Status`                              | `Lead Status`                       |

## Check that it worked

Open the workflow's **History**: a run waiting on **Wait** shows **Waiting**. The **Assign from Queue** step shows who was picked, and **Branch** shows each condition as TRUE or FALSE. **Routing** › **Assignment log** lists the pick once the owner is written.

## Troubleshoot

| What you see                                       | What to check                                                                                    |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| The run fails at **Assign from Queue**             | The queue is paused, or every member is paused or out of office. The run shows why.              |
| The rep is picked but the CRM owner doesn't change | Map the rep's Salesforce user under **Connected identities**.                                    |
| No Slack message                                   | Map the rep's Slack user under **Connected identities**.                                         |
| One lead starts two runs                           | A form workflow created the record and the CRM trigger started too; tighten **Start only when**. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.distro.so/guides/speed-to-lead.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
