Slack alerts for every new Shopify order with map and drive time

Every 30 minutes, send your fulfillment team a Slack message for each new order with the customer's address, drive distance from your warehouse, and a route map.

Agentic Task
ShopifyMapboxSlack BotOperationsSalesNotifications & Alerts

Build an agent workflow on a cron schedule that runs every 30 minutes and sends my fulfillment team a Slack brief for each new Shopify order, including a route map from our warehouse to the customer.

On each run:

1) Pull recently created Shopify orders with the List Orders action, filtered to status=open and created since the previous successful run. Persist the latest processed order timestamp between runs so we don't re-process the same orders.

2) For each order, skip it if any fulfillment on the order already has a tracking number set. We only want to notify on orders the team has not started handling yet.

3) For each remaining order, read the shipping address and forward-geocode it with the Mapbox Forward Geocode (v6) action. If geocoding fails or returns no high-confidence match, still post the order to Slack with a note that the address could not be mapped, and skip the directions and map steps for that order.

4) Call the Mapbox Get Directions action with the driving-traffic profile, using the configured warehouse coordinates as the origin and the geocoded customer coordinates as the destination. Extract total driving distance and duration in traffic (ETA).

5) Render a Mapbox Get Static Map Image of the route. The agent should pick a zoom level that fits both the warehouse and the customer comfortably in the frame, place markers at both endpoints, and overlay the route geometry on top. The output is a PNG.

6) Post one fulfillment brief to Slack using the slackbot Send a Message action. The message should include: a one-line natural-language summary the agent writes (e.g. "Order #1234 going to Sarah in Austin, TX — about 245 miles, 4h 10m by truck"), the order number, customer name, full shipping address, drive distance (formatted in the configured unit), ETA in hours and minutes, and the static route map embedded inline as an image.

Inputs the workflow should ask for up front:

- Shopify store connection (read_orders scope is enough).

- Mapbox access token (a public pk. token is fine; needs geocoding, directions, and static images scopes, all on the default public scope set).

- Slack Bot connection and the channel ID to post fulfillment briefs to.

- Warehouse origin: either a street address (which we forward-geocode once at setup) or explicit latitude/longitude.

- Distance unit preference: miles or kilometers.

- Optional cap on max orders processed per run to keep Slack from getting flooded during big sale bursts.

Additional information

What does this prompt do?
  • Checks Shopify every 30 minutes for new orders and grabs each shipping address.
  • Pinpoints the customer on a map and calculates the driving distance and ETA from your warehouse.
  • Posts one Slack message per order with the customer, address, drive time, and a route map image.
  • Skips orders that already have a tracking number, so your team is never pinged twice on the same order.
What do I need to use this?
  • A Shopify store you can connect.
  • A Mapbox account (the free tier is plenty for most stores).
  • A Slack workspace and a channel for fulfillment notifications.
  • Your warehouse address or latitude and longitude.
How can I customize it?
  • Change how often it runs, from every 15 minutes to once a day.
  • Pick a different Slack channel, or post the brief to several channels at once.
  • Switch the routing profile from driving with traffic to plain driving, cycling, or walking.
  • Filter to specific order tags, fulfillment locations, or shipping countries.
  • Choose miles or kilometers for the distance shown in the message.

Frequently asked questions

Does this work for international orders?
Yes. Mapbox covers addresses worldwide, so the Slack message goes out even when the customer is in another country. The drive time may simply be longer.
Is the route map embedded inside the Slack message?
Yes. A static map image renders right inside the Slack post, with the warehouse and customer pinned and the driving route drawn between them.
What happens if an address can't be mapped?
The Slack brief still goes out with the order details, but it notes that the address could not be geocoded so your team knows to verify it before shipping.
How does it avoid re-notifying on orders the team already handled?
If a Shopify order already has a tracking number on its fulfillment, the workflow skips it. Only fresh, unhandled orders trigger a Slack post.
Can I change the warehouse location later?
Yes. You set the warehouse address or coordinates once, and they're used for every routing calculation. Update them any time.

Stop hunting through Shopify for every new order's address.

Connect Shopify, Mapbox, and Slack once, and Geni delivers a map, drive time, and customer brief to your fulfillment team every 30 minutes.