Escalate high-value shipping problems to the deal owner
Every hour during business hours, we catch AfterShip exceptions on high-value orders, find the deal owner in HubSpot, and Slack them the details.
Every hour during business hours, sweep AfterShip for shipments that just broke on a high-value order and escalate them straight to the deal owner in HubSpot so they never sit unnoticed in a support queue.
Trigger: cron, once per hour during business hours. AfterShip is not a native poll source on this platform, so a scheduled sweep is the correct pattern.
Step 1. Call AfterShip List Trackings and filter to trackings whose status is Exception, Undelivered, or Returned to Sender and that were updated in the last hour. Page through until every recent hit is in hand.
Step 2. For each troubled shipment, use HubSpot Search Deals to find the associated deal. Try the order number first (typically stored on a custom deal property such as order_number), then fall back to the customer email associated with the shipment. If nothing matches, skip the shipment.
Step 3. Read the deal's amount and skip anything below a configurable threshold. Default to $5,000 and expose the number as a workflow input so an admin can raise or lower it without touching the prompt. Also skip deals that have no assigned owner.
Step 4. For qualifying incidents, call HubSpot Create Note associated with the deal. The note should summarize the courier (slug), the last checkpoint message and location, the destination, the exception reason returned by AfterShip, and the AfterShip tracking id so it is easy to cross-reference later.
Step 5. Use Slack Send a Message to DM the HubSpot deal owner (map their HubSpot email to a Slack user). The message should include the customer name, deal amount, courier, exception reason, a direct link to the AfterShip tracking page, and a short suggested next action based on the failure mode: a proactive customer call for a delivery exception, refund or reship for returned-to-sender, or a courier escalation for a stalled undelivered shipment.
Guardrails. Skip shipments below the deal-value threshold. Skip shipments that can't be matched to a deal. Skip deals with no owner. Do not alert twice on the same tracking id within a 24 hour window.
This is an agent workflow because matching AfterShip trackings to HubSpot deals via order number or customer email is fuzzy, and the suggested next action requires judgment based on which failure mode the shipment hit.
Additional information
What does this prompt do?
- Every hour during business hours, we scan AfterShip for shipments that hit an exception, went undelivered, or were returned to sender in the last hour.
- We match each troubled shipment to its deal in HubSpot using the order number or customer email, then skip anything below your configurable deal-value threshold.
- For qualifying incidents, we log a note on the HubSpot deal summarizing the courier, last checkpoint, destination, and exception reason.
- We DM the deal owner in Slack with a link to the AfterShip tracking and a suggested next action so they can act before the customer complains.
What do I need to use this?
- An AfterShip account with a live tracking feed for your shipments
- A HubSpot account where deals carry an order number or customer email that ties back to shipments
- A Slack workspace where the deal owner can receive a direct message
How can I customize it?
- Change the hourly cadence or the business-hours window that governs when this runs
- Adjust the deal-value threshold that decides which incidents get escalated (the default is $5,000)
- Rewrite the Slack message tone, or the format of the note that gets attached to the deal
- Add or remove AfterShip statuses in the filter (for example, include In Transit shipments that have been stuck for days)
Frequently asked questions
What if a broken shipment doesn't map to any HubSpot deal?
What happens for shipments on deals below the value threshold?
Can I run this more frequently or outside business hours?
Does this cover shipments that are just late but haven't hit an exception status yet?
How does it decide who to Slack?
Related templates
Stop letting five-figure orders go quiet.
Put the right account owner on the phone the moment a high-value shipment breaks.