July 1 cycle: recompute every customer × SKU price for next SY. Cloudflare Workflow durable execution via AnnualRollWorkflow class. Bulk HITL review per customer; on approval, NS bulk update + customer notification + pricing_history snapshot.
cron0 8 1 7 *| name | required | type / hint |
|---|---|---|
next_school_year | required | — |
markup_rules_json | required | — |
customer_cohort_size | optional | — |
all_customerscustomersSELECT id, companyname FROM customers WHERE isinactive != 'T'
all_active_itemsitemsSELECT id, itemid FROM items WHERE isinactive != 'T'
prior_sy_pricingpricing_masterSELECT customer_id, item_code, case_price FROM pricing_master WHERE school_year=?
customer_programs_activecustomer_programsSELECT customer_id, program_type, value, value_type FROM customer_programs WHERE status='active' AND deleted_at IS NULL
| check | rule | severity |
|---|---|---|
prior_sy_pricing_exists | COUNT(prior_sy_pricing) > 0 | block |
cost_data_fresh | MAX(assembly_cost_rollup.computed_at WHERE status='active') > now - 7 days | warn |
kill_switch | NOT kill:high_risk_ops | block |
Risk level 5 ≥ 3 — runner stages a proposed_actions row before fan-out runs. Mike must approve in proposed-actions.html before any side-effect step executes (real or stub).
workflow_annual_price_roll (proposal envelope)workflow:annual_price_roll:run_<run_id>pillar_4_workflow_launch workflow_class_invoke STUBAnnualRollWorkflowANNUAL_ROLL_WORKFLOW{next_sy:?, markup_rules:?}src/lib/workflow_runner.ts (kind workflow_class_invoke hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.customer_notification hitl_email_draft STUBpropose_email_to_customersrc/lib/workflow_runner.ts (kind hitl_email_draft hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.render_quote_pdfs http_call STUB/api/quote/pdfsrc/lib/workflow_runner.ts (kind http_call hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.| id | action | source |
|---|---|---|
runner_log_run | INSERT into workflow_run_log (run_id, workflow_type, status, started_at, completed_at, summary_json) | runner automatic |
runner_reflexion | INSERT into reflexion_log (tags=annual_price_roll, run_id, narrative) | runner automatic (reflexion_enabled=1) |
log_run | INSERT workflow_runs | declared in contract |
reflexion | INSERT reflexion_log with tags=annual_roll,sy:? | declared in contract |
workflow_health | UPDATE annual_roll_workflow_runs status | declared in contract |
workflow_verify_results (pending — verify cron not yet wired)new_sy_pricing_presentSELECT COUNT(*) FROM pricing_master WHERE school_year=? AND created_at > ?
history_snapshot_presentSELECT COUNT(*) FROM pricing_history WHERE created_at > ?
1nonetruenative_cloudflare_workflow_retry| system | table / resource | action | status | source |
|---|---|---|---|---|
| D1 | workflow_run_log | INSERT (run summary) | REAL | runner automatic |
| D1 | reflexion_log | INSERT (tags=annual_price_roll) | REAL | runner automatic |
| Event | workflow.completed (or workflow.failed) | fire | REAL | runner automatic |
| D1 | workflow_verify_results | INSERT pending × 2 | REAL | runner verify staging |
| D1 | proposed_actions | INSERT (HITL gate envelope) | REAL | runner HITL gate |
| Cloudflare Workflow | AnnualRollWorkflow | invoke instance | STUB | fan-out #1 (pillar_4_workflow_launch) |
| D1 | proposed_actions | INSERT (email draft via propose_email_to_customer) | STUB | fan-out #2 (customer_notification) |
| Worker HTTP | POST /api/quote/pdf | invoke | STUB | fan-out #3 (render_quote_pdfs) |