Runlane
ReferenceVocabulary

Tasks And Schedules

Stable task retry, release, schedule, occurrence, and duration vocabularies.

Task and schedule vocabulary appears in public task configuration, runtime trigger boundaries, release results, and durable schedule occurrence state. Use these values when authoring task definitions, validating runtime options, or implementing storage schedule claims.

Task ids, queue names, idempotency keys, singleton keys, and concurrency keys are opaque public identifiers; see Identifiers. Trigger outcomes and run sources are run-lifecycle vocabulary; see Run Lifecycle. Queue policy fields are provider-neutral configuration rather than enum values; see Queues.

Task Boundary Vocabulary

ValueStable shapeMeaning
retry.maxAttemptsPositive safe integerTotal attempt budget, including the first attempt.
retry.backoffDuration string or RetryBackoff objectDelay policy used only after retryable failures. A string is fixed backoff.
context.release(delay, options)TaskReleaseBusiness waiting result that the handler must return to release the run. It is not a failure or retry.
idempotencyKeyTTLDuration string or 'active'Retention policy for the selected idempotency owner. It requires an idempotency key.

When an idempotency key is selected and no TTL is supplied, run creation captures 30d. With a finite TTL, successful and cancelled terminal owners remain readable until that TTL expires; failed terminal owners release automatically. The literal 'active' releases ownership when the run reaches any terminal state.

Release reason strings, cancellation reasons, cron expressions, time zones, and metadata keys are open vocabulary. Keep provider or business-specific values in meta instead of inventing Runlane enum values.

RetryBackoffType

EnumValueMeaning
RetryBackoffType.ExponentialexponentialRetry delay doubles from the base delay and respects maxDelay when present.
RetryBackoffType.FixedfixedEvery retry uses the same delay.

A string retry.backoff is accepted as shorthand for RetryBackoffType.Fixed. Object backoff policies should use RetryBackoffType. When a retry policy omits backoff, core uses contractDefaults.retry.backoff, currently 30s.

When retry itself is omitted, task failures do not schedule automatic retries.

RetryBackoffType.Exponential uses the failed attempt number: the first retry waits the base delay, then later retries double from that base. maxDelay must be greater than or equal to delay.

TaskRelease

TaskRelease is a typed handler result, not an enum. The stable field names are still part of the public task contract.

FieldRequiredMeaning
delayYesRunlane duration string until the released run becomes due again.
reasonNoShort public reason for operator views. Runlane treats values as open vocabulary.
metaNoJSON object with structured domain detail.

Core validates release-shaped handler returns before persisting them. Invalid release objects fail the attempt with ErrorCode.ConfigurationInvalid instead of silently completing the run.

Schedule Authoring Vocabulary

Task-colocated schedules infer their kind from exactly one selector field. The public authoring shape must not include type or taskId; core attaches those lower-level fields during registration.

SelectorInferred ScheduleTypeMeaning
runAtScheduleType.OnceMaterialize one run at a specific Date.
everyScheduleType.IntervalMaterialize recurring runs on a duration cadence.
cronScheduleType.CronMaterialize recurring runs from a cron expression.

Shared schedule authoring fields are id, optional queue, optional enabled, and optional or required static payload depending on the task schema. Schedule queues must match the runtime queue registry. Static payloads validate synchronously at task registration and again before materialization.

ScheduleType

EnumValueMeaning
ScheduleType.CroncronMaterialize runs from a cron expression.
ScheduleType.IntervalintervalMaterialize runs on a fixed duration cadence.
ScheduleType.OnceonceMaterialize one run at a specific time.

Lower-level ScheduleDefinition records use this discriminant after core normalizes task-colocated schedules.

Interval schedules anchor to Unix epoch unless startsAt is supplied. endsAt caps the latest eligible interval boundary. Cron schedules use the supplied timeZone when present. Each maintenance pass materializes at most one latest due occurrence per schedule; missed intermediate boundaries are not backfilled in the same tick.

ScheduleOccurrenceStatus

EnumValueMeaning
ScheduleOccurrenceStatus.ClaimedclaimedA scheduler owns the occurrence and may be creating or recovering its run.
ScheduleOccurrenceStatus.CompletedcompletedThe occurrence has recorded the run ids it produced.

Occurrence ids are deterministic for environment + scheduleId + fireAt. If a scheduler creates the run and crashes before completion, another materializer can reclaim the occurrence after claim expiry, recover the already-created scheduled run, and complete the occurrence with that run id.

DurationUnit

EnumValueMeaning
DurationUnit.DaydDay unit for duration strings.
DurationUnit.HourhHour unit for duration strings.
DurationUnit.MillisecondmsMillisecond unit for duration strings.
DurationUnit.MinutemMinute unit for duration strings.
DurationUnit.SecondsSecond unit for duration strings.

Duration strings look like 500ms, 0.5s, 30s, 5m, 2h, or 7d. Durations must include a unit, be no longer than 100 characters, and resolve to positive whole safe-integer milliseconds.

Use durationSchema or createDurationSchema(message) at boundaries; read .duration for the public string and .milliseconds for executable time math. Duration strings appear in retry backoff, release delay, idempotency TTLs, interval schedules, worker lease options, dispatch timeouts, maintenance claim durations, and pruning filters.

On this page