Skip to main content

How Temporal Works

Temporal provides a comprehensive platform for building distributed applications with a focus on durability and reliability.

Resilient applications by default

Temporal lets you code as if failures don't exist and have reliable applications by default. This includes minor issues like brief network outages and more significant problems such as unexpected reboots, application crashes, or hardware failures.

By offloading the responsibility of failure management from the application to the platform, developers are freed from extensive coding, testing, and maintenance tasks. This shift both simplifies the development process and enables your application to seamlessly recover from disruptions. It does so by automatically reconstructing its previous state. Your application logic can be recovered, replayed, or paused from any previous point in the application process.

How It Works

HIW Recent Workflows page HIW Recent Workflows page

Workflow as Code

A Temporal application is the code you write, comprised of Workflow and Activities. Workflows are defined as code: either a function or an object method, depending on the language. A Temporal Workflow defines your overall business logic. That business logic might involve moving money between bank accounts, processing orders, deploying cloud infrastructure, training an AI model, or something else entirely. The Worker runs the Workflow and Activity code.

HIW Recent Workflows page HIW Recent Workflows page

Activities

Activities are functions which encapsulate logic that can potentially fail, such as network calls, file operations, or random number generation. Activities are invoked in Workflow code and the Server coordinates with the application to execute them.

HIW Recent Workflows page HIW Recent Workflows page

Server

Temporal consists of two components, the Server and an SDK in your preferred language such as Go, .NET, Java, Python, PHP, or Typescript. The Server logs the progress and state of your application. Once the application finishes executing the Activity, it communicates with the Server, which records the Activity's completion in the Workflow's Event History. The Activity invocation is handled by the Server. The Server updates the Event History and creates a Task for executing the Activity.

HIW Recent Workflows page HIW Recent Workflows page HIW Recent Workflows page

Recovering from Failure

A Temporal Workflow is basically a process or sequence of events you want to make sure will execute reliably. They can run—and keep running—for years, even if the underlying infrastructure fails. If the execution of your Workflow code crashes, Temporal automatically recreates its pre-crash state, allowing the Workflow to continue execution as if it never even happened. Temporal provides built-in solutions for timers, event sourcing, state checkpointing, retries, and timeouts, removing the necessity for custom implementations.

HIW Recent Workflows page HIW Recent Workflows page HIW Recent Workflows page HIW Recent Workflows page HIW Recent Workflows page

info

Follow one of our tutorials to Get started learning how to develop Workflows and Activities and run them in Worker Processes.

Or jump straight to a Temporal SDK feature guide:

For a deep dive into Temporal Workflows, Activities, and Workers, visit the following Temporal Encyclopedia pages or enroll in one of our courses: