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: LANGUAGE_SDK_SPECIFICATION.md
+36-8Lines changed: 36 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,14 +188,22 @@ The SDK MUST determine if an operation has already been executed by checking:
188
188
- The operation's current status
189
189
- Whether a result or error is already recorded
190
190
191
-
### 3.4 Response Size Limits
191
+
### 3.4 Response Size and Error Handling
192
192
193
-
The SDK MUST handle Lambda's 6MB response payload limit:
193
+
The SDK MUST handle API size limit errors gracefully:
194
194
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:
196
203
- Checkpoint the result using an `EXECUTION` operation with `SUCCEED` action
197
204
- 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.
199
207
200
208
## 4. Durable Operations
201
209
@@ -210,6 +218,19 @@ SDKs MUST support six operation types:
210
218
5.**CHAINED_INVOKE** - Invoke another Lambda function
211
219
6.**CONTEXT** - Group operations with isolated state
212
220
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
+
213
234
### 4.2 Common Operation Properties
214
235
215
236
All operations MUST have:
@@ -480,6 +501,9 @@ Each operation update MAY include:
The SDK MUST process checkpoint responses that include:
@@ -603,15 +627,19 @@ Repeatedly check a condition until it is met, with configurable wait intervals.
603
627
604
628
The SDK SHOULD implement wait-for-condition as:
605
629
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
610
636
611
637
The SDK MAY provide built-in wait strategies (exponential backoff, linear, constant, etc.).
612
638
613
639
### 7.2 Callback Patterns
614
640
641
+
The callback patterns described here are SDK constructs built on the CALLBACK operation primitive. They provide convenient wrappers around the core CALLBACK functionality.
0 commit comments