Skip to content

Field notes

Workout Route Files in an Apple Health Export: What the GPX Folder Holds

An Apple Health export keeps GPS routes in a separate workout-routes folder of GPX files, linked from export.xml. Here is what is inside and what to check.

datareferenceorganization
The Optimized Team· ProductUpdated Nov 24, 2026

Introduction#

The workout-routes folder in an Apple Health export holds the GPS path of your workouts, one GPX file per workout that recorded a map. The workout itself lives in export.xml, and a link inside that file points to the route file. If you only open export.xml, you will see the workout but never the path.

That split matters when you keep your own record. The distance, duration and energy figures sit in one place, and the coordinates sit in another. This article covers where the folder sits, how the link works, what a route point holds, and what can be missing.

What the workout-routes folder holds#

Where it sits in the export#

When you export all health data, you get a zip file. Inside it, the export folder holds export.xml and a workout-routes directory with timestamped GPX files for workouts that have a map, as one Apple Community thread describes it. Apple publishes no schema for the export, so what follows comes from third-party guides and open-source readers. Check each point against your own export.

Which workouts get a file#

One third-party guide to the export format describes the folder as GPX files, one per outdoor workout, with GPS, elevation and pace data. It adds that the folder appears only when you record outdoor workouts with an Apple Watch. A workout with no recorded route has no file, so a missing file is not always a fault. Many workouts in your history will have a record in export.xml and nothing in the folder.

How a workout points to its route file#

Inside a Workout element, a WorkoutRoute entry carries a FileReference. One open-source reader collects these linked route files for each workout and resolves them to workout-routes/*.gpx. The same reader normalizes the reference paths so they cannot point outside the export, which is a sensible habit for any script you write.

The exact attribute names and path format are not documented by Apple. Open your own export.xml, search for WorkoutRoute, and read one entry before you write any code against it.

Matching a file back to a workout#

Follow the reference, not the file order. A filename may carry a date, but the link inside the workout is the part that ties a route to a specific session. If two workouts start close together, matching by filename alone can pair the wrong ones. The same care applies to the type identifier on each export record: read what the record says it is, and do not infer it from where it sits.

What one GPX track point holds#

GPX is an XML format. A track (trk) holds one or more segments (trkseg), and each segment holds a series of points (trkpt), as the GPX format overview lays out. Latitude and longitude are the minimum for a point, in decimal degrees on the WGS 84 datum. Elevation, when present, is in meters. Time is in UTC, written in ISO 8601.

The same open-source reader pulls these fields from each point: latitude, longitude, time, horizontal accuracy, elevation, speed and course. It parses without regard to namespaces and handles files that have no extensions. That's a useful hint. Not every file will carry every field, so a parser should regard everything beyond latitude and longitude as optional.

| Field | What it records | Keep in mind | |---|---|---| | Latitude, longitude | Position in decimal degrees | Required for a point | | Elevation | Height in meters | May be absent | | Time | UTC timestamp | Convert before comparing with export.xml | | Horizontal accuracy, speed, course | Extra fields one reader extracts | Not guaranteed in every file |

Because GPX times are UTC, line them up with your other entries carefully. The article on how the export handles time zone offsets covers why an offset belongs to the export and not to the entry.

When files are missing or empty#

Three things can go wrong, and each one deserves a note in your record rather than a silent fix.

  1. The folder is absent. If you recorded no routes, the folder may not exist. A 2020 Apple Community thread also reported an extraction with no workout-routes directory. The report is old and closed without a confirmed fix, so read it as history, not a current rule.
  2. A reference points to a file that is not there. The open-source reader skips route files the export does not contain, and skips invalid points. Do the same, but log how many you skipped.
  3. A file is present but holds no coordinates. The same 2020 thread described GPX files that were valid XML yet carried no coordinate data, each exactly 438 bytes. Check file sizes and point counts before you trust a route.

In all three cases, a gap in the route is a gap in the data, not a zero-length run. If you total distance from points, write down which workouts you could not total and why.

Reading the files for your own records#

You don't have to write a parser. The DuckDB healthkit_export extension accepts the export zip, a folder containing export.xml, or export.xml alone, and lists functions for routes and route points. If you read the files yourself, the XML is plain and any streaming XML reader will do.

Keep the folder with export.xml. If you archive only export.xml, the links inside it point at files you no longer have. The piece on choosing a format for your log archive covers how to keep the pieces together.

What to record#

Keep a short note beside each export you archive:

  • The export date and the number of workouts in export.xml.
  • The number of files in workout-routes, and how many workouts reference a file.
  • Any references with no file, and any files with no coordinates.
  • Whether you converted the UTC times, and to which zone.

Conclusion#

The workout-routes folder is a set of plain GPX files, linked from workouts in export.xml and holding the path that the XML itself leaves out. Keep both together, follow the link rather than the filename, and count what is missing before you rely on a total. Since Apple documents none of this, a real export is the only reliable reference.

Share

X / Twitter