Skip to content

StartWorkoutInput

StartWorkoutInput = { devices: DeviceId | RoleAssignment; kind: "free"; splitEvery?: Quantity; target?: WorkoutTarget; targets?: PerformanceTargets; } | { devices: DeviceId | RoleAssignment; intervals: readonly IntervalSpec[]; kind: "intervals"; mode?: "broadcast" | "sequential"; rounds?: number | "unlimited"; }

Defined in: console-sdk/src/session/types.ts:203

What to program a workout session with (SDK_PLAN.md §3.6.5). This IS the complete programming vocabulary (re-scope): higher-level workout models (e.g. the Rogue app’s WPT prescriptions) live app-side and RESOLVE to this input before calling start() — the SDK never learns their vocabulary.

devices is either a single DeviceId (the N=1 convenience) or a modality-keyed RoleAssignment (the general fleet form).

{ devices: DeviceId | RoleAssignment; kind: "free"; splitEvery?: Quantity; target?: WorkoutTarget; targets?: PerformanceTargets; }

devices: DeviceId | RoleAssignment

One device, or a modality-keyed assignment.

kind: "free"

optional splitEvery?: Quantity

Emit a split every N distance/time/calories.

optional target?: WorkoutTarget

Whole-workout target; omit for just row/ride/ski.

optional targets?: PerformanceTargets

Optional whole-workout performance targets. Only targets.pace is programmed to the console; the rest are app-scored pass-through values.


{ devices: DeviceId | RoleAssignment; intervals: readonly IntervalSpec[]; kind: "intervals"; mode?: "broadcast" | "sequential"; rounds?: number | "unlimited"; }

devices: DeviceId | RoleAssignment

One device, or a modality-keyed assignment.

intervals: readonly IntervalSpec[]

The interval program (broadcast or role-scoped; never mixed).

kind: "intervals"

optional mode?: "broadcast" | "sequential"

Multi-machine choreography (SDK_PLAN.md §3.6.5).

  • broadcast (parallel, role-less): every device runs the program SIMULTANEOUSLY (two-athletes-racing). Intervals must be role-less. This is the DEFAULT when mode is omitted AND every interval is role-less, so existing broadcast callers are unaffected.
  • sequential (relay, role-scoped): ONE athlete moves machine-to-machine; only the active role’s console runs while the others HOLD. Every interval must be role-scoped.

A role-scoped plan MUST declare mode explicitly (no default); a broadcast plan with any role, or a sequential plan with a missing role, rejects with 'session/invalid-plan'.

optional rounds?: number | "unlimited"

Number of rounds; 'unlimited' hides the ≥255 firmware encoding.