create_workout
ChatGPTtrainer, a treadmill, an elliptical or a rower via targetMachine (default trainer) and holds an ordered list of sections plus optional global rules. Each section has a duration in seconds, a target and optional adaptive rules. Targets: trainer or elliptical { targetPower: { watts } } or { resistance: { level } }; treadmill { speed: { kilometersPerHour } }, { incline: { percent } } or { speedAndIncline: {…} }; rower { rowerResistance: { level } }; any machine { inherit: {} }, which carries the previous target and can't be first. The declared machine must agree with every section target, rule action and machine-exclusive trigger, or the workout is rejected: watts/resistance ⇒ trainer or elliptical, speed/incline ⇒ treadmill, rower-resistance ⇒ rower. An elliptical workout uses exactly the trainer's vocabulary and differs only in its declared machine; the app never runs a trainer workout on an elliptical or the reverse. Elliptical workouts run in the iOS and Android releases that add elliptical support; older builds cannot ride one. An elliptical that accepts a power target is driven in ERG; otherwise a watts target is shown for the rider to hold. Rower workouts can be saved, but no released Derny app can ride one yet: rower support (NordicTrack RW200, iOS) is still being built. Actions steer the machine's own axis: setTargetPower, { adjustTargetPower: { delta: -5 } } or adjustResistance on a trainer or elliptical; { adjustTargetSpeed: { deltaKilometersPerHour: -0.5 } } or adjustIncline on a treadmill; { adjustRowerResistance: { delta: -1 } } or { setRowerResistance: { level } } on a rower. { advanceToNextSection: {} } and { endWorkout: {} } work on any machine. Triggers: hrAbove/hrBelow and elapsedInSection work everywhere. powerAbove/powerBelow work on a trainer, an elliptical or a rower, and are rejected in a treadmill workout. Cadence is a bike's pedal rpm, so cadenceAbove/cadenceBelow work on a trainer only; cadenceAbove/cadenceBelow in an elliptical workout is rejected, as in a treadmill or rower one. strokeRateAbove/strokeRateBelow are rower only. speedAbove/speedBelow are rejected in a rower workout (a rower reports pace per 500 m) and are accepted elsewhere, but only fire on a treadmill: live speed reaches rule evaluation from the belt alone, so in a trainer or elliptical workout such a rule never fires. Treadmill values the app enforces: an absolute speed must be greater than zero (zero would be a remote belt stop), an adjustment must be non-zero, a single speed step is capped at 10 km/h, and a target outside the connected treadmill's advertised speed or incline range blocks the launch. Rower values: a level is a whole-number rung greater than zero on that machine's own ladder, an adjustment is a non-zero integer, and there is no ERG on a rower, so a targetPower section or setTargetPower action in a rower workout is rejected. A rower level means nothing on another machine model, which is what the optional resistanceProfileID names. The server assigns ids and timestamps.





