Systems Library / Sales Automation / How to Create Automated Deal Progress Notifications
Sales Automation crm pipeline

How to Create Automated Deal Progress Notifications

Notify managers automatically when deals advance, stall, or need attention.

Jay Banlasan

Jay Banlasan

The AI Systems Guy

Sales managers should not have to check the CRM to know when deals move. This automate deal progress notification system for sales pings the right people the moment something changes. I set this up for teams that were missing stage changes for days.

What You Need Before Starting

Step 1: Set Up CRM Webhooks

Configure your CRM to fire a webhook on every deal stage change.

from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route("/webhook/deal-update", methods=["POST"])
def handle_deal_update():
    payload = request.json
    old_stage = payload.get("previous_stage")
    new_stage = payload.get("current_stage")
    if old_stage != new_stage:
        process_stage_change(payload["deal_id"], old_stage, new_stage)
    return jsonify({"status": "received"})

Step 2: Define Notification Rules

Different changes get different alerts. A close gets celebration. A stall gets escalation.

NOTIFICATION_RULES = {
    "advanced": {"channels": ["slack"], "recipients": ["deal_owner"]},
    "stalled": {"channels": ["slack", "email"], "recipients": ["deal_owner", "manager"]},
    "won": {"channels": ["slack"], "recipients": ["team"]},
    "lost": {"channels": ["email"], "recipients": ["deal_owner", "manager"]},
}

Step 3: Route Notifications

Send the right message to the right channel based on the change type.

import requests

def send_notification(deal, change_type):
    rule = NOTIFICATION_RULES.get(change_type, {})
    message = f"Deal update: {deal['name']} (${deal['amount']:,.0f}) - {change_type}"

    if "slack" in rule.get("channels", []):
        requests.post(SLACK_WEBHOOK, json={"text": message})
    if "email" in rule.get("channels", []):
        for recipient in rule["recipients"]:
            send_email(get_email(recipient, deal), "Deal Update", message)

Step 4: Add Rich Context

Include deal value, days in previous stage, and next suggested action.

def enrich_notification(deal, old_stage, new_stage):
    return {
        "deal_name": deal["name"],
        "value": deal["amount"],
        "transition": f"{old_stage} -> {new_stage}",
        "days_in_previous": (datetime.now() - deal["stage_changed_at"]).days,
        "next_action": get_suggested_action(new_stage),
    }

Step 5: Log Notification History

Track every alert sent for debugging and deal progression analysis.

import sqlite3

def log_notification(deal_id, change_type, recipients):
    conn = sqlite3.connect("notifications.db")
    conn.execute(
        "INSERT INTO notification_log (deal_id, change_type, recipients, sent_at) VALUES (?, ?, ?, ?)",
        (deal_id, change_type, ",".join(recipients), datetime.now().isoformat())
    )
    conn.commit()

What to Build Next

Add a digest mode for managers. Instead of every notification, they get a morning summary of all stage changes from the previous day.

Related Reading

Want this system built for your business?

Get a free assessment. We will map every system your business needs and show you the ROI.

Get Your Free Assessment

Related Systems