Skip to Content
Runlane
ReferenceApplication API

Application API

Look up Runlane's runtime, queue, schedule, task, run, wait, stream, realtime, React, and error APIs.

This reference covers Runlane's application APIs. Import the names shown here from @runlane/core, unless a page names another package.

Core explicitly exports task authoring, runtime configuration, observation, and result types. It does not re-export every contract. Import storage and transport contracts, provider schemas, codecs, and conformance helpers from @runlane/contracts. That package groups its exports by audience: task authors, provider authors, and internal package implementation.

ReferenceWhat to look up
RuntimeRuntime options, triggering, workers, and maintenance.
Queue operationsDurable pause, capacity overrides, expiry, and effective queue state.
SchedulesTask-declared schedules and runtime schedule creation, updates, and controls.
Tasks and contextTask and queue options, retry policy, schedules, steps, and handler context.
Runs and waitsStored results, filters, cancellation, retries, signals, and tokens.
StreamsDurable named output, resumable readers, and run subscriptions.
RealtimeAuthorized Fetch SSE handler, scoped tokens, and browser client.
ReactProvider, run and stream hooks, attempt modes, and retention bounds.
ErrorsError construction, retry decisions, and public failure fields.
DefaultsShared values read from contractDefaults.

Start with add Runlane to your app for file layout and setup. Use the provider reference when building a storage or delivery adapter.

When updating an existing deployment, follow Upgrade Runlane for handler changes, stored-format compatibility, migrations, and rollback.

Shared value types

  • DurationString is a duration with a unit, such as '30s', '5m', or '7d'. Use a duration string where an option asks for one, not a number of milliseconds.
  • JsonValue is stored JSON: strings, finite numbers, booleans, null, arrays, and plain objects. Task payloads and outputs may also be undefined where their schema allows it. Convert dates and binary data before storing them in JSON fields.
  • A branded ID is a string whose TypeScript type identifies its role, such as RunId or TaskId. Keep IDs returned by Runlane in that type. Use createRunlaneIdSchema<'run'>('Run id').parse(value) to validate a run ID received from a request.
  • A Schema<Input, Output> follows Standard Schema. Runlane validates the input and stores the schema's output. Zod is one supported schema library.
  • A Page<T> contains data: T[] and an optional nextCursor. Pass that cursor back with the same filters. Do not parse or edit it.

Public calls reject with a structured RunlaneError when validation, storage, or delivery fails. A handler failure is normally saved on the run instead. The error reference explains that distinction.

On this page