Back to The Times of Claw

Setting Up Smart Deal Alerts in Your CRM

Set up smart deal alerts in DenchClaw: Telegram notifications for stalled deals, stage changes, and closing deadlines — powered by DuckDB queries and cron.

Mark Rachapoom
Mark Rachapoom
·7 min read
Setting Up Smart Deal Alerts in Your CRM

Setting Up Smart Deal Alerts in Your CRM

The deals you lose aren't usually the ones that blew up dramatically. They're the ones that quietly went cold while you were focused on something else. No urgency, no alarm — just a deal that used to be active and now isn't, and by the time you noticed, the prospect moved on.

Smart deal alerts fix this. Instead of relying on you to remember to check on every deal in your pipeline, DenchClaw monitors your deals and proactively surfaces the ones that need attention. Here's how to set up alerts that actually matter.

Why Deal Alerts Matter#

Every sales pipeline has three deal categories that need active monitoring:

Stalled deals — deals that haven't moved in X days. These are quietly dying. The prospect hasn't disengaged, but the deal has lost momentum. Without an alert, you might not notice until it's too late.

Deals closing soon — deals with close dates in the next 7-14 days. These need prioritization right now. If you're going to close them, you need to be taking action today, not finding out on the day the close date passes.

At-risk deals — deals showing warning signs: no recent activity, overdue follow-ups, or explicitly marked as at-risk. These might still be saveable, but only if you act before the window closes.

Manual CRM monitoring can catch these — if you're disciplined about checking your pipeline daily. Most people aren't. Automated alerts are more reliable than willpower.

The Core Alert: Deals That Haven't Moved in 14 Days#

The single most valuable alert is the stalled deal notification. Here's the DuckDB query that powers it:

SELECT 
    d.name AS deal_name,
    d.value,
    d.stage,
    d.updated_at,
    CURRENT_DATE - d.updated_at::DATE AS days_since_update,
    c.name AS primary_contact
FROM deals d
LEFT JOIN contacts c ON c.deal_id = d.id
WHERE d.stage NOT IN ('Closed Won', 'Closed Lost')
    AND d.updated_at::DATE < CURRENT_DATE - INTERVAL '14 days'
ORDER BY days_since_update DESC;

Set this as a daily cron job at 9am and push the results to your Telegram. Any deal that hasn't been touched in 14 days shows up on your radar.

You can adjust the threshold for your sales cycle. If your average deal takes 90 days, 14 days without an update is fine. If your cycles are shorter, set it to 7 days.

Setting Up Telegram Notifications for New Deals#

When a new deal enters your pipeline (from a website form, a referral, a LinkedIn connection), you want to know immediately — not when you happen to check your CRM.

DenchClaw supports webhook-triggered notifications. When a new deal is created, it can immediately send a Telegram message:

🆕 New Deal: Sarah Chen at Acme Corp
Value: $18,000
Stage: Qualification
Source: Referral from David Kim
Created: Just now

Ready to set up the first touch?

This is set up via DenchClaw's webhook configuration:

webhooks:
  on_deal_created:
    - action: telegram_notify
      message: |
        🆕 New Deal: {deal.name}
        Value: ${deal.value}
        Stage: {deal.stage}
        Source: {deal.source}

The same webhook system works for deal stage changes — get notified whenever a deal moves to Proposal, Negotiation, or any stage you define as significant.

Cron-Based Alert Schedule#

Here's a practical alert schedule that covers the main scenarios:

Daily at 9am:

  • Deals closing in the next 7 days
  • Follow-ups that are overdue
  • New leads added yesterday

Every Monday morning:

  • Deals stalled for 14+ days (weekly audit)
  • Pipeline summary (total value, count by stage)
  • Win/loss summary for the previous week

Real-time (via webhook):

  • New deal created
  • Deal stage change
  • New contact added from a high-priority source

Monthly:

  • Deals in pipeline for over 90 days with no stage change (these are probably dead and need to be closed out or re-evaluated)

This schedule covers urgency (daily for closing soon and overdue), momentum (weekly for stalled deals), and hygiene (monthly for pipeline cleanup).

DuckDB Queries to Power Your Alerts#

Here are the core queries for common alert conditions:

Deals closing in the next 7 days:

SELECT name, value, stage, close_date,
    close_date - CURRENT_DATE AS days_to_close
FROM deals
WHERE stage NOT IN ('Closed Won', 'Closed Lost')
    AND close_date BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL '7 days'
ORDER BY close_date ASC;

Deals over $X with no activity this week:

SELECT name, value, stage, updated_at
FROM deals
WHERE value >= 10000
    AND stage NOT IN ('Closed Won', 'Closed Lost')
    AND updated_at::DATE < CURRENT_DATE - INTERVAL '7 days'
ORDER BY value DESC;

Pipeline summary by stage:

SELECT stage, 
    COUNT(*) AS deal_count,
    SUM(value) AS total_value,
    AVG(value) AS avg_value
FROM deals
WHERE stage NOT IN ('Closed Won', 'Closed Lost')
GROUP BY stage
ORDER BY total_value DESC;

Deals that have been in the same stage for too long:

SELECT name, value, stage,
    CURRENT_DATE - stage_entered_date AS days_in_stage
FROM deals
WHERE stage NOT IN ('Closed Won', 'Closed Lost')
    AND days_in_stage > 21
ORDER BY days_in_stage DESC;

These queries can be dropped directly into DenchClaw's cron configuration as scheduled tasks. Each one produces a result set that DenchClaw formats as a readable Telegram message.

Action Fields: Slack Alerts on Deal Updates#

Beyond Telegram, DenchClaw supports Action fields — field types that trigger external actions when their value changes. You can use this to send Slack notifications when a deal enters a specific stage:

fields:
  - name: "stage"
    type: select
    on_change:
      - condition: "value == 'Closed Won'"
        action: slack_notify
        channel: "#wins"
        message: "🎉 {deal.name} — ${deal.value} closed!"
      - condition: "value == 'Proposal Sent'"
        action: slack_notify
        channel: "#pipeline"
        message: "📋 Proposal sent to {deal.company} — ${deal.value}"

This creates a lightweight deal monitoring layer that keeps your whole team informed without requiring everyone to log into the CRM.

Building a Deal Monitoring Dashboard#

If you want a visual overview of your deal health, DenchClaw's app builder can create a simple monitoring dashboard in a few minutes:

  • Pipeline by stage (bar chart of deal count and value)
  • Days since last update per deal (heat map — red = stalled)
  • Deals by close date (timeline view)
  • Win rate over time (trend line)

The dashboard pulls from the same DuckDB queries described above, so it's always current. You can pin it in your browser or set it as a tab that auto-refreshes each morning.

For most people, the Telegram alerts cover what they need day-to-day. The dashboard is useful for weekly reviews and team pipeline calls.

Frequently Asked Questions#

Can I set different alert thresholds for different deal sizes? Yes. You can add value-based conditions to your queries — for example, alerts for deals over $25K that haven't moved in 7 days, and alerts for deals under $25K that haven't moved in 14 days. The DuckDB query handles the conditional logic and you configure which result set gets which threshold.

What if I want to snooze an alert for a specific deal? DenchClaw supports alert snoozing via Telegram. When you receive an alert about a stalled deal, you can reply "snooze this for 7 days" and that deal won't appear in the stalled list until the snooze expires. The snooze is stored as a field on the deal record.

Can alerts trigger actions, not just notifications? Yes. Rather than just notifying you, alerts can also trigger automated actions: sending a templated email, creating a follow-up task, tagging the deal as "at-risk," or updating a field. You configure the trigger condition and the downstream action together.

How do I avoid alert fatigue if I have a large pipeline? Apply value thresholds and prioritize by urgency. "Only alert on deals over $10K" cuts most noise. Use the daily briefing for comprehensive coverage and reserve real-time alerts for truly time-sensitive conditions (closing in 3 days, very large deal stalled). The goal is 3-5 actionable alerts per day, not 30.

Can I use custom fields I've created in DenchClaw as alert conditions? Yes. Any field you've defined on a deal record can be used as an alert condition in your DuckDB query. If you have a "Priority" field with values 1-3, you can alert only on Priority 1 deals that are stalled.

Ready to try DenchClaw? Install in one command: npx denchclaw. Full setup guide →

Mark Rachapoom

Written by

Mark Rachapoom

Building the future of AI CRM software.

Continue reading

DENCH

© 2026 DenchHQ · San Francisco, CA