What is Temporal > How it Works
Temporal decoded: How it works
Dive into how Temporal delivers durable execution for your applications and services.
Durable Execution and Temporal
An abstraction for building simple, sophisticated, resilient applications
Developing your application on the Temporal platform gives you a secret weapon—durable execution—which guarantees that your code runs to completion no matter what. The result? Bulletproof applications that are faster to develop and easier to support.
Run Temporal LocallyHow to build with Temporal
Write your business logic as code
Temporal SDKs provide a foundation for your application. Choose the SDK for your preferred language and write your business logic. You can use your favorite IDE, libraries, and tools as you code and then you can build, deploy, and run the application wherever and however you choose.
1 Write your business logic as code
Temporal SDKs provide a foundation for your application. Choose the SDK for your preferred language and write your business logic. You can use your favorite IDE, libraries, and tools as you code and then you can build, deploy, and run the application wherever and however you choose.
Create Workflows that guarantee execution
A Temporal Workflow defines your business logic. It might involve moving money between bank accounts, processing orders, deploying cloud infrastructure, training an AI model, or something else entirely.
Because the full running state of a workflow is durable and fault tolerant by default, your business logic can be recovered, replayed or paused from any arbitrary point.
Dive Deeper
2 Create Workflows that guarantee execution
A Temporal Workflow defines your business logic. It might involve moving money between bank accounts, processing orders, deploying cloud infrastructure, training an AI model, or something else entirely.
Because the full running state of a workflow is durable and fault tolerant by default, your business logic can be recovered, replayed or paused from any arbitrary point.
Code Activities to handle and retry failure-prone logic
Applications need to interact with the messy real world of services, users and devices that are inherently failure prone or take a long time to respond.
With Temporal, these parts of your logic are implemented as Activities, separate functions or methods orchestrated by the Workflow. Temporal Activities can be run for as long as necessary (with heartbeat), can be automatically retried forever (set as policy) and can be routed to specific services or processes.
Dive Deeper
3 Code Activities to handle and retry failure-prone logic
Applications need to interact with the messy real world of services, users and devices that are inherently failure prone or take a long time to respond.
With Temporal, these parts of your logic are implemented as Activities, separate functions or methods orchestrated by the Workflow. Temporal Activities can be run for as long as necessary (with heartbeat), can be automatically retried forever (set as policy) and can be routed to specific services or processes.
Deploy your application on YOUR infrastructure
You deploy your application code (Workflow and Activities) on your infrastructure using your existing build, test and deploy tools.
It's up to you how you structure your application. Temporal can be gradually introduced into your existing architecture, be it a monolith or a complex web of microservices.
4 Deploy your application on YOUR infrastructure
You deploy your application code (Workflow and Activities) on your infrastructure using your existing build, test and deploy tools.
It's up to you how you structure your application. Temporal can be gradually introduced into your existing architecture, be it a monolith or a complex web of microservices.
Connect your application to a Temporal Service
The Temporal Service coordinates the execution of your application code—Workflows and Activities—by exchanging events with Workers. The Service can be self-hosted or fully managed and serverless with Temporal Cloud.
Workers poll a Task Queue that feeds it tasks to execute. It reports the result back to the Service, which responds by adding additional tasks to the queue, repeating this process until execution is finished.
The Service maintains a detailed history of every execution. If the app crashes, another Worker automatically takes over by replaying this history in order to recover the state prior to the crash, and then continues.
5 Connect your application to a Temporal Service
The Temporal Service coordinates the execution of your application code—Workflows and Activities—by exchanging events with Workers. The Service can be self-hosted or fully managed and serverless with Temporal Cloud.
Workers poll a Task Queue that feeds it tasks to execute. It reports the result back to the Service, which responds by adding additional tasks to the queue, repeating this process until execution is finished.
The Service maintains a detailed history of every execution. If the app crashes, another Worker automatically takes over by replaying this history in order to recover the state prior to the crash, and then continues.
Temporal is secure by design
Workflow and Activities are deployed as part of your application, on your infrastructure and all connections from your app to the Temporal Service are unidirectional so you never need to open up the firewall.
All communications are secure and your data is encrypted within your app, with your encryption library and keys. The Temporal Service never needs to access your data in clear text.
6 Temporal is secure by design
Workflow and Activities are deployed as part of your application, on your infrastructure and all connections from your app to the Temporal Service are unidirectional so you never need to open up the firewall.
All communications are secure and your data is encrypted within your app, with your encryption library and keys. The Temporal Service never needs to access your data in clear text.
Tune Workers to increase scale and availability
At runtime, applications can grow from a few to several thousand instances depending on your requirements for scale, performance and availability. We recommend that every application has at least two Workers, so there’s no single point of failure.
You can tune your Workers for optimal performance and we've tested Temporal Cloud to scale beyond 200 million executions per second.
7 Tune Workers to increase scale and availability
At runtime, applications can grow from a few to several thousand instances depending on your requirements for scale, performance and availability. We recommend that every application has at least two Workers, so there’s no single point of failure.
You can tune your Workers for optimal performance and we've tested Temporal Cloud to scale beyond 200 million executions per second.
Manage the Temporal Server using terminal
A command-line interface available for macOS, Windows, and Linux enables you to interact with the Temporal Service from your terminal. It allows you to manage Workflow executions and view history.
Additionally, it can be used to spin up (start-dev) a self-contained lightweight Server in less than two seconds, allowing you to develop and test Temporal applications right from your laptop.
8 Manage the Temporal Server using terminal
A command-line interface available for macOS, Windows, and Linux enables you to interact with the Temporal Service from your terminal. It allows you to manage Workflow executions and view history.
Additionally, it can be used to spin up (start-dev) a self-contained lightweight Server in less than two seconds, allowing you to develop and test Temporal applications right from your laptop.
Monitor individual executions of your application
Finally, the Temporal Web UI allows you to inspect details of past and present Workflow Executions from a convenient browser-based interface. It can help you to quickly isolate, debug, and resolve production problems.
9 Monitor individual executions of your application
Finally, the Temporal Web UI allows you to inspect details of past and present Workflow Executions from a convenient browser-based interface. It can help you to quickly isolate, debug, and resolve production problems.
Build invincible apps
Give your apps and services durable execution.