Aviary
Transports

Choosing a transport

A capability matrix of every transport (BullMQ, SQS, SQL, event-emitter, in-memory) checked against the source, the known limitations of each, and which one to pick.

Every transport carries the same RemoteTask / StepResult JSON, and the engine's durable machinery (checkpoints, replay, retry backoff, timers, flow-control admission, dead-lettering) runs on top of any of them. The transports differ in everything around that contract: how fast a task is picked up, how many run at once, how a crashed worker is detected, and which optional Transport capabilities they implement. The engine only enables some cluster features when the transport implements them.

This page compares them side by side. Every cell reflects what the transport's source does today.

Capability matrix

✅ supported · ⚠️ partial or conditional (see the numbered note) · ❌ not supported

InMemoryTransport is the in-process transport exported from @dudousxd/nestjs-durable-core for tests (see Testing); it's listed for completeness, not for production.

Delivery

BullMQSQSSQL (DbTransport)Event emitterIn-memory (test)
How a task reaches the workerPush: BullMQ worker on Redis blocking commandsLong-poll: ReceiveMessage with waitTimeSeconds (default 20)Polling: a claim query every pollMs (default 500 ms) while the table is emptyIn-process emitDirect call inside dispatch
Pickup latency on an idle systemMillisecondsReturns as soon as a message arrivesUp to pollMs per hop; a step pays it twice (task, then result)Same tickInline
Cost while idleHeld Redis connections, a heartbeat key write per handler every 10 s, a subscriber PING every 30 sOne ReceiveMessage request per loop per 20 s (billed by AWS)One claim transaction per loop every 500 ms against your databaseNoneNone

Throughput

BullMQSQSSQL (DbTransport)Event emitterIn-memory (test)
Steps run concurrently per process✅ concurrency (default 1)❌ one at a time¹✅ concurrency (default 1)¹⚠️ unbounded²⚠️ inline in dispatch
Adaptive concurrency (concurrency: 'adaptive')✅❌❌❌❌
Results handled concurrently (engine side)✅ up to 512 per instance✅ up to 80 per instance✅ up to 512 per instance⚠️ unbounded²⚠️ unbounded
Broker-level step priority✅ priority mapped to BullMQ job priority❌ ignored❌ ignored❌❌
What one worker instance consumesAny number of step names, one queue eachOne groupOne groupEvery registered step nameEvery registered step name

Reliability

BullMQSQSSQL (DbTransport)Event emitterIn-memory (test)
Delivery guaranteeAt-least-onceAt-least-onceAt-least-onceAt-most-once (lost on crash)At-most-once
Detects a crashed worker viaJob lock + a peer worker's stalled-checkVisibility timeout (visibilityTimeoutSec, default 60 s)Lease expiry (leaseMs, default 30 s)❌❌
Time to recover a crashed stepAbout 30–60 s with BullMQ defaults (30 s lock, 30 s stalled-check)³visibilityTimeoutSecleaseMs plus up to pollMs❌❌
Lock/lease renewed while a long step runs✅ BullMQ renews the job lock✅ visibility extended for every received message⁴✅ every held claim renewed⁴n/an/a
Failed-job bridge (crash ➜ failed StepResult ➜ durable retry)✅❌ redelivered until it succeeds, unless the queue has a redrive policy⁵❌ reclaimed indefinitely, no attempt cap⁵❌❌
Per-step wall-clock ceiling (stepTimeoutMs)✅❌❌❌❌
Step heartbeats (keep a timeoutMs window open)✅ <prefix>-heartbeat pub/sub, published with transport.heartbeat()❌⁶❌⁶⚠️ listens on durable.heartbeat, but nothing in the library emits it⚠️ emitHeartbeat() test hook
Result redelivered when the engine's handler throws✅ result job retried 5 times, exponential backoff⚠️ reported via onError, redelivered after the 30 s visibility timeout⁷⚠️ reported via onError, redelivered after leaseMs✅ reported via onError, redelivered with backoff until close()❌

Cluster features

BullMQSQSSQL (DbTransport)Event emitterIn-memory (test)
Steps in another process✅✅✅❌❌
Python steps✅ run_redis_worker✅ run_sqs_worker✅ run_db_worker❌❌
Remote workflows (Python @workflow, @dudousxd/durable-worker, streamed step events)✅ dispatchWorkflowTask / onDecision / onStepEvent❌❌❌❌
Store-less tenant pods (dispatchStartRun, RunRequest/RunReply, TenantEvent)✅❌❌❌❌
Worker health in the dashboard (groupHealth, live workers, queue depth)✅❌ panels stay empty❌ panels stay empty❌❌
Worker descriptors (handshake routing guard, announced workflows, workflow directory)✅❌ guard disengaged❌ guard disengaged❌❌

Operations

BullMQSQSSQL (DbTransport)Event emitterIn-memory (test)
Infrastructure to runRedis (options, an IORedis instance, or a redis:// URL)SQS queues (auto-created only with autoCreate)Postgres 9.5+ or MySQL 8+ (two tables, auto-created)NoneNone
Several engine instances✅✅✅❌ single process❌ single process
Built-in control plane (cross-pod live-tail and cancel fan-out)✅ Redis pub/sub❌ pass a separate controlPlane⁸❌ pass a separate controlPlane⁸⚠️ in-process only⚠️ in-process only
Cancellation reaches a running Python handler (ctx.cancelled)✅ run_redis_worker subscribes to <prefix>-control❌❌❌❌
Bounded shutdown✅ closeTimeoutMs (default 5 s)⚠️ aborts the long poll, then waits for the message being processed⚠️ waits for the running tasks to finishStops result redeliveryNothing to close
Producer-only processes (CLI, REPL, scripts don't consume)✅ deferConsumers(), or DurableModule consumers: false❌ keeps consuming (consumers: false warns)❌ keeps consuming (consumers: false warns)n/an/a

Notes

  1. SqsTransport receives up to 10 messages per round trip and runs their handlers sequentially; batching saves round trips, it doesn't add parallelism. DbTransport claims only as many rows as it has free concurrency slots and runs them in parallel. Either way, more worker processes scale out.
  2. Every emit starts its handler immediately, so there is no limit. A burst of steps runs all at once in the same process.
  3. Recovery needs a live peer: BullMQ's stalled-check runs on a worker, so if the only worker for a queue dies and never comes back, nothing settles the step. The engine's opt-in remoteRedispatchMs covers that case on every transport (see Retries).
  4. SqsTransport re-extends the visibility timeout of every message it has received (the one running and the ones of the same batch waiting behind it) every third of visibilityTimeoutSec. DbTransport re-stamps every claim it holds every leaseMs / 3, re-checks the claim before running, and deletes the task and writes its result in one transaction only while it still holds the claim. Only a crashed worker (or one whose event loop is blocked past the timeout/lease) has its task picked up and run again elsewhere, so keep handlers idempotent on stepId.
  5. A task whose handler crashes the worker process every time ("poison" task) is redelivered on every visibility/lease expiry. No failed StepResult is ever produced, so the engine's step retries never come into play. On SQS, set a redrive policy (DLQ) on the tasks queue. The SQL transport has no equivalent.
  6. A step's timeoutMs still works, but with no heartbeats nothing keeps the window open. Set it above the step's real runtime.
  7. A failure processing a message (the engine's result handler throwing, a SendMessage failure, a non-JSON body) is reported through onError and the poll loop carries on. The message is not deleted: SQS redelivers it after its visibility timeout, and a redrive policy moves one that keeps failing to a DLQ.
  8. SqsTransport and DbTransport are point-to-point only. Without a controlPlane, events and cancellation stay on the instance that produced them. Any ControlPlane works, including a BullMQTransport instance passed only as controlPlane (see Control plane).

The same on every transport: retry backoff (a durable wakeAt on the failed checkpoint), flow-control admission priority and fairness, remoteRedispatchMs, recovery of runs, and failover across a transport pool are all engine-side, so they behave the same whichever transport carries the step.

Limitations per transport

BullMQ. It needs Redis. Crash recovery depends on a live peer worker's stalled-check, and the failure bridge exists only in consumers that implement it (the TypeScript transport and the Python durable-worker). A namespaced transport refuses to dispatch @tenant-suffixed routing tokens. Pair it with a bare-prefix transport in the pool.

SQS. Each process runs one step at a time. There are no heartbeats, no failure bridge, no worker health, and no control plane. A message that fails to process is left for redelivery (note 7), so set a redrive policy. Remote workflows and store-less tenant pods are BullMQ-only. One instance consumes one group.

SQL (DbTransport). It's polling-based, so idle latency is pollMs per hop and it keeps querying your primary database while idle. Each process runs concurrency steps at once (default 1), there is no attempt cap on reclaimed rows, and there are no heartbeats, worker health or control plane. It needs FOR UPDATE SKIP LOCKED (no SQLite). One instance consumes one group. Throughput is bounded by row contention on the database your store also uses.

Event emitter. Single process only. There is no persistence (a crash loses in-flight steps), no concurrency limit, and no Python. A result whose engine-side handler throws is redelivered in memory until close(), which doesn't survive a crash. A dispatched step with no registered handler is ignored silently, because another subscriber might own it, so the run waits on it.

In-memory. For tests. It runs the handler inside dispatch and needs onResult registered first.

Which one to pick

Recommended for production: BullMQ

BullMQTransport is the most complete transport, and several features exist only on it:

  • Throughput controls. Per-process concurrency (fixed or adaptive) and broker-level priority. SQS runs one step at a time per process, and SQL has a fixed concurrency.
  • Crash handling for long steps. BullMQ renews the job lock while a step runs, so a slow step isn't redelivered. A crashed worker's job is failed by a peer's stalled-check and bridged into a retryable StepResult, stepTimeoutMs caps a wedged handler, and a result whose engine-side handling throws is retried 5 times.
  • Everything in Cluster. Remote workflows (Python @workflow, the @dudousxd/durable-worker JS worker), store-less tenant pods, worker descriptors, and the handshake routing guard all require transport methods only BullMQ implements.
  • Observability and control. Worker health and queue depth in the dashboard, step heartbeats, and a built-in control plane for cross-pod live-tail and cancellation (including cooperative cancel in Python workers).

If you can run Redis, use BullMQ.

SQL (DbTransport) is a reasonable choice when you can't or don't want to run Redis or a broker. It fits steps with a modest dispatch rate, steps that are idempotent, and setups where one database is all you want to operate. Add processes for parallelism, and pass a separate controlPlane if you run more than one engine instance and need cross-pod cancellation or live-tail.

SQS is a reasonable choice for an AWS-native shop that doesn't want to add Redis, or that already runs SQS queues it wants steps on (taskQueueUrl / resultsQueueUrl reuse existing queues). Put a redrive policy on the queues, and run more processes for parallelism. Remote workflows and tenant pods aren't available on SQS.

Event emitter is for a single process: a monolith splitting work across modules, local development, or a first deploy. It needs no infrastructure, and moving to BullMQ later is a transport swap with no workflow-code change.

In-memory is for tests only.

You don't have to pick only one: the engine accepts an ordered pool of transports with failover and per-step pinning.

On this page