---
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

- `$select` string
- `timeout` integer
- `api-version` string, required

## Headers

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

## Response `200`

A response containing the list of subtasks.

- CloudTaskListSubtasksResult
  - `value` SubtaskInformation[]
    - `id` integer
    - `nodeInfo` ComputeNodeInformation
      - `affinityId` string
      - `nodeUrl` string
      - `poolId` string
      - `nodeId` string
      - `taskRootDirectory` string
      - `taskRootDirectoryUrl` string
    - `startTime` string, date-time
    - `endTime` string, date-time — This property is set only if the subtask is in the Completed state.
    - `exitCode` integer — 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` TaskContainerExecutionInformation
      - `containerId` string
      - `state` string — 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 — This is the detailed error string from the Docker service, if available. It is equivalent to the error field returned by "docker inspect".
    - `failureInfo` TaskFailureInformation
      - `category` 'usererror' | 'servererror', required
      - `code` string
      - `message` string
      - `details` NameValuePair[]
        - `name` string
        - `value` string
    - `state` 'preparing' | 'running' | 'completed'
    - `stateTransitionTime` string, date-time
    - `previousState` 'preparing' | 'running' | 'completed'
    - `previousStateTransitionTime` string, date-time — This property is not set if the subtask is in its initial running state.
    - `result` 'success' | 'failure'

## Other responses

- `default` — The error from the Batch service.

---

[API](https://skmtc.net/azure/apis/batchservice.md) · [All operations](https://skmtc.net/azure/apis/batchservice/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/batchservice/versions/4c9161203dbe/schema)
