getTaskInstance method

Future<GetTaskInstanceResponse> getTaskInstance({
  1. required String runId,
  2. required String taskInstanceId,
  3. required String workflowArn,
})

Retrieves detailed information about a specific task instance within a workflow run. Task instances represent individual tasks that are executed as part of a workflow in the Amazon Managed Workflows for Apache Airflow Serverless environment. Each task instance runs in an isolated ECS container with dedicated resources and security boundaries. The service tracks task execution state, retry attempts, and provides detailed timing and error information for troubleshooting and monitoring purposes.

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

Parameter runId : The unique identifier of the workflow run that contains the task instance.

Parameter taskInstanceId : The unique identifier of the task instance to retrieve.

Parameter workflowArn : The Amazon Resource Name (ARN) of the workflow that contains the task instance.

Implementation

Future<GetTaskInstanceResponse> getTaskInstance({
  required String runId,
  required String taskInstanceId,
  required String workflowArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonMWAAServerless.GetTaskInstance'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'RunId': runId,
      'TaskInstanceId': taskInstanceId,
      'WorkflowArn': workflowArn,
    },
  );

  return GetTaskInstanceResponse.fromJson(jsonResponse.body);
}