listTaskInstances method

Future<ListTaskInstancesResponse> listTaskInstances({
  1. required String runId,
  2. required String workflowArn,
  3. int? maxResults,
  4. String? nextToken,
})

Lists all task instances for a specific workflow run, with optional pagination support.

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

Parameter runId : The unique identifier of the workflow run for which you want a list of task instances.

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

Parameter maxResults : The maximum number of task instances to return in a single response.

Parameter nextToken : The pagination token you need to use to retrieve the next set of results. This value is returned from a previous call to ListTaskInstances.

Implementation

Future<ListTaskInstancesResponse> listTaskInstances({
  required String runId,
  required String workflowArn,
  int? maxResults,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonMWAAServerless.ListTaskInstances'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'RunId': runId,
      'WorkflowArn': workflowArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListTaskInstancesResponse.fromJson(jsonResponse.body);
}