---
title: "Lists all of the subtasks that are associated with the specified multi-instance
Task."
method: GET
path: "/jobs/{jobId}/tasks/{taskId}/subtasksinfo"
tags: ["Tasks"]
---

# Lists all of the subtasks that are associated with the specified multi-instance
Task.

`GET /jobs/{jobId}/tasks/{taskId}/subtasksinfo`

If the Task is not a multi-instance Task then this returns an empty collection.

## Path parameters

- `jobId` string, required
- `taskId` string, required

## Query parameters

- `api-version` string, required
- `timeOut` integer
- `$select` string[]

## Headers

- `client-request-id` string
- `return-client-request-id` boolean
- `ocp-date` string, date-time-rfc7231

## Response `200`

The request has succeeded.

- BatchTaskListSubtasksResult — The result of listing the subtasks of a Task.
  - `value` BatchSubtask[] — The list of subtasks.
    - `id` integer — The ID of the subtask.
    - `nodeInfo` BatchNodeInfo — Information about the Compute Node on which a Task ran.
      - `affinityId` string — An identifier for the Node on which the Task ran, which can be passed when adding a Task to request that the Task be scheduled on this Compute Node.
      - `nodeUrl` string, uri — The URL of the Compute Node on which the Task ran.
      - `poolId` string — The ID of the Pool on which the Task ran.
      - `nodeId` string — The ID of the Compute Node on which the Task ran.
      - `taskRootDirectory` string — The root directory of the Task on the Compute Node.
      - `taskRootDirectoryUrl` string, uri — The URL to the root directory of the Task on the Compute Node.
    - `startTime` string, date-time — The time at which the subtask started running. If the subtask has been restarted or retried, this is the most recent time at which the subtask started running.
    - `endTime` string, date-time — The time at which the subtask completed. This property is set only if the subtask is in the Completed state.
    - `exitCode` integer — The exit code of the program specified on the subtask command line. This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
    - `containerInfo` BatchTaskContainerExecutionInfo — Contains information about the container which a Task is executing.
      - `containerId` string — The ID of the container.
      - `state` string — The state of the container. This is the state of the container according to the Docker service. It is equivalent to the status field returned by "docker inspect".
      - `error` string — Detailed error information about the container. This is the detailed error string from the Docker service, if available. It is equivalent to the error field returned by "docker inspect".
    - `failureInfo` BatchTaskFailureInfo — Information about a Task failure.
      - `category` 'usererror' | 'servererror', required — BatchErrorSourceCategory enums
      - `code` string — An identifier for the Task error. Codes are invariant and are intended to be consumed programmatically.
      - `message` string — A message describing the Task error, intended to be suitable for display in a user interface.
      - `details` NameValuePair[] — A list of additional details related to the error.
        - `name` string — The name in the name-value pair.
        - `value` string — The value in the name-value pair.
    - `state` 'preparing' | 'running' | 'completed' — BatchSubtaskState enums
    - `stateTransitionTime` string, date-time — The time at which the subtask entered its current state.
    - `previousState` 'preparing' | 'running' | 'completed' — BatchSubtaskState enums
    - `previousStateTransitionTime` string, date-time — The time at which the subtask entered its previous state. This property is not set if the subtask is in its initial running state.
    - `result` 'success' | 'failure' — BatchTaskExecutionResult enums
  - `odata.nextLink` string, uri — The URL to get the next set of results.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/batch-batch.md) · [All operations](https://skmtc.net/azure/apis/batch-batch/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/batch-batch/revisions/8427acd8fd77/schema)
