---
name: salesforce-lead-response-time
description: "Every Monday: median hours from lead created to first logged activity for last week's Salesforce leads, per owner, with the leads still waiting. Use when the user asks for this, or when it runs on a schedule."
---

# Salesforce lead response time

Every Monday: median hours from lead created to first logged activity for last week's Salesforce leads, per owner, with the leads still waiting.

Speed to lead is the sales metric everyone agrees on and almost nobody measures, because Salesforce does not store it. The number has to be rebuilt from two places: when the Lead record was created, and when the first Task or Event was logged against it.

This skill does that rebuild every Monday for last week's leads. The tile shows the median in hours, the table shows it per owner, and leads that still have no activity at all are listed by name, because those are exactly the ones a median hides.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- Read access to Lead, Task and Event records for the team, with SOQL through the `sf` CLI, a connector, or the REST API and a token in `SF_ACCESS_TOKEN`.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **Get last week's leads and their first activity** (Salesforce): `SELECT Id, Name, Company, LeadSource, Owner.Name, Owner.Type, CreatedDate, (SELECT CreatedDate FROM Tasks ORDER BY CreatedDate ASC LIMIT 1), (SELECT CreatedDate FROM Events ORDER BY CreatedDate ASC LIMIT 1) FROM Lead WHERE CreatedDate = LAST_WEEK`.
2. **Measure the gap**: First touch is the earlier of the two subquery dates; hours to first touch is that minus the lead's `CreatedDate`. Leads still owned by a queue (`Owner.Type = 'Queue'`) stay out of the per-owner table and are counted on their own.
3. **Compute the medians**: Median for the team and per owner over touched leads, plus the share of all leads touched within 1 hour and within 24 hours. Leads with no activity yet are listed as waiting, with their age so far.
4. **Post the median**: Headline: team median in hours, against the week before. Add the per-owner table (leads, median, share within an hour) and the untouched leads, oldest first.

## Route B: the browser

### What you need

- Signed in to Salesforce with Run Reports and read access to the team's leads, tasks and events.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://login.salesforce.com/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Report activities on last week's leads**: From your My Domain open **Reports** > **New Report**, report type **Activities with Leads**. Filters: Show Me All activities, **Lead: Created Date** **Last Week**, Date range All Time. Group by Lead, columns Lead Created Date, activity **Date** or Created Date, Assigned, Company, Lead Owner, Lead Source. Sort activities oldest first inside each group.
2. **Measure the gap**: The first activity in each lead group is the first touch; hours to first touch is its created time minus Lead Created Date. **Export** the report as Details Only CSV when there are more than a few dozen leads and do the subtraction in a sheet. Leads owned by a queue stay out of the per-owner numbers.
3. **Find the untouched leads**: A second report of type **Leads** with Created Date Last Week and **Last Activity** equals blank lists the leads with no Task or Event at all, with owner and Lead Source; sort by Created Date oldest first.
4. **Post the median**: Team median hours, the share touched within 1 hour and within 24 hours, the per-owner table, and the untouched leads, compared with the week before from your saved numbers.

Note: Salesforce stores no first-response field, so this route is export and arithmetic; the API route does the same from subqueries. Automated sends logged as Tasks by marketing tools count as a touch unless you exclude them by subject or creator in the report filter.

## The report

- **Median hours to first touch** for last week's leads, and the week before.
- **Within 1 hour and within 24 hours**, as shares of all leads.
- **By owner**: leads, median and the share touched within an hour.
- **Untouched leads**, oldest first, with owner and lead source.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "salesforce-lead-response-time/<date of this run, e.g. 2026-10-16>",
  "item_key": "salesforce-lead-response-time",
  "project": "Acme",
  "source": "Salesforce lead response time skill",
  "kind": "metric",
  "title": "Median lead response 3.4 h last week",
  "metric": {
    "label": "Median first response",
    "value": 3.4,
    "unit": "h",
    "better": "lower",
    "period_start": "<start of the period, ISO 8601>",
    "period_end": "<end of the period, ISO 8601>"
  },
  "glance": {
    "type": "Grid",
    "props": {
      "columns": 3
    },
    "children": [
      {
        "type": "Stat",
        "props": {
          "label": "Within 1 h",
          "value": 35,
          "unit": "%"
        }
      },
      {
        "type": "Stat",
        "props": {
          "label": "Within 24 h",
          "value": 88,
          "unit": "%"
        }
      },
      {
        "type": "Stat",
        "props": {
          "label": "Untouched",
          "value": 6,
          "tone": "warn"
        }
      }
    ]
  },
  "widget": [
    {
      "type": "Table",
      "props": {
        "columns": [
          "Owner",
          "Leads",
          "Median",
          "Within 1 h"
        ],
        "align": [
          "left",
          "right",
          "right",
          "right"
        ],
        "rows": [
          [
            "Dana",
            22,
            "1.2 h",
            "55%"
          ],
          [
            "Sam",
            19,
            "2.8 h",
            "37%"
          ],
          [
            "Priya",
            17,
            "4.1 h",
            "24%"
          ],
          [
            "Theo",
            14,
            "9.6 h",
            "14%"
          ]
        ]
      }
    },
    {
      "type": "Table",
      "props": {
        "columns": [
          "Untouched lead",
          "Company",
          "Owner",
          "Source",
          "Waiting"
        ],
        "align": [
          "left",
          "left",
          "left",
          "left",
          "right"
        ],
        "rows": [
          [
            "Rafael Costa",
            "Wide World Importers",
            "Theo",
            "Web",
            "6 days"
          ],
          [
            "Emma Lindqvist",
            "Alpine Ski House",
            "Theo",
            "Phone Inquiry",
            "5 days"
          ],
          [
            "Arjun Patel",
            "Litware",
            "Priya",
            "Web",
            "4 days"
          ],
          [
            "Grace Kim",
            "Humongous Insurance",
            "Theo",
            "Partner Referral",
            "3 days"
          ],
          [
            "Noah Fischer",
            "Proseware",
            "Sam",
            "Web",
            "3 days"
          ],
          [
            "Chloe Martin",
            "Fourth Coffee",
            "Priya",
            "Purchased List",
            "2 days"
          ]
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "Theo holds 3 of the 6 untouched leads, and his median is 9.6 h.",
        "tone": "warn"
      }
    }
  ],
  "size": "md"
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

Set `period_start` and `period_end` to the window the number covers: the tile names it from them ("Last 7 days", "Today", "This month"). For a count right now (open items, a balance), send `"period_label": ""` so no period shows; for another name, send it as `period_label` (at most 24 characters).

## Run it on a schedule

Suggested: Mondays at 9:00 (`0 9 * * 1`). From cron, with the agent signed in on that machine:

```bash
0 9 * * 1 claude -p "Run the salesforce-lead-response-time skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/salesforce-lead-response-time#schedule

Source: https://briefkin.dev/skills/salesforce-lead-response-time
