tp_create_workout
Create a planned workout with simplified interval structure or native TrainingPeaks structured workout payload. Automatically compute duration from structure if not provided.
Instructions
Create a planned workout with optional simplified interval structure or native TrainingPeaks structured_workout payload. Duration is auto-computed only from simplified structure when not provided.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rpe | No | Rating of perceived exertion (RPE), 0-10. | |
| date | Yes | YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS | |
| tags | No | Optional comma-separated tags | |
| sport | Yes | ||
| title | Yes | Workout title | |
| athlete | No | Target athlete name or ID (coach accounts only). Omit to use your own profile. | |
| feeling | No | TrainingPeaks feeling value (0-10). | |
| is_hidden | No | Whether to hide the workout | |
| structure | No | Interval structure as a JSON object or string. Format: {"steps": [...], "primaryIntensityMetric": "percentOfFtp"|"percentOfThresholdHr"|"percentOfThresholdPace"}. Each step is either a single interval or a repetition block. SINGLE STEP: {"name": "Endurance", "duration_seconds": 1200, "intensity_min": 65, "intensity_max": 75, "intensityClass": "active"}. REPETITION BLOCK: {"type": "repetition", "reps": 5, "steps": [{"name": "VO2max", "duration_seconds": 180, "intensity_min": 106, "intensity_max": 120, "intensityClass": "active"}, {"name": "Spin", "duration_seconds": 180, "intensity_min": 40, "intensity_max": 50, "intensityClass": "rest"}]}. FOR MULTIPLE SETS separated by longer recovery, alternate repetition blocks with single rest steps: [{"type": "repetition", "reps": 4, "steps": [...]}, {"name": "Block Recovery", "duration_seconds": 600, "intensity_min": 45, "intensity_max": 55, "intensityClass": "rest"}, {"type": "repetition", "reps": 4, "steps": [...]}]. intensityClass values: warmUp, active (work intervals), rest (all recovery), coolDown, other. Intensity values are % of threshold (FTP/HR/pace). Optional per-step: cadence_min, cadence_max (rpm). | |
| subtype_id | No | Workout subtype ID from tp_get_workout_types | |
| description | No | Optional description | |
| distance_km | No | Optional distance in km | |
| tss_planned | No | Optional planned TSS | |
| duration_minutes | No | Planned duration in minutes (optional if structure provided) | |
| structured_workout | No | Native TrainingPeaks structured workout payload in builder format. Use this only when you already have a TP structure object with keys like structure, polyline, primaryLengthMetric, primaryIntensityMetric, and primaryIntensityTargetOrRange. |