# GetAsyncTasksRangeRequest

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.GetAsyncTasksRangeRequest/

A structure that specifies the request type for the WaitForAsyncTaskCompletion method.

- **Full name:** `MFiles.GetAsyncTasksRangeRequest`
- **Proto file:** [`mfiles/IRPCBackgroundOperationsAdmin.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/IRPCBackgroundOperationsAdmin.proto)
- **Request of:** [IRPCBackgroundOperationsAdmin.GetAsyncTasksRange](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetAsyncTasksRange/index.md)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-async_task_start"></a>`async_task_start` | `int64` | 1 | The first task ID to return, or -1 to start from the newest (`latest` true) or the oldest (`latest` false) task. |
| <a id="f-max_count"></a>`max_count` | `uint32` | 2 | The maximum number of tasks to return. 0 returns nothing. |
| <a id="f-latest"></a>`latest` | `bool` | 3 | True to go from `async_task_start` towards older tasks (descending IDs), false to go towards newer tasks (ascending IDs). |
| <a id="f-filters"></a>`filters` | `uint32` | 4 | The task states to include, as a sum of bit values: 1 queued, 2 running, 4 completed successfully, 8 cancelled, 16 failed. 0 includes all tasks. |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCBackgroundOperationsAdmin.WaitForAsyncTaskCompletion](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/WaitForAsyncTaskCompletion/index.md): Waits until the given asynchronous tasks have finished, then optionally returns a list of tasks.

<a id="used-in-fields"></a>

## Used in fields

- [`WaitForAsyncTaskCompletionRequest.tasks_request`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/WaitForAsyncTaskCompletion/index.md#request): Optional. If set, the response carries the result of this [GetAsyncTasksRange](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetAsyncTasksRange/index.md) request, run after the wait. `max_count` must be at most 50.
