durable-execution-sdk-js.md
December 2, 2025 ยท View on GitHub
Home > @aws/durable-execution-sdk-js
durable-execution-sdk-js package
Classes
|
Class |
Description |
|---|---|
|
Error thrown when a callback operation fails | |
|
Error thrown when a child context operation fails | |
|
Durable execution client which uses an API-based LambdaClient with built-in error logging. By default, the Lambda client will have custom timeouts set. | |
|
A promise that defers execution until it's awaited or .then/.catch/.finally is called | |
|
Error thrown when an invoke operation fails | |
|
Error thrown when a step operation fails | |
|
Error thrown when a step with AT_MOST_ONCE_PER_RETRY semantics was started but interrupted before completion. | |
|
Error thrown when a wait for condition operation fails |
Abstract Classes
|
Abstract Class |
Description |
|---|---|
|
Base class for all durable operation errors |
Enumerations
|
Enumeration |
Description |
|---|---|
|
The status of a batch item | |
|
Status enumeration for durable execution invocation results. This enum defines the possible outcomes of a durable execution invocation, indicating whether the execution completed successfully, failed, or is continuing asynchronously. The status determines how the AWS durable execution service will handle the execution: - SUCCEEDED: Execution completed successfully with a final result - FAILED: Execution failed with an error that cannot be retried - PENDING: Execution is continuing and will be resumed later (checkpointed) | |
|
Jitter strategy for retry delays to prevent thundering herd. Jitter reduces simultaneous retry attempts by spreading retries out over a randomized delay interval. | |
|
Operation subtype enumeration for categorizing different types of durable operations. This enum provides fine-grained classification of durable operations beyond the basic operation types. Subtypes enable improved observability for specific operation patterns. Each subtype corresponds to a specific durable context method or execution pattern. | |
Functions
|
Function |
Description |
|---|---|
|
(BETA) Creates a Serdes for a specific class that preserves the class type. This implementation is a basic class wrapper and does not support any complex class structures. If you need custom serialization, it is recommended to create your own custom serdes. | |
|
(BETA) Creates a custom Serdes for a class with special handling for Date properties. This implementation is a basic class wrapper and does not support any complex class structures. If you need custom serialization, it is recommended to create your own custom serdes. | |
|
Creates a retry strategy function with exponential backoff and configurable jitter | |
|
Wraps a durable handler function to create a handler with automatic state persistence, retry logic, and workflow orchestration capabilities. This function transforms your durable handler into a function that integrates with the AWS Durable Execution service. The wrapped handler automatically manages execution state and checkpointing. |
Interfaces
|
Interface |
Description |
|---|---|
|
Represents a single item in a batch result | |
|
Result of a batch operation (map, parallel, or concurrent execution) | |
|
Configuration options for child context operations | |
|
Configuration options for concurrent execution operations | |
|
Represents an item to be executed with metadata for deterministic replay | |
|
Client interface for durable execution backend operations. This interface defines the core operations needed to manage durable execution state and checkpoints. It abstracts the underlying service calls and provides a clean contract for: - Retrieving execution state during replay scenarios - Creating checkpoints for state persistence - Managing long-running workflow state Implementations of this interface handle the communication with AWS services to ensure durable execution capabilities including automatic retry, state recovery, and workflow orchestration. | |
|
Configuration options for durable execution setup. This interface allows customization of the durable execution runtime behavior, primarily for dependency injection and testing scenarios. In most production use cases, the default configuration is sufficient. | |
|
Input structure for durable execution invocations. This interface defines the payload structure that the durable execution service provides to durable functions. It contains all the necessary information for the Durable Execution Language SDK to: - Manage checkpointing and state persistence - Replay completed operations from previous state The input is automatically provided by the durable execution service and contains both execution metadata and the operation history for replay. | |
|
Log data passed to the durable logger when | |
|
This interface provides structured logging capabilities for durable execution contexts. A custom logger must implement this interface to be used by the Durable Execution Language SDK. The SDK will automatically parse the logger and use the appropriate logging method based on the log level. | |
|
The durable logging context that can be used to provide durable execution metadata such as executionArn, operationId, and attempt. | |
|
Configuration options for invoke operations | |
|
Configuration options for map operations | |
|
Decision returned by a retry strategy function | |
|
Configuration options for creating a retry strategy | |
|
Serdes (Serialization/Deserialization) interface for durable functions. This interface allows customizing how data is serialized and deserialized when persisting state in durable functions. Both methods are async to support custom implementations that need to interact with external services (e.g., AWS S3, DynamoDB, etc.) | |
|
Configuration options for step operations | |
|
Configuration options for waitForCondition operations | |
Variables
|
Variable |
Description |
|---|---|
|
Default Serdes implementation using JSON.stringify and JSON.parse Wrapped in Promise.resolve() to maintain async interface compatibility Ignores context parameter since it uses inline JSON serialization Note: Uses 'any' type intentionally as this is a generic serializer that must handle arbitrary JavaScript values. JSON.stringify/parse work with any type, and using more restrictive types would break compatibility with the generic Serdes | |
|
Pre-configured retry strategies for common use cases |
Type Aliases
|
Type Alias |
Description |
|---|---|
|
Executor function type for concurrent execution | |
|
The durable logger available inside a context. | |
|
A handler function type for a durable execution that provides automatic state persistence, retry logic, and workflow orchestration capabilities. This handler type is the core interface for building stateful, long-running AWS Durable Executions using the Durable Execution SDK. The handler receives a durable context that enables: - Step-based execution with automatic checkpointing and replay - Built-in retry strategies with exponential backoff and jitter - Workflow orchestration with parallel execution and child contexts - External system integration via callbacks and conditional waiting - Batch operations with concurrency control This handler function must be wrapped by | |
|
Union type representing all possible output formats for durable execution invocations. This type defines the complete response structure that durable functions return to the AWS Durable Execution service. The response format varies based on the execution outcome: **Successful Completion ( **Execution Failure ( **Continued Execution ( The durable execution service uses this response to determine next steps: - Schedule continuation for PENDING status - Complete the execution for SUCCEEDED status - Complete the execution for FAILED status | |
|
The handler type returned by This handler type represents the final lambda function that gets deployed and invoked by the Durable Execution service. The handler receives | |
|
Type representing time durations for durable execution operations, such as **Supported Units:** - **Usage Rules:** - At least one time unit must be specified - All numeric values must be positive integers - Fractional values are not supported | |
|
Function to be executed for each item in a map operation | |
|
Function to be executed as a durable step | |
|
Function that checks and updates state for waitForCondition operations | |
|
Decision object for waitForCondition wait strategy | |
|
Function that determines whether to continue waiting and how long to delay |