Quick Overview
This workflow runs every 15 minutes to fetch active shipments from an n8n Data Table, query FedEx, UPS, or DHL tracking APIs with circuit-breaker protection, normalize each response into a shared status schema, and upsert the latest status back into the same table.
How it works
- Runs every 15 minutes on a schedule.
- Loads all rows from the n8n Data Table
shipment_tracking and filters out shipments already marked as DELIVERED or RETURNED_TO_SENDER.
- Routes each remaining shipment by
carrier and marks unsupported carriers with a canonicalStatus of UNKNOWN.
- For FedEx, UPS, and DHL shipments, checks a per-carrier circuit breaker and either calls the carrier’s tracking API or skips the call when the breaker is open.
- Normalizes each carrier response (or skip) into a canonical status (for example PRE_TRANSIT, IN_TRANSIT, OUT_FOR_DELIVERY, DELIVERED, EXCEPTION, UNKNOWN) while updating the breaker state based on 429/5xx/network failures.
- Merges all carrier results and upserts the latest fields back into the
shipment_tracking Data Table using trackingNumber as the match key.
Setup
- Create the n8n Data Table named
shipment_tracking with columns such as trackingNumber, carrier, canonicalStatus, rawStatus, breakerState, httpStatus, and checkedAt, and seed it with shipments (use lowercase carriers: fedex, ups, dhl).
- Add OAuth2 credentials for the FedEx Track API and select them in the FedEx HTTP request step.
- Add OAuth2 credentials for the UPS Track API and select them in the UPS HTTP request step.
- Add DHL API authentication (as configured for the DHL request in this template) and select it in the DHL HTTP request step.
- Activate the workflow so workflow static data persists between runs and the circuit breaker state is maintained.