Durable beside Trigger.dev
A platform runs your task on its workers. Making the run safe to run again is yours.
A background-job platform: Trigger.dev
What it gives by its own documentation, what that leaves you to write, and the same work under Durable. Each product compared has a page like this one.
What Trigger.dev gives, as its documentation describes
- 1
A task on the platform's workers
- it gives
- A task is an async function under an id. The CLI's deploy builds the code and packages it into an image per environment; a trigger runs it in an isolated environment on the platform's worker pool, and your app gets a handle back before the task finishes.
- you write
- The deploy per environment and the API key each environment carries.
- 2
A retry runs the whole function again
- it gives
- A thrown error fails the attempt and the next attempt runs the run function from the top, so every call inside it repeats unless you made it idempotent. A child task is triggered again too unless its trigger carries an idempotency key, and then the repeat returns the original child run. A key stops a task being triggered twice, scoped to the task and the environment and kept for a set window; a failed run clears its key, a successful or cancelled run keeps it.
- you write
- An idempotency key on every child trigger, and the provider's own key on every API call, write and email inside the run, or a record in your own database you check before each one. The key, its scope and its lifetime where the defaults do not fit, and the reset after a success or a cancel when the work must happen again.
- 3
Retries and a catch
- it gives
- A task retries on a thrown error under a backoff you set; catchError can skip the retry or set the next attempt's time, and a task aborts its own retries by throwing an abort error. After a fix is deployed, failed runs are replayed in bulk from the dashboard or the SDK.
- you write
- The compensation when a later step fails, which the docs never describe, and the guard on every call a retry repeats.
- 4
A wait snapshots the process
- it gives
- On the platform's cloud a long wait pauses the run and frees its slot only once the machine is snapshotted and shut down; a shorter wait stays executing and holds its concurrency slot.
- you write
- The length of each wait against the slot it holds, since a wait shorter than the snapshot point keeps its slot, and the idempotency key that stops a retried task waiting twice.
- 5
A token with no timeout
- it gives
- A wait token is completed from your backend with the SDK, by a request to the token's URL or from a browser under a public access token; its timeout is optional, and a token without one never times out.
- you write
- The timeout on each token, and the branch for the timed-out result, since a timeout is the one error the wait returns.
- 6
A dashboard of traces
- it gives
- Logs are kept for the plan's retention period, and a query looks back no further than the plan allows.
- you write
- The images of your own data before and after a write, which no log or trace holds.
The same work under Durable
- 7
No image, no machine, no worker
- it does
- The engine is a library inside your own functions on the one Postgres the app already has; a minute cron is the one moving part outside the request path.
- 8
The key is a field list
- it does
- key: ["orderId", "requestId"]. The key and the run commit in one transaction, so the same intent twice is one run for the row's life, and a key that reads the clock is refused before a deploy.
- 9
A finished step is never re-run
- it does
- Each step's input and output land on a row before the body goes on; after a crash the next attempt replays the finished rows and re-invokes only what did not finish.
- 10
The undo in reverse, then the images
- it does
- Every step carries its undo with its effect or says why it cannot, refused at the door otherwise; when a later step fails the undos run in reverse, each its own ledger row. Every write leaves a before and after image on an append-only, hash-chained ledger in your database; durable-sdk ledger verify --file <export> walks an export offline.
- 11
The agent asks the graph
- it does
- durable-sdk explain <workflow> prints what the door admits, every step with its undo and its writes, the facts and who listens; durable-sdk graph walk <subject> prints the closure from any node; durable-sdk graph impact --changed prints what a change reaches before it is made. Offline, over a committed index: an AI coding agent asks before it edits, never guesses.
- 12
Nothing to write but the steps
- it does
- No key per subtask, no snapshot, no compensation by hand, no record kept by hand; a failed run waits in limbo for a person with its rows.
- you write
- The steps and their undos.
When Trigger.dev wins: long compute on a machine you size with no function deadline, a running process snapshotted through a wait, and live streams from a task to a page. The walk in prose, with its sources.
The whole table, with every source, in Compared.
One charge, and a row that says so.
Two commands to an app with a ledger, and one that asks the graph what happens before you edit.