Examples¶
Complete SWF documents you can copy and run. The test suite validates all of them.
New to SWF? Getting Started walks through the format one concept at a time.
Find an example by tag
cycling: Minimal workout, Constant intensity, Open-ended step, Rest steps, Repeat, Nested repeats, Notes, Intensity range, Intensity ramp, Training zones, Parameter references, Time-to-exhaustion, Mixed references, Parameterised repeat count, Cycling: threshold intervals
running: Duration volume, Distance volume, No intensity target, Sections, Repeat count range, Heart rate, Speed, Perceived exertion, Running: track intervals
swimming: Swimming: pool set, Swimming: open water
open-water: Swimming: open water
duration: Minimal workout, Duration volume, Constant intensity, No intensity target, Rest steps, Repeat, Nested repeats, Sections, Notes, Intensity range, Intensity ramp, Training zones, Parameter references, Time-to-exhaustion, Mixed references, Parameterised repeat count, Heart rate, Perceived exertion, Cycling: threshold intervals, Running: track intervals, Swimming: open water
distance: Distance volume, Repeat count range, Speed, Running: track intervals, Swimming: pool set
open-volume: Open-ended step, Rest steps
power: Constant intensity, Open-ended step, Rest steps, Repeat, Nested repeats, Notes, Intensity range, Intensity ramp, Training zones, Parameter references, Time-to-exhaustion, Mixed references, Parameterised repeat count, Cycling: threshold intervals
heart-rate: Heart rate
speed: Repeat count range, Speed, Running: track intervals, Swimming: pool set, Swimming: open water
rpe: Perceived exertion
open-intensity: Minimal workout, Duration volume, Distance volume, No intensity target, Sections
range: Intensity range, Parameter references, Mixed references, Heart rate, Cycling: threshold intervals, Swimming: pool set, Swimming: open water
ramp: Intensity ramp
zone: Training zones
parameter: Parameter references, Mixed references, Cycling: threshold intervals, Running: track intervals, Swimming: pool set, Swimming: open water
tte: Time-to-exhaustion
repeat: Repeat, Nested repeats, Parameterised repeat count, Repeat count range, Cycling: threshold intervals, Running: track intervals
nested-repeat: Nested repeats
repeat-range: Repeat count range
repeat-parameter: Parameterised repeat count
section: Sections
warmup: Sections
main: Sections
cooldown: Sections
note: Notes
rest: Rest steps, Repeat, Nested repeats, Cycling: threshold intervals, Running: track intervals
pool-length: Swimming: pool set
Minimal workout¶
The smallest useful document: a sport and one step.
{
"title": "Minimal workout",
"sport": "cycling",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 1800
}
}
]
}
Duration volume¶
Volumes are seconds. 1800 is 30 minutes.
{
"title": "Duration volume",
"sport": "running",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 1800
}
}
]
}
Distance volume¶
Volumes are metres. 5000 is 5 km.
{
"title": "Distance volume",
"sport": "running",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "distance",
"value": 5000
}
}
]
}
Constant intensity¶
A single target value to hold.
{
"title": "Constant intensity",
"sport": "cycling",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 1200
},
"intensity": {
"type": "constant",
"quantity": "power",
"value": 220
}
}
]
}
Open-ended step¶
Leave out volume and the step runs until you press lap.
{
"title": "Open-ended step",
"sport": "cycling",
"content": [
{
"type": "step",
"intensity": {
"type": "constant",
"quantity": "power",
"value": 200
}
}
]
}
No intensity target¶
Leave out intensity when the effort is the athlete's call.
{
"title": "No intensity target",
"sport": "running",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 2400
}
}
]
}
Rest steps¶
An effort of rest marks recovery: with a volume, or bare for an open-ended rest.
{
"title": "Rest steps",
"sport": "cycling",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 300
},
"intensity": {
"type": "constant",
"quantity": "power",
"value": 250
}
},
{
"type": "step",
"effort": "rest",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 120
}
},
{
"type": "step",
"effort": "rest"
}
]
}
Repeat¶
Loop a block a fixed number of times.
{
"title": "Repeat",
"sport": "cycling",
"content": [
{
"type": "repeat",
"count": 4,
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 300
},
"intensity": {
"type": "constant",
"quantity": "power",
"value": 250
}
},
{
"type": "step",
"effort": "rest",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 120
}
}
]
}
]
}
Nested repeats¶
Repeats nest. This is 3 sets of 4 sprints.
{
"title": "Nested repeats",
"sport": "cycling",
"content": [
{
"type": "repeat",
"count": 3,
"content": [
{
"type": "repeat",
"count": 4,
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 30
},
"intensity": {
"type": "constant",
"quantity": "power",
"value": 300
}
}
]
},
{
"type": "step",
"effort": "rest",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 300
}
}
]
}
]
}
Sections¶
Group content into warmup, main and cooldown.
{
"title": "Sections",
"sport": "running",
"content": [
{
"type": "section",
"phase": "warmup",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 600
}
}
]
},
{
"type": "section",
"phase": "main",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 1800
}
}
]
},
{
"type": "section",
"phase": "cooldown",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 600
}
}
]
}
]
}
Notes¶
Standalone notes sit in the flow. Step notes attach to one effort.
{
"title": "Notes",
"sport": "cycling",
"content": [
{
"type": "note",
"text": "Calibrate the trainer before starting"
},
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 600
},
"intensity": {
"type": "constant",
"quantity": "power",
"value": 200
},
"note": "Stay seated, smooth pedalling"
}
]
}
Intensity range¶
A target band instead of a single number.
{
"title": "Intensity range",
"sport": "cycling",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 1200
},
"intensity": {
"type": "range",
"quantity": "power",
"min": 220,
"max": 250
}
}
]
}
Intensity ramp¶
Linear progression from start to end, for a warm-up that builds.
{
"title": "Intensity ramp",
"sport": "cycling",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 600
},
"intensity": {
"type": "ramp",
"quantity": "power",
"start": 120,
"end": 220
}
}
]
}
Training zones¶
Reference the athlete's own device zones. of is 3, 5 or 7.
{
"title": "Training zones",
"sport": "cycling",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 3600
},
"intensity": {
"type": "zone",
"quantity": "power",
"zone": 2,
"of": 5
}
}
]
}
Parameter references¶
A percentage of a named parameter makes the workout a template. Supply ftp at export.
{
"title": "Parameter references",
"sport": "cycling",
"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"
}
}
}
]
}
Time-to-exhaustion¶
A tte of 300 means the intensity you can hold for 300 seconds.
{
"title": "Time-to-exhaustion",
"sport": "cycling",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 300
},
"intensity": {
"type": "constant",
"quantity": "power",
"value": {
"tte": 300
}
}
}
]
}
Mixed references¶
Absolute and parameter bounds can mix inside one range.
{
"title": "Mixed references",
"sport": "cycling",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 600
},
"intensity": {
"type": "range",
"quantity": "power",
"min": 200,
"max": {
"percent": 85,
"of": "ftp"
}
}
}
]
}
Parameterised repeat count¶
Repeat counts take parameters too, so set length can vary by athlete.
{
"title": "Parameterised repeat count",
"sport": "cycling",
"content": [
{
"type": "repeat",
"count": {
"percent": 100,
"of": "num_intervals"
},
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 240
},
"intensity": {
"type": "constant",
"quantity": "power",
"value": 250
}
}
]
}
]
}
Repeat count range¶
A count of min 3, max 5 prescribes a range of reps.
{
"title": "Repeat count range",
"sport": "running",
"content": [
{
"type": "repeat",
"count": {
"min": 3,
"max": 5
},
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "distance",
"value": 400
},
"intensity": {
"type": "constant",
"quantity": "speed",
"value": 5.0
}
}
]
}
]
}
Heart rate¶
Heart rate in BPM.
{
"title": "Heart rate",
"sport": "running",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 3600
},
"intensity": {
"type": "range",
"quantity": "heart_rate",
"min": 135,
"max": 145
}
}
]
}
Speed¶
Speed in m/s. 4.17 is 4:00/km.
{
"title": "Speed",
"sport": "running",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "distance",
"value": 1000
},
"intensity": {
"type": "constant",
"quantity": "speed",
"value": 4.17
}
}
]
}
Perceived exertion¶
CR10 (0-10) or Borg (6-20). RPE takes absolute values only.
{
"title": "Perceived exertion",
"sport": "running",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 600
},
"intensity": {
"type": "constant",
"quantity": "rpe_cr10",
"value": 7
}
},
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 600
},
"intensity": {
"type": "constant",
"quantity": "rpe_borg",
"value": 15
}
}
]
}
Cycling: threshold intervals¶
4x8min at threshold with recovery, as a percentage of the athlete's FTP.
{
"title": "Cycling: threshold intervals",
"sport": "cycling.road",
"content": [
{
"type": "repeat",
"count": 4,
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 480
},
"intensity": {
"type": "range",
"quantity": "power",
"min": {
"percent": 95,
"of": "threshold"
},
"max": {
"percent": 105,
"of": "threshold"
}
}
},
{
"type": "step",
"effort": "rest",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 240
}
}
]
}
]
}
Running: track intervals¶
5x1km at threshold pace with a fixed recovery.
{
"title": "Running: track intervals",
"sport": "running.track",
"content": [
{
"type": "repeat",
"count": 5,
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "distance",
"value": 1000
},
"intensity": {
"type": "constant",
"quantity": "speed",
"value": {
"percent": 105,
"of": "threshold"
}
}
},
{
"type": "step",
"effort": "rest",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 180
}
}
]
}
]
}
Swimming: pool set¶
Pool swims set pool_length in metres. Pace is a percentage of threshold.
{
"title": "Swimming: pool set",
"sport": "swimming.pool",
"pool_length": 25,
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "distance",
"value": 400
},
"intensity": {
"type": "range",
"quantity": "speed",
"min": {
"percent": 83.3,
"of": "threshold"
},
"max": {
"percent": 95.2,
"of": "threshold"
}
}
}
]
}
Swimming: open water¶
Open water is prescribed by time, because GPS distance is unreliable in the water.
{
"title": "Swimming: open water",
"sport": "swimming.open_water",
"content": [
{
"type": "step",
"volume": {
"type": "constant",
"quantity": "duration",
"value": 1800
},
"note": "Sight every 6-8 strokes",
"intensity": {
"type": "range",
"quantity": "speed",
"min": {
"percent": 83.3,
"of": "threshold"
},
"max": {
"percent": 95.2,
"of": "threshold"
}
}
}
]
}
All 26 examples live in examples/.