# Durable beside Temporal Cloud

The shape: a workflow cloud. [Why Durable](https://durablesdk.com/why/vs/temporal-cloud) steps this walk
beat by beat; this page is the walk in prose, with the page each beat
reads under Sources, and [Compared](https://durablesdk.com/docs/compare.md) is the table of every
product.

## What Temporal Cloud gives, as its documentation describes

**A hosted server keeps the history.** The service keeps every workflow's event history; you do not run the server. [1]

**Workers run your code.** Workflow and activity code runs on the workers you run, in the languages its SDKs cover. [2]

**Deterministic workflow code.** Workflow code is written deterministic, so a worker can replay the history and resume where the last one stopped. [3]

**Signals, queries, timers.** A signal into a running workflow, a query of its state, and a timer that lasts as long as you like. [4]

**The saga as code you write.** A saga is a pattern in the workflow code: each compensation registered as the workflow goes, run in reverse on a failure. [5]

**A history of inputs and results.** The history records each event's inputs and results and is kept for a retention period. [6][1][7]

## The same work under Durable

**No server and no worker.** The engine is a library inside your functions, on your Postgres; a minute cron is the one moving part outside the request path.

**Keys from the input.** `key: ["checkoutId", "requestId"]`. One run per intent, and a key that reads the clock is refused before a deploy.

**The undo declared on the step.** Its compensation beside its effect, or the reason it has none; the undo a row with what it found and what it restored.

**A ledger verify walks.** Before and after images of your data, hash-chained, append-only; `durable-sdk ledger verify --file <export>` walks an export offline.

**The agent asks the graph.** `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.

**Refusals as values, the doctor before a deploy.** A door refuses with an id and a remedy; `durable-sdk doctor --host` runs every rule over the tree, offline, before a deploy.

## What you write yourself

| What you write yourself           | Temporal Cloud                                                                                                                                              | Durable                                                                                                        |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| A hosted server keeps the history | A worker fleet of your own that polls the service: sized, deployed and kept up by you.                                                                      | none; the engine is a library inside your functions on your Postgres                                           |
| Workers run your code             | The fleet's deploys and versions, and the task queues each worker listens on.                                                                               | no fleet; a minute cron the one moving part outside the request path                                           |
| Deterministic workflow code       | The discipline: no clock, no randomness, no call outside an activity, and a versioning step when the code changes.                                          | a step is the one place a body reads the world; the doctor holds it                                            |
| Signals, queries, timers          | The handlers and the state they read, inside the deterministic code.                                                                                        | waits and signals as rows; the console reads a run's state; a timer fires at the minute on the hosted platform |
| The saga as code you write        | The compensations by hand, and the test that each restores what it found.                                                                                   | declared on the step; each undo a row with what it found and restored                                          |
| A history of inputs and results   | The images of your own data, if you want to know what a step found and left; and a cluster-shaped operations story: namespaces, task queues, worker health. | the ledger: before and after images, verify walks it                                                           |

When Temporal Cloud wins: workers in several languages, timers that must fire to the second on the hosted platform or more than about fifty due a minute anywhere, and a history UI with saved views, a query language and schedule controls.

## Sources

1. https://docs.temporal.io/cloud/overview
2. https://docs.temporal.io/workers
3. https://docs.temporal.io/workflow-definition
4. https://docs.temporal.io/evaluate/understanding-temporal
5. https://docs.temporal.io/design-patterns/saga-pattern
6. https://docs.temporal.io/references/events
7. https://docs.temporal.io/cloud/namespaces

---

Prompt for an agent:

```text
Read https://durablesdk.com/docs/compare/temporal-cloud.md, then decide between Durable and Temporal Cloud for a keyed multi-step job that outlives a request; run durable-sdk doctor --host before and after; a refused line is a refusal id: durable-sdk explain <id>
```
