Choose a lane
Pick where Runlane stores runs and how workers find new work.
With createLocalLane(), runlane dev owns the runs in its memory. The app, CLI, and worker reach that store over a loopback bridge: a token-protected connection that only accepts traffic from your own machine (127.0.0.1). The app never keeps runs in its own memory. Without dev, the first trigger or read fails with storage_unavailable. Start dev and retry; no app restart is needed.
A lane is the setup behind your Runlane runtime. It answers two questions:
- Where are runs stored?
- How do workers find out about new work?
lane = storage + deliveryYou pick one lane for the whole runtime. Tasks do not pick their own. Your task and trigger code stays the same on every lane, so you can start local and switch later.
Quick pick
| If you are | Use | Package |
|---|---|---|
| Developing | createLocalLane() | @runlane/lane-local |
| Testing in one process | createTestLane() | @runlane/lane-local |
| Running always-on workers in production | Postgres polling | @runlane/lane-postgres-polling |
| Running workers on AWS Lambda or as SQS consumers | Postgres and SQS | @runlane/lane-postgres-sqs |
| Using Redis or Valkey with direct worker claims | Redis polling | @runlane/lane-redis-polling |
| Using Redis or Valkey for state and queued wakeups | Redis Streams | @runlane/lane-redis-streams |
| Using Redis or Valkey with SQS consumers | Redis and SQS | @runlane/lane-redis-sqs |
| Running tasks in your app's own HTTP route | HTTP push | @runlane/lane-postgres-http or @runlane/lane-redis-http |
Not sure? Start with the local lane. Move to Postgres polling when runs must survive a restart. HTTP push pairs Postgres or Redis storage with signed HTTP delivery. See HTTP push.
Compare lanes
| Local | Postgres polling | Postgres and SQS | Redis polling | Redis Streams | Redis and SQS | HTTP push | |
|---|---|---|---|---|---|---|---|
| Stores runs in | Dev process memory | Postgres | Postgres | Redis or Valkey | Redis or Valkey | Redis or Valkey | Postgres, Redis, or Valkey |
| Workers find work by | Polling dev | Polling and hints | SQS messages | Polling and hints | Stream messages | SQS messages | Signed POSTs to your route |
| Runs survive a restart | No | Yes | Yes | Depends on persistence settings | Depends on persistence settings | Depends on persistence settings | Same as its storage |
| Services you run | runlane dev | Postgres | Postgres and SQS | Redis or Valkey | Redis or Valkey | Redis or Valkey and SQS | Storage and an HTTPS route |
| Lambda workers | No | Scheduled drain | Native SQS handler | Scheduled drain | No native handler | Native SQS handler | Function URL with a fetch bridge |
Choose Postgres when it fits your database operations and SQL tooling. Choose Redis when you already operate Redis or Valkey and can fit each namespace's memory and write traffic on one primary. Cluster spreads independent namespaces across slots; it does not divide a namespace among primaries. Both providers include operator reads, leases, waits, and schedules. Review the Redis startup checks and durability boundary.
Redis and SQS uses the same native SQS handler as Postgres and SQS, through redisSqsLane() from @runlane/lane-redis-sqs.
Where Runlane runs
Producers accept work with trigger(). Workers execute tasks. Maintenance moves due work forward and recovers interrupted runs. These roles can run on different hosts with the same lane configuration.
| Role | Long-running Node process or container | AWS Lambda | Other serverless functions | Edge runtimes |
|---|---|---|---|---|
Producer (calls trigger()) | Supported | Supported | Works but has no guide | Not supported |
| Worker (runs tasks) | Supported | Supported (SQS with Postgres or Redis storage, or a scheduled polling drain) | Supported through HTTP push with explicit in_request lifetime, or a scheduled Postgres or Redis polling drain. A drain's latency follows the timer interval. Each run must finish within the function timeout | Not supported |
| Maintenance | Supported | Supported (scheduled Lambda) | Supported in the same scheduled function | Not supported |
All supported hosts need Node.js 22.18+ and access to the lane's services. Production producers need reachable storage; a transport lane also needs access to its broker. SQS requires AWS credentials and SQS access. A serverless producer can use Postgres or Redis storage while workers run elsewhere. On ready-made lanes, set runHints: false in serverless processes to disable run-progress hints. A raw Redis composition leaves them disabled by default. On Postgres polling, only a long-running worker opens the dedicated worker wake-up connection, on top of the storage pool. Producers, maintenance, and drain() do not open it. Count it in each long-running worker process's connection budget. The Postgres + SQS lane opens no worker wake-up listener.
“Works but has no guide” means the Node.js entry point can run within a function invocation. For maintenance, export const handler = runlane.createMaintenanceHandler() directly on a recurring schedule. It starts lazily. For scheduled polling workers, export runlane.createDeliveryHandler({ maxDuration: '50s' }); it runs maintenance and drains due work. Check the host's timeout and connection limits.
Long-running workers use createDeliveryWorker(). Scheduled polling workers use createDeliveryHandler({ maxDuration: '50s' }). SQS Lambda workers use the lane's native createDeliveryHandler() and must finish within the invocation limit. The SQS handler accepts SQS Lambda events. HTTP delivery uses a fetch handler from @runlane/transport-http, with a required lifetime choice. Edge runtimes need non-Node support that Runlane does not provide.
See Deploy to AWS for Lambda, Fargate, and scheduled maintenance; Postgres polling for a long-running process; and the Hono recipe for request-side triggers.
Local lane
app, CLI, scripts ──> runlane dev (memory + worker)Use createLocalLane() for Node.js development. Runs live in dev's memory and are gone when dev stops. Use createTestLane() for in-process tests without dev.
In an app, run two terminals:
- Start
runlane dev. It holds the runs and runs the worker. - Start your app. It finds the dev process and shares its runs.
runlane dev reloads your task code when you save. Runs that are already going finish on the old code.
Keep in mind:
- No dev, no accepted run. The first trigger fails. Start dev and retry in the same app process.
- Tests use a test lane. Call
drain()orexecuteNext()on a runtime built withcreateTestLane(). Same-name test lanes share memory until the last handle closes. - Restarting dev clears every run.
- Development on Node.js. In production, use Postgres or Redis storage. The Postgres and Redis SQS lanes supply native AWS Lambda delivery.
See run local development for how the app finds dev, and reload task code for what happens on save.
Postgres polling
producer ── writes run ──────> Postgres
worker ── polls, claims ───> Postgres
Postgres ── wake-up signal ──> workerUse postgresPollingLane() when your workers run all the time and can connect to Postgres. This is the smallest production setup. There is no message broker.
Postgres stores each run and decides which worker gets it. When new work arrives, Postgres sends a quick signal so idle workers wake up sooner. If a signal is lost, the next poll still finds the work.
Postgres and SQS
producer
│
▼
Postgres (run + outbox)
│
▼
publisher ──> SQS ──> worker
│
▼
PostgresUse postgresSqsLane() when SQS should wake your workers, such as AWS Lambda functions or long-running SQS consumers. Postgres still stores the runs. An SQS message only tells a worker which run to check.
A duplicate or late SQS message does not create a second run. The worker reads the run from Postgres before it does anything.
Redis polling and Streams
Use Redis polling for direct storage claims. Pub/sub hints reduce idle waits, and polling finds work after a missed hint. This lane can also drain work in a scheduled function.
Use Redis Streams when long-running consumers should receive queued wakeups. Storage still decides which worker owns a run. Each transport namespace uses one fixed consumer group per logical queue. For Lambda, use Redis and SQS.
Standalone, Sentinel, and Cluster are supported. Use noeviction; an observed allkeys-* policy fails startup. Check the endpoint's command, routing, eviction and request-size requirements.
HTTP push
producer ── writes run + outbox ──> storage
publisher ── signed POST ─────────> your route
your route ── claims run ─────────> storage ── replies 202Use @runlane/transport-http when Runlane should wake a route in your own app instead of a queue service. The POST only says which run to check. Storage still holds the run, decides who owns it, and keeps the pending wakeup until it is sent.
Use postgresHttpLane() or redisHttpLane(). lifetime is required. in_request works on every supported host; the sending request and await runlane.trigger() wait for the attempt. Set publishTimeout above maxDuration plus settlement. Nested child publication needs maxConcurrentPublishes above concurrent in-request parents, with spare incoming and queue capacity; otherwise avoid nested triggers in these handlers. process replies 202 after claim and keeps running in the app process, so use it only on long-lived servers. Serverless background replies require a host lifetime callback such as after or waitUntil.
Each POST is signed with a shared secret. Runlane retries a failed POST from storage, and maintenance recovers a run whose wakeup never arrived. Because HTTP itself keeps no copy, the composed lane reports productionDurable: false. Run maintenance on a schedule, and limit execution with queue concurrency. Edge runtimes are not supported. Follow HTTP delivery for setup, secret rotation, and host guidance.
What production lanes need
Production lanes need:
- Compatible storage. Apply Postgres migrations before the new app version starts. Redis startup initializes an empty namespace with a format marker and rejects incompatible markers; there is no Redis migration CLI.
- Maintenance. It starts scheduled runs, wakes runs whose wait or retry delay has ended, and recovers work from crashed workers. It also finishes cancellations and sends pending SQS messages.
runlane workruns it inside a worker by default. With Lambda workers, run it on a schedule instead. - Compatible setup. Producers and workers use the same environment and queue definitions, with compatible task schemas. Keep maintenance running for every scheduled task. Processes with the same declared schedule IDs share one schedule owner; processes with different scheduled tasks each create runs for their own.
Before you go live, also read make side effects safe to repeat and change tasks safely.
Next steps
Deploy with Postgres polling
Run workers that poll Postgres. No broker needed.
Deploy with Postgres and SQS
Wake Lambda functions or SQS consumers.
Deploy with Redis polling
Claim work directly from Redis or Valkey.
Deploy with Redis Streams
Use queued wakeups for long-running consumers.
Deploy with Redis and SQS
Use the Redis SQS lane with native workers and Lambda handlers.
Deliver wakeups over HTTP
Send signed wakeups to a route in your app.