durable_executions
Creates, updates, deletes, gets or lists a durable_executions resource.
Overview
| Name | durable_executions |
| Type | Resource |
| Id | aws.lambda.durable_executions |
Fields
The following fields are returned by SELECT queries:
- get_durable_execution
| Name | Datatype | Description |
|---|---|---|
durable_config | object | Configuration 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_arn | string | The 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_name | string | The 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_timestamp | string (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). |
error | object | Error 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_included | boolean | Indicates whether execution data is included in this response. Returns false when IncludeExecutionData is set to false in the request. |
function_arn | string | The 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_payload | string | The 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. |
result | string | The 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_timestamp | string (date-time) | The date and time when the durable execution started, in Unix timestamp format. |
status | string | The current status of the durable execution. Valid values are RUNNING, SUCCEEDED, FAILED, TIMED_OUT, and STOPPED. (RUNNING, SUCCEEDED, FAILED, TIMED_OUT, STOPPED) |
trace_header | object | The trace headers associated with the durable execution. |
version | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_durable_execution | select | durable_execution_arn, region | IncludeExecutionData | 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. |
checkpoint_durable_execution | exec | durable_execution_arn, region, CheckpointToken | 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. | |
send_durable_execution_callback_failure | exec | callback_id, region | Sends 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_heartbeat | exec | callback_id, region | Sends 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_success | exec | callback_id, region | Sends 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_execution | exec | durable_execution_arn, region | Stops 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.
| Name | Datatype | Description |
|---|---|---|
callback_id | string | The unique identifier for the callback operation. |
durable_execution_arn | string | The Amazon Resource Name (ARN) of the durable execution. |
region | string | AWS region (default: us-east-1) |
IncludeExecutionData | boolean | Specifies 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
- get_durable_execution
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
- checkpoint_durable_execution
- send_durable_execution_callback_failure
- send_durable_execution_callback_heartbeat
- send_durable_execution_callback_success
- stop_durable_execution
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 }}"
}'
;
Sends a failure response for a callback operation in a durable execution. Use this API when an external system cannot complete a callback operation successfully.
EXEC aws.lambda.durable_executions.send_durable_execution_callback_failure
@callback_id='{{ callback_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"Error": "{{ Error }}"
}'
;
Sends 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.
EXEC aws.lambda.durable_executions.send_durable_execution_callback_heartbeat
@callback_id='{{ callback_id }}' --required,
@region='{{ region }}' --required
;
Sends 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.
EXEC aws.lambda.durable_executions.send_durable_execution_callback_success
@callback_id='{{ callback_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"Result": "{{ Result }}"
}'
;
Stops a running durable execution. The execution transitions to STOPPED status and cannot be resumed. Any in-progress operations are terminated.
EXEC aws.lambda.durable_executions.stop_durable_execution
@durable_execution_arn='{{ durable_execution_arn }}' --required,
@region='{{ region }}' --required
@@json=
'{
"Error": "{{ Error }}"
}'
;