Skip to content

describe_state_machine_for_execution async

describe_state_machine_for_execution(
    execution_arn: Arn,
    *,
    config_overrides: Optional[AsyncSFNClientConfig] = None,
    included_data: Optional[IncludedData] = None,
) -> DescribeStateMachineForExecutionOutput

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 operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

This API action is not supported by EXPRESS state machines.

Parameters:

  • execution_arn (Arn) –

    The Amazon Resource Name (ARN) of the execution you want state machine information for.

  • included_data (Optional[IncludedData], default: None ) –

    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.

Raises:

Source code in docs_src/capo_sfn/_services/async_sfn.py
async def describe_state_machine_for_execution(
    self,
    execution_arn: "capo_sfn.types.arn.Arn",
    *,
    config_overrides: Optional[AsyncSFNClientConfig] = None,
    included_data: Optional["capo_sfn.types.included_data.IncludedData"] = None,
) -> "capo_sfn.types.describe_state_machine_for_execution_output.DescribeStateMachineForExecutionOutput":
    """<p>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.</p> <note> <p>This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.</p> </note> <p>This API action is not supported by <code>EXPRESS</code> state machines.</p>

    Args:
        execution_arn: <p>The Amazon Resource Name (ARN) of the execution you want state machine information for.</p>
        included_data: <p>If your state machine definition is encrypted with a KMS key, callers must have <code>kms:Decrypt</code> permission to decrypt the definition. Alternatively, you can call the API with <code>includedData = METADATA_ONLY</code> to get a successful response without the encrypted definition.</p>

    Raises:
        capo_sfn.errors.execution_does_not_exist.ExecutionDoesNotExist: <p>The specified execution does not exist.</p>
        capo_sfn.errors.invalid_arn.InvalidArn: <p>The provided Amazon Resource Name (ARN) is not valid.</p>
        capo_sfn.errors.kms_access_denied_exception.KmsAccessDeniedException: <p>Either your KMS key policy or API caller does not have the required permissions.</p>
        capo_sfn.errors.kms_invalid_state_exception.KmsInvalidStateException: <p>The KMS key is not in valid state, for example: Disabled or Deleted.</p>
        capo_sfn.errors.kms_throttling_exception.KmsThrottlingException: <p>Received when KMS returns <code>ThrottlingException</code> for a KMS call that Step Functions makes on behalf of the caller.</p>
        capo_sfn.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sfn.types.describe_state_machine_for_execution_input.DescribeStateMachineForExecutionInput]",
    ) -> AsyncOperationResponse[
        "capo_sfn.types.describe_state_machine_for_execution_output.DescribeStateMachineForExecutionOutput"
    ]:
        import capo_sfn._operations.aws_step_functions.describe_state_machine_for_execution

        (
            output,
            http_response,
        ) = await capo_sfn._operations.aws_step_functions.describe_state_machine_for_execution.async_describe_state_machine_for_execution(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_sfn.types.describe_state_machine_for_execution_output.DescribeStateMachineForExecutionOutput",
    ) -> dict[str, Any]:
        import capo_sfn.types.describe_state_machine_for_execution_output

        return capo_sfn.types.describe_state_machine_for_execution_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "DescribeStateMachineForExecution", redact_output=_redact_output
        ),
    )
    input_: capo_sfn.types.describe_state_machine_for_execution_input.DescribeStateMachineForExecutionInput = {
        "execution_arn": execution_arn
    }
    if included_data is not None:
        input_["included_data"] = included_data

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output