# ScheduledJob

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.ScheduledJob/

Struct for a scheduled job.

- **Full name:** `MFiles.ScheduledJob`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

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

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-id"></a>`id` | `int32` | 1 | Job ID. |
| <a id="f-name"></a>`name` | `string` | 2 | Job name. |
| <a id="f-is_enabled"></a>`is_enabled` | `bool` | 3 | If true, the job is enabled (runs according to the specified schedule). |
| <a id="f-schedule"></a>`schedule` | `bytes` | 4 | The schedule of this job (a serialized Task object of Task Scheduler). |
| <a id="f-type"></a>`type` | [`JobType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.JobType/index.md) | 5 | Job type. Values: `JOB_TYPE_UNINITIALIZED` (0), `JOB_TYPE_BACKUP` (1), `JOB_TYPE_RESTORE` (2), `JOB_TYPE_COPY_VAULT` (3), `JOB_TYPE_VERIFY_VAULT` (4), `JOB_TYPE_ARCHIVE_OBJECTS` (5), `JOB_TYPE_ARCHIVE_OLD_VERSIONS` (6), `JOB_TYPE_RESTORE_FROM_ARCHIVE` (7), `JOB_TYPE_OPTIMIZE_VAULT` (8), `JOB_TYPE_RECALCULATE_PROPERTY` (9), `JOB_TYPE_MIGRATE_VAULT` (10), `JOB_TYPE_ENCRYPT_FILE_DATA` (11). |
| <a id="f-data"></a>`data` | [`JobDataUnion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.JobDataUnion/index.md) | 6 | The job details as a union. |
| <a id="f-is_temporary"></a>`is_temporary` | `bool` | 7 | True if the job is temporary and thus executed only once. Temporary jobs are not scheduled so their run info should not be interpreted. |

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

## Used by methods

- [IRPCScheduledJobsAdmin.AddScheduledJob](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/AddScheduledJob/index.md): Adds a scheduled job to the server or to the vault, depending on the job type.
- [IRPCScheduledJobsAdmin.GetScheduledJob](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/GetScheduledJob/index.md): Gets one scheduled job and its run state.
- [IRPCScheduledJobsAdmin.GetScheduledJobs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/GetScheduledJobs/index.md): Gets the scheduled jobs of the server (server-level session) or of the vault (vault session), with their run state.
- [IRPCScheduledJobsAdmin.ModifyScheduledJob](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/ModifyScheduledJob/index.md): Replaces the definition of an existing scheduled job.

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

## Used in fields

- [`GetScheduledJobsResponse.jobs`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/GetScheduledJobs/index.md#response): The scheduled jobs.
- [`AddScheduledJobRequest.scheduled_job`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/AddScheduledJob/index.md#request): The new job. `id` is ignored.
- [`ModifyScheduledJobRequest.scheduled_job`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/ModifyScheduledJob/index.md#request): The complete new definition of the job, with its `id`.
- [`GetScheduledJobResponse.scheduled_job`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/GetScheduledJob/index.md#response): The job definition.
