Logistics Optimization Workflow: Carrier Selection and Shipment Tracking
Logistics optimization at the operational level means two things: choosing the right carrier and service for each shipment, and knowing about delays before customers do. The workflow rates every order across your carrier contracts, picks the cheapest service that meets the promised date, books it, then watches tracking events and uses an AI agent to draft customer updates and carrier claims when something slips.
Written by Max Zeshut
Founder at Agentmelt · Last updated Sep 11, 2026
The problem
Shipping decisions are made by habit — the same carrier for everything — and delays are discovered when the customer emails. Carrier invoices are paid without being checked against the quoted rate. Nobody knows the real cost per shipment by lane.
What changes when it runs
Each order is shipped on the cheapest service that meets its date, with the decision logged. Delays trigger a proactive customer message and a carrier claim where the SLA was missed. Carrier invoices are audited automatically against quotes, and the lane-cost dashboard shows where the money goes.
Trigger, then 8 steps
Trigger
Webhook (order ready to ship)
The WMS or e-commerce platform (Shopify, NetSuite, ShipStation) posts when a shipment is packed. A Schedule Trigger polls tracking every 30 minutes for in-flight shipments.
Receive the shipment
WebhookDestination, weight, dimensions, service promise (delivery date), declared value and any constraints (residential, hazmat, signature).
Rate across carriers
HTTP RequestRequests rates from each contracted carrier (UPS, FedEx, DHL, USPS, regional) directly or via EasyPost/Shippo, applying your negotiated discounts and accessorials.
Select the service
CodeFilters to services meeting the promise date with a buffer from measured on-time performance per lane, then picks the cheapest. Rules can force a carrier for certain customers or products.
Book and label
HTTP RequestPurchases the label, writes the tracking number and chosen service back to the order, and prints to the pack station.
Track in flight
Schedule TriggerPolls tracking for open shipments; each event is compared to the expected milestone times for that service and lane.
Detect and explain delays
AI AgentWhen a milestone is late or an exception code appears, the agent reads the tracking history and drafts a plain-language customer update and, if the carrier's SLA was missed, a claim request with the evidence.
Notify and escalate
GmailCustomer update sent from the support inbox (after a human click for high-value orders); internal alert to the logistics lead for exceptions.
Audit carrier invoices
Compare DatasetsWeekly: carrier invoice lines matched to booked shipments; differences above tolerance become dispute items with the quote attached.
Data it touches
- Orders and shipments (WMS / Shopify / NetSuite / ShipStation)
- Carrier rate APIs and contract discounts
- Tracking events per carrier
- Measured on-time performance by carrier, service and lane
- Carrier invoices (EDI, CSV or portal export)
Guardrails
- Customer messages for orders above a value threshold are approved by a person before sending.
- Carrier selection rules (customer or product overrides) always win over cost.
- Claims are drafted, not filed, until the logistics lead confirms.
- Every selection is logged with the alternatives and prices for later audit.
Carrier selection is a per-shipment decision
The cheapest carrier for a 2 kg parcel to a city is rarely the cheapest for a 15 kg parcel to a rural address, and the fastest service is often unnecessary when the promise date is five days out. Rating every shipment across contracts and picking the cheapest service that still meets the date — with a buffer based on how that carrier actually performs on that lane — is the whole game. Companies doing this for the first time typically find 8–15% of parcel spend was going to unnecessary service levels or the wrong carrier.
Proactive delay handling
Tracking data is public and constant; what nobody has time for is reading it. The workflow compares each event to the expected milestone for that service and flags the shipment the moment it falls behind — usually a day before the customer would notice. The agent turns the tracking history into a two-sentence update (“Your order left the Memphis hub late due to weather; new estimate Thursday”) and, where the carrier missed its own SLA, drafts the refund claim with the timestamps. Support tickets about “where is my order” drop because the answer arrived first.
Invoice audit
Carriers make billing mistakes in their own favour more often than in yours: wrong service, wrong weight, accessorials that do not apply, residential surcharges on commercial addresses. Matching every invoice line to the booked shipment and its quoted rate is tedious by hand and trivial for a workflow. Recovered overcharges usually pay for the subscription on their own.
Tools in the stack
| Tool | Role in this workflow |
|---|---|
| n8n | Rating, selection, tracking loop, invoice audit |
| EasyPost / Shippo / carrier APIs | Rates, labels, tracking |
| Claude | Delay explanations, customer updates, claim drafts |
| Gmail / Zendesk | Customer communication |
| Google Sheets / Postgres | Lane-cost and on-time data |
Want this running without building it?
Automation workflow
$247/month
We set up, host and maintain this workflow on n8n and connect it to your tools. Setup included, cancel monthly, you keep the JSON.
Custom build
$4,000–7,000 one-time
Your systems, your rules, your edge cases. A one-off build on Claude and n8n, delivered with documentation and a walkthrough.
Covers up to 3,000 shipments a month through one shipping API. Direct carrier integrations, LTL/freight rating or multi-warehouse routing are a custom build.
Frequently asked questions
Which carriers and platforms are supported?
Any carrier available through EasyPost or Shippo (UPS, FedEx, DHL, USPS and 100+ regional carriers) plus direct API integrations for carriers with your own contracts. Order sources: Shopify, WooCommerce, NetSuite, ShipStation, and any WMS with a webhook.
Does it handle freight (LTL/FTL)?
Parcel is the standard workflow. LTL and FTL rating through carrier or broker APIs is a custom build because the tender process differs.
Will customers get automated messages?
Yes for delays, drafted by the agent, sent automatically below a value threshold and after a human click above it. The tone and templates are yours.
The pillar
AI Supply Chain Agent
Optimize inventory, forecast demand, track shipments, and automate procurement with AI.