Send WhatsApp shipping updates when Shopify orders ship

By General Input

Every hour, just-shipped customers get a WhatsApp message with their order number, carrier and tracking link, so they stop emailing to ask where it is.

Integrations

  • WhatsApp Business
  • Shopify
  • Slack Bot

Type

Agentic Task

Categories

  • Customer Support
  • Operations

Every hour, send a WhatsApp shipping notification to every Shopify customer whose order was fulfilled in the last hour, so they get their tracking details without having to email us asking where their order is. Run this on an hourly cron schedule.

Start with Shopify List Orders to find orders fulfilled in the last hour. Filter to orders whose fulfillment status is fulfilled or partially fulfilled and that were updated since the start of the window. For each order, call Shopify List Fulfillments for Order to pull its fulfillments, and keep only the fulfillments created inside the last hour. If you need fuller customer or shipping detail for an order, use Shopify Get Order.

For each new fulfillment, read the carrier name, the tracking number and the tracking URL. Skip the fulfillment if there is no tracking number yet. That happens when a fulfillment is created before the label is bought, and it will be picked up on a later run once tracking is attached. Prefer the tracking URL Shopify supplies. If there is no URL, send the carrier name and tracking number on their own.

Find the customer's phone number, checking the order phone, then the shipping address phone, then the saved customer record phone. Normalise it to full international format with no plus sign, spaces, dashes or brackets, for example 15551234567. If the number is in a local national format, use the shipping address country to work out the correct country code. Skip the order if there is no usable phone number anywhere.

Send the notification with WhatsApp Send Message as a template message. This is a business-initiated message, so it must use a template that has already been approved in the WhatsApp Business account rather than free text, since the 24-hour customer service window will normally be closed. Pass the order number, the carrier and the tracking link as the template variables, in the order the template defines them.

A given fulfillment must only ever be messaged once. Use the fulfillment ID as the key, and only message fulfillments whose created timestamp falls inside the current hour window. If a run is retried, or if windows overlap, do not resend for a fulfillment that was already covered. When an order ships in several packages, treat each fulfillment separately and make clear which package the tracking refers to.

Finish with Slack Bot Send a Message to the ops channel summarising the run: how many shipping notifications went out, and how many orders were skipped, broken down by reason (no phone number, no tracking number yet, or the WhatsApp send failed). List the skipped order numbers so someone can follow them up.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them