NetSuite work order lifecycle

From WO intake to finished goods · 9 phases · BOM consumption · labor capture · variance audit

Work orders authorize production of an assembly. Mike's expanding NS usage to track every assembly run end-to-end so actual cost, labor, and yield variance roll back into assembly_cost_rollup and feed pricing decisions. This diagram traces a WO from intake (manual or low-inventory trigger) through component pull, labor capture, build complete, WO close, and variance audit, terminating in finished goods on the shelf.

D1-mirrored from NS HITL on variance > threshold labor capture STUB

Pipeline — 9 phases, left to right

idle
NS work order lifecycle — WO intake → component pull → production start → labor capture → component issue → build complete → WO close → variance audit → finished goods 01 / Intake 02 / Pull 03 / Start 04 / Labor 05 / Issue 06 / Build 07 / Close 08 / Variance 09 / FG WO INTAKE — Work order created in NetSuite, either manually by production lead or auto-generated when an assembly's quantityavailable drops below reorder_point. TRIGGER manual: NS UI · production lead enters qty + due date auto: low_inventory event → propose_work_order action_type TARGET ns_record: workorder d1_table: transactions (type=WorkOrd) status: REAL WO intake manual or auto FRONTEND · workorder i COMPONENT PULL — Resolve the assembly's BOM, check inventory_balance for each component, and reserve the required quantity per location. ACTION lookup: assembly_bom WHERE assembly_id = ? check: inventory_balance.quantityavailable per line_key reserve: write reservation row TABLES read: assembly_bom · inventory_balance write: inventory_balance.reserved_qty STATUS d1_mirror: REAL ns_reservation_write: STUB component pull BOM lookup inventory_balance reservation DATABASE · D1 i PRODUCTION START — Work order status transitions to 'In Progress' with start_timestamp recorded. NS workorder record marked released; D1 transactions row updated. ACTION status: 'In Progress' start_ts: now() TABLES write: transactions (WO row) ENDPOINT push: POST /api/ns/workorder/release (via NS_PUSH_QUEUE) STATUS: REAL production start status='In Progress' start_ts captured BACKEND · workorder release i LABOR CAPTURE — Time entries booked against the WO. Hours roll up into actual_labor_cost on completion. Currently STUB — no time-entry surface yet; manual NS entry only. ACTION entry_per_employee_per_phase hours · rate · cost_per_entry TABLES write: transactions (type=TimeBill) · linked to WO STATUS ns_native: REAL (manual) auto_capture: STUB · no scanner/kiosk yet labor capture time entries vs WO hours × rate CAPTURE · STUB autoflow i COMPONENT ISSUE — Components consumed from inventory; inventory_balance decrements per BOM line for the WO. NS posts a workorderissue transaction; D1 mirrors with negative qty rows. ACTION decrement: inventory_balance per BOM line ns_record: workorderissue TABLES write: inventory_balance · transactions (WkOrdIss) STATUS: REAL component issue debit inventory workorderissue posted DATABASE · -qty per line i BUILD COMPLETE — Assembly produced; finished goods qty added to inventory_balance at the production location. NS posts a 'build' transaction; D1 mirrors with +qty for the assembly item. ACTION increment: inventory_balance (assembly_id) ns_record: build (assemblybuild) TABLES write: inventory_balance · transactions (Build) STATUS: REAL build complete credit FG inventory build txn posted BACKEND · +qty assembly i WO CLOSE — Status flips to 'Built'. NS rolls actual cost (components + labor + overhead) and compares to estimated cost on the BOM. Triggers workorderclose record. ACTION status: 'Built' actual_cost_rollup: sum(issues + timebills + overhead_alloc) delta_vs_estimated: computed TABLES write: transactions (WkOrdCls) STATUS: REAL WO close status='Built' actual cost rollup BACKEND · workorderclose i VARIANCE AUDIT — If |actual − estimated| / estimated > threshold (default 5%), proposed_action staged for review. Mike sees the diff and decides whether to update the BOM or flag a production exception. THRESHOLD default: 5% of estimated cost HITL proposed_actions row · action_type='wo_variance_review' TABLES write: proposed_actions · reflexion_log STATUS: REAL · risk 3 variance audit |actual−est| / est > 5% → HITL staged proposal SECURITY · risk 3 i FINISHED GOODS — Assembly is available for sales. inventory_balance.quantityavailable reflects the new build. Sales orders for the SKU can now allocate. TABLES read: inventory_balance · assemblies SURFACES bid-command-center, item entity page, chat get_assembly_inventory STATUS: REAL finished goods available_qty++ SO allocatable DATABASE · D1 · NS sync i if variance approved → update BOM estimated cost LEGEND Frontend Database Backend HITL / risk Capture

Phase detail — 9 phases

01 WO intake REAL

Work order opens in NS, either as a human-authored production order or as the resolution of a low_inventory proposed_action.
NS record
workorder
D1 table
transactions (type='WorkOrd')
Auto trigger
inventory_balance.quantityavailable < reorder_point
Manual trigger
NS UI · production lead

02 Component pull D1 mirror REAL NS reservation STUB

Pull the assembly's BOM, look at on-hand quantity per location, reserve the qty. We mirror inventory positions in D1; native NS reservation is a follow-up.
Tables read
assembly_bom · inventory_balance
Tables write
inventory_balance.reserved_qty
Endpoint
GET /api/assemblies/{id}/bom

03 Production start REAL

WO transitions to In Progress. Start timestamp captured. NS workorder record marked released.
Tables write
transactions (WO row update)
Endpoint
POST /api/ns/workorder/release (via NS_PUSH_QUEUE)

04 Labor capture auto STUB

Time entries booked against the WO. NS natively supports this; we don't yet have an auto-capture surface (scanner / kiosk).
NS record
timebill linked to WO
D1 table
transactions (type='TimeBill')
STUB
no kiosk/scanner surface yet — manual NS entry

05 Component issue REAL

Components are formally consumed; inventory_balance decrements per BOM line for the WO.
NS record
workorderissue
D1 table
inventory_balance · transactions (WkOrdIss)

06 Build complete REAL

Assembly produced; finished goods qty credited to inventory at the production location.
NS record
assemblybuild (build)
D1 table
inventory_balance · transactions (Build)

07 WO close REAL

Status flips to Built. Actual cost rolls up and is compared to estimated cost on the BOM.
NS record
workorderclose
Rollup formula
sum(workorderissue.amount) + sum(timebill.amount) + overhead_alloc

08 Variance audit risk 3

If |actual − estimated| / estimated > 5%, a proposed_action is staged for Mike. He approves either a BOM update or a one-off exception note.
Threshold
5% (configurable via guardrails.wo_variance_pct)
HITL surface
/proposed-actions.html
Tables write
proposed_actions · reflexion_log
Feedback
approved BOM update flows back into assembly_bom.estimated_cost

09 Finished goods REAL

Assembly available for sales. Sales orders for the SKU can now allocate against this build.
Tables read
inventory_balance · assemblies
Surfaces
bid-command-center · item entity page · get_assembly_inventory chat tool

Tables, endpoints, code paths

kindnamepurpose
D1 tableassembliesmaster record per assembly_id · mirrors NS assemblyitem
D1 tableassembly_bomBOM lines per assembly · line_key, qty, uom, estimated_cost
D1 tableinventory_balanceon-hand · available · reserved · per item × location
D1 tabletransactionsWorkOrd, WkOrdIss, WkOrdCls, Build, TimeBill rows
D1 tableproposed_actionswo_variance_review rows when threshold breached
NS recordworkorderNetSuite system-of-record for the WO itself
NS recordworkorderissuecomponent consumption event
NS recordworkordercloseWO finalization · actual-vs-estimated roll
NS recordassemblybuildFG production event · credits inventory
EndpointPOST /api/ns/workorder/releaseflips status to In Progress via NS_PUSH_QUEUE
EndpointPOST /api/ns/workorder/closefinalizes WO; triggers variance audit
EndpointGET /api/assemblies/{id}/bomresolves current BOM with cost rollup
Code pathsrc/index.ts (sync engine)WO + WO line tables sync from NS every 5 min
Code pathsrc/lib/workflow_runner.tsvariance audit fires the proposed_action

Open gaps — honest punch list