# Weekly CSM book-of-business digest

> Create a weekly account digest for each CSM with risks, expansion signals, product adoption, and customers needing outreach.

## Agent adaptation contract

- Canonical human page: https://agentry.sh/workflows/csm-book-of-business-digest
- Execution mode: human_review
- Immutable automation template: none
- Applies to: b2b-saas, devtools-api, enterprise-sales
- Required example events: account_snapshot
- Required Agentry resources: analytics
- Do not use when:
  - Do not use until the example events are mapped to observed project signals, the current onboarding state is verified, and live event/property reads prove the required data is present.
  - Do not recommend this when the product has no stable account or workspace identity.
  - Do not automatically send, publish, suppress, mutate, or contact anyone from this workflow.
- Ask before using:
  - Which observed events map to account_snapshot? Is the current onboarding state verified, and do live event/property reads show non-synthetic traffic for them?
  - Which live properties provide account_snapshot.account_id, account_snapshot.csm_owner, and which stable user or account identifier joins the signals?

This is an adaptable workflow example, not an API recipe. Map event and property names to the project's saved signal map, require status: "verified" from GET /v1/projects/:project_id/onboarding, and confirm the required signals through live event/property metadata and rows. Fetch current OpenAPI or query-blueprint details before making calls. Do not infer unattended authority from this page.

## Why this matters

CSMs operate from notes, Slack, and stale dashboards. A book-of-business digest gives them a prioritized list every week without a BI analyst.

## What you get

- Accounts needing outreach
- Expansion and champion signals
- Usage drops and support friction
- Suggested next action per account

## Walk through it

**You:**
> Build this week's digest for each CSM.

**Agent:**
> I'll group account signals by CSM owner and write short action briefs.

```text
Endpoint: POST /v1/projects/:project_id/analytics/query
Exact shape: /v1/openapi.json?path=%2Fv1%2Fprojects%2F%7Bproject_id%7D%2Fanalytics%2Fquery&method=post
Custom HogQL goes in the OpenAPI-defined `query` field.
Concept fields:
  query: "SELECT properties.csm_owner AS csm, properties.account_id AS account, count() AS events_7d, max(timestamp) AS last_seen FROM events WHERE timestamp > now() - INTERVAL 7 DAY AND properties.account_id IS NOT NULL GROUP BY csm, account ORDER BY csm, events_7d DESC"
```

## The output

The agent returns one digest per CSM with high-signal bullets. It should avoid flooding the CSM with healthy accounts unless there is an expansion opportunity.

## Setting it up

Emit account snapshot or usage events with `account_id` and `csm_owner`. Provide each CSM's preferred brief format in the interactive prompt or keep it in your team's existing reviewed configuration; do not rely on undocumented agent-local state.

This query exposes account-level activity and uses owner-authenticated custom analytics, so run it in a human-controlled session. A runner cannot receive raw accounts or generic HogQL, and this page does not grant authority to contact customers. The reviewer chooses what to share and with whom.

## Variations

- *"Only show accounts with a health score drop."*
- *"Create a version for the VP CS."*
- *"Prepare this for the latest seven-day window and let the CSM review it before choosing any recipients."*
