Bid award arrives. Cascade: contract creation, customer_programs update, bid_lines → pricing_master commit, menu start dates, fulfillment heads-up.
event["inbound_email","portal_webhook","manual"]| name | required | type / hint |
|---|---|---|
bid_id | required | — |
award_date | required | — |
contract_start_date | required | — |
contract_end_date | optional | — |
award_doc_r2_key | optional | — |
bidbidsSELECT * FROM bids WHERE id=?
bid_linesbid_linesSELECT * FROM bid_lines WHERE bid_id=? AND deleted_at IS NULL
customer_existing_programscustomer_programs · bidsSELECT * FROM customer_programs WHERE customer_id=(SELECT customer_id FROM bids WHERE id=?) AND status='active'
| check | rule | severity |
|---|---|---|
bid_open | bid.status IN ('open','pending_award') | block |
Risk level 4 ≥ 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_bid_award_notification (proposal envelope)workflow:bid_award_notification:run_<run_id>commit_pricing d1_write STUB["INSERT pricing_master FROM bid_lines"]src/lib/workflow_runner.ts (kind d1_write hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.update_customer_programs stage_proposed_action REALcreate_customer_programfulfillment_alert hitl_email_draft STUBpropose_email_to_customerfulfillment_teamsrc/lib/workflow_runner.ts (kind hitl_email_draft hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.customer_acknowledgement hitl_email_draft STUBpropose_email_to_customercustomersrc/lib/workflow_runner.ts (kind hitl_email_draft 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=bid_award_notification, run_id, narrative) | runner automatic (reflexion_enabled=1) |
log_run | INSERT workflow_runs | declared in contract |
reflexion | INSERT reflexion_log with tags=bid_award,bid_id:?,customer:? | declared in contract |
bid_status_update | UPDATE bids SET status='awarded', awarded_at=now WHERE id=? | declared in contract |
workflow_verify_results (pending — verify cron not yet wired)pricing_committedSELECT COUNT(*) FROM pricing_master WHERE source LIKE '%bid_award_' || ? || '%'
bid_status_updatedSELECT status FROM bids WHERE id=?
3exponential200030000true| system | table / resource | action | status | source |
|---|---|---|---|---|
| D1 | proposed_actions | INSERT (action_type=create_customer_program, entity_type=workflow_run) | REAL | fan-out #2 (update_customer_programs) |
| D1 | workflow_run_log | INSERT (run summary) | REAL | runner automatic |
| D1 | reflexion_log | INSERT (tags=bid_award_notification) | 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 |
| D1 | unknown | write | STUB | fan-out #1 (commit_pricing) |
| D1 | proposed_actions | INSERT (email draft via propose_email_to_customer) | STUB | fan-out #3 (fulfillment_alert) |
| D1 | proposed_actions | INSERT (email draft via propose_email_to_customer) | STUB | fan-out #4 (customer_acknowledgement) |