ReferenceApplication API
Application API
Look up Runlane's task, runtime, run, wait, and error APIs.
This reference covers the application APIs in Runlane 0.4. Import the names shown here from @runlane/core, unless a page names another package.
| Reference | What to look up |
|---|---|
| Runtime | Runtime options, triggering, workers, and maintenance. |
| Tasks and context | Task and queue options, retry policy, schedules, steps, and handler context. |
| Runs and waits | Stored results, filters, cancellation, retries, signals, and tokens. |
| Errors | Error construction, retry decisions, and public failure fields. |
| Defaults | Shared 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.
Shared value types
DurationStringis 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.JsonValueis stored JSON: strings, finite numbers, booleans,null, arrays, and plain objects. Task payloads and outputs may also beundefinedwhere 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
RunIdorTaskId. Keep IDs returned by Runlane in that type. UsecreateRunlaneIdSchema<'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>containsdata: T[]and an optionalnextCursor. 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.