---
title: HKWorkoutRouteBuilder
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkworkoutroutebuilder
---

# HKWorkoutRouteBuilder

A builder object that incrementally constructs a workout route.

## Declaration

```swift
class HKWorkoutRouteBuilder
```

## Overview

Overview To create a workout route, use seriesBuilder(for:) to instantiate a HKWorkoutRouteBuilder, and provide it with location data throughout the workout. After the workout ends, call the builder’s finishRoute(with:metadata:completion:) method to construct the route. Instantiating a HKWorkoutRouteBuilder directly is discouraged. For detailed instructions, see Creating a workout route.

## Topics

### Creating the builder

- [seriesBuilder(for:)](healthkit/hkworkoutbuilder/seriesbuilder(for:).md)
- [init(healthStore:device:)](healthkit/hkworkoutroutebuilder/init(healthstore:device:).md)

### Building the route

- [finishRoute(with:metadata:completion:)](healthkit/hkworkoutroutebuilder/finishroute(with:metadata:completion:).md)
- [insertRouteData(_:completion:)](healthkit/hkworkoutroutebuilder/insertroutedata(_:completion:).md)
- [addMetadata(_:completion:)](healthkit/hkworkoutroutebuilder/addmetadata(_:completion:).md)

## Relationships

### Inherits From

- [HKSeriesBuilder](healthkit/hkseriesbuilder.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Route data

- [Creating a workout route](healthkit/creating-a-workout-route.md)
- [Reading route data](healthkit/reading-route-data.md)
- [HKWorkoutRoute](healthkit/hkworkoutroute.md)
- [HKWorkoutRouteQueryDescriptor](healthkit/hkworkoutroutequerydescriptor.md)
- [HKWorkoutRouteQuery](healthkit/hkworkoutroutequery.md)
- [HKWorkoutRouteTypeIdentifier](healthkit/hkworkoutroutetypeidentifier.md)
- [HKSeriesBuilder](healthkit/hkseriesbuilder.md)
- [HKSeriesSample](healthkit/hkseriessample.md)
