checkpointDurableExecution method
Saves the progress of a durable function execution during runtime. This API is used by the Lambda durable functions SDK to checkpoint completed steps and schedule asynchronous operations. You typically don't need to call this API directly as the SDK handles checkpointing automatically.
Each checkpoint operation consumes the current checkpoint token and returns a new one for the next checkpoint. This ensures that checkpoints are applied in the correct order and prevents duplicate or out-of-order state updates.
May throw InvalidParameterValueException.
May throw ServiceException.
May throw TooManyRequestsException.
Parameter checkpointToken :
A unique token that identifies the current checkpoint state. This token is
provided by the Lambda runtime and must be used to ensure checkpoints are
applied in the correct order. Each checkpoint operation consumes this
token and returns a new one.
Parameter durableExecutionArn :
The Amazon Resource Name (ARN) of the durable execution.
Parameter clientToken :
An optional idempotency token to ensure that duplicate checkpoint requests
are handled correctly. If provided, Lambda uses this token to detect and
handle duplicate requests within a 15-minute window.
Parameter updates :
An array of state updates to apply during this checkpoint. Each update
represents a change to the execution state, such as completing a step,
starting a callback, or scheduling a timer. Updates are applied atomically
as part of the checkpoint operation.
Implementation
Future<CheckpointDurableExecutionResponse> checkpointDurableExecution({
required String checkpointToken,
required String durableExecutionArn,
String? clientToken,
List<OperationUpdate>? updates,
}) async {
final $payload = <String, dynamic>{
'CheckpointToken': checkpointToken,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (updates != null) 'Updates': updates,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/2025-12-01/durable-executions/${Uri.encodeComponent(durableExecutionArn)}/checkpoint',
exceptionFnMap: _exceptionFns,
);
return CheckpointDurableExecutionResponse.fromJson(response);
}