create_workout
Create and preview structured workouts for running, cycling, or swimming, then confirm to sync them to your Garmin watch.
Instructions
Create a structured workout in the athlete's Garmin library.
Args: name: What the session is called, e.g. "Threshold 4x2km". blocks: The session, in order. A block is either a step or a repeat. Step: {"kind": "warmup"|"interval"|"recovery"|"cooldown"|"rest", "duration_s": 1200} or {"distance_m": 2000}, optionally "target_pace": "3:55" and "pace_tolerance_s": 5. Exactly one of duration_s or distance_m per step. Repeat: {"times": 4, "steps": [ ...steps... ]} sport: running, cycling or swimming. description: Optional note attached to the workout. confirm: Must be true to actually create it.
Call this without confirm first. That returns the session written out
in full and creates nothing. Show it to the athlete, and only call again
with confirm=true once they have agreed — this puts a real workout on their
Garmin account and onto their watch, and they should see it before that
happens rather than after.
Example blocks for "20 min easy, then 12 x 1 min at 3:45 with 1 min float": [{"kind": "warmup", "duration_s": 1200}, {"times": 12, "steps": [ {"kind": "interval", "duration_s": 60, "target_pace": "3:45"}, {"kind": "recovery", "duration_s": 60}]}, {"kind": "cooldown", "duration_s": 600}]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| sport | No | running | |
| blocks | Yes | ||
| confirm | No | ||
| description | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||