@@ -88,6 +88,18 @@ a workflow continues as new, the same app record keeps the same
8888identifier. New app projection code should prefer ` workflowId() ` so the
8989application vocabulary matches workflow authoring code.
9090
91+ The engine's durable column names are ` workflow_instance_id ` (foreign
92+ key from a run row to its parent instance row) and ` workflow_run_id `
93+ (foreign key from child rows such as tasks, activities, signals,
94+ updates, child calls, and commands to the run row). Applications should
95+ not reference those engine columns directly. They exist for engine
96+ joins and operator queries, not as a stable app projection contract.
97+ Use the public API surfaces ` Workflow::workflowId() ` ,
98+ ` WorkflowStub::workflowId() ` , and ` CommandResult::workflowId() ` for the
99+ logical id, and ` Workflow::runId() ` , ` WorkflowStub::runId() ` , and
100+ ` CommandResult::runId() ` for the generation id, then store them on
101+ business records as ` workflow_id ` and ` run_id ` .
102+
91103## Milestone-Based Read-Model Pattern
92104
93105Applications should update business read models at meaningful workflow
@@ -100,9 +112,10 @@ Recommended pattern:
100112 ` claim_reviewed ` , ` case_escalated ` .
1011132 . Cross each milestone through a deterministic workflow decision and a
102114 side-effect boundary that is legal under
103- ` docs/architecture/execution-guarantees.md ` . Workflow code must not
104- write external state directly; use an activity, command handler, or
105- application event consumer to perform the read-model write.
115+ ` docs/architecture/execution-guarantees.md ` .
116+ Workflow code must not write external state directly; use an activity,
117+ command handler, or application event consumer to perform the
118+ read-model write.
1061193 . Upsert app read-model rows idempotently. Choose a key such as
107120 ` (workflow_id, milestone) ` for latest-state projections or
108121 ` (workflow_id, run_id, milestone, sequence) ` for append-only audit
0 commit comments