create_workout
Create a new structured workout in the user's Garmin workout library. It never edits an existing one. A workout reaches the watch once it is scheduled on a date.
Args: name: Shown in Garmin Connect and on the watch. steps: Ordered steps, each with "type" (warmup, interval, recovery, rest, cooldown or repeat) and exactly one of "duration_seconds", "distance_meters" or "until_lap": true (the step ends on the lap button). A repeat is {"type": "repeat", "times": 5, "steps": [...]} and can't contain another repeat. Optional target on a step: "pace" (min/km, "4:05" or ["4:00", "4:10"]), "hr" (bpm [150, 165], or a Garmin zone such as "z2" or "z3-z4") or "power" (watts, 250 or [240, 260]; a share of the FTP set in Garmin, "95%" or ["88%", "94%"]; or a power zone, "z3"). A pace target narrower than 5 s/km either side is widened to that, and a single power value becomes a range 5% either side. Example, 15 min warm-up, 5 x 1 km at 4:05 with 90 s recoveries, 10 min cool-down: [{"type": "warmup", "duration_seconds": 900}, {"type": "repeat", "times": 5, "steps": [{"type": "interval", "distance_meters": 1000, "pace": "4:05"}, {"type": "recovery", "duration_seconds": 90}]}, {"type": "cooldown", "duration_seconds": 600}] sport: running (default), cycling, swimming, walking or hiking. description: Optional note stored with the workout. pool_length_meters: For a swim, 25 (default) or 50.
A swim's steps are whole pool lengths (100, 200...), each with an optional "stroke": freestyle, backstroke, breaststroke, butterfly, im, drill or any. Its "pace" is per 100 m ("1:45") and shows on the step as a note rather than an alert. A "rest" with no duration waits for the lap button; "duration_seconds" fixes its length. A "note" (e.g. "kick with board") shows on the step.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| sport | No | running | |
| steps | Yes | ||
| description | No | ||
| pool_length_meters | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||