getDurableExecutionState method

Future<GetDurableExecutionStateResponse> getDurableExecutionState({
  1. required String checkpointToken,
  2. required String durableExecutionArn,
  3. String? marker,
  4. int? maxItems,
})

Retrieves the current execution state required for the replay process during durable function execution. This API is used by the Lambda durable functions SDK to get state information needed for replay. You typically don't need to call this API directly as the SDK handles state management automatically.

The response contains operations ordered by start sequence number in ascending order. Completed operations with children don't include child operation details since they don't need to be replayed.

May throw InvalidParameterValueException. May throw ServiceException. May throw TooManyRequestsException.

Parameter checkpointToken : A checkpoint token that identifies the current state of the execution. This token is provided by the Lambda runtime and ensures that state retrieval is consistent with the current execution context.

Parameter durableExecutionArn : The Amazon Resource Name (ARN) of the durable execution.

Parameter marker : If NextMarker was returned from a previous request, use this value to retrieve the next page of operations. Each pagination token expires after 24 hours.

Parameter maxItems : The maximum number of operations to return per call. You can use Marker to retrieve additional pages of results. The default is 100 and the maximum allowed is 1000. A value of 0 uses the default.

Implementation

Future<GetDurableExecutionStateResponse> getDurableExecutionState({
  required String checkpointToken,
  required String durableExecutionArn,
  String? marker,
  int? maxItems,
}) async {
  _s.validateNumRange(
    'maxItems',
    maxItems,
    0,
    1000,
  );
  final $query = <String, List<String>>{
    'CheckpointToken': [checkpointToken],
    if (marker != null) 'Marker': [marker],
    if (maxItems != null) 'MaxItems': [maxItems.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/2025-12-01/durable-executions/${Uri.encodeComponent(durableExecutionArn)}/state',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetDurableExecutionStateResponse.fromJson(response);
}