Skip to content

get_durable_execution_history

get_durable_execution_history(
    durable_execution_arn: DurableExecutionArn,
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    include_execution_data: Optional[IncludeExecutionData] = None,
    max_items: Optional[ItemCount] = None,
    marker: Optional[String] = None,
    reverse_order: Optional[ReverseOrder] = None,
) -> GetDurableExecutionHistoryResponse

Retrieves the execution history for a durable execution, showing all the steps, callbacks, and events that occurred during the execution. This provides a detailed audit trail of the execution's progress over time.

The history is available while the execution is running and for a retention period after it completes (1-90 days, default 30 days). You can control whether to include execution data such as step results and callback payloads.

Parameters:

  • durable_execution_arn (DurableExecutionArn) –

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

  • include_execution_data (Optional[IncludeExecutionData], default: None ) –

    Specifies whether to include execution data such as step results and callback payloads in the history events. Set to true to include data, or false to exclude it for a more compact response. The default is true.

  • max_items (Optional[ItemCount], default: None ) –

    The maximum number of history events 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.

  • marker (Optional[String], default: None ) –

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

  • reverse_order (Optional[ReverseOrder], default: None ) –

    When set to true, returns the history events in reverse chronological order (newest first). By default, events are returned in chronological order (oldest first).

Raises:

  • InvalidParameterValueException –

    One of the parameters in the request is not valid.

  • KMSAccessDeniedException –

    Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.

  • KMSDisabledException –

    Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.

  • KMSInvalidStateException –

    Lambda couldn't decrypt the environment variables because the state of the KMS key used is not valid for Decrypt. Check the function's KMS key settings.

  • KMSNotFoundException –

    Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.

  • ResourceNotFoundException –

    The resource specified in the request does not exist.

  • ServiceException –

    The Lambda service encountered an internal error.

  • TooManyRequestsException –

    The request throughput limit was exceeded. For more information, see Lambda quotas.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lambda/_services/_lambda.py
def get_durable_execution_history(
    self,
    durable_execution_arn: "capo_lambda.types.durable_execution_arn.DurableExecutionArn",
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    include_execution_data: Optional[
        "capo_lambda.types.include_execution_data.IncludeExecutionData"
    ] = None,
    max_items: Optional["capo_lambda.types.item_count.ItemCount"] = None,
    marker: Optional["capo_lambda.types.string.String"] = None,
    reverse_order: Optional["capo_lambda.types.reverse_order.ReverseOrder"] = None,
) -> "capo_lambda.types.get_durable_execution_history_response.GetDurableExecutionHistoryResponse":
    """<p>Retrieves the execution history for a <a href="https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html">durable execution</a>, showing all the steps, callbacks, and events that occurred during the execution. This provides a detailed audit trail of the execution's progress over time.</p> <p>The history is available while the execution is running and for a retention period after it completes (1-90 days, default 30 days). You can control whether to include execution data such as step results and callback payloads.</p>

    Args:
        durable_execution_arn: <p>The Amazon Resource Name (ARN) of the durable execution.</p>
        include_execution_data: <p>Specifies whether to include execution data such as step results and callback payloads in the history events. Set to <code>true</code> to include data, or <code>false</code> to exclude it for a more compact response. The default is <code>true</code>.</p>
        max_items: <p>The maximum number of history events to return per call. You can use <code>Marker</code> to retrieve additional pages of results. The default is 100 and the maximum allowed is 1000. A value of 0 uses the default.</p>
        marker: <p>If <code>NextMarker</code> was returned from a previous request, use this value to retrieve the next page of results. Each pagination token expires after 24 hours.</p>
        reverse_order: <p>When set to <code>true</code>, returns the history events in reverse chronological order (newest first). By default, events are returned in chronological order (oldest first).</p>

    Raises:
        capo_lambda.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid.</p>
        capo_lambda.errors.kms_access_denied_exception.KMSAccessDeniedException: <p>Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.</p>
        capo_lambda.errors.kms_disabled_exception.KMSDisabledException: <p>Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.</p>
        capo_lambda.errors.kms_invalid_state_exception.KMSInvalidStateException: <p>Lambda couldn't decrypt the environment variables because the state of the KMS key used is not valid for Decrypt. Check the function's KMS key settings.</p>
        capo_lambda.errors.kms_not_found_exception.KMSNotFoundException: <p>Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.</p>
        capo_lambda.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
        capo_lambda.errors.service_exception.ServiceException: <p>The Lambda service encountered an internal error.</p>
        capo_lambda.errors.too_many_requests_exception.TooManyRequestsException: <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
        capo_lambda.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lambda.types.get_durable_execution_history_request.GetDurableExecutionHistoryRequest]",
    ) -> OperationResponse[
        "capo_lambda.types.get_durable_execution_history_response.GetDurableExecutionHistoryResponse"
    ]:
        import capo_lambda._operations.aws_gir_api_service.get_durable_execution_history

        output, http_response = (
            capo_lambda._operations.aws_gir_api_service.get_durable_execution_history.get_durable_execution_history(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_lambda.types.get_durable_execution_history_response.GetDurableExecutionHistoryResponse",
    ) -> dict[str, Any]:
        import capo_lambda.types.get_durable_execution_history_response

        return capo_lambda.types.get_durable_execution_history_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetDurableExecutionHistory", redact_output=_redact_output
        ),
    )
    input_: capo_lambda.types.get_durable_execution_history_request.GetDurableExecutionHistoryRequest = {
        "durable_execution_arn": durable_execution_arn
    }
    if include_execution_data is not None:
        input_["include_execution_data"] = include_execution_data
    if max_items is not None:
        input_["max_items"] = max_items
    if marker is not None:
        input_["marker"] = marker
    if reverse_order is not None:
        input_["reverse_order"] = reverse_order

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output