Skip to main content

Understanding Temporal

Temporal offers an entirely new way to build scalable and reliable applications.

Build Invincible Apps

In any complex system, failures are bound to happen. Software engineers spend a lot of time ensuring that what they build can withstand potential failures. Temporal makes your code execution reliable and durable by default.

Normally, if a crash occurs then the state of your application's execution is lost. The application has no memory of what happened before the failure, requiring extensive error handling logic and complex recovery code to resume. The process is time-consuming and error-prone, making it difficult to ensure reliability.

Temporal tracks the progress of your application. If something goes wrong, like a power outage, it guarantees that your application can pick up right where it left off — it’s like having the ultimate autosave. Offloading the responsibility of failure management from the application to the platform removes the need for extensive recovery coding, testing, and maintenance tasks.

Durable Execution

Temporal is a Durable Execution Platform. Durable Execution ensures that your application behaves correctly despite adverse conditions by guaranteeing that it will run to completion. This shift simplifies the development process. If a failure or a crash happens, your business processes keep running seamlessly without interruptions. Developers shift their focus on business logic rather than infrastructure concerns and create applications that are inherently scalable and maintainable.

Thousands of developers trust Temporal for use cases like order processing, customer onboarding, and payment handling because it enables them to build invincible applications that are resilient, durable, and just work. With Temporal, your applications keep running, no matter what happens.

Temporal Application: The Building Blocks

Workflow

Conceptually, a Workflow is a sequence of steps. You've likely encountered Workflows in your daily life, whether it's:

  • Using a mobile app to transfer money
  • Booking a vacation
  • Filing an expense report
  • Creating a new employee onboarding process
  • Deploying cloud infrastructure
  • Training an AI model

A Temporal Workflow is your business logic, defined in code, outlining each step in your process.

Temporal isn’t a no-code Workflow engine — it is Workflows-as-Code. Instead of dragging and dropping steps in a visual interface, you write your Workflows in code in your favorite programming language, code editor, and other tools. No-code engines eventually hit their limitations however, Temporal gives you full control and flexibility over your business processes. This allows you to build exactly what you need.

Activities

Activities are the individual units of work in your Workflow. Activities are defined as either functions or methods, depending on the programming language. Activities often involve interacting with the outside world, such as sending emails, making network requests, writing to a database, or calling an API, which are prone to failure. You can call Activities directly from your Workflow code.

If an Activity fails, Temporal automatically retries it based on your configuration. Since Activities often rely on external systems, transient issues can occur. These include temporary but critical problems like network failures, timeouts, or service outages. You have full control over how often and how many times these retries should happen for each Activity.

SDK

Developers create Temporal applications by writing code, just like you would to create any other software.

A Temporal SDK (software development kit) is an open-source library that developers add to their application to use Temporal. It provides everything needed to build Workflows, Activities, and various other Temporal features in a specific programming language.

Temporal offers six SDKs: Java, Go, TypeScript, .NET, Python, and PHP. Since Temporal supports multiple programming languages, you can mix-and-match between languages for polyglot teams. You can easily add any Temporal SDK to your current projects without changing the tools you're already using to build and deploy. Temporal fits right into your existing tech stack.

Temporal Service

Temporal has two main parts:

  1. Your application
  2. The Temporal Service (a set of services and components)

At the heart of Temporal architecture is the Temporal Service, which provides durability, scalability, and reliability for your application. Your application communicates with the Temporal Service and the Temporal Service oversees the execution of critical tasks such as making an API call, then records their completion. It maintains a detailed history of each event, which it reliably persists to a database.

One of the biggest advantages of the Temporal Service is how it handles failures. The Temporal Service maintains a meticulous record of every step in your Workflows. By keeping a history of every step in your Workflow, it ensures that even if something goes wrong your Workflow can continue from the last successful point. The Temporal Service knows exactly where to resume without losing any work. This saves you from having to write complex error handling code or painstaking recovery mechanisms yourself.

You can run the Temporal Service on your own infrastructure or use Temporal Cloud, a managed service that handles operational overhead and offers scalability and expert support.

Workers

The real strength of Temporal comes from the combination of your application and the Temporal Service. Whenever your application needs to perform a task, like sending a notification or processing a payment, the Temporal Service orchestrates what needs to be done. Workers, which are part of your application and provided by the Temporal SDK, then carry out the tasks defined in your Workflow.

The Worker polls the Temporal Service to see if there are tasks available and the Temporal Service matches the task with the Worker. The Worker runs the Workflow code based on the details specified in the task.

This collaboration is crucial for building reliable, scalable, and durable applications. You can run multiple Workers — often dozens, hundreds, or even thousands — to improve application performance and scalability.

A common misconception is that the Temporal Service runs your code. In fact, the Worker runs your code and works with your data directly. Temporal applications are secure by design. Workflows and Activities are seamlessly deployed within your infrastructure, fully integrated into your application. Your data is also protected with your encryption libraries and keys. You maintain full control over the security of your application from end to end.

Visibility

There are two tools provided by Temporal that allow you to see behind the scenes and interact with your Workflows. These are powerful for debugging uses and provide real-time monitoring of your applications.

Temporal UI

The Temporal UI is a browser-based user interface that allows you to see the progress of your application. Also, known as the Web UI, it can also help you to quickly isolate, debug, and resolve production problems.

Recent Workflows page

Temporal CLI

The Temporal CLI is a command-line interface tool for managing, monitoring, and debugging Temporal Applications. Through your terminal, you can:

  • Start a Workflow
  • Trace the progress of a Workflow
  • Cancel or terminate a Workflow
  • And perform other operations

The Temporal CLI provides developers with direct access to a Temporal Service for local development purposes.

Reliable as Gravity

Temporal provides effortless durability, allowing applications to run for days, weeks, or even years without interruption even if the underlying infrastructure fails. This is what we call Durable Execution. Temporal also represents a paradigm shift in software development. It's not just about making existing patterns more reliable; it's about enabling entirely new approaches to building complex, distributed systems.

Temporal simplifies state management and developers don't have to write tons of extra code to handle every possible thing that could go wrong. With built-in scalability, Temporal ensures that your application runs smoothly, no matter its size or complexity.

tip

Follow one of our tutorials to Get Started learning how to use a Temporal SDK. Or, jump straight into an Introduction to Temporal 101 course.

Looking for more? Explore Temporal's Resource Library.