describeExecution method

Future<DescribeExecutionOutput> describeExecution({
  1. required String executionArn,
  2. IncludedData? includedData,
})

Provides information about a state machine execution, such as the state machine associated with the execution, the execution input and output, and relevant execution metadata. If you've redriven an execution, you can use this API action to return information about the redrives of that execution. In addition, you can use this API action to return the Map Run Amazon Resource Name (ARN) if the execution was dispatched by a Map Run.

If you specify a version or alias ARN when you call the StartExecution API action, DescribeExecution returns that ARN. Executions of an EXPRESS state machine aren't supported by DescribeExecution unless a Map Run dispatched them.

May throw ExecutionDoesNotExist. May throw InvalidArn. May throw KmsAccessDeniedException. May throw KmsInvalidStateException. May throw KmsThrottlingException.

Parameter executionArn : The Amazon Resource Name (ARN) of the execution to describe.

Parameter includedData : If your state machine definition is encrypted with a KMS key, callers must have kms:Decrypt permission to decrypt the definition. Alternatively, you can call DescribeStateMachine API with includedData = METADATA_ONLY to get a successful response without the encrypted definition.

Implementation

Future<DescribeExecutionOutput> describeExecution({
  required String executionArn,
  IncludedData? includedData,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSStepFunctions.DescribeExecution'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'executionArn': executionArn,
      if (includedData != null) 'includedData': includedData.value,
    },
  );

  return DescribeExecutionOutput.fromJson(jsonResponse.body);
}