Back to Roadmap

Structured Workout Plans

Planned/structured workouts with interval targets and plan-vs-actual adherence. Designed in SYNTHESIS §10.1 based on TrainingPeaks, Garmin FIT, and OpenAthlete.

Table: workout_plans

  • FK to athletes
  • Title, description, activity_type, scheduled_date
  • Planned targets: duration, distance, TSS, intensity factor
  • structure JSONB: tree of steps with interval targets

Structure format

Step types: warmup, cooldown, active, rest, steady, ramp, repeat, free Duration types: time (seconds), distance (meters), calories, reps, hr_below, hr_above, lap_button, open

Target specification — three modes:

  • Absolute: { "metric": "power", "min": 200, "max": 250 }
  • Zone: { "metric": "power", "zone": 3 } — references athlete's training_zones
  • Percentage: { "metric": "power", "pct_min": 0.75, "pct_max": 0.90, "anchor": "ftp" } — resolves via athlete_metrics

Multiple targets per step (e.g., pace AND HR zone simultaneously). Per-step instructions for coaching notes.

Plan → Execution linkage

activities.workout_plan_id FK links completed activity to the plan it executed. Adherence = compare plan structure against activity streams.

Calendar integration

Polymorphic calendar = UNION of workout_plans (scheduled_date) + activities (start_date) + sleep_sessions + athlete_metrics.

TODO before implementation

  • Zod schema for structure JSONB validation
  • Decide on CrossFit/WOD scoring fields (SYNTHESIS §13 open question)

Depends on

Schema Migration

Reference

See docs/api-research/SYNTHESIS.md §10.1 (Planned/Structured Workouts), §10.5 (Polymorphic Calendar).

Status
Backlog
Priority
Low
Platform
API
Date
1 month ago
Structured Workout Plans - Roadmap - Trainstack