Wiki · NetSuite expansion

NS assembly build flow

Ten beats from "build request" to "spec sheet refresh + cost recalc". Pillar 4 cost rollup, HITL gate at $5K or 8% drift, and one STUB (labor capacity calendar) that's been on the punch list since R49.

Mixed · 9 real, 1 STUB
What this is

The Pillar 4 build — cost, capacity, consumption

The NS assembly build flow is the operational sibling of the work order lifecycle. Where the WO lifecycle tracks what NS records, the assembly build flow tracks what the platform decides before NS records anything — BOM resolution, cost rollup against current vendor costs, capacity check, and HITL authorization when the cost surface is about to move significantly.

It runs every time a build request hits the system — from an operator, a WO, or a sales-driven backorder. The first six steps happen before NS posts a build; the last four are the consumption + creation + refresh tail.

Diagram: ns-assembly-build-flow.html. One STUB: labor capacity check — there is no formal capacity calendar table yet, so the check is currently a hand-wave that returns true unless inventory is short.

When to use it

Trigger conditions

HITL thresholds

Authorization fires if rollup cost > $5K OR drift_pct_vs_prior > 8%. Either condition stages a row in proposed_actions — risk_level 3, action_type='assembly_build_review'.

Worked example

Build 200 cases of Melt Mates — cheese cost moved

Scenario

Wednesday. NYC DOE bid B5875 requires 200 cases of MM-CHEESE-MELT-22 by Friday. SO posts; allocation can't satisfy from FG; build request opens. BOM resolves: cheddar (Bongards), bread (PUB house), butter, seasoning. assembly_cost_rollup recomputes: cheese ran +9.1% WoW (CME trailing-week formula caught the spike). Total cost moves from $14.42 to $15.71 — 8.9% drift, over threshold.

HITL fires. Mike sees the card at 11:04 — with the Bongards CME table, the 35% moisture adjustment, and the drift_pct sparkline embedded. He approves at 11:07 (knows it's real; Bongards moved this week). Capacity check: STUB — returns ok unless inventory short. Components debit; the floor builds 200 cases; NS posts the build at 16:30. Assembly created; cost recalc anchors the new $15.71 number on the cost surface. Spec sheet didn't need refresh — pack and allergens unchanged.

Step-by-step what happens

The ten beats

  1. 01

    Build request — manual, WO, or SO-driven

    An operator, an open work order, or a customer order requiring assembled stock fires a build request. The source is recorded for downstream tracing.

    Source operator / WO / SO
  2. 02

    BOM resolution

    Pull assembly_bom rows for the assembly_id. Validate every line_key exists in items master, has a current cost, and has on-hand availability. Missing or zero-cost lines abort the request with an actionable error.

    Reads assembly_bom, items, inventory_balance
  3. 03

    Cost rollup — Pillar 4 logic

    Refresh assembly_cost_rollup by summing raw component cost, packaging, labor estimate, overhead allocation, and freight per pillar 4 cost-surface logic. Bongards, Cardinal, and Ace Endico items pick up their special formulas (CME trailing week, USDA drawdown, etc.).

    Writes assembly_cost_rollup
    Computes drift_pct_vs_prior
  4. 04

    Capacity check — STUB

    Confirm labor hours available and components in inventory. Components check is real (reads inventory_balance). STUB: labor capacity is not formally tracked — there's no capacity_calendar table, so the check returns true unless a hard inventory short forces a queue. This is acceptable today because we run a single shift, but it won't scale beyond two production lines.

    STUB labor capacity calendar
    Real inventory shortfall check
  5. 05

    HITL authorization — $5K or 8% gate

    If rollup_cost > $5,000 OR drift_pct_vs_prior > 0.08, a row is staged in proposed_actions with action_type='assembly_build_review', risk_level 3. Mike approves at /proposed-actions.html. Below threshold, the build proceeds without HITL.

    HITL risk_level 3
    Writes proposed_actions
  6. 06

    Component consumption — debit inventory

    Debit inventory_balance per BOM line for the build qty. NS posts a workorderissue (or inventoryadjustment for non-WO builds). D1 mirrors negative-qty rows in transaction_lines.

    Writes workorderissue, inventory_balance--
  7. 07

    Build operation — the physical build

    The floor produces the assembly. System-side this is the NS build transaction record that links consumption (step 6) to creation (step 8). The transaction id is the durable cross-reference.

    Writes NS build transaction
  8. 08

    Assembly created — credit inventory

    Credit inventory_balance for the assembly item at the production location. The assembly is now allocatable for the triggering SO or for general sale.

    Writes inventory_balance++
  9. 09

    Spec sheet refresh — if claims changed

    If claims, allergens, or pack format changed in the BOM since the last spec render, regenerate via the spec-sheet-pipeline workflow. Otherwise skip. Driven by a content hash on the BOM spec-relevant fields.

    Conditional hash-changed only
    Writes R2 spec-sheets/
  10. 10

    Cost recalc — final actuals

    assembly_cost_rollup re-runs with the final actuals from steps 6 & 8. drift_pct_vs_prior surfaces on the item entity page and the admin-dashboard cost-surface tile. The new value becomes the baseline for the next build.

    Writes assembly_cost_rollup
    Surfaces /item/<code>, admin-dashboard
Outcomes

What's different after the build

Assembly
Available
SO-allocatable
Cost surface
Anchored
final actuals
Spec sheet
Current
if hash changed
HITL gate
Cleared
if >$5K or 8% drift
Failure modes

What can go wrong

Labor capacity STUB — over-commit risk

With no capacity calendar, two parallel build requests can claim the same labor hours. Today we mitigate by running a single shift with one production scheduler (Susan). Detection: WOs that miss promised dates. Long-term fix: capacity_calendar table + per-line shift inventory.

BOM line missing in items master

Resolution aborts. The build request returns an error naming the missing line_key. Recovery: create the item in NS, wait for hot-tier mirror, retry.

Cost rollup uses stale vendor cost

If vendor_cost_update workflow hasn't run since the last vendor invoice, rollup carries old number. Detection: drift_pct_vs_prior unexpectedly low when invoices show a change. Recovery: trigger vendor_cost_update for the affected vendor.

HITL deferred past production window

Mike doesn't approve the build_review in time; production blocks. The decide endpoint emits hitl.deferred; the operator can fall back to manual NS build but loses the cost rollup audit trail.

Related

Adjacent flows + diagrams

For developers

Code paths + invariants

ConcernWhere
BOM sourceassembly_bom (D1 mirror)
Cost rollupassembly_cost_rollup (Pillar 4)
HITL workflowworkflow_type='assembly_build_review'
Drift thresholdguardrails.assembly_drift_threshold (default 0.08)
Cost thresholdguardrails.assembly_cost_threshold (default $5,000)
Spec sheet regenspec_review_queue, content_hash trigger
Drift surface/item/<code> (Pages Function), admin-dashboard
STUB — capacityno capacity_calendar table; check returns true
// HITL gate (simplified) if (rollup_cost > 5000 || drift_pct_vs_prior > 0.08) { stageProposedAction({ action_type: 'assembly_build_review', risk_level: 3, payload: { rollup_cost, drift_pct_vs_prior, bom_snapshot } }); }