What is Temporal?
Temporal is a scalable and reliable runtime for durable function executions called Temporal Workflow Executions.
Said another way, it's a platform that guarantees the Durable Execution of your application code.
It enables you to develop as if failures don't even exist. Your application will run reliably even if it encounters problems, such as network outages or server crashes, which would be catastrophic for a typical application. The Temporal Platform handles these types of problems, allowing you to focus on the business logic, instead of writing application code to detect and recover from failures.
The Temporal System
Durable Execution
Durable Execution in the context of Temporal refers to the ability of a Workflow Execution to maintain its state and progress even in the face of failures, crashes, or server outages. This is achieved through Temporal's use of an Event History, which records the state of a Workflow Execution at each step. If a failure occurs, the Workflow Execution can resume from the last recorded event, ensuring that progress isn't lost. This durability is a key feature of Temporal Workflow Executions, making them reliable and resilient. It enables application code to execute effectively once and to completion, regardless of whether it takes seconds or years.
What is the Temporal Platform?
The Temporal Platform consists of a Temporal Service and Worker Processes. Together these components create a runtime for Workflow Executions.
The Temporal Platform consists of a supervising software typically called the Temporal Service and application code bundled as Worker Processes. Together these components create a runtime for your application.
The Temporal Platform
A Temporal Service consists of the Temporal Server and a database.
Our software as a service (SaaS) offering, Temporal Cloud, offers an alternative to hosting the Temporal Service yourself.
Worker Processes are hosted and operated by you and execute your code. Workers run using one of our SDKs.
Basic component topology of the Temporal Platform
What is a Temporal Application?
A Temporal Application is a set of Temporal Workflow Executions. Each Temporal Workflow Execution has exclusive access to its local state, executes concurrently to all other Workflow Executions, and communicates with other Workflow Executions and the environment via message passing.
A Temporal Application can consist of millions to billions of Workflow Executions. Workflow Executions are lightweight components. A Workflow Execution consumes few compute resources; in fact, if a Workflow Execution is suspended, such as when it is in a waiting state, the Workflow Execution consumes no compute resources at all.
Reentrant Process
A Temporal Workflow Execution is a Reentrant Process. A Reentrant Process is resumable, recoverable, and reactive.
- Resumable: Ability of a process to continue execution after execution was suspended on an awaitable.
- Recoverable: Ability of a process to continue execution after execution was suspended on a failure.
- Reactive: Ability of a process to react to external events.
Therefore, a Temporal Workflow Execution executes a Temporal Workflow Definition, also called a Temporal Workflow Function, your application code, exactly once and to completion—whether your code executes for seconds or years, in the presence of arbitrary load and arbitrary failures.
What is a Failure?
Temporal Failures are representations (in the SDKs and Event History) of various types of errors that occur in the system.
Failure handling is an essential part of development. For more information, including the difference between application-level and platform-level failures, see Handling Failure From First Principles. For the practical application of those concepts in Temporal, see Failure Handling in Practice.
For languages that throw (or raise) errors (or exceptions), throwing an error that is not a Temporal Failure from a Workflow fails the Workflow Task (and the Task will be retried until it succeeds), whereas throwing a Temporal Failure (or letting a Temporal Failure propagate from Temporal calls, like an Activity Failure from an Activity call) fails the Workflow Execution. For more information, see Application Failure.