Skip to main content

Temporal Workflows

In Temporal, a Workflow defines a process tailored to your business logic. Like in the wider world, a Temporal Workflow is a sequence of steps or tasks carried out to complete a process or reach a goal. Workflows are normally used in business operations, project management, and software development to build processes. Their role is to trigger a response to events or conditions and complete that response reliably and visibly. With Temporal, you write your application code as workflows.

CASING
  • In our documentation, uppercase Workflow refers to elements of the Temporal framework.
  • Lowercase workflow describes the steps and tasks that make up a process.

Workflows

Workflows are a core abstraction for Temporal Durable Execution. You don't work with an actual "Workflow" type, as that doesn't exist. Instead, Workflows are created using the following elements:

  • A Workflow Definition is code written in your preferred programming language. It outlines the end-to-end steps, constraints, and tasks needed to achieve a goal in a Temporal application.
  • A Workflow Type is a name. It's used to identify a specific Workflow Definition, typically its type name. Temporal needs this name to run and control a Workflow.
  • A Workflow Execution is a record of a running, completed, or terminated Workflow. This record includes the Workflow’s state, History, and other details that enable Temporal to ensure durable execution. It’s the primary unit of control in Temporal applications.

The Temporal Service manages and oversees Workflow Executions. It uses Workflow Executions to manage Workflow state and invoke Workflow Definition code to ensure durability and reliability in real world deployment.

The Service coordinates an Execution's run by issuing Tasks, which are picked up by Temporal Workers. Workers monitor Temporal Task Queues (this is called "polling"), select available Workflow Tasks, and run those Tasks on Worker processes. These processes invoke your Workflow Definitions, producing the actual code execution that moves your applications forward.

The Temporal Service controls this process, ensuring our core promise of durability and reliability. The Service doesn't execute your Workflow Definition code itself. Instead, your Workflow Definition code runs on your machines, written in the language or languages you choose, compiled with our SDKs.

The following image shows where these pieces live and how they connect:

Workflow Definition and Workflow Execution Overview

This section of the Temporal Encyclopedia introduces Workflows in depth. Here, you'll find all the technical material you need to understand how Workflows are defined and used.

Workflows in Depth

With basic Workflow terms in-hand, you're ready to dive deeper. The following sections cover important aspects of Workflow use, including Executions, Definitions, and best practices.

  • Workflow Limits
  • Workflow Best Practices
  • Workflow FAQs

Learn more

To learn more about Workflows, visit our courses. Each course provides guided introductions to many of these elements with an expert instructor: