π Aggregate shipment tracking statuses with FedEx, UPS and DHL
β‘ 89 views Β· π File Management
Description
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_trackingand filters out shipments already marked as DELIVERED or RETURNED_TO_SENDER. - Routes each remaining shipment by
carrierand 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_trackingData Table usingtrackingNumberas the match key.
Setup
- Create the n8n Data Table named
shipment_trackingwith columns such astrackingNumber,carrier,canonicalStatus,rawStatus,breakerState,httpStatus, andcheckedAt, 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.
π Nodes Used
HTTP Request, Schedule Trigger, Filter, Data table
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File