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

Why Zapier?

Zapier works well for stale deal checks if you're already on the Professional plan. The Schedule trigger runs daily, the Webhooks step handles the HubSpot API call, and a Code step formats the results. You don't need to host anything — Zapier runs everything in the cloud.

The trade-off is complexity and cost. This Zap requires 4 steps (Schedule + Code for timestamp + Webhooks + Code for formatting + Filter + Slack), which makes it one of the more involved Zapier setups. The Professional plan ($30/mo) is required for the Code and Webhooks steps. If you're not already on Zapier, n8n (free self-hosted) or Make (cheaper) are better choices for this use case.

How it works

  • Schedule by Zapier triggers the Zap daily at a set time
  • Code by Zapier calculates the 14-day-ago timestamp in milliseconds
  • Webhooks by Zapier sends a POST to HubSpot's CRM search API to find stale deals
  • Code by Zapier formats the results into a human-readable Slack message
  • Filter skips posting when no stale deals are found
  • Slack posts the formatted summary to your channel

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

Troubleshooting

Common questions

How many Zapier tasks does the daily stale deal check use?

About 4-5 tasks per run: Schedule (1) + Code for timestamp (1) + Webhooks (1) + Code for formatting (1) + Slack (1). At 30 runs/month, that's roughly 120-150 tasks — well within the Professional plan's 750 monthly quota.

Can I calculate the timestamp without a Code step?

Not easily. Zapier's built-in date formatting doesn't support Unix millisecond timestamps, which HubSpot's search API requires. The Code step is the cleanest approach. Alternatively, you could use a Formatter by Zapier date math step, but it's more fragile.

What if I have more than 100 stale deals?

The HubSpot search API caps at 100 results per page. Pagination in Zapier requires a looping pattern with Paths, which is complex. If you regularly have 100+ stale deals, consider the code or n8n approach instead.

Cost

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

Looking to scale your AI operations?

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