Customer order arrives by email at orders@globalfoodsolutions.co or danielle@globalfoodsolutions.co. Team reviews against customer file, keys SO into NetSuite. SO branches by item type into 3 paths: PATH 1 inventory PATH 2 assembly (WO from SO) PATH 3 dropship (PO from SO). All paths converge at Item Fulfillment, which fires an ★ automation alert to Finance — the named handoff between Operations and Finance. Finance reviews → invoices → monitors terms → dunning if past due → payment apply → close. Path 3 sidecar: vendor bill cycle in parallel.
email_intakeorders@globalfoodsolutions.codanielle@globalfoodsolutions.coorders@ or danielle@. Team reviews, enters as SO in NetSuite. Other channels (NS UI, portal, EDI 850 manual keying, phone) feed the same downstream branching.| name | required | type / hint |
|---|---|---|
customer_id | required | integer · NS customer internal ID |
items | required | array · item_code, qty, rate, requested_ship_date |
shipping_requirements | required | object · ship-to, carrier, delivery window |
special_instructions | optional | string · notes the team must honor |
email_thread_id | optional | string · trace back to inbound email |
customercustomersSELECT id, entityid, terms, credit_limit, hold_status, service_hold FROM customers WHERE id = ?
items_inventoryitems · inventory_balanceSELECT item_code, itemtype, dropship, quantityavailable, cost FROM items LEFT JOIN inventory_balance USING (item_code) WHERE item_code IN (?)
customer_programcustomer_programsSELECT item_code, override_price, override_terms FROM customer_programs WHERE customer_id = ? AND status = 'active'
credit_limitcustomers · transactionsSELECT credit_limit,
(SELECT SUM(amount_remaining) FROM transactions
WHERE customer=? AND type='Invoice' AND status != 'paid') AS open_ar
FROM customers WHERE id = ?hold_statuscustomersSELECT hold_status, service_hold FROM customers WHERE id = ?
| check | rule | severity |
|---|---|---|
customer_exists | customer_id IN (SELECT id FROM customers) | block |
all_items_priced | every item has a resolved price via pricing_master OR customer_programs OR contracts | warn |
customer_not_on_hold | customer.hold_status = 'active' AND customer.service_hold = 0 | block |
Mike's documented process does not explicitly show a credit gate. under_credit_limit is no longer a precondition. Confirm with Mike whether NS-side enforces this or whether it should be re-added.
Risk level 2 < 3 — no global HITL gate. Individual fan-out steps that are HITL-gated: create_work_orders (Path 2), complete_assembly_build (Path 2), create_purchase_order (Path 3), invoice_customer (Finance), trigger_dunning email send (Finance).
classify_path chat_tool STUB auto REAL operatorclassify_so_line_pathsfulfill_from_inventory d1_write PATH 1 REALinventory_balancepath=inventoryUPDATE inventory_balance SET reserved_qty = reserved_qty + ? WHERE item_code = ? AND location_id = ?
create_work_orders stage_proposed_action PATH 2 REALworkorder_create_from_sosales_orderpath=assemblyparent_so_id linking back to SO. Records linked end-to-end.complete_assembly_build chat_tool PATH 2 REALcomplete_assembly_buildpath=assembly/assembly-build.html. Alternate: if FG already on hand → close WO + fulfill from inventory instead.create_purchase_order stage_proposed_action PATH 3 REALpurchaseorder_create_from_sosales_orderpath=dropshipparent_so_id. Records linked end-to-end.receive_item_receipt chat_tool PATH 3 REALpost_item_receiptpath=dropshipitem_fulfillment_complete d1_write REAL · CONVERGENCEitem_fulfillmentsINSERT INTO item_fulfillments (so_id, status, shipped_at)
VALUES (?, 'Shipped', datetime('now'))
notify_finance hitl_email_draft ★ KEY HANDOFF code verifypropose_email_to_financefinance@globalfoodsolutions.coitemfulfillment_to_finance_alertfinance_review chat_tool FINANCE REALfinance_review_fulfillmentinvoice_customer stage_proposed_action FINANCE REALpost_customer_invoicesales_ordermonitor_payment_terms flag FINANCE REALv_customer_ar_agingbuckettrigger_dunning workflow_class_invoke FINANCE REALar_aging_action_planinvoice_overduepayment_apply d1_write FINANCE REALpayment_applicationsINSERT INTO payment_applications (payment_id, invoice_id, amount) VALUES (?,?,?)
close_so d1_write REALtransactionsUPDATE transactions SET status='Closed' WHERE id=? AND type='SalesOrd'
enter_vendor_bill stage_proposed_action PATH 3 sidecar REALenter_vendor_billpurchase_orderpath=dropshippay_vendor_bill stage_proposed_action PATH 3 sidecar REALpay_vendor_billvendor_billpath=dropshipreflexion_write d1_write REALreflexion_logsales_order,3_path,fulfillmentINSERT INTO reflexion_log (workflow_run_id, entity_type, entity_id, outcome, tags) VALUES (?, 'sales_order', ?, ?, 'sales_order,3_path,fulfillment')
| id | action | source |
|---|---|---|
runner_log_run | INSERT into workflow_run_log | runner automatic |
runner_reflexion | INSERT into reflexion_log (tags=sales_order,3_path) | runner automatic |
log_run | INSERT workflow_run_log | declared in contract |
reflexion | INSERT reflexion_log with tags=sales_order,3_path | declared in contract |
event_completed | FIRE event workflow.completed (workflow_type=sales_order_lifecycle) | declared in contract |
workflow_verify_resultsinvoice_createdn >= 1SELECT COUNT(*) AS n FROM customer_invoices
WHERE so_id=? AND created_at > datetime('now','-24 hours')ns_so_status_closedSELECT status FROM transactions WHERE id=? AND type='SalesOrd'
customer_payment_appliedn >= 1SELECT COUNT(*) AS n FROM payment_applications pa JOIN customer_invoices ci ON pa.invoice_id=ci.id WHERE ci.so_id=?
3exponential100030000true| system | table / resource | action | status | source |
|---|---|---|---|---|
| D1 | inventory_balance | UPDATE (reserve_qty) | REAL | #2 (Path 1) |
| D1 | proposed_actions | INSERT (workorder_create_from_so) | REAL | #3 (Path 2) |
| NS | assemblybuild | INSERT | REAL | #4 (Path 2) |
| D1 | proposed_actions | INSERT (purchaseorder_create_from_so) | REAL | #5 (Path 3) |
| NS | itemreceipt | INSERT | REAL | #6 (Path 3) |
| D1 | item_fulfillments | INSERT (Shipped) | REAL | #7 convergence |
| NS Workflow | finance_alert | fire (★ key handoff) | verify in code | #8 |
| D1 | proposed_actions | INSERT (post_customer_invoice) | REAL | #10 (Finance) |
| Workflow | ar_aging_action_plan | invoke (if invoice_overdue) | REAL | #12 (Finance) |
| D1 | payment_applications | INSERT | REAL | #13 (Finance) |
| D1 | transactions (SalesOrd) | UPDATE status='Closed' | REAL | #14 |
| D1 | proposed_actions | INSERT (enter_vendor_bill) | REAL | #15 (Path 3 sidecar) |
| D1 | proposed_actions | INSERT (pay_vendor_bill) | REAL | #16 (Path 3 sidecar) |
| D1 | reflexion_log | INSERT (tags=sales_order,3_path) | REAL | #17 |
| D1 | workflow_run_log | INSERT (run summary) | REAL | runner automatic |
| Event | workflow.completed | fire | REAL | runner automatic |
| Event | order.closed | fire | REAL | #14 post-close |