<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKHealthStore/recoverActiveWorkoutSession(completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKHealthStore(im)recoverActiveWorkoutSessionWithCompletion:"
  },
  "title" : "recoverActiveWorkoutSession(completion:)"
}
-->

# recoverActiveWorkoutSession(completion:)

Recovers an active workout session.

```
func recoverActiveWorkoutSession(completion: @escaping @Sendable (HKWorkoutSession?, (any Error)?) -> Void)
```

```
func recoverActiveWorkoutSession() async throws -> HKWorkoutSession?
```

## Discussion

If your app crashes during an active workout session, the system calls your extension delegate’s <doc://com.apple.documentation/documentation/WatchKit/WKExtensionDelegate/handleActiveWorkoutRecovery()> method the next time your app launches. To recover the workout session, call [`recoverActiveWorkoutSession(completion:)`](/documentation/HealthKit/HKHealthStore/recoverActiveWorkoutSession(completion:)) from your extension delegate’s <doc://com.apple.documentation/documentation/WatchKit/WKExtensionDelegate/handleActiveWorkoutRecovery()> method. HealthKit then attempts to restore the previous workout session, returning either a new session object or an error to the completion block.

As soon as you receive the session object, you must access its builder and set up your data source and delegates again, as described in <doc://com.apple.healthkit/documentation/HealthKit/running-workout-sessions#Start-a-session>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)