Generate a single structured running workout
generate_workoutProduce one concrete running session from the desired stimulus (recovery, endurance, marathon pace, threshold, VO2max, speed, or mixed) and training phase, scaled to fitness anchored by any recent race time via the Riegel power law. Prescriptions follow Daniels-style time-domain quality windows converted to track-friendly distances at the athlete’s own paces. Deterministic for a given seed — vary the seed for a different workout of the same type. Source: ham.run workout generator module.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | Yes | Random seed. Same inputs + same seed reproduce the identical workout; change it to regenerate. | |
| phase | Yes | Training phase — shapes eligible workouts, doses, and the reference copy. | build |
| raceTime | Yes | Recent race time for that distance (current fitness, not a goal). | |
| stimulus | Yes | What the session should train: recovery | endurance | marathon | threshold | vo2max | speed | mixed. | |
| raceDistance | Yes | Distance of the anchor race used to derive paces. | marathon |
| timeBudgetMin | No | Total session cap in minutes (including warm-up/cool-down). Omit for no cap. | |
| speedAdjustPct | Yes | Shift all paces together; positive = faster (feeling sharp), negative = slower. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| why | Yes | Physiological purpose of the session. | |
| text | Yes | The full workout as shareable plain text. | |
| input | Yes | Echo of resolved input parameters. | |
| paces | Yes | Resolved target paces by name (min/km), after any speed adjustment. | |
| phase | Yes | Training phase. | |
| title | Yes | Workout title. | |
| totals | Yes | ||
| citation | Yes | Literature anchor for the session type. | |
| shareUrl | Yes | ham.run link that reproduces this exact workout (seed included) with a Garmin .fit download. | |
| stimulus | Yes | Stimulus trained. | |
| template | Yes | Template id (stable across regenerations of the same workout type). | |
| hamFactor | Yes | How much of a day this session is. | |
| reference | Yes | Ability-anchored framing, e.g. which marathoner runs this and when. | |
| structure | Yes | The workout, section by section. | |
| marathonEquivalent | Yes | Marathon-equivalent time implied by the anchor race (Riegel). |