# PeriodicWorkRequest

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/PeriodicWorkRequest.kt+class:androidx.work.PeriodicWorkRequest) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

*** ** * ** ***


```
public final class PeriodicWorkRequest extends WorkRequest
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.work.WorkRequest](https://developer.android.com/reference/androidx/work/WorkRequest) ||
|   | ↳ | [androidx.work.PeriodicWorkRequest](https://developer.android.com/reference/androidx/work/PeriodicWorkRequest) |

*** ** * ** ***

A `https://developer.android.com/reference/androidx/work/WorkRequest` for repeating work. This work executes multiple times until it is cancelled, with the first execution happening immediately or as soon as the given `https://developer.android.com/reference/androidx/work/Constraints` are met. The next execution will happen during the period interval; note that execution may be delayed because `https://developer.android.com/reference/androidx/work/WorkManager` is subject to OS battery optimizations, such as doze mode.

You can control when the work executes in the period interval more exactly - see `https://developer.android.com/reference/androidx/work/PeriodicWorkRequest.Builder` for documentation on `flexInterval`s.

Periodic work has a minimum interval of 15 minutes.

Periodic work is intended for use cases where you want a fairly consistent delay between consecutive runs, and you are willing to accept inexactness due to battery optimizations and doze mode. Please note that if your periodic work has constraints, it will not execute until the constraints are met, even if the delay between periods has been met.

If you need to schedule work that happens exactly at a certain time or only during a certain time window, you should consider using `https://developer.android.com/reference/androidx/work/OneTimeWorkRequest`s.

The normal lifecycle of a PeriodicWorkRequest is `ENQUEUED -> RUNNING -> ENQUEUED`. By definition, periodic work cannot terminate in a succeeded or failed state, since it must recur. It can only terminate if explicitly cancelled. However, in the case of retries, periodic work will still back off according to `https://developer.android.com/reference/androidx/work/PeriodicWorkRequest.Builder#setBackoffCriteria(androidx.work.BackoffPolicy,kotlin.Long,java.util.concurrent.TimeUnit)`.

Periodic work cannot be part of a chain or graph of work.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/work/PeriodicWorkRequest.Builder extends https://developer.android.com/reference/androidx/work/WorkRequest.Builder<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/work/PeriodicWorkRequest.Builder, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/work/PeriodicWorkRequest>` Builder for `https://developer.android.com/reference/androidx/work/PeriodicWorkRequest`s. |

| ### Constants |
|---|---|
| `static final long` | `https://developer.android.com/reference/androidx/work/PeriodicWorkRequest#MIN_PERIODIC_FLEX_MILLIS()` The minimum flex duration for `https://developer.android.com/reference/androidx/work/PeriodicWorkRequest` (in milliseconds). |
| `static final long` | `https://developer.android.com/reference/androidx/work/PeriodicWorkRequest#MIN_PERIODIC_INTERVAL_MILLIS()` The minimum interval duration for `https://developer.android.com/reference/androidx/work/PeriodicWorkRequest` (in milliseconds). |

### Inherited methods

From [androidx.work.WorkRequest](https://developer.android.com/reference/androidx/work/WorkRequest) `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/UUID.html` `https://developer.android.com/reference/androidx/work/WorkRequest#getId()()`

The unique identifier associated with this unit of work.

## Constants

### MIN_PERIODIC_FLEX_MILLIS

```
public static final long MIN_PERIODIC_FLEX_MILLIS
```

The minimum flex duration for `https://developer.android.com/reference/androidx/work/PeriodicWorkRequest` (in milliseconds).

### MIN_PERIODIC_INTERVAL_MILLIS

```
public static final long MIN_PERIODIC_INTERVAL_MILLIS
```

The minimum interval duration for `https://developer.android.com/reference/androidx/work/PeriodicWorkRequest` (in milliseconds).