# IRPCApplicationTaskQueue.AddScheduledTask

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Server integration API](https://developer.m-files.com/APIs/gRPC-API/integration/index.md) > [Application task queue](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCApplicationTaskQueue/index.md)

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

Badges: `Server integration API / specialized` `write` `session`

Adds a task to a task queue that becomes available for processing at a given time.

- **Service:** [Application task queue](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCApplicationTaskQueue/index.md) `MFiles.IRPCApplicationTaskQueue`
- **gRPC method:** `/MFiles.IRPCApplicationTaskQueue/AddScheduledTask`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/add-scheduled-task`
- **Request:** [`AddScheduledTaskRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCApplicationTaskQueue/AddScheduledTask/index.md#request)
- **Response:** [`AddScheduledTaskResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCApplicationTaskQueue/AddScheduledTask/index.md#response)
- **Book and level:** Server integration API, specialized
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Same as [AddTask](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCApplicationTaskQueue/AddTask/index.md), except that
  [ReserveTasksForProcessing](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCApplicationTaskQueue/ReserveTasksForProcessing/index.md)
  does not return the task before `activation_timestamp`.
- Requires a vault session and the vault right `change_full_control_role`.

<a id="request"></a>

## Request: AddScheduledTaskRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `queue_id` | `string` | The ID of the queue. |
| `restore_to_waiting_timeout_in_minutes` | `int32` | As in [AddTask](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCApplicationTaskQueue/AddTask/index.md); 0 or less means 5 minutes. |
| `task_type` | `string` | A free-form type name that tells the processor how to read `task_data`. |
| `task_data` | `bytes` | The payload of the task. |
| `activation_timestamp` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The earliest time (UTC) at which the task can be reserved. |

<a id="response"></a>

## Response: AddScheduledTaskResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `task_id` | `string` | The ID of the new task, a decimal number as a string. |

<a id="related"></a>

## Related methods

- [AddTask](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCApplicationTaskQueue/AddTask/index.md): Adds a task to a task queue, ready to be reserved at once.
- [ReserveTasksForProcessing](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCApplicationTaskQueue/ReserveTasksForProcessing/index.md): Reserves the next waiting task from each of the given queues for the caller to process.
