Skip to content

The moment it happens

Be warned when an AfterShip parcel is stuck

When a delivery attempt fails or a carrier flags an exception, you find out first and can reach the customer.

Runs
The moment it happens
Apps
AfterShip
AI
Not needed
Access
API key

Send this to your assistant

Create a ClickRuntime automation: when an AfterShip tracking moves to Exception or AttemptFail, email me the order number, tracking number, carrier and the checkpoint message.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

When a parcel gets an exception, such as damaged in transit, held at customs or delivery failed, every hour counts. A customer who ordered a gift for a birthday on Saturday needs to hear on Wednesday that it is stuck, not on Saturday when it is too late. Support teams that wait for AfterShip's dashboard to be checked, or for the customer to email, give up the one window in which a refund, reship or call to the carrier still fixes the problem.

AfterShip sends a webhook when a tracking changes. The automation checks the tag and, when it is an exception or a failed attempt, alerts your team with the tracking number, carrier and last checkpoint message. Other updates are ignored.

It is useful for stores selling time-sensitive goods, high-value items or international orders.

What you get out of it

  • Customers hear from you first

    A short message saying you know about the delay and are fixing it builds trust. Customers forgive problems far more easily when you tell them before they ask. Being early with bad news is a service in itself.

  • Refunds and reships are faster

    The sooner you know a parcel is damaged or lost, the sooner a replacement can ship. That can turn a ruined delivery into a recovered sale. Replacement orders sent within a day feel like care, not compensation.

  • Carrier claims are filed on time

    Many carriers set strict deadlines for damage and loss claims. An alert that arrives when the exception occurs leaves plenty of time to collect evidence and file. Missing a claim window can mean absorbing the whole loss yourself.

  • High-value orders get special attention

    You can limit alerts to orders above a value, so the team's attention goes to the shipments where a failure costs the most. A single threshold turns a flood of alerts into a short, valuable list.

  • Customs problems are fixed in time

    An international parcel held for missing information needs a fast reply. The alert gives the team the checkpoint text so they know what the customs authority wants. Waiting a week for the customer to complain can mean the parcel is already sent back.

How it works

What happens, step by step

  1. When a parcel's tracking changes in AfterShip, AfterShip tells ClickRuntime straight away.

  2. ClickRuntime only acts if a delivery attempt failed or the carrier flagged an exception.

  3. You get an email with the order number, tracking number, carrier and the latest checkpoint message.

Before it runs live

  • Connect AfterShip
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Be warned when an AfterShip parcel is stuckjust nowSucceeded
Email · Delivery exceptionAttemptFail: order #10422 Tracking: 92612999897543581234 (fedex) · Checkpoint: Customer not available

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other AfterShip steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
shipment_exception_alert.pyexample
from clickruntime import on_event, notify

@on_event
def handle(event):
    t = (event.json or {}).get("msg") or {}
    if t.get("tag") not in ("Exception", "AttemptFail"):
        return {"tag": t.get("tag")}
    checkpoint = (t.get("checkpoints") or [{}])[-1]
    notify.email_me(f"{t['tag']}: order {t.get('order_id') or '-'}",
                    f"Tracking: {t['tracking_number']} ({t['slug']})\nCheckpoint: {checkpoint.get('message', 'no message')}")
    return {"tracking": t["tracking_number"]}

FAQ

Common questions

What counts as an exception in AfterShip?
AfterShip uses the Exception tag for problems such as damaged parcels, customs holds, address issues and returned items. Failed delivery attempts have their own AttemptFail tag, and the alert can cover both. It is one of several statuses AfterShip reports.
Will I get an alert for every repeated update on the same parcel?
The alert fires when the tag changes to an exception state. If the same parcel receives several updates while it stays in that state, you can choose to alert once or on each update. This stops a stuck parcel from creating repeated pings.
Can the alert go to the customer too?
It can send a message to your team, and a customer email can be added as a separate step. Because that is a message to a customer, you would see and approve it before it goes live.
What permissions does it need?
API key. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Be warned when an AfterShip parcel is stuck” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.