Skip to main content

The problem

You built the funnel, the scoring, the forecast. But all of it still depends on someone opening the dashboard, reading the numbers, and deciding what to do. A deal sitting in the same stage for 90 days doesn’t raise a flag. A high-scoring lead with no meeting scheduled doesn’t trigger an alert. The intelligence is there, but nobody acts on it until it’s too late. The difference between intelligence and autonomy is who initiates the action: the human or the system.

What we did

We created a Deal Health Score that classifies every open deal into one of four levels based on how long it has been in its current funnel stage: Then we built automated alerts that flag deals requiring action, grouped by type of recommended intervention.

What we found

18% Healthy

Only 18% of open deals are progressing within normal timeframes. The majority of the pipeline needs attention.

30% Watch

Deals slowing down but still within an acceptable window. Monitoring these prevents them from becoming critical.

52% At Risk or Critical

More than half the pipeline is stalled. Without automated alerts, these deals would go unnoticed until the next manual review.
The alerts identified three categories of deals that need action:
  1. Never advanced - deals created 60+ days ago that never moved past the first stage. Likely abandoned.
  2. Stalled mid-funnel - deals that advanced but have been stuck in their current stage for 30+ days.
  3. Post-meeting stall - deals where a meeting happened but no progress followed. Warm leads cooling off.
Each alert can generate a Slack message, an email, or a CRM task. The agent runs on a defined schedule (daily, weekly) and notifies when something needs attention. Nobody needs to remember to open the dashboard.

The takeaway

This is the jump from Stage 03 (Predictive) to Stages 04-05 (Prescriptive/Autonomous). In Post 06 and Post 07, the system answers when you ask. Here, it tells you before you ask. The “agent” is simply this Skill running on a schedule. No complex infrastructure, no ML model. A prompt, SQL, and a cron job.

The Skill

Download the file below and add it to your Claude Skills. It will query your HubSpot pipeline data at Nekt and generate the health score and alerts automatically. ⬇ Download Skill file (.md)

SQL — Deal Health Score

Classify every open deal by time in current stage. Replace pipeline and stage IDs with your own:

SQL — Health summary

Aggregate the health distribution across the pipeline:

SQL — Automated alerts

Flag deals that need action, grouped by alert type:

Variations

Generate a compact summary ready to send as a notification:
Break down health distribution by how deals entered the pipeline:

Watch the walkthrough (PT-BR)

Implementation notes

  • The thresholds (30/60/90 days) are a starting point. Adjust based on your funnel velocity. If your average sales cycle is 120 days, 30 days in a stage may be normal. Use the average time-in-stage for won deals as your baseline.
  • Alerts are composable. Each alert query is independent. Run only the ones that make sense for your context, add new ones, or adjust criteria. Examples: deals with no activity in X days, deals with a proposal sent but no response, high-value deals stalled.
  • The agent is a recurring prompt. In practice, the “agent” is this Skill running on a defined schedule (daily or weekly) via Claude schedule or a cron job. The output can be directed to Slack, email, or any webhook.
  • HubSpot timestamps. The field hs_v2_date_entered_current_stage records when the deal entered its current stage. The format includes milliseconds (2025-10-27T19:37:04.929Z), so we use SUBSTR(..., 1, 10) to extract the date only.
  • Pipeline and stage IDs are specific to each HubSpot account. Use the pipeline overview query to discover yours.
  • The methodology applies to any funnel type. Replace stage IDs with your pipeline stages (Lead, MQL, SQL, Opportunity, Negotiation, Won). The logic of “time in stage = deal health” is universal.

The series

This is the final post. Here’s what we built across the 8 posts:
  • Connected CRM, billing, and ads in one place
  • Built a funnel the whole company reads the same way
  • Diagnosed where each channel breaks
  • Created a lead scoring model with 6 factors
  • Built a probability-weighted revenue forecast
  • Set up a health score and an agent that monitors on its own
All of it with SQL and a prompt. The data was already there. It just needed to be in the right place.

Back to series overview

See all 8 posts and how to run the Skills on your own data.