---
ref: workflow:product-qualified-expansion
title: "Tell sales when an account's usage passes your threshold"
author: thedogwiththedataonit
tools: [tool:amplitude/query-analytics, tool:attio/list-records, tool:attio/update-record, tool:attio/create-note, tool:slack/post-message]
tags: [capability:analyze-product-usage, capability:manage-crm, capability:route-alerts, channel:chat, has:mcp, motion:plg]
updated: 2026-09-29
---

# Tell sales when an account's usage passes your threshold

Finds accounts over your weekly-active-user threshold in Amplitude, marks and notes them in Attio, and posts each one to Slack for sales.

Set up the tools below, then run the steps in order for the user, carrying each step's results into the next. The run is done when the user has the outcome below.

## Outcome

- Every account over your usage threshold marked expansion-ready in Attio, with a note on the metric and the week.
- A Slack post for sales about each of those accounts.
- The domains that have no Attio record.

## Inputs

Ask the user for these before you start.

- `amplitude_project_id`: the Amplitude project to query
- `account_property`: the Amplitude user property that holds each account's domain, e.g. company_domain
- `usage_threshold`: the weekly active users that signal a bigger team, e.g. 25
- `lookback_days`: the window to check, in full weeks, e.g. 14
- `ready_attribute`: the Attio company checkbox, set up once, that marks expansion-ready accounts, e.g. expansion_ready
- `sales_channel`: the Slack channel to post in, e.g. #expansion

## Set up

### Query product analytics (Amplitude, tool:amplitude/query-analytics)

Use the MCP server. Add it to your agent's MCP settings, then sign in when asked.

```json
{ "mcpServers": { "amplitude": { "url": "https://mcp.amplitude.com/mcp" } } }
```

Call the MCP tool `query_amplitude_data`.

Note: Call `get_amplitude_context` with the project id first, so the query uses the project's time zone and metric definitions.

### Attio (tool:attio/list-records, tool:attio/update-record, tool:attio/create-note)

Use the first option your agent supports.

Notes:

- Create a note: Needs the record's object as `parent_object`, such as `people`, and its `parent_record_id`. The title is plain text only.

#### MCP (official, remote)

Add this server to your agent's MCP settings, then sign in when asked.

```json
{ "mcpServers": { "attio": { "url": "https://mcp.attio.com/mcp" } } }
```

- List records: call the MCP tool `list-records`
- Update a record: call the MCP tool `update-record`
- Create a note: call the MCP tool `create-note`

#### API (official)

- Base URL: https://api.attio.com
- List records: `POST /v2/objects/{object}/records/query`
- Update a record: `PATCH /v2/objects/{object}/records/{record_id}`
- Create a note: `POST /v2/notes`
- Auth: send the header `Authorization: Bearer $ATTIO_API_KEY`
- Get a key: https://attio.com/help/reference/apps/generating-an-api-key

### Post a message (Slack, tool:slack/post-message)

Use the first option your agent supports.

Note: Needs the `chat:write` scope. Over MCP it posts as the signed-in user; the API and CLI post as the app's bot.

#### MCP (official, remote)

Add this server to your agent's MCP settings, then sign in when asked.

```json
{ "mcpServers": { "slack": { "url": "https://mcp.slack.com/mcp" } } }
```

Call the MCP tool `slack_send_message`.

#### CLI (official)

Install the command, then confirm it runs.

```sh
curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash
slack --version
```

Run `slack api chat.postMessage`.

Set `$SLACK_BOT_TOKEN` in your environment first (get a key: https://api.slack.com/apps).

Before step 1, confirm access to each service with its cheapest read-only call, like a list or a search. Never send or change anything to test access.

## Steps

1. **Find accounts over the line** with Query product analytics (Amplitude). In `amplitude_project_id`, query weekly active users grouped by `account_property`, for each full week in the last `lookback_days`. Keep each domain with a week at or above `usage_threshold`, with the number and the week.
2. **Find their records** with List records (Attio). For each domain, find the company record. Keep its record ID and name; note the domains with no record.
3. **Mark them** with Update a record (Attio). Set `ready_attribute` to true on each record ID.
4. **Note the reason** with Create a note (Attio). Add a note to each record with the weekly active users and the week.
5. **Tell sales** with Post a message (Slack). Post one message per account to `sales_channel` with its name, the metric and the week.

## Rules

- Use only the services set up above. The read-only calls they need, like listing ids or polling for results, are fine.
- Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
- Never print API keys.
