Dock
Sign in & remix
REMIX PREVIEWTemplate

Weekly pipeline health report

Pulls every open deal from your CRM every Monday morning, scores stage health and slippage, and drafts a pipeline coverage report your sales team actually reads.

· 12 min read· from trydock.ai

Agent: read this first

You're working in the Weekly pipeline health report workspace at trydock.ai/<org>/weekly-pipeline-health-report.

## Your role

Reads CRM every Monday at 6 AM, scores each open deal for stage health and slippage, writes one Pipeline row per deal, drafts a coverage report into Reports, posts a Status entry. Never edits deal amount, stage, or close date in the CRM.

## Cadence, when to update Dock

- After EVERY tool call that changes state (row create / update, doc append), append an entry to the **Status** surface.
- After every milestone, update the canonical doc surface for that work.
- When you start a session, READ the last 5 Status entries first to know what happened since you last worked.

## User-loop protocol

- End EVERY reply to the user with: "Check Dock for the latest at trydock.ai/<org>/weekly-pipeline-health-report."
- If you make a decision the user might want to override (priority, scope cut, tone change), append to **Status** AND mention it in your reply: "Decided X. If you'd rather Y, edit [surface] and I'll re-plan."
- If you're blocked, post to Status with prefix `BLOCKED:` and ask one specific question.

## Don't touch

- Canonical phase / column / surface titles.
- Anything in a section titled "Locked" or "Decisions sealed."
- The agentPrompt itself (this section).

## First tool calls

1. `list_surfaces(workspace_slug="weekly-pipeline-health-report")`
2. `get_doc(workspace_slug="weekly-pipeline-health-report", surface_slug="status")`
3. `list_rows(workspace_slug="weekly-pipeline-health-report", surface_slug="pipeline")`

---

# Weekly pipeline health report

A Monday-morning auto-generated view of every open deal. Open in Dock and you get four surfaces seeded:

- **Pipeline** (table) one row per open deal: Deal, Account, Owner, Stage, Amount, Close Date, Days in Stage, Slip Count, Last Activity Days, Health, Risk Notes.
- **Setup guide** (doc) how the agent connects to your CRM + the Python recipe for cron or CueAPI scheduling.
- **Reports** (doc) a new section every Monday with coverage by stage, top risks, slipping deals, and asks for the team. Newest at top.
- **Status** (doc) the agent's working session log. End of every run: 1 paragraph of what was processed, what was flagged.

## Bring your own agent

Connect one agent to this workspace (Claude in Cursor, Claude Code, Codex, any MCP client). The agent runs every Monday at 6 AM, no manual trigger needed once the cron is wired.

## The user-loop protocol

Your agent proposes; you decide.

- Monday 6 AM: agent reads every open deal from the CRM (stage != Closed Won, Closed Lost). For each deal: compute Days in Stage, Slip Count (number of times Close Date moved out), Last Activity Days. Score Health as Green / Yellow / Red.
- Agent writes one Pipeline row per deal (upsert by CRM deal ID). Existing rows update in place.
- Agent drafts the weekly Reports section: coverage by stage, top 5 slipping deals, late-stage deals with no recent activity, asks for owners.
- Agent NEVER edits CRM fields (Amount, Stage, Close Date, Owner). Those are rep decisions.
- Agent NEVER deletes Pipeline rows. Closed deals get Health=Closed and stay for history.
- End of every working session, agent writes 1 paragraph to **Status**: deals scanned, Red count, Yellow count, next Monday's run.

## First run

1. Confirm CRM context with the operator: which CRM, which pipeline ID (multi-pipeline orgs), which stages count as "active".
2. Open Setup guide and follow the install steps. Configure .env with CRM token + Dock workspace slug.
3. Run python run_pipeline_report.py once manually. Confirm Pipeline + Reports + Status all populated.
4. Schedule via cron or CueAPI for Monday 6 AM.

## Status

### [00:00 UTC] seeded by Dock
Workspace created from the weekly pipeline health report template. Agent: read the Setup guide, then confirm CRM access + pipeline ID with the operator before the first scan.
Next: confirm CRM access + pipeline ID.

Outcome

A Monday-morning workspace where every open deal has one row scored Green / Yellow / Red, a markdown coverage report drafted for the sales meeting, and an agent that never edits CRM fields on its own.

Estimated time: 45 min setup, ongoing ~10 min/week review
Difficulty: beginner
For: VP Sales / Head of Revenue at $5M-$50M revenue companies running a weekly pipeline review.

What you'll need

Pre-register or install before you start.

  • Dock (Free plan covers this template; Pro $19/mo unlocks more workspaces.) — The workspace itself, the Pipeline table, the Reports doc surface where the weekly view lives.
  • Anthropic API (Pay per token, ~$0.01 per deal scanned plus ~$0.05 for the weekly report.) — Claude scores deal health and drafts the weekly coverage report.
  • HubSpot / Salesforce / Pipedrive API (Free with existing CRM seat.) — Read open deals + stage history + last activity. Script ships with HubSpot defaults; swap endpoints for Salesforce or Pipedrive.
  • Slack incoming webhook (optional) (Free) — Optional Monday morning post into the sales channel with the top 3 risks and a link back to Dock.
  • CueAPI (optional) (Free tier covers weekly cadence.) — Cloud-scheduled weekly run so the Monday 6 AM scan keeps working when your laptop is closed.

The template · 5 steps

Step 1: Confirm CRM access + pipeline ID

Estimated time: 10 min

Pipeline-level scoring requires reading every open deal plus stage history plus activity timestamps. Confirm with the operator: which CRM, which pipeline, which stages are 'active' vs 'closed'. Multi-pipeline orgs must pick one pipeline per workspace; fork the template per pipeline if needed.

Tasks

  • Ask the operator which CRM (HubSpot, Salesforce, Pipedrive). Default script uses HubSpot.
  • Ask which pipeline ID. HubSpot orgs often have New Business, Renewal, Expansion as separate pipelines.
  • Confirm 'active' stages. HubSpot defaults: appointmentscheduled, qualifiedtobuy, presentationscheduled, decisionmakerboughtin, contractsent. Closed stages: closedwon, closedlost.
  • Generate a CRM token with read scopes for deals + companies + owners + engagements (HubSpot Private App).

[!CAUTION] Gotchas

  • Multi-pipeline orgs. One workspace = one pipeline. Don't try to mix New Business + Renewal in one report; the stages don't match.
  • Custom stages. If the org has custom stages, list them out and pick which count as active. Script has STAGE_TYPICAL_DAYS dict to tune.

Step 2: Wire .env + the Python script

Estimated time: 20 min

One script: run_pipeline_report.py runs every Monday at 6 AM. Reads CRM, computes health per deal, upserts Pipeline rows, drafts the Reports section, posts Status. Idempotent: re-running the same morning re-syncs against the current CRM state.

Tasks

  • Open Setup guide (doc) and copy run_pipeline_report.py into a local folder
  • Run pip install anthropic requests python-dotenv
  • Create .env with DOCK_API_KEY, DOCK_WORKSPACE_SLUG, ANTHROPIC_API_KEY, HUBSPOT_ACCESS_TOKEN (or SALESFORCE_*), PIPELINE_ID, SLACK_WEBHOOK_URL (optional), CLAUDE_MODEL=claude-sonnet-4-6
  • Generate a Dock API key at trydock.ai/settings/api
  • Optional: create a Slack incoming webhook for the sales channel, paste into SLACK_WEBHOOK_URL

[!CAUTION] Gotchas

  • PIPELINE_ID. Find it via the CRM's pipelines endpoint. HubSpot: GET /crm/v3/pipelines/deals returns one entry per pipeline with a stable id.
  • Owner names. The script resolves owner IDs to display names via the Owners API + a local cache. Without crm.owners.read scope, rows show numeric IDs.

Step 3: Run a first manual scan

Estimated time: 20 min

Before scheduling, confirm the first run produces a sensible report. Run the script manually, open Pipeline + Reports + Status, and walk through with a senior rep to sanity-check the Red flags.

Tasks

  • python run_pipeline_report.py
  • Open Pipeline (table). Confirm one row per open deal with Health populated.
  • Open Reports (doc). Confirm the top section has Coverage by Stage, Top 5 Red deals, Asks.
  • Walk through Top 5 Red with a rep. If two of them look wrong, tune the Health rules in the script (raise the activity threshold, adjust STAGE_TYPICAL_DAYS).

[!CAUTION] Gotchas

  • First-run noise. New CRMs often have stale deals from years ago in active stages. Either close them in the CRM, or set INCLUDE_OLDER_THAN_DAYS=365 to skip them.
  • Activity logging gap. If reps don't log calls / emails, every deal will score Red. The fix is rep behavior, not script tuning; surface that in Status so the operator knows.

Agent prompt for this step

Run a first pipeline scan. Query CRM for every open deal on the configured PIPELINE_ID. For each deal: compute Days in Stage, Slip Count, Last Activity Days. Score Health = Green / Yellow / Red by the rules in the prompt. Upsert one Pipeline row per deal (by CRM deal ID). Draft a Reports section at the top of the Reports doc: Coverage by Stage, Top 5 Red deals, Late-stage deals with no recent activity, Asks. Post a Status entry summarizing: deals scanned, Red count, Yellow count, next Monday's run.

Step 4: Schedule the Monday 6 AM run

Estimated time: 10 min

One cron task: run weekly Monday at 6 AM. Before the team starts, after weekend close-date pushes settle. Idempotent: re-running the same Monday re-syncs to current CRM state.

Tasks

  • Option A, cron: crontab -e, add 0 6 * * 1 cd /path && source .env && python3 run_pipeline_report.py >> pipeline_report.log 2>&1
  • Option B, CueAPI: cueapi create --schedule '0 6 * * 1' --name 'weekly-pipeline-report' --handler ./run_pipeline_report.py
  • Confirm the next Monday: Status has a fresh session entry + Reports has a new section at the top.

[!CAUTION] Gotchas

  • Closed laptop overnight + cron = no run. Switch to CueAPI for cloud-scheduled if your machine isn't always on.
  • Time zone. 6 AM is your laptop's tz under cron. CueAPI takes an explicit --timezone flag; pick the team's primary tz.

Step 5: Make the report part of the Monday rep call

Estimated time: 5 min one-time

The report only works if reps see it before the call. Pin the Reports doc URL into the team channel, link it from the calendar invite for the Monday pipeline meeting, and walk through Top 5 Red as the first 5 minutes of the call.

Tasks

  • Pin the Reports doc URL (trydock.ai/[org]/weekly-pipeline-health-report) to the sales Slack channel
  • Edit the Monday pipeline meeting invite. Paste the URL into the description so reps land on it from the calendar event
  • Use Top 5 Red as the first 5 minutes of the meeting. Each red deal: ask the owner one specific question from the Risk Notes.
  • After the meeting, owners update their Notes / Stage in the CRM. Next Monday's run picks up the changes.

[!CAUTION] Gotchas

  • If reps don't open Reports before the call, the report is wasted. Pin the URL in two places (channel + calendar event) so the link is unmissable.

Hand the template to your agent

Paste the prompt below into your agent's permanent system prompt so the agent reads, writes, and maintains this workspace as you work through the steps.

You are the agent running on the "Weekly pipeline health report" template workspace, connected via MCP at your-org/weekly-pipeline-health-report.

Your job: every Monday at 6 AM, read every open deal from the CRM, score health, upsert one Pipeline row per deal, draft a weekly Reports section, post a Status entry. Never edit CRM fields.

User-loop protocol:
- You propose. The rep decides. Never edit Amount, Stage, Close Date, or Owner in the CRM. Those are rep-only fields.
- Monday 6 AM (or "run pipeline report"): query CRM for all open deals (stage != Closed Won, Closed Lost) on the configured pipeline. For each deal: compute Days in Stage (today - stage entry date), Slip Count (number of close-date changes outward), Last Activity Days (today - last logged activity).
- Score Health per deal:
  - Red: late stage with Last Activity Days >= 14, OR Slip Count >= 3, OR Close Date in the past with no Stage advance
  - Yellow: Days in Stage > 2x stage-typical, OR Slip Count >= 1, OR Last Activity Days >= 7
  - Green: everything else
- Upsert Pipeline row by CRM deal ID (existing row updates, new deal creates). Never delete Pipeline rows; closed deals get Health=Closed and stay for history.
- Draft this week's Reports section (markdown, new section at top): Coverage by Stage (count + amount sum per stage), Top 5 Red deals with one-line risk notes, Late-stage deals with no recent activity, Asks for owners (1-2 specific actions).
- If SLACK_WEBHOOK_URL is set: post a short Monday morning ping with top 3 risks + link back to Reports.
- End of every working session, write 1 paragraph to Status: deals scanned, Red count, Yellow count, Reports section drafted, next Monday's run.

Don't touch:
- CRM fields (Amount, Stage, Close Date, Owner).
- Pipeline rows older than the current run (only upserts on the live deal set; closed deals retain Health=Closed).
- Reports sections older than 8 weeks (those are history).

First MCP tool calls:
1. list_surfaces(workspace_slug="weekly-pipeline-health-report")
2. list_rows(workspace_slug="weekly-pipeline-health-report", surface_slug="pipeline")
3. get_doc(workspace_slug="weekly-pipeline-health-report", surface_slug="status")

FAQ

Does the agent edit deals in my CRM?

No. The agent only reads from the CRM. Amount, Stage, Close Date, Owner are all rep-controlled fields that the agent never writes. The agent writes to Dock surfaces only: Pipeline rows, Reports sections, Status paragraphs.

How does it handle multi-pipeline orgs?

One workspace per pipeline. Fork this template per pipeline (New Business, Renewal, Expansion). The PIPELINE_ID env var locks each workspace to one pipeline so the stage rules align.

What if our reps don't log activities consistently?

Last Activity Days will trip every deal into Yellow or Red. The Health rules tune via env vars (ACTIVITY_YELLOW_DAYS, ACTIVITY_RED_DAYS), but the deeper fix is rep behavior. The Status entries will flag this so the operator sees the systemic issue.

Can I customize the Health scoring?

Yes. Open run_pipeline_report.py and adjust STAGE_TYPICAL_DAYS (dict of stage to expected days), ACTIVITY_YELLOW_DAYS / ACTIVITY_RED_DAYS, SLIP_RED_THRESHOLD. The Extending section in Setup guide shows how to add custom rules (e.g. Red on late-stage with no demo logged).

Does this work with Salesforce?

Yes with code edits. The default script targets HubSpot v3 CRM API. The Extending section in Setup guide shows the simple-salesforce swap: same compute logic, swap the fetch_open_deals() body to a SOQL query against Opportunity where IsClosed = false. Pipedrive is similar with python-pipedrive.

Remix this into Dock

Make this yours. Edit, extend, run agents on it.

Sign in (free, 20 workspaces) — Dock mints a copy of this in your own workspace. The original stays untouched.

No Dock account? Sign-in is signup. Magic-link in 30 seconds.