Lambda / Client / get_durable_execution_state
get_durable_execution_state¶
- Lambda.Client.get_durable_execution_state(**kwargs)¶
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.
See also: AWS API Documentation
Request Syntax
response = client.get_durable_execution_state( DurableExecutionArn='string', CheckpointToken='string', Marker='string', MaxItems=123 )
- Parameters:
DurableExecutionArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the durable execution.
CheckpointToken (string) –
[REQUIRED]
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.
Marker (string) – If
NextMarkerwas returned from a previous request, use this value to retrieve the next page of operations. Each pagination token expires after 24 hours.MaxItems (integer) – The maximum number of operations to return per call. You can use
Markerto retrieve additional pages of results. The default is 100 and the maximum allowed is 1000. A value of 0 uses the default.
- Return type:
dict
- Returns:
Response Syntax
{ 'Operations': [ { 'Id': 'string', 'ParentId': 'string', 'Name': 'string', 'Type': 'EXECUTION'|'CONTEXT'|'STEP'|'WAIT'|'CALLBACK'|'CHAINED_INVOKE', 'SubType': 'string', 'StartTimestamp': datetime(2015, 1, 1), 'EndTimestamp': datetime(2015, 1, 1), 'Status': 'STARTED'|'PENDING'|'READY'|'SUCCEEDED'|'FAILED'|'CANCELLED'|'TIMED_OUT'|'STOPPED', 'ExecutionDetails': { 'InputPayload': 'string' }, 'ContextDetails': { 'ReplayChildren': True|False, 'Result': 'string', 'Error': { 'ErrorMessage': 'string', 'ErrorType': 'string', 'ErrorData': 'string', 'StackTrace': [ 'string', ] } }, 'StepDetails': { 'Attempt': 123, 'NextAttemptTimestamp': datetime(2015, 1, 1), 'Result': 'string', 'Error': { 'ErrorMessage': 'string', 'ErrorType': 'string', 'ErrorData': 'string', 'StackTrace': [ 'string', ] } }, 'WaitDetails': { 'ScheduledEndTimestamp': datetime(2015, 1, 1) }, 'CallbackDetails': { 'CallbackId': 'string', 'Result': 'string', 'Error': { 'ErrorMessage': 'string', 'ErrorType': 'string', 'ErrorData': 'string', 'StackTrace': [ 'string', ] } }, 'ChainedInvokeDetails': { 'Result': 'string', 'Error': { 'ErrorMessage': 'string', 'ErrorType': 'string', 'ErrorData': 'string', 'StackTrace': [ 'string', ] } } }, ], 'NextMarker': 'string' }
Response Structure
(dict) –
The response from the GetDurableExecutionState operation, containing the current execution state for replay.
Operations (list) –
An array of operations that represent the current state of the durable execution. Operations are ordered by their start sequence number in ascending order and include information needed for replay processing.
(dict) –
Information about an operation within a durable execution.
Id (string) –
The unique identifier for this operation.
ParentId (string) –
The unique identifier of the parent operation, if this operation is running within a child context.
Name (string) –
The customer-provided name for this operation.
Type (string) –
The type of operation.
SubType (string) –
The subtype of the operation, providing additional categorization.
StartTimestamp (datetime) –
The date and time when the operation started, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
EndTimestamp (datetime) –
The date and time when the operation ended, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
Status (string) –
The current status of the operation.
ExecutionDetails (dict) –
Details about the execution, if this operation represents an execution.
InputPayload (string) –
The original input payload provided for the durable execution.
ContextDetails (dict) –
Details about the context, if this operation represents a context.
ReplayChildren (boolean) –
Whether the state data of child operations of this completed context should be included in the invoke payload and
GetDurableExecutionStateresponse.Result (string) –
The response payload from the context.
Error (dict) –
Details about the context failure.
ErrorMessage (string) –
A human-readable error message.
ErrorType (string) –
The error type.
ErrorData (string) –
Machine-readable error data.
StackTrace (list) –
Stack trace information for the error.
(string) –
StepDetails (dict) –
Details about the step, if this operation represents a step.
Attempt (integer) –
The current attempt number for this step.
NextAttemptTimestamp (datetime) –
The date and time when the next attempt is scheduled, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD). Only populated when the step is in a pending state.
Result (string) –
The JSON response payload from the step operation.
Error (dict) –
Details about the step failure.
ErrorMessage (string) –
A human-readable error message.
ErrorType (string) –
The error type.
ErrorData (string) –
Machine-readable error data.
StackTrace (list) –
Stack trace information for the error.
(string) –
WaitDetails (dict) –
Details about the wait operation, if this operation represents a wait.
ScheduledEndTimestamp (datetime) –
The date and time when the wait operation is scheduled to complete, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CallbackDetails (dict) –
Contains details about a callback operation in a durable execution, including the callback token and timeout configuration.
CallbackId (string) –
The callback ID. Callback IDs are generated by the
DurableContextwhen a durable function callsctx.waitForCallback.Result (string) –
The response payload from the callback operation as a string.
Error (dict) –
An error object that contains details about the failure.
ErrorMessage (string) –
A human-readable error message.
ErrorType (string) –
The error type.
ErrorData (string) –
Machine-readable error data.
StackTrace (list) –
Stack trace information for the error.
(string) –
ChainedInvokeDetails (dict) –
Contains details about a chained function invocation in a durable execution, including the target function and invocation parameters.
Result (string) –
The response payload from the chained invocation.
Error (dict) –
Details about the chained invocation failure.
ErrorMessage (string) –
A human-readable error message.
ErrorType (string) –
The error type.
ErrorData (string) –
Machine-readable error data.
StackTrace (list) –
Stack trace information for the error.
(string) –
NextMarker (string) –
If present, indicates that more operations are available. Use this value as the
Markerparameter in a subsequent request to retrieve the next page of results.
Exceptions