Skip to main content

durable_executions

Creates, updates, deletes, gets or lists a durable_executions resource.

Overview

Namedurable_executions
TypeResource
Idaws.lambda.durable_executions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
durable_configobjectConfiguration settings for durable functions, including execution timeout, retention period for execution history, and an optional ARN of the Key Management Service (KMS) customer managed key that is used to encrypt your durable execution's payload data, including input, output, and error payloads.
durable_execution_arnstringThe Amazon Resource Name (ARN) of the durable execution. (pattern: <code>arn:([a-zA-Z0-9-]+):lambda:([a-zA-Z0-9-]+):(\d{12}):function:([a-zA-Z0-9_-]+):($LATEST(?:.PUBLISHED)?|[0-9]+)/durable-execution/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)</code>)
durable_execution_namestringThe name of the durable execution. This is either the name you provided when invoking the function, or a system-generated unique identifier if no name was provided. (pattern: <code>[a-zA-Z0-9-_]+</code>)
end_timestampstring (date-time)The date and time when the durable execution ended, in Unix timestamp format. This field is only present if the execution has completed (status is SUCCEEDED, FAILED, TIMED_OUT, or STOPPED).
errorobjectError information if the durable execution failed. This field is only present when the execution status is FAILED, TIMED_OUT, or STOPPED. The combined size of all error fields is limited to 256 KB.
execution_data_includedbooleanIndicates whether execution data is included in this response. Returns false when IncludeExecutionData is set to false in the request.
function_arnstringThe Amazon Resource Name (ARN) of the Lambda function that was invoked to start this durable execution. (pattern: <code>arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-.]+(:($LATEST(.PUBLISHED)?|[a-zA-Z0-9-]+))?</code>)
input_payloadstringThe JSON input payload that was provided when the durable execution was started. For asynchronous invocations, this is limited to 256 KB. For synchronous invocations, this can be up to 6 MB.
resultstringThe JSON result returned by the durable execution if it completed successfully. This field is only present when the execution status is SUCCEEDED. The result is limited to 256 KB.
start_timestampstring (date-time)The date and time when the durable execution started, in Unix timestamp format.
statusstringThe current status of the durable execution. Valid values are RUNNING, SUCCEEDED, FAILED, TIMED_OUT, and STOPPED. (RUNNING, SUCCEEDED, FAILED, TIMED_OUT, STOPPED)
trace_headerobjectThe trace headers associated with the durable execution.
versionstringThe version of the Lambda function that was invoked for this durable execution. This ensures that all replays during the execution use the same function version. (pattern: <code>($LATEST(.PUBLISHED)?|[0-9]+)</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_durable_executionselectdurable_execution_arn, regionIncludeExecutionDataRetrieves detailed information about a specific durable execution, including its current status, input payload, result or error information, and execution metadata such as start time and usage statistics.
checkpoint_durable_executionexecdurable_execution_arn, region, CheckpointTokenSaves 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.
send_durable_execution_callback_failureexeccallback_id, regionSends a failure response for a callback operation in a durable execution. Use this API when an external system cannot complete a callback operation successfully.
send_durable_execution_callback_heartbeatexeccallback_id, regionSends a heartbeat signal for a long-running callback operation to prevent timeout. Use this API to extend the callback timeout period while the external operation is still in progress.
send_durable_execution_callback_successexeccallback_id, regionSends a successful completion response for a callback operation in a durable execution. Use this API when an external system has successfully completed a callback operation.
stop_durable_executionexecdurable_execution_arn, regionStops a running durable execution. The execution transitions to STOPPED status and cannot be resumed. Any in-progress operations are terminated.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
callback_idstringThe unique identifier for the callback operation.
durable_execution_arnstringThe Amazon Resource Name (ARN) of the durable execution.
regionstringAWS region (default: us-east-1)
IncludeExecutionDatabooleanSpecifies whether to include execution data such as input payload, result, and error information in the response. Set to false for a more compact response that includes only execution metadata. The default value is set to true.

SELECT examples

Retrieves detailed information about a specific durable execution, including its current status, input payload, result or error information, and execution metadata such as start time and usage statistics.

SELECT
durable_config,
durable_execution_arn,
durable_execution_name,
end_timestamp,
error,
execution_data_included,
function_arn,
input_payload,
result,
start_timestamp,
status,
trace_header,
version
FROM aws.lambda.durable_executions
WHERE durable_execution_arn = '{{ durable_execution_arn }}' -- required
AND region = '{{ region }}' -- required
AND IncludeExecutionData = '{{ IncludeExecutionData }}'
;

Lifecycle Methods

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.

EXEC aws.lambda.durable_executions.checkpoint_durable_execution
@durable_execution_arn='{{ durable_execution_arn }}' --required,
@region='{{ region }}' --required
@@json=
'{
"CheckpointToken": "{{ CheckpointToken }}",
"Updates": "{{ Updates }}",
"ClientToken": "{{ ClientToken }}"
}'
;