Wiki · NS logistics review flow R594

12-section R586 wiki · workflow contract: logistics_review_workflow · risk 2 · owner: logistics team

The operational doc for the logistics team. Runs after freight_routing_check flags a record needing freight planning. Team picks carrier, schedules pickup, generates BOL, captures tracking, confirms delivery.

01 · Hero

Logistics is the team that turns freight intent into actual shipments. They open this queue daily, work through pending reviews, pick carriers, schedule pickups, generate BOLs, capture tracking, handle issues. This workflow gives them a structured queue with everything they need to act — no re-reading the source SO/PO, no hunting for ship addresses, no guessing the freight class.

02 · What this is

A v2 workflow contract that fires when a record lands on the logistics review queue (output of freight_routing_check). 7 stages: review → carrier select → pickup schedule → BOL generate → tracking capture → verify +24h → verify +7d.

03 · When it fires

Triggered by freight_routing_check when its flag_for_logistics_review step lands a proposed_actions row. Once Mike (or logistics lead) approves the routing, this workflow advances through its 7 stages with HITL gates at carrier selection, pickup schedule, and BOL generation.

04 · Step-by-step

  1. Logistics team review — confirm classification, check address, item weights, special handling. Escalate if anything mis-classified.
  2. Select carrier — based on classification + lane history. HITL-approved.
  3. Schedule pickup — once freight is ready (IF/IR created or assembly built), write pickup datetime to NS.
  4. Generate BOL — PDF using GFS standard template. Includes customer PO# threading.
  5. Capture tracking + notify owner — tracking number stored on record, owner emailed, customer emailed if SO.
  6. Verify tracking active (+24h) — carrier API confirms picked up. Else escalate.
  7. Verify delivery confirmed (+7d) — POD captured to R2, freight_status=delivered, reflexion writes lane score.

05 · Outcomes

06 · Failure modes

ModeTriggerRecovery
Pickup missedverify +24h fails OR carrier no-showRe-schedule, log lane reliability penalty
Delay in transittracking no movement > 48hCarrier call, customer pre-notify, ETA update
Damage on deliveryPOD notes damageOpen carrier claim, document, replacement order
Refused deliveryCarrier returns shipmentInvestigate cause, hold inventory, escalate to sales
Lost shipmenttracking stuck > 7 daysFormal loss claim, ship replacement

07 · Related

UpstreamNS freight routing check (lands records here) Sibling wikiFreight routing check wiki SourceNS sales order master SourceNS purchase order master SystemSO+PO+WO integration view

08 · For developers

workflow_type: logistics_review_workflow
risk_level: 2
trigger: freight_routing_check.flag_for_logistics_review approval
inputs_required:
  source_record_id: number
  source_record_type: ['so', 'po']
  classification_from_check: ['LTL', 'FTL', 'parcel', 'dropship_vendor_freight', 'customer_pickup', 'freight_collect']
context_to_load:
  - full source record (SO or PO)
  - customer_or_vendor_address
  - prior_freight_history (same lane, last 90 days)
preconditions:
  - classification present
  - source record in correct status (IF created OR IR received)
fan_out_targets:
  - logistics_team_review (hitl_email_draft)
  - select_carrier (stage_proposed_action)
  - schedule_pickup (stage_proposed_action)
  - generate_BOL (stage_proposed_action)
  - capture_tracking (chat_tool)
  - notify_so_or_po_owner (hitl_email_draft)
  - update_freight_status (d1_write)
post_actions:
  - log_run
  - reflexion (updates lane_history scores)
  - event(logistics.shipment_scheduled)
  - event(logistics.shipment_delivered) on +7d verify pass
verify_checks:
  - tracking_active (+24h post pickup)
  - delivery_confirmed (+7d post pickup)

09 · Changelog

DateRoundChangeBy
2026-05-26R594Built initial logistics review workflow. Dashboard URL https://gfs-netsuite.pages.dev/logistics-review.html flagged TBD pending build.Mike + Claude

10 · Schema (PO# threading)

RecordFieldCarries
Logistics queue entrysource_po_or_otherrefnum (mirrored)From SO.otherrefnum or PO.memo
BOLshipper_ref= source_po_or_otherrefnum — customer sees their PO# on their end
Tracking rowtracking_number + carrierWritten back to source SO/PO as custbody_tracking_number TBD field name
PODpod_url (R2)Written back as custbody_pod_url TBD field name
Delivery eventevent_ledger.payload.po_or_otherrefnumTriggers Finance handoff with PO# context

11 · Runbook

Daily logistics flow:

1. Open https://gfs-netsuite.pages.dev/logistics-review.html (TBD URL)
2. Sort by pickup_scheduled (oldest first)
3. For each "pending review" row: confirm classification, click into source record, then stage carrier
4. For each "scheduled" row past pickup: verify tracking active
5. For each "in transit" past delivery ETA: verify POD or escalate

Manual issue escalation:

POST /api/workflow/run
{ "workflow_type": "logistics_review_workflow", "inputs": { "source_record_id": 12345, "issue_type": "delay" } }

12 · Backlog