Skip to content

Commit ac8c2a6

Browse files
durable-workflow.github.io: update v2 changes
1 parent f39bb27 commit ac8c2a6

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

docs/constraints/structural-limits.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,34 @@ foreach (array_chunk($items, 500) as $chunk) {
7676

7777
The `all()` and `parallel()` functions check the total number of leaf operations in a single fan-out group against `command_batch_size`. This is checked before any individual activities or children are scheduled, so the run fails cleanly rather than partially scheduling a batch.
7878

79-
### Payload size limits
79+
### Payload size
8080

81-
Payload size checks apply to serialized argument data. When a serialized payload exceeds the configured `payload_size_bytes`, the engine rejects the operation.
81+
When the executor schedules an activity or child workflow, it serializes the argument payload and checks the byte length against `payload_size_bytes`. If the serialized payload exceeds the limit, the run fails before any database rows are created for the operation.
8282

83-
### Metadata size limits
83+
This applies to:
8484

85-
Memo and search-attribute metadata are checked against `memo_size_bytes` and `search_attribute_size_bytes` respectively when upserting metadata.
85+
- **Activity arguments** — checked at the point `scheduleActivity` serializes the `ActivityCall` arguments.
86+
- **Child workflow arguments** — checked at the point `scheduleChildWorkflow` serializes the child's start arguments, before creating the child instance or run rows.
87+
88+
```php
89+
// A 3 MiB payload will fail with the default 2 MiB limit
90+
activity(ProcessDocumentActivity::class, $threeMegabyteBlob);
91+
```
92+
93+
To work within the limit, store large data externally and pass a reference:
94+
95+
```php
96+
$ref = Storage::put('docs/incoming.pdf', $blob);
97+
activity(ProcessDocumentActivity::class, $ref);
98+
```
99+
100+
### Memo size
101+
102+
When a workflow upserts memo entries via `upsertMemo()`, the executor merges the new entries into the existing memo map, then JSON-encodes the merged result and checks the byte length against `memo_size_bytes`. If the merged memo exceeds the limit, the run fails before the memo is persisted.
103+
104+
### Search attribute size
105+
106+
When a workflow upserts search attributes via `upsertSearchAttributes()`, the executor merges the new attributes into the existing set, then JSON-encodes the merged result and checks the byte length against `search_attribute_size_bytes`. If the merged attributes exceed the limit, the run fails before the attributes are persisted.
86107

87108
## Failure taxonomy
88109

docs/failures-and-recovery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Every failure recorded by the engine carries a `failure_category` that classifie
8585
| Timeout | `timeout` | Failure caused by a timeout expiration — enforced by the engine when a workflow execution or run deadline passes. |
8686
| Task Failure | `task_failure` | Workflow-task execution failure such as replay errors, determinism violations, or invalid command shapes. |
8787
| Internal | `internal` | Server or infrastructure failure (database, queue, worker crash). |
88-
| Structural Limit | `structural_limit` | Failure caused by exceeding a structural limit (payload size, pending fan-out count, command batch size, metadata size). See [Structural Limits](/constraints/structural-limits). |
88+
| Structural Limit | `structural_limit` | Failure caused by exceeding a structural limit (payload size, pending fan-out count, command batch size, metadata size). See [Structural Limits](./constraints/structural-limits.md). |
8989

9090
The category is determined automatically when the failure is recorded:
9191

docs/features/timeouts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,4 @@ The following are planned but not yet implemented:
181181

182182
### Structural limits
183183

184-
Typed structural-limit failures for payload size, pending fan-out counts, and metadata size ceilings are enforced by the engine. See [Structural Limits](/constraints/structural-limits) for the full limit contract, configuration, and failure taxonomy.
184+
Typed structural-limit failures for payload size, pending fan-out counts, and metadata size ceilings are enforced by the engine. See [Structural Limits](../constraints/structural-limits.md) for the full limit contract, configuration, and failure taxonomy.

0 commit comments

Comments
 (0)