getWorkflow method

Future<GetWorkflowResponse> getWorkflow({
  1. required String workflowArn,
  2. String? workflowVersion,
})

Retrieves detailed information about a workflow, including its configuration, status, and metadata.

May throw AccessDeniedException. May throw InternalServerException. May throw OperationTimeoutException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter workflowArn : The Amazon Resource Name (ARN) of the workflow you want to retrieve.

Parameter workflowVersion : Optional. The specific version of the workflow to retrieve. If not specified, the latest version is returned.

Implementation

Future<GetWorkflowResponse> getWorkflow({
  required String workflowArn,
  String? workflowVersion,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonMWAAServerless.GetWorkflow'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'WorkflowArn': workflowArn,
      if (workflowVersion != null) 'WorkflowVersion': workflowVersion,
    },
  );

  return GetWorkflowResponse.fromJson(jsonResponse.body);
}