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.

Agentic Task
AfterShipHubSpotSlackSalesCustomer SupportNotifications & Alerts
PromptCreate

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?
We skip it. This workflow is designed to protect high-value deals, so if a shipment can't be matched to a deal by order number or customer email, no note or alert is sent. You can pair this with a separate ops-facing digest to catch unmatched shipments.
What happens for shipments on deals below the value threshold?
They are filtered out and no alert is sent. The idea is to keep deal owners focused on the incidents worth their time. You can lower the threshold if you want broader coverage.
Can I run this more frequently or outside business hours?
Yes. The default is hourly during business hours because that matches when deal owners can actually act. You can shorten the cadence or extend the window when you set up the workflow.
Does this cover shipments that are just late but haven't hit an exception status yet?
Not by default. This workflow watches for the concrete exception, undelivered, and returned-to-sender statuses. If you want to catch stuck-but-not-yet-flagged shipments, extend the status filter when customizing.
How does it decide who to Slack?
It uses the deal owner recorded on the matched HubSpot deal and looks that person up in your Slack workspace. If a deal has no assigned owner, the alert is skipped for that record.

Stop letting five-figure orders go quiet.

Put the right account owner on the phone the moment a high-value shipment breaks.