describeStateMachineForExecution method

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

Provides information about a state machine's definition, its execution role ARN, and configuration. If a Map Run dispatched the execution, this action returns the Map Run Amazon Resource Name (ARN) in the response. The state machine returned is the state machine associated with the Map Run. This API action is not supported by EXPRESS state machines.

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 you want state machine information for.

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 the API with includedData = METADATA_ONLY to get a successful response without the encrypted definition.

Implementation

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

  return DescribeStateMachineForExecutionOutput.fromJson(jsonResponse.body);
}