Skip to content

Commit 6c0f639

Browse files
durable-workflow.github.io: update v2 changes
1 parent 73851bd commit 6c0f639

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/failures-and-recovery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The category is determined automatically when the failure is recorded:
9090

9191
- Activity failures use `activity` when the exception exhausts the retry policy.
9292
- Child workflow failures use `child_workflow` when the child run terminates with a failure.
93-
- Cancelled and terminated workflows use `cancelled` or `terminated` respectively. These categories are also assigned when failure snapshots are reconstructed from `WorkflowCancelled`, `WorkflowTerminated`, `ChildRunCancelled`, or `ChildRunTerminated` history events.
93+
- Cancelled and terminated workflows create a dedicated `WorkflowFailure` row with `propagation_kind = cancelled` or `terminated` and `failure_category = cancelled` or `terminated` respectively. The `WorkflowCancelled` or `WorkflowTerminated` history event carries the `failure_id` and `failure_category` so failure snapshots, run detail, and history exports link directly to the failure record. Child run cancellation and termination events (`ChildRunCancelled`, `ChildRunTerminated`) also carry the child's `failure_category` when the child failure row exists.
9494
- Terminal workflow failures and failed update handlers inspect the throwable to refine the category:
9595
- Determinism violations (`UnsupportedWorkflowYieldException`, `StraightLineWorkflowRequiredException`) classify as `task_failure`.
9696
- Infrastructure exceptions (database/PDO errors, queue max-attempts exceeded) classify as `internal`.

docs/features/cancel-and-terminate.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ When a cancel command is accepted:
4747
4. All open activity executions are closed as cancelled, with `ActivityCancelled` history recorded for each.
4848
5. All pending timers are cancelled, with `TimerCancelled` history recorded for each.
4949
6. The run status transitions to `cancelled` with `closed_reason = cancelled`.
50-
7. `WorkflowCancelled` history is appended.
51-
8. If this run is a child workflow, the parent receives a resume task so it can observe the child cancellation.
52-
9. The run summary projection is updated.
50+
7. A `WorkflowFailure` row is created with `failure_category = cancelled` and `propagation_kind = cancelled`.
51+
8. `WorkflowCancelled` history is appended with the `failure_id` and `failure_category`.
52+
9. If this run is a child workflow, the parent receives a resume task so it can observe the child cancellation.
53+
10. The run summary projection is updated.
5354

5455
### Cancel is rejected when
5556

@@ -81,6 +82,7 @@ $result->reason(); // "Operator emergency shutdown"
8182
Terminate follows the same transactional steps as cancel, but:
8283

8384
- Records `TerminateRequested` and `WorkflowTerminated` history events instead.
85+
- Creates the `WorkflowFailure` row with `failure_category = terminated` and `propagation_kind = terminated`.
8486
- Sets `closed_reason = terminated` on the run.
8587
- Does not schedule any further workflow-code execution.
8688

@@ -173,7 +175,7 @@ WorkflowStarted
173175
CancelRequested <- reason field present when supplied
174176
TimerCancelled <- for each open timer
175177
ActivityCancelled <- for each open activity
176-
WorkflowCancelled <- reason field present when supplied
178+
WorkflowCancelled <- failure_id, failure_category, reason when supplied
177179
```
178180

179181
A terminated run produces:
@@ -185,7 +187,7 @@ WorkflowStarted
185187
TerminateRequested <- reason field present when supplied
186188
TimerCancelled <- for each open timer
187189
ActivityCancelled <- for each open activity
188-
WorkflowTerminated <- reason field present when supplied
190+
WorkflowTerminated <- failure_id, failure_category, reason when supplied
189191
```
190192

191193
## Cancel vs. terminate
@@ -198,5 +200,6 @@ WorkflowTerminated <- reason field present when supplied
198200
| Reason metadata | Yes | Yes |
199201
| Durable command history | Yes | Yes |
200202
| Parent receives child outcome | Yes | Yes |
203+
| Failure row recorded | Yes (`cancelled`) | Yes (`terminated`) |
201204
| Status bucket | `failed` | `failed` |
202205
| Closed reason | `cancelled` | `terminated` |

0 commit comments

Comments
 (0)