Skip to content

Commit 17bc8fb

Browse files
committed
docs: improvements
Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com>
1 parent efd2053 commit 17bc8fb

File tree

1 file changed

+36
-8
lines changed

1 file changed

+36
-8
lines changed

LANGUAGE_SDK_SPECIFICATION.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,22 @@ The SDK MUST determine if an operation has already been executed by checking:
188188
- The operation's current status
189189
- Whether a result or error is already recorded
190190

191-
### 3.4 Response Size Limits
191+
### 3.4 Response Size and Error Handling
192192

193-
The SDK MUST handle Lambda's 6MB response payload limit:
193+
The SDK MUST handle API size limit errors gracefully:
194194

195-
1. If the serialized result exceeds approximately 6MB, the SDK MUST:
195+
1. When serialization or API calls fail due to size constraints, the SDK MUST:
196+
- Catch the error from the API
197+
- Return `FAILED` status with a clear error message
198+
- NOT allow the error to propagate and trigger invocation-level retries
199+
200+
2. Exception: `InvalidParameterValueException` for checkpoint tokens SHOULD be allowed to propagate, as this indicates a transient issue that may resolve on retry.
201+
202+
3. For large execution results that would exceed response size limits, the SDK MUST:
196203
- Checkpoint the result using an `EXECUTION` operation with `SUCCEED` action
197204
- Return an empty `Result` field with `SUCCEEDED` status
198-
2. The SDK SHOULD monitor payload size proactively to avoid failures
205+
206+
Note: Specific size limits are subject to change. Refer to AWS Lambda service limits documentation for current values.
199207

200208
## 4. Durable Operations
201209

@@ -210,6 +218,19 @@ SDKs MUST support six operation types:
210218
5. **CHAINED_INVOKE** - Invoke another Lambda function
211219
6. **CONTEXT** - Group operations with isolated state
212220

221+
#### 4.1.1 API Primitives vs SDK Constructs
222+
223+
The six operation types listed above are **API primitives** defined by the AWS Lambda Durable Execution API. These are the fundamental building blocks provided by the service.
224+
225+
The SDK MAY provide **higher-level constructs** that compose these primitives to offer convenient patterns:
226+
227+
- `map` - Concurrent processing of items (uses CONTEXT operations)
228+
- `parallel` - Concurrent execution of branches (uses CONTEXT operations)
229+
- `waitForCondition` - Polling with state accumulation (uses STEP with RETRY)
230+
- `waitForCallback` - Callback with submission logic (uses CALLBACK primitive)
231+
232+
These constructs exist only in the SDK layer and are built upon the core API primitives. They are not separate operation types in the API.
233+
213234
### 4.2 Common Operation Properties
214235

215236
All operations MUST have:
@@ -480,6 +501,9 @@ Each operation update MAY include:
480501
- `Error`: Failure error object
481502
- Type-specific options (`StepOptions`, `WaitOptions`, `CallbackOptions`, `ChainedInvokeOptions`, `ContextOptions`)
482503

504+
For detailed field constraints (length limits, patterns, and valid values), refer to the AWS Lambda API documentation:
505+
https://docs.aws.amazon.com/lambda/latest/api/API_OperationUpdate.html
506+
483507
### 5.5 Checkpoint Response
484508

485509
The SDK MUST process checkpoint responses that include:
@@ -603,15 +627,19 @@ Repeatedly check a condition until it is met, with configurable wait intervals.
603627

604628
The SDK SHOULD implement wait-for-condition as:
605629

606-
1. A loop using STEP operations for each check
607-
2. WAIT operations for delays between checks
608-
3. A parent CONTEXT for isolation
609-
4. User-defined condition check and wait strategy functions
630+
1. A single STEP operation that acts as a reducer pattern
631+
2. Each check attempt uses the STEP's retry mechanism via RETRY action
632+
3. The condition check function returns state that is passed as the payload
633+
4. On retry, the previous payload (state) is passed to the next attempt (not an error)
634+
5. The retry delay (NextAttemptDelaySeconds) creates the wait period between checks
635+
6. No separate WAIT or CONTEXT operations are required
610636

611637
The SDK MAY provide built-in wait strategies (exponential backoff, linear, constant, etc.).
612638

613639
### 7.2 Callback Patterns
614640

641+
The callback patterns described here are SDK constructs built on the CALLBACK operation primitive. They provide convenient wrappers around the core CALLBACK functionality.
642+
615643
#### 7.2.1 Create Callback
616644

617645
The SDK SHOULD provide a pattern where:

0 commit comments

Comments
 (0)