# WorkInfo

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

*** ** * ** ***


```
class WorkInfo
```

<br />

*** ** * ** ***

Information about a particular `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` containing the id of the WorkRequest, its current `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State`, output, tags, and run attempt count. Note that output is only available for the terminal states (`https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State#SUCCEEDED` and `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State#FAILED`).

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.PeriodicityInfo` A periodic work's interval and flex duration |
| `enum https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html<https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State>` The current lifecycle state of a `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_APP_STANDBY() = 12` The current standby bucket requires that the job stop now. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_BACKGROUND_RESTRICTION() = 11` The app is restricted from running in the background. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_CANCELLED_BY_APP() = 1` The worker was cancelled directly by the app, either by calling cancel methods, e.g. `https://developer.android.com/reference/kotlin/androidx/work/WorkManager#cancelUniqueWork(kotlin.String)`, or enqueueing uniquely named worker with a policy that cancels an existing worker, e.g. `https://developer.android.com/reference/kotlin/androidx/work/ExistingWorkPolicy#REPLACE`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_CONSTRAINT_BATTERY_NOT_LOW() = 5` The requested battery-not-low constraint is no longer satisfied. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_CONSTRAINT_CHARGING() = 6` The requested charging constraint is no longer satisfied. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_CONSTRAINT_CONNECTIVITY() = 7` The requested connectivity constraint is no longer satisfied. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_CONSTRAINT_DEVICE_IDLE() = 8` The requested idle constraint is no longer satisfied. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_CONSTRAINT_STORAGE_NOT_LOW() = 9` The requested storage-not-low constraint is no longer satisfied. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_DEVICE_STATE() = 4` The device state (eg. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_ESTIMATED_APP_LAUNCH_TIME_CHANGED() = 15` The system's estimate of when the app will be launched changed significantly enough to decide this worker shouldn't be running right now. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_FOREGROUND_SERVICE_TIMEOUT()` The foreground worker used up its maximum execution time and timed out. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_NOT_STOPPED()` Additional stop reason, that is returned from `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#stopReason()` in cases when a worker in question wasn't stopped. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_PREEMPT() = 2` The job was stopped to run a higher priority job of the app. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_QUOTA() = 10` The app has consumed all of its current quota. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_SYSTEM_PROCESSING() = 14` The system is doing some processing that requires stopping this job. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_TIMEOUT() = 3` The worker used up its maximum execution time and timed out. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_UNKNOWN()` Stop reason that is used in cases when worker did stop, but the reason for this is unknown. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_USER() = 13` The user stopped the job. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#WorkInfo(java.util.UUID,androidx.work.WorkInfo.State,kotlin.collections.Set,androidx.work.Data,androidx.work.Data,kotlin.Int,kotlin.Int,androidx.work.Constraints,kotlin.Long,androidx.work.WorkInfo.PeriodicityInfo,kotlin.Long,kotlin.Int,kotlin.String)( id: https://developer.android.com/reference/java/util/UUID.html, state: https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State, tags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>, outputData: https://developer.android.com/reference/kotlin/androidx/work/Data, progress: https://developer.android.com/reference/kotlin/androidx/work/Data, runAttemptCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, generation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, constraints: https://developer.android.com/reference/kotlin/androidx/work/Constraints, initialDelayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, periodicityInfo: https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.PeriodicityInfo?, nextScheduleTimeMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, stopReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, workerClassName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/work/Constraints` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#constraints()` `https://developer.android.com/reference/kotlin/androidx/work/Constraints` of this worker. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#generation()` The latest generation of this Worker. |
| `https://developer.android.com/reference/java/util/UUID.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#id()` The identifier of the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#initialDelayMillis()` The initial delay for this work set in the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#nextScheduleTimeMillis()` The earliest time this work is eligible to run next, if this work is `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State#ENQUEUED`. |
| `https://developer.android.com/reference/kotlin/androidx/work/Data` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#outputData()` The output `https://developer.android.com/reference/kotlin/androidx/work/Data` for the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.PeriodicityInfo?` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#periodicityInfo()` For periodic work, the period and flex duration set in the `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest`. |
| `https://developer.android.com/reference/kotlin/androidx/work/Data` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#progress()` The progress `https://developer.android.com/reference/kotlin/androidx/work/Data` associated with the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#runAttemptCount()` The run attempt count of the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#state()` The current `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State` of the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#stopReason()` The reason why this worker was stopped on the previous run attempt. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#tags()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html` of tags associated with the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#workerClassName()` The worker class specified when the work request was enqueued. |

## Constants

### STOP_REASON_APP_STANDBY

```
const val STOP_REASON_APP_STANDBY = 12: Int
```

The current standby bucket requires that the job stop now.

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/job/JobParameters.html#STOP_REASON_APP_STANDBY` |   |

### STOP_REASON_BACKGROUND_RESTRICTION

```
const val STOP_REASON_BACKGROUND_RESTRICTION = 11: Int
```

The app is restricted from running in the background.

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/job/JobParameters.html#STOP_REASON_BACKGROUND_RESTRICTION` |   |

### STOP_REASON_CANCELLED_BY_APP

```
const val STOP_REASON_CANCELLED_BY_APP = 1: Int
```

The worker was cancelled directly by the app, either by calling cancel methods, e.g. `https://developer.android.com/reference/kotlin/androidx/work/WorkManager#cancelUniqueWork(kotlin.String)`, or enqueueing uniquely named worker with a policy that cancels an existing worker, e.g. `https://developer.android.com/reference/kotlin/androidx/work/ExistingWorkPolicy#REPLACE`.

### STOP_REASON_CONSTRAINT_BATTERY_NOT_LOW

```
const val STOP_REASON_CONSTRAINT_BATTERY_NOT_LOW = 5: Int
```

The requested battery-not-low constraint is no longer satisfied.

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/job/JobInfo.Builder.html#setRequiresBatteryNotLow(boolean)` |   |

### STOP_REASON_CONSTRAINT_CHARGING

```
const val STOP_REASON_CONSTRAINT_CHARGING = 6: Int
```

The requested charging constraint is no longer satisfied.

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/job/JobInfo.Builder.html#setRequiresCharging(boolean)` |   |

### STOP_REASON_CONSTRAINT_CONNECTIVITY

```
const val STOP_REASON_CONSTRAINT_CONNECTIVITY = 7: Int
```

The requested connectivity constraint is no longer satisfied.

### STOP_REASON_CONSTRAINT_DEVICE_IDLE

```
const val STOP_REASON_CONSTRAINT_DEVICE_IDLE = 8: Int
```

The requested idle constraint is no longer satisfied.

### STOP_REASON_CONSTRAINT_STORAGE_NOT_LOW

```
const val STOP_REASON_CONSTRAINT_STORAGE_NOT_LOW = 9: Int
```

The requested storage-not-low constraint is no longer satisfied.

### STOP_REASON_DEVICE_STATE

```
const val STOP_REASON_DEVICE_STATE = 4: Int
```

The device state (eg. Doze, battery saver, memory usage, etc) requires WorkManager to stop this worker.

### STOP_REASON_ESTIMATED_APP_LAUNCH_TIME_CHANGED

```
const val STOP_REASON_ESTIMATED_APP_LAUNCH_TIME_CHANGED = 15: Int
```

The system's estimate of when the app will be launched changed significantly enough to decide this worker shouldn't be running right now.

### STOP_REASON_FOREGROUND_SERVICE_TIMEOUT

```
const val STOP_REASON_FOREGROUND_SERVICE_TIMEOUT: Int
```

The foreground worker used up its maximum execution time and timed out.

Foreground workers have a maximum execution time limit depending on the `https://developer.android.com/reference/kotlin/androidx/work/ForegroundInfo` type. See the notes on `https://developer.android.com/reference/android/content/pm/ServiceInfo.html` types.

### STOP_REASON_NOT_STOPPED

```
const val STOP_REASON_NOT_STOPPED: Int
```

Additional stop reason, that is returned from `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#stopReason()` in cases when a worker in question wasn't stopped. E.g. when a worker was just enqueued, but didn't run yet.

### STOP_REASON_PREEMPT

```
const val STOP_REASON_PREEMPT = 2: Int
```

The job was stopped to run a higher priority job of the app.

### STOP_REASON_QUOTA

```
const val STOP_REASON_QUOTA = 10: Int
```

The app has consumed all of its current quota. Each app is assigned a quota of how much it can run workers within a certain time frame. The quota is informed, in part, by app standby buckets.

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/job/JobParameters.html#STOP_REASON_QUOTA` |   |

### STOP_REASON_SYSTEM_PROCESSING

```
const val STOP_REASON_SYSTEM_PROCESSING = 14: Int
```

The system is doing some processing that requires stopping this job.

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/job/JobParameters.html#STOP_REASON_SYSTEM_PROCESSING` |   |

### STOP_REASON_TIMEOUT

```
const val STOP_REASON_TIMEOUT = 3: Int
```

The worker used up its maximum execution time and timed out. Each individual worker has a maximum execution time limit, regardless of how much total quota the app has. See the note on `https://developer.android.com/reference/android/app/job/JobScheduler.html` for the execution time limits.

### STOP_REASON_UNKNOWN

```
const val STOP_REASON_UNKNOWN: Int
```

Stop reason that is used in cases when worker did stop, but the reason for this is unknown. For example, when the app abruptly stopped due to a crash or when a device suddenly ran out of the battery.

### STOP_REASON_USER

```
const val STOP_REASON_USER = 13: Int
```

The user stopped the job. This can happen either through force-stop, adb shell commands, uninstalling, or some other UI.

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/job/JobParameters.html#STOP_REASON_USER` |   |

## Public constructors

### WorkInfo

Added in [2.12.0](https://developer.android.com/jetpack/androidx/releases/work#2.12.0)

```
WorkInfo(
    id: UUID,
    state: WorkInfo.State,
    tags: Set<String>,
    outputData: Data = Data.EMPTY,
    progress: Data = Data.EMPTY,
    runAttemptCount: Int = 0,
    generation: Int = 0,
    constraints: Constraints = Constraints.NONE,
    initialDelayMillis: Long = 0,
    periodicityInfo: WorkInfo.PeriodicityInfo? = null,
    nextScheduleTimeMillis: Long = Long.MAX_VALUE,
    stopReason: Int = STOP_REASON_NOT_STOPPED,
    workerClassName: String? = null
)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### constraints

Added in [2.9.0](https://developer.android.com/jetpack/androidx/releases/work#2.9.0)

```
val constraints: Constraints
```

`https://developer.android.com/reference/kotlin/androidx/work/Constraints` of this worker.

### generation

Added in [2.8.0](https://developer.android.com/jetpack/androidx/releases/work#2.8.0)

```
val generation: Int
```

The latest generation of this Worker.

A work has multiple generations, if it was updated via `https://developer.android.com/reference/kotlin/androidx/work/WorkManager#updateWork(androidx.work.WorkRequest)` or `https://developer.android.com/reference/kotlin/androidx/work/WorkManager#enqueueUniquePeriodicWork(kotlin.String,androidx.work.ExistingPeriodicWorkPolicy,androidx.work.PeriodicWorkRequest)` using `https://developer.android.com/reference/kotlin/androidx/work/ExistingPeriodicWorkPolicy#UPDATE`.

If this worker is currently running, it can possibly be of an older generation rather than returned by this function if an update has happened during an execution of this worker.

### id

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
val id: UUID
```

The identifier of the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`.

### initialDelayMillis

Added in [2.9.0](https://developer.android.com/jetpack/androidx/releases/work#2.9.0)

```
val initialDelayMillis: Long
```

The initial delay for this work set in the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`

### nextScheduleTimeMillis

Added in [2.9.0](https://developer.android.com/jetpack/androidx/releases/work#2.9.0)

```
val nextScheduleTimeMillis: Long
```

The earliest time this work is eligible to run next, if this work is `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State#ENQUEUED`.

This is the earliest `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()` time that WorkManager would consider running this work, regardless of any other system. It only represents the time that the initialDelay, periodic configuration, and backoff criteria are considered to be met.

Work will almost never run at this time in the real world. This method is intended for use in scheduling tests or to check set schedules in app. Work run times are dependent on many factors like the underlying system scheduler, doze and power saving modes of the OS, and meeting any configured constraints. This is expected and is not considered a bug.

The returned value may be in the past if the work was not able to run at that time. It will be eligible to run any time after that time.

Defaults to `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/-companion/-m-a-x_-v-a-l-u-e.html` for all other states, including if the work is currently `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State#RUNNING` or `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State#BLOCKED` on prerequisite work.

Even if this value is set, the work may not be registered with the system scheduler if there are limited scheduling slots or other factors.

### outputData

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
val outputData: Data
```

The output `https://developer.android.com/reference/kotlin/androidx/work/Data` for the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. If the WorkRequest is unfinished, this is always `https://developer.android.com/reference/kotlin/androidx/work/Data#EMPTY()`.

### periodicityInfo

Added in [2.9.0](https://developer.android.com/jetpack/androidx/releases/work#2.9.0)

```
val periodicityInfo: WorkInfo.PeriodicityInfo?
```

For periodic work, the period and flex duration set in the `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest`.

Null if this is onetime work.

### progress

Added in [2.3.0](https://developer.android.com/jetpack/androidx/releases/work#2.3.0)

```
val progress: Data
```

The progress `https://developer.android.com/reference/kotlin/androidx/work/Data` associated with the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`.

### runAttemptCount

Added in [2.1.0](https://developer.android.com/jetpack/androidx/releases/work#2.1.0)

```
val runAttemptCount: Int
```

The run attempt count of the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. Note that for `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest`s, the run attempt count gets reset between successful runs.

### state

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
val state: WorkInfo.State
```

The current `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State` of the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`.

### stopReason

Added in [2.9.0](https://developer.android.com/jetpack/androidx/releases/work#2.9.0)

```
val stopReason: Int
```

The reason why this worker was stopped on the previous run attempt.

For a worker being stopped, at first it should have attempted to run, i.e. its state should be == RUNNING and then `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker#onStopped()` should have been called, resulting in this worker's state going back `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State#ENQUEUED`. In this situation (`runAttemptCount > 0` and `state == ENQUEUED`) this `stopReason` property could be checked to see for additional information. Please note, that this state (`runAttemptCount > 0` and `state == ENQUEUED`) can happen not only because a worker was stopped, but also when a worker returns `ListenableWorker.Result.retry()`. In this situation this property will return `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo#STOP_REASON_NOT_STOPPED()`.

Value is one of the following:

- `-512`
- `-256`
- `-128`
- `1`
- `2`
- `3`
- `4`
- `5`
- `6`
- `7`
- `8`
- `9`
- `10`
- `11`
- `12`
- `13`
- `14`
- `15`

<br />

### tags

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
val tags: Set<String>
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html` of tags associated with the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`.

### workerClassName

Added in [2.12.0](https://developer.android.com/jetpack/androidx/releases/work#2.12.0)

```
val workerClassName: String?
```

The worker class specified when the work request was enqueued.