You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration/microservices.md
+34-2Lines changed: 34 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -527,7 +527,7 @@ Like the activity task HTTP surface, these routes are the same first bridge expo
527
527
528
528
## Control Plane
529
529
530
-
A control-plane contract is exposed through `Workflow\V2\Contracts\WorkflowControlPlane`, registered as a singleton in the container. This contract lets a standalone server or external adapter start, signal, query, update, cancel, and terminate workflows using **durable type keys** instead of requiring local PHP class resolution.
530
+
A control-plane contract is exposed through `Workflow\V2\Contracts\WorkflowControlPlane`, registered as a singleton in the container. This contract lets a standalone server or external adapter start, signal, query, update, cancel, terminate, repair, and archive workflows using **durable type keys** instead of requiring local PHP class resolution.
531
531
532
532
This is the key difference from `WorkflowStub::make()` and `WorkflowStub::load()`: the control plane accepts workflow type strings and instance ids directly, so a server process that does not have the workflow PHP classes installed can still drive the full workflow lifecycle. Workers that do have the classes pick up the actual replay work through the task bridges.
Both return `accepted` (bool), `workflow_instance_id`, `workflow_command_id`, and `reason` (on rejection). Rejection reasons include `instance_not_found`, `instance_not_started`, and `run_not_active`.
629
629
630
+
### Repairing a workflow
631
+
632
+
`repair()` requests a repair of the current workflow run. Repair re-projects the run summary, detects liveness issues, and creates a new workflow task when the run is in a repairable state. Only open runs on the current instance may be repaired:
633
+
634
+
```php
635
+
$result = $controlPlane->repair('order-12345');
636
+
637
+
if ($result['accepted']) {
638
+
// Repair was accepted and a new task was created
639
+
}
640
+
```
641
+
642
+
Rejection reasons include `instance_not_found`, `instance_not_started`, and `run_not_active` (run is already closed).
643
+
644
+
### Archiving a workflow
645
+
646
+
`archive()` marks a terminal workflow run as archived. Archived runs are excluded from active fleet views and may be eligible for cold storage or cleanup. Only closed (completed, failed, cancelled, terminated) runs may be archived:
647
+
648
+
```php
649
+
$result = $controlPlane->archive('order-12345', [
650
+
'reason' => 'Retention period expired',
651
+
]);
652
+
653
+
if ($result['accepted']) {
654
+
// Run is now archived
655
+
}
656
+
```
657
+
658
+
Archiving an already-archived run returns `accepted` with an `archive_not_needed` outcome. Rejection reasons include `instance_not_found`, `instance_not_started`, and `run_not_closed`.
659
+
630
660
### Describing a workflow
631
661
632
662
`describe()` returns the current state of a workflow instance without loading the full Waterline detail view. This is the recommended path for server APIs, CLI tools, and operator dashboards that need workflow state without the overhead of the full projection tree:
@@ -659,6 +689,8 @@ if ($result['found']) {
659
689
$result['actions']['can_update']; // true (false for remote-only or non-current runs)
660
690
$result['actions']['can_cancel']; // true
661
691
$result['actions']['can_terminate']; // true
692
+
$result['actions']['can_repair']; // true (false for closed runs or non-current runs)
693
+
$result['actions']['can_archive']; // false (true only for terminal runs not yet archived)
Action availability reflects whether the operation can succeed right now: closed runs cannot accept commands, remote-only workflows cannot serve queries or updates locally, and non-current runs cannot receive signals, updates, cancellations, or terminations.
705
+
Action availability reflects whether the operation can succeed right now: closed runs cannot accept commands, remote-only workflows cannot serve queries or updates locally, non-current runs cannot receive signals, updates, cancellations, terminations, or repairs, and only terminal runs that have not already been archived are eligible for archival.
- Timeout-indicating exceptions (messages containing "timed out", "timeout exceeded", "execution deadline", or "run deadline") classify as `timeout`.
98
98
- All other business-logic exceptions default to `application`.
99
+
- External worker failures (submitted through the workflow task bridge HTTP protocol) use the same classification rules based on the exception class name and message strings, even though the original throwable is not available in the host process.
0 commit comments