Structured Workout Format is a JSON format for structured endurance workouts. Define a workout once, export to SweatStack, Garmin, Intervals.icu, or other platforms.
Training platforms all have their own workout formats. SWF sits in the middle as an interchange format, so you can build tools that work across platforms without dealing with each one individually.
{
"sport": "cycling",
"title": "Sweet Spot 2x20",
"content": [
{
"type": "repeat",
"count": 2,
"content": [
{
"type": "step",
"volume": { "type": "constant", "quantity": "duration", "value": 1200 },
"intensity": {
"type": "range", "quantity": "power",
"min": { "percent": 88, "of": "ftp" },
"max": { "percent": 93, "of": "ftp" }
}
},
{
"type": "step",
"effort": "rest",
"volume": { "type": "constant", "quantity": "duration", "value": 300 }
}
]
}
]
}
The format¶
An SWF document describes a workout as a tree of four content types:
step-- a single effort with volume (duration or distance) and intensity (power, speed, HR, or RPE)repeat-- a counted loop of stepssection-- groups steps into warmup, main, or cooldown phasesnote-- coaching text, standalone or attached to a step
Intensity values can be absolute (250), a percentage of an athlete parameter ({"percent": 88, "of": "ftp"}), or based on time-to-exhaustion ({"tte": 300}). Three shapes: constant, range, and ramp.
Workouts are parameterized. A workout template with {"percent": 90, "of": "ftp"} can be rendered for any athlete by supplying their FTP value at export time.
Export targets¶
| Platform | Status |
|---|---|
| Garmin Training API | Supported |
| Intervals.icu | Supported |
Get started¶
The Python package includes a CLI for validation and export:
swf validate workout.json
swf export garmin workout.json --render '{"ftp": 250}'
swf export intervals-icu workout.json
Validation API¶
POST SWF JSON to /api/validate to validate it against the JSON Schema.
curl -s -X POST https://structuredworkoutformat.dev/api/validate \
-H "Content-Type: application/json" \
-d '{"sport": "cycling", "content": []}'
Returns {"valid": true} or:
CORS is enabled. Content-Type must be application/json.
For AI agents¶
This repo ships an agent skill that teaches AI coding agents how to read and write SWF. If your agent supports Agent Skills, it loads automatically.
Links¶
SWF is developed by SweatStack as a general-purpose format, not tied to any specific platform.