Skip to main content
Run states indicate the current status of a W&B run. You can view the state of a run in the W&B App or programmatically using the W&B Python SDK.

Run states

The following table describes the possible states a run can be in:
StateDescription
CrashedRun stopped sending heartbeats in the internal process, which can happen if the machine crashes.
FailedRun ended with a non-zero exit status.
FinishedRun ended and fully synced data, or called wandb.Run.finish().
KilledRun was forcibly stopped before it could finish.
RunningRun is still running and has recently sent a heartbeat.
PendingRun is scheduled but not yet started (common in sweeps and Launch jobs).

Run states in sweeps

When runs are part of a sweep, their states behave independently from the sweep’s status:
  • Individual run states reflect each run’s execution status (Running, Finished, Failed, etc.)
  • Sweep status controls whether new runs are created, not how existing runs execute
  • Pausing or stopping a sweep doesn’t affect already-running runs
  • Only cancelling a sweep forcibly kills running runs (changes their state to Killed)
For a detailed explanation of how sweep and run statuses interact, see Understanding sweep and run statuses.

View the state of a run

Programmatically or interactively view a run’s state with the Python SDK or W&B App.
Use the state property of the wandb.Api.Run object to access the current state of a run.Copy and paste the following code snippet into your Python environment. Replace the values enclosed in angle brackets (< >) with your own values:
import wandb

api = wandb.Api()

runs = api.runs(path="<entity>/<project>")

# Access run object's properties
for run in runs:
    print(f"Run: {run.name}")
    print(f"Run state: {run.state}")
    print()