Alert Slack when a HubSpot deal is stuck in a stage for over 14 days using Zapier

medium complexityCost: $20-50/mo

Prerequisites

Prerequisites
  • Zapier Professional plan (required for Schedule trigger + Webhooks + Code steps)
  • HubSpot private app token for API calls
  • Slack workspace connected to Zapier

Step 1: Schedule a daily trigger

Create a new Zap with Schedule by Zapier:

  • Frequency: Every Day
  • Time: 8:00 AM

Step 2: Search for stale deals via Webhooks

Add a Webhooks by Zapier → Custom Request step:

  • Method: POST
  • URL: https://api.hubapi.com/crm/v3/objects/deals/search
  • Headers: Authorization: Bearer YOUR_TOKEN, Content-Type: application/json
  • Data:
{
  "filterGroups": [{
    "filters": [
      {"propertyName": "hs_lastmodifieddate", "operator": "LT", "value": "FOURTEEN_DAYS_AGO_MS"},
      {"propertyName": "dealstage", "operator": "NOT_IN", "values": ["closedwon", "closedlost"]}
    ]
  }],
  "properties": ["dealname", "amount", "dealstage", "hs_lastmodifieddate"],
  "limit": 100
}
Timestamp calculation

Zapier doesn't have a built-in way to calculate "14 days ago in milliseconds." Use a Code by Zapier step before the webhook to calculate it: return { fourteenDaysAgo: String(Date.now() - 14 * 86400000) }.

Step 3: Format with Code by Zapier

Add a Code by Zapier step (JavaScript) to process the deals:

const data = JSON.parse(inputData.rawResponse);
const deals = data.results || [];
 
if (deals.length === 0) return { message: "No stale deals found", count: 0 };
 
const lines = deals.map(d => {
  const days = Math.round((Date.now() - new Date(d.properties.hs_lastmodifieddate)) / 86400000);
  const amount = parseFloat(d.properties.amount || "0").toLocaleString();
  return `• *${d.properties.dealname}* — ${days}d stale — $${amount}`;
}).join("\n");
 
return { message: lines, count: deals.length };

Step 4: Send to Slack

Add a Slack → Send Channel Message step:

  • Channel: #sales-pipeline
  • Message:
⚠️ *Stale Deals Alert*
*{{count}}* deals with no activity for 14+ days:
 
{{message}}

Add a Filter step before Slack to skip posting when count is 0.

Step 5: Test and publish

  1. Test each step
  2. Turn the Zap On

Cost

  • Professional plan: $29.99/mo. Uses ~4 tasks per daily run = ~120 tasks/month.

Need help implementing this?

We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.