---
url: /docs/api/core/variables/durationSchema.md
---
[**@kaiord/core**](../README.md)

***

[@kaiord/core](../README.md) / durationSchema

# Variable: durationSchema

> `const` **durationSchema**: `ZodDiscriminatedUnion`<\[`ZodObject`<{ `seconds`: `ZodNumber`; `type`: `ZodLiteral`<`"time"`>; }, `$strip`>, `ZodObject`<{ `meters`: `ZodNumber`; `type`: `ZodLiteral`<`"distance"`>; }, `$strip`>, `ZodObject`<{ `bpm`: `ZodNumber`; `type`: `ZodLiteral`<`"heart_rate_less_than"`>; }, `$strip`>, `ZodObject`<{ `bpm`: `ZodNumber`; `repeatFrom`: `ZodNumber`; `type`: `ZodLiteral`<`"repeat_until_heart_rate_greater_than"`>; }, `$strip`>], `"type"`>

Defined in: [packages/core/src/domain/schemas/duration.ts:21](https://github.com/pablo-albaladejo/kaiord/blob/3eacbe62ef72342d970523967cc5155b5935bb85/packages/core/src/domain/schemas/duration.ts#L21)

Zod schema for workout step duration.

Validates duration specifications using discriminated unions based on duration type.
Supports time-based, distance-based, heart rate conditional, power conditional,
calorie-based, and open durations.

`repeatFrom` (on the `repeat_until_*` variants) is a 0-based **step
index**, not a repeat count: execution jumps back to the step at that
index and repeats the steps from there up to the current one until the
variant's condition is met (elapsed time, distance, calories, or the
HR/power threshold crossing).
