describeStateMachine method

Future<DescribeStateMachineOutput> describeStateMachine({
  1. required String stateMachineArn,
  2. IncludedData? includedData,
})

Provides information about a state machine's definition, its IAM role Amazon Resource Name (ARN), and configuration.

A qualified state machine ARN can either refer to a Distributed Map state defined within a state machine, a version ARN, or an alias ARN.

The following are some examples of qualified and unqualified state machine ARNs:

  • The following qualified state machine ARN refers to a Distributed Map state with a label mapStateLabel in a state machine named myStateMachine.

    arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel

  • The following qualified state machine ARN refers to an alias named PROD.

    arn:

  • The following unqualified state machine ARN refers to a state machine named myStateMachine.

    arn:

This API action returns the details for a state machine version if the stateMachineArn you specify is a state machine version ARN.

May throw InvalidArn. May throw KmsAccessDeniedException. May throw KmsInvalidStateException. May throw KmsThrottlingException. May throw StateMachineDoesNotExist.

Parameter stateMachineArn : The Amazon Resource Name (ARN) of the state machine for which you want the information.

If you specify a state machine version ARN, this API returns details about that version. The version ARN is a combination of state machine ARN and the version number separated by a colon (:). For example, stateMachineARN:1.

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<DescribeStateMachineOutput> describeStateMachine({
  required String stateMachineArn,
  IncludedData? includedData,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSStepFunctions.DescribeStateMachine'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'stateMachineArn': stateMachineArn,
      if (includedData != null) 'includedData': includedData.value,
    },
  );

  return DescribeStateMachineOutput.fromJson(jsonResponse.body);
}