Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

FDE Academy  /  Case study: logistics
Case StudyAuthored, synthetic engagement~20 min readUpdated Nov 2026Case Study 3 of 5 · Logistics

The control tower that started as a shared inbox

Ridgeway Freight, a fictional third-party logistics provider, asks for an AI control tower that predicts every late shipment. Twelve weeks later it has something less glamorous that works: carrier signals turned into confirmed actions on a shift lead’s tablet in under an hour. The dominant challenge is not the model: it is 211 carrier codes for 140 carriers, an ERP that only takes batches, a replay storm that broke the first idempotency key, and a night shift that never looks at a screen.

01

The customer, the ask, and how to read this page

One of five worked cases, each in a different industry with a different dominant problem. This one is about plumbing, and about people standing on a loading dock.

→ Authored, synthetic engagement

This is an authored, synthetic engagement. The customer, the people and every number are invented for teaching and are internally consistent; none comes from a real customer, and every figure on this page is illustrative unless a source is named next to it. Regulatory facts are real and are stated as rules, not as outcomes.

The ask, as received

“Our customers find out about late shipments before we do. We want an AI control tower: something that watches every load and predicts which ones will be late. Peak season is ten weeks out.” — Ridgeway’s COO, at kickoff.

Ridgeway (illustrative) runs six distribution centres and ships about 4,200 outbound loads a week for retail and industrial clients, using roughly 140 carriers. Thirty-eight of them exchange EDI; the rest send status by email, by carrier portal, or by phone call to a customer service rep. About 9% of loads hit an exception — a late or missed pickup, a short shipment, a missed delivery appointment, a refusal — which is around 380 exceptions a week.

Terms used below. X12 is the North American EDI standard; each document is a numbered transaction set: 204 load tender, 990 the carrier’s accept or decline, 214 shipment status, 210 freight invoice, 856 advance ship notice. A 997 functional acknowledgment confirms a group of documents arrived and parsed — not that anyone agreed with them. Documents travel over AS2 (signed, encrypted HTTP with receipts) or a VAN (value-added network mailboxes), wrapped in envelopes with control numbers.

123456789101112Discovery + dock ride-alongsCarrier alias clean-upEDI event layerEmail classifier + golden setShadow at two DCsVAN replay incidentAssisted pilotMeasurementHandoffWeek of the engagement
Data clean-up runs from week 2 to week 5 and gates everything after it. The replay incident lands on the first day of the assisted pilot.
02

Discovery: who was in the room, and what they actually needed

Ten interviews, four shifts on the dock, and a time study of 200 exceptions. Nobody on the floor asked for a prediction.

Person / roleGoalPainInfluence
COOStop customers hearing bad news firstTwo large clients cited late notification in quarterly reviewsSponsor; owns budget
Customer service leadFewer angry callsSeven reps triage a shared inbox of carrier email by handChampion; owns the inbox
DC shift leads (day)Know about a missed pickup before the trailer door is reassignedHear about problems by radio, hours lateDecide whether anything changes on the dock
DC shift leads (night)Get through the shiftOne lead covers two buildings; no desk, no mounted screenInformal veto, exercised by ignoring things
EDI analysts (2)Stop being paged for partner mapping errorsEvery carrier implements the 214 slightly differentlyOwn the translator and, later, the system
ERP ownerNo customisation that breaks the next upgradeA past integration wrote directly to tables and corrupted a quarter-endHard gate on how anything writes to the ERP
Union steward, DC-NorthNo new surveillance of warehouse workersA previous scanner rollout was used for disciplineCan stall a rollout on the floor

Where the 5.5 hours go (time study, 200 exceptions)

Stage between carrier signal and warehouse actionShare of elapsed time
Signal sitting unread in the shared inbox or the portal52%
Working out which load the message is about23%
Telling the right DC (phone, then radio)14%
Re-keying status into the ERP11%

Illustrative baseline: median 330 minutes from carrier signal to warehouse action; in 31% of exceptions the client called Ridgeway before Ridgeway called the client; 8% of inbox messages were first matched to the wrong load and corrected later.

What they asked for versus what they needed

  • Asked: prediction. Found: the carrier usually already said the load would be late; the signal sat unread for half the elapsed time.
  • Asked: AI everywhere. Found: 56% of signals are structured 214s a rule reads exactly; only the 44% in free text needs a model.
  • Assumed: the carrier list is clean. Found: 211 carrier codes in the ERP for 140 real carriers. One national carrier appeared under three codes, including a retired SCAC (Standard Carrier Alpha Code) from before an acquisition.
→ The discovery move that mattered

The FDE asked for every carrier email from one Tuesday, unedited: 214 of them. Reading them in one sitting showed the real distribution — reply chains, three loads in one message, Spanish notes from a cross-border carrier — and they became the seed of the golden set.

03

The scoped first delivery

End of week 2. The COO signed it after one question: “If we knew about every exception within the hour, would you still need a prediction this quarter?”

Charter — Ridgeway exception desk

Problem. Carrier exception signals take a median 330 minutes to reach a warehouse action, mostly because they sit unread and must be matched to a load by hand; clients call first in 31% of exceptions.

First delivery. At DC-North and DC-South, every carrier signal — 214, email or portal note — becomes a typed exception matched to one ERP load with a playbook action for the shift lead to confirm; confirmed actions write through the ERP’s batch interface.

Success. Median signal-to-action ≤60 minutes for signals through the system; client-called-first ≤15%; measured with the week-2 method in weeks 10–11.

Guardrails. No ERP write without a lead’s confirmation. Wrong-load matches at or under 0.5% of messages. No status in the ERP ever moves backwards. No per-worker performance data collected.

In scopeOut of scope, with the reason
Rules over 214 status codes for the 38 EDI carriersLate-load prediction. Revisit after peak: the existing signals were not being read, so prediction would add a second unread signal
LLM classification and reference extraction for free-text email and portal notesAutomatic carrier rebooking. Rates and relationships live with the carrier desk
Carrier alias table: 211 codes collapsed to 140 carriers210 freight invoice audit. Real money, different owner, next engagement
Lead confirmation on a tablet, writes via the ERP batch APIAny ERP customisation or table write. The ERP owner’s veto, and the upgrade path
→ How the “control tower” conversation went

Prediction was not called a bad idea; the argument was ordering. If nobody reads the carrier’s own late notice for five hours, nobody will read a prediction either. Prediction went in the charter as phase 2, dated after peak, with the week-11 numbers as its entry ticket.

04

Architecture: an event layer beside a legacy core

Weeks 3–7. Two constraints decided most of the design: the ERP may not be modified, and every carrier message may arrive twice, late, or out of order.

As found: 38 carriers send 214s through a VAN mailbox or AS2, in bursts, and a VAN holds messages during an outage, so arrival order is not event order. An existing EDI translator parses X12 and sends 997s; it is reused, not replaced. The ERP takes status updates through a SOAP service in batches every 15 minutes, up to 500 rows (illustrative). The shared inbox is free text with PRO numbers, bills of lading and client POs mixed together: the only place a language model earns its keep.

Options considered

OptionForAgainstVerdict
A. Replace the VAN with direct carrier APIsFresher data, modern formats140 carriers, a few with APIs; would take years, not weeksRejected
B. Custom module inside the ERPOne system of recordThe ERP owner’s veto; breaks on upgrade; quarterly change windowRejected
C. Event layer beside the ERP: consume the translator’s output and the inbox, keep canonical events, write back only through the batch APINo ERP change; reuses EDI investment; every write is replayableA second store to operate; the 15-minute batch is a floor on latencyChosen

Data flow

  1. Normaliser maps each message to a canonical event: carrier (via the alias table), load reference, status, reason, event time, location. Unknown codes go to review, never to a guess.
  2. Event store applies two layers of deduplication and a state machine (detailed in section 06 after the incident rewrote it) so that a load’s current state only moves forward.
  3. Exception engine. Deterministic rules over structured status (for example, arrived at pickup with no departure within the appointment window). For free text, the LLM returns an exception type from a fixed list plus the references it found; a deterministic matcher then looks those references up in the ERP. If they do not resolve to exactly one open load, the message goes to a rep as “unmatched”.
  4. Lead tablet. Exception, source text and a playbook action (re-tender, hold the door, notify the client); confirming writes to the ERP batch.
VAN + inbox214s via AS2/VAN; carrieremails, portalTranslatorexisting EDItranslator;sends 997sNormalisercanonical event;SCAC aliastableEvent storetwo-layer dedupe;event-timestate machineException engine214 rules +LLM for freetext onlyLead tabletshift leadconfirms everyactionIntegration layer built in the engagement; the ERP is never modified, only written through its batch APIAlias tablecarrier relationsERP SOAP batchevery 15 min, 500 rows max
The dashed boundary is the only code the engagement added. The model sits inside the exception engine and reads free text only; it never chooses which load a message belongs to.

Threats and mitigations

ThreatMitigation
Model attaches a message to the wrong loadModel extracts references; a lookup matches; ambiguity goes to a human
Duplicate or replayed messagesIdempotency on the envelope. Written in week 4 as sufficient. See section 05.
System becomes a worker-monitoring toolConfirmations logged by role and shift; written agreement with HR and the steward: no per-worker metric
Try it

Break an integration on purpose

The reliability lab replays duplicates, timeouts and out-of-order deliveries against your design.

05

The hard moment: a week of 214s, replayed out of order

Week 8, Monday, six weeks before peak. A national carrier’s VAN connection had been down since Friday evening. When it came back, the carrier re-sent everything.

WhenWhat happened
Mon 04:10The carrier’s VAN link reconnects. Its operations team, unsure what had been delivered, re-sends seven days of 214s, each re-wrapped in a new envelope with a new interchange control number.
04:5018,400 messages received in 40 minutes; a normal Monday brings about 2,600 all day. Of the 18,400, about 6,100 are genuinely new (held during the outage) and 12,300 are re-sends of events already processed.
05:30The envelope-level dedupe sees new control numbers and lets the re-sends through. Older “arrived at pickup” events are applied after “delivered”. ERP batch 1 sends 480 status rows; 312 of them move a delivered load back to “at pickup”. Clients’ tracking pages now show delivered freight as not yet collected.
06:00Day shift starts at DC-North. 212 “missed pickup” exceptions sit on the lead’s tablet, because the regressed loads now look stuck at the dock. The lead radios the ops manager: “the AI is broken, I’m ignoring it.”
06:08Exception-rate alert (over three times normal) pages the FDE.
06:15FDE pauses the ERP write adapter (batches queue, nothing is lost) and sets the exception engine to shadow for that one carrier. Other carriers and the email path continue.
06:40Cause: dedupe keyed on the envelope, and the state machine trusted newer-arriving over newer-happening.
07:30A reconciliation query restores the 312 regressed loads via a correction batch; customer service notes the two affected clients.
09:00Fix deployed to staging and the quarantined 18,400 replayed in event-time order: 0 regressions, 6 real exceptions found among the genuinely new events.
11:30Production replay complete; the carrier’s exceptions back on. Carrier relations asks the carrier to notify Ridgeway before any future bulk re-send.

Three problems at once: the ERP clients see was wrong about their freight, 212 false exceptions could have got a door reassigned, and a new user had just told an open radio channel he was ignoring the tool.

06

How it was handled

The fix took two hours. The four design changes behind it are the part worth repeating in an interview.

  1. Stop the writes, keep the data. Pausing the ERP adapter protected the system of record while messages kept landing in the event store. Switching everything off would have blinded the other 37 EDI carriers too.
  2. Dedupe on two identities, not one. The envelope key, (trading partner, interchange control number), still catches exact retransmissions and tracks 997s. A second key, (trading partner, load reference, status code, event time), identifies the business event; a re-wrapped copy of an event already seen is recorded as a duplicate and does nothing.
  3. Order by when it happened, not when it arrived. A forward-only state machine: older events go to history and never overwrite a later state, and the ERP writer only sends forward transitions, so “status never moves backwards” is a property of the code.
  4. Treat bulk replays as a mode. Over five times a partner’s normal hourly volume quarantines that feed; quarantined messages replay in event-time order, and events older than six hours raise no dock exception — they go to a reconciliation report, because nobody can act on Thursday’s pickup.

The FDE went to DC-North at 13:00, before the afternoon shift, and showed the day lead the 212 false exceptions next to the replay graph. The system had believed old news; nothing older than six hours would reach the tablet again. Then the FDE asked what else would make the lead ignore it. His answer (“when it tells me about loads in the other building”) became a per-building filter the same week.

→ The lesson that generalises

An idempotency key is a claim about what counts as the same thing. The envelope is the transport’s idea of sameness; the business event is the customer’s. In any integration fed by retries, queues or third parties, write both down and ask which one a replay will change.

07

What was measured, and its honest limits

Two evaluations: a golden set that gates the free-text path, and a pilot measured with the week-2 method. The structured path is tested by replaying real traffic, not scored by a model.

Golden set for free-text messages

600 carrier emails and portal notes, seeded from that Tuesday, labelled by two reps with their lead as tie-break. Two outcomes are kept apart:

  • Wrong-load match: the message is attached to a load it is not about. Someone may hold a door, re-tender or call a client about the wrong freight. Gate: ≤0.5% overall, ≤2% on any slice.
  • Unmatched: references do not resolve to exactly one open load, so a rep matches it by hand. This costs minutes, not mistakes. Tracked, with a target to reduce.
SliceMessagesException type correctWrong-load matchUnmatched (to a rep)
Template emails, large carriers220214 (97.3%)06 (2.7%)
Free text, small carriers160142 (88.8%)1 (0.6%)19 (11.9%)
Forwarded reply threads9074 (82.2%)1 (1.1%)14 (15.6%)
Multi-shipment emails6047 (78.3%)1 (1.7%)12 (20.0%)
Spanish notes, cross-border4035 (87.5%)05 (12.5%)
Portal note snippets3027 (90.0%)02 (6.7%)
Total600539 (89.8%)3 (0.5%)58 (9.7%)
Template emails2.7%Portal snippets6.7%Free text, small carrier11.9%Spanish notes12.5%Forwarded threads15.6%Multi-shipment emails20%
Share of messages routed to a rep because their references did not resolve to exactly one open load. Multi-shipment emails are the worst slice and the next thing to fix: split the message per reference before matching.

All three wrong-load matches hit a closed load from another client with the same PRO number; the matcher now considers only the sending carrier’s open loads. The structured path was tested by replaying two weeks of production 214s plus the incident’s 18,400 messages through staging after every change: zero backward transitions is a release condition.

Pilot outcome (weeks 10–11, DC-North and DC-South, illustrative)

MeasureBaseline (wk 2)TargetThrough the system
Median signal-to-action330 min≤60 min48 min
Client called first31%≤15%12%
Inbox messages matched to the wrong load8%≤0.5%0.4% (sampled)
Confirmations on the tablet, day shift——92%
Confirmations on the tablet, night shift——41%, then 74% by week 12

The night-shift number

Night shift at 41% was not resistance to AI. One lead covered two buildings on foot with a radio; the tablet lived in an office she passed twice a shift. A rugged tablet at each shipping office door and an hourly three-line digest read out on the radio moved it to 74%.

Run cost: roughly 1,100 free-text messages a week at the two DCs, at about a cent each, is around $11 a week, illustrative. In this case the model is the cheapest component; the integration and the clean-up are the cost.

The limits, stated before anyone asked

  • Pre-peak traffic. Weeks 10–11 ran at normal volume. Peak behaviour, when carriers are late in bulk, is unmeasured.
  • Signal-to-action uses the lead’s tap as “action”. A lead may act on the radio and tap later, or tap and act later. The number is consistent with the baseline method, not a stopwatch.
  • Phone-in exceptions (about one in ten) are outside the system.
08

Handoff

Week 12. Ridgeway’s two EDI analysts own the system; the FDE leaves before peak, deliberately.

  • Owner: the senior EDI analyst. Alias table owner: carrier relations — a new carrier code is a commercial fact, not an engineering one.
  • Partner replay runbook: confirm quarantine; ask the carrier what it re-sent; replay in event-time order on staging (zero backward transitions); replay to production; send the reconciliation report.
  • Gate: any change runs the golden set and the 14-day replay; it fails on wrong-load above 0.5% (2% per slice) or any backward transition.
  • Controls: ERP write pause, per-carrier shadow, email-path off; each rehearsed by the analyst.
  • Open items with owners: multi-shipment splitting (EDI analysts), the four remaining DCs (ops), phone-in exceptions (customer service), phase 2 prediction (COO, after peak).

The handoff drill seeded 2,000 duplicated 214s; the analyst replayed them cleanly in 22 minutes and found one gap — telling a replay from a real spike of delays — now covered by a rule of thumb (mostly events older than six hours means replay) and its query.

09

What an interviewer would probe

Logistics stories invite deep questions on integration mechanics. Have the mechanics ready.

ProbeWeak answerStrong answer
“They asked for prediction. Why didn’t you build it?”“There wasn’t enough data.”The carrier already said the load was late; we read it five hours later. I fixed that first and dated prediction for after peak.
“What was your idempotency key?”“The message ID.”Two: the envelope (partner, interchange control number) for exact retransmits, and the business event (partner, load, status, event time) for re-wrapped copies. The first version only had the envelope, which is why the incident happened.
“Why not let the LLM pick the load?”“It’s accurate enough.”The model extracts references; a lookup decides. Matching to the wrong load is the harmful error, so it belongs to deterministic code with a human fallback.
“Night shift used it 41% of the time. Whose fault?”“They needed more training.”Mine: I designed for a desk. A mounted tablet and a radio digest got it to 74%.
10

Use this in your interview

Two shapes: a behavioural story and a decomposition answer. Both should leave room for the interviewer to dig into the integration.

As a behavioural story (“Tell me about a production issue you owned”)

Situation, task, action, result, reflection

Situation. A 3PL, six weeks before peak; I had built an event layer turning carrier EDI and email into exceptions for warehouse leads. A carrier came back from a VAN outage and re-sent a week of status messages, re-enveloped and out of order.

Task. Stop delivered loads showing as not collected in the ERP and on clients’ portals, clear 212 false exceptions, and keep the other 37 EDI carriers flowing.

Action. Paused ERP writes and shadowed that one carrier in seven minutes. Found that my dedupe keyed on the envelope, not the business event, and my state machine trusted arrival order. Restored 312 regressed loads with a correction batch, added an event-level key and forward-only state, quarantined and replayed in event-time order. Went to the dock that afternoon to explain it to the lead who had said “I’m ignoring it” on the radio.

Result. Clean replay with zero regressions by 11:30; the lead kept using it; the pilot hit its targets (illustrative: 330 to 48 minutes signal-to-action).

Reflection. An idempotency key is a definition of sameness. I now ask what each partner does after an outage before I choose one.

As a decomposition answer (“Design exception handling for a 3PL with 140 carriers”)

  1. Find where the time goes. Propose a time study from carrier signal to warehouse action; hypothesise the signal exists but sits unread.
  2. Split structured from unstructured. Rules for 214 status codes; a model only for free text.
  3. Fix master data first. Carrier aliases and SCACs; unknown codes stop at review.
  4. Design for replay. Envelope and business-event keys; event-time ordering; forward-only state; quarantine on volume spikes.
  5. Keep the harmful decision deterministic. The model extracts references; a lookup matches; ambiguity goes to a person.
  6. Design for the floor. Who stands where, on which shift, with what device; radio before dashboard.

Common mistakes when candidates tell a logistics story

  • One idempotency key. Interviewers will ask what happens on a re-enveloped replay.
  • Accuracy without the harmful error. “90% classification” says nothing about wrong-load matches.
  • Blaming adoption on users. Low use on one shift is a design finding about that shift.
Practise

Rehearse the loop

Run the decomposition outline in the simulator, map the story onto the behavioural bank, then do the take-home spec closest to this case under its time box.

11

Pattern recognition across the five cases

The same FDE moves recur in every industry; the dominant risk changes. Compare this one with the insurance case, which met a smaller cousin of the same idempotency bug.

CaseFictional customerDominant FDE challenge
InsuranceNorthstar MutualScope down a vague “agent” ask; idempotent ingest; honest ROI
Healthcare (payer)Cedarline Health PlanPHI boundaries, BAAs, clinician trust, edge-case evals
Banking (AML)Harborview BankModel risk management, auditability, false-negative cost, in-VPC
Logistics (this page)Ridgeway FreightEDI and legacy APIs, messy data, idempotency, warehouse adoption
Retail supportLumen & LoomAgent tool use, escalation, cost per conversation, honest deflection
Public sectorFederal benefits officeProcurement, Section 508, data residency, change management

Specific to logistics: third parties you do not control send the same fact many times in different envelopes, the system of record cannot be touched, and the users are on their feet, across several shifts.

12

Check yourself

Five questions. Open one to see the answer.

A carrier re-sends a week of 214s, each in a new envelope. Why did the first dedupe miss them?
  1. The translator rejected them
  2. It keyed on (partner, interchange control number), and every re-sent copy had a new control number
  3. The 997s failed
  4. The ERP batch was full

Answer: B. The envelope identity changed while the business event did not; the fix added a key on (partner, load, status, event time).

What does an X12 997 functional acknowledgment tell you?
  1. The partner accepted the business content
  2. The functional group was received and parsed
  3. The load was delivered
  4. The invoice is approved

Answer: B. A 997 reports receipt and syntax; business validity still has to be checked downstream.

Why does the LLM extract references but not choose the load?
  1. LLMs cannot read PRO numbers
  2. A wrong-load match is the harmful error, so a deterministic lookup decides and ambiguity goes to a person
  3. It is cheaper
  4. The ERP forbids it

Answer: B. The model handles the language; the matching that can cause harm stays deterministic and auditable.

How does the system guarantee that an ERP status never moves backwards?
  1. By trusting arrival order
  2. A forward-only state machine ordered by event time; older events go to history, and the writer only sends forward transitions
  3. By manual review of every write
  4. By deleting old messages

Answer: B. Making it a property of the code means a replay cannot regress a load.

Night-shift confirmations were 41%. What moved them to 74%?
  1. A mandate from the COO
  2. Fitting the radio culture: a mounted tablet at the office door and an hourly radio digest
  3. A better model
  4. Removing the confirmation step

Answer: B. One lead covered two buildings on foot; the design met her where she already listened.

Quick answers

Is Ridgeway Freight a real company?

No. This is an authored, synthetic engagement. The customer, people and numbers are invented and reconciled with each other; the X12 transaction sets (204, 990, 214, 210, 856, 997), AS2 and VAN behaviours described are real conventions.

How do you make EDI 214 processing idempotent?

Use two identities. The envelope key, such as trading partner plus interchange control number, catches exact retransmissions. A business-event key, such as partner, load reference, status code and event time, catches the same event re-sent in a new envelope. Then order by event time and only allow forward state transitions, so a late or replayed message cannot regress a load.

Where does an LLM help in logistics exception handling?

On free text: carrier emails, portal notes and reply threads. Structured status messages suit rules, and attaching a message to a specific load is safer as a deterministic lookup with a human fallback.

What is the hardest part of an FDE engagement in logistics?

Usually not the model: duplicate carrier codes, partners that resend data in new envelopes and out of order, a core ERP you may not change, and warehouse users who work by radio rather than at a desk.

FDE Case Study: Logistics · part of the FDE career track · Vibe Engines · 2026
Finished this one? 0 / 223 Handbooks done
NextFDE Case Study: The Support Agent Whose Deflection Rate Lied Next on the “Six engagements, six industries” ladder · rung 5 of 6

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Handbooks