Temporal is a durable execution platform: you write a multi-step job as ordinary code, and Temporal makes sure it finishes, even when the network drops for days or the process running it crashes halfway through. Instead of starting over, the job carries on from the last step that succeeded.
Why long-running jobs break
Take a job that runs every hour: fetch a recipe from an API, check it, save it. As a script on a timer it looks like three lines of work. In practice every step talks to something that can fail.
If the network drops during the fetch, the script throws and that run is lost. So you add a retry loop. Then the machine restarts mid-retry, and you need to remember how far you got, so you store progress in a database. Then a slow run is still going when the next hour starts, so you add a lock to stop two runs overlapping.
None of that code is about recipes. It is plumbing, and every team writes its own slightly broken version. Temporal moves that plumbing out of your code and into a platform built for it.
Workflows and activities
Temporal splits your code into two kinds of function.
- A workflow is the plan: which steps run, in what order, and what happens between them. It can run for seconds or for months.
- An activity is one step that touches the outside world: an HTTP call, a database write, an email. Activities are where failures happen, so they are what Temporal retries.
Two more pieces make it run. The Temporal Service (which you host yourself, or rent as Temporal Cloud) keeps track of every workflow. Workers are your own processes: they poll a task queue on the service, run your workflow and activity code, and report back.
The split matters because of one rule: workflow code must be deterministic. Given the same inputs and the same activity results, it must make the same decisions every time. No network calls, no reading the clock directly, no random numbers. Anything unpredictable belongs in an activity. The next section shows why.
Wondering how this was made? How we make these