create_library_workout
Save a workout template to the Intervals.icu library, validating structured steps and rendering them into workout text.
Instructions
Use only when the athlete asks to save a workout template in the workout library. Writes to Intervals.icu.
The workout_doc is validated like add_or_update_event (with errors nothing is created) and rendered into the workout text; an empty workout_doc is ignored and description is used. Format: intervals://workout-syntax (get_guide). dry_run shows the request; the answer reads back what Intervals.icu stored and parsed. Schedule it with add_event_from_library.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Workout name, e.g. "Sweet Spot 3x10" | |
| folder | No | Folder or plan by name (case-insensitive) or id; optional if the library has exactly one folder | |
| dry_run | No | true = check and return the exact request, write nothing | |
| distance | No | Planned distance in metres | |
| athlete_id | No | Default: the configured athlete | |
| sport_type | Yes | Sport, e.g. Ride, Run, Swim, Walk, Row, WeightTraining | |
| description | No | Workout text in Intervals.icu syntax or free text; ignored when workout_doc has steps | |
| moving_time | No | Planned moving time in seconds | |
| workout_doc | No | Structured steps, rendered into the text. Format: intervals://workout-syntax |