Temporal — Durable Workflow Execution Platform
Temporal is an open-source platform for building reliable distributed applications. It provides durable execution — your workflow code runs reliably even through failures, restarts, and deployments — making complex business processes simple to build and maintain.
Instalación lista para agent
Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.
npx -y tokrepo@latest install eb6474e2-371c-11f1-9bc6-00163e2b0d79 --target codexEjecutar después de confirmar el plan con dry-run.
What it is
Temporal is an open-source platform for building reliable distributed applications. It provides durable execution -- your application code runs to completion even through process crashes, server restarts, and network failures. Instead of writing retry logic, timeout handling, and state management, you write normal code and Temporal handles the durability.
Temporal is designed for backend engineers building long-running processes like payment flows, order fulfillment, user onboarding sequences, data pipelines, and any workflow that spans multiple services and must not silently fail.
How it saves time or tokens
Temporal eliminates the need to write and maintain infrastructure code for reliability. Without Temporal, a multi-step payment flow requires message queues, dead-letter queues, retry policies, idempotency keys, state machines, and monitoring for each step. With Temporal, you write sequential code and the platform handles all failure modes. SDKs are available for Go, TypeScript, Python, Java, and .NET.
How to use
- Install the Temporal CLI:
brew install temporal(macOS) or download from the releases page. - Start a local dev server:
temporal server start-devand open the Web UI athttp://localhost:8233. - Write a workflow function in your language of choice, register it with a worker, and start it via the SDK or CLI.
Example
from temporalio import workflow, activity
import asyncio
@activity.defn
async def send_email(to: str, subject: str) -> str:
# Actual email sending logic
return f'Email sent to {to}'
@activity.defn
async def charge_payment(amount: float) -> str:
# Payment processing logic
return f'Charged ${amount}'
@workflow.defn
class OrderWorkflow:
@workflow.run
async def run(self, order_id: str) -> str:
# Step 1: Charge payment (retried automatically on failure)
await workflow.execute_activity(
charge_payment, 99.99,
start_to_close_timeout=timedelta(seconds=30)
)
# Step 2: Send confirmation email
await workflow.execute_activity(
send_email, 'user@example.com', 'Order confirmed',
start_to_close_timeout=timedelta(seconds=10)
)
return f'Order {order_id} completed'
Related on TokRepo
- AI tools for automation -- workflow automation tools and platforms
- AI tools for coding -- developer productivity tools
Common pitfalls
- Making workflow code non-deterministic. Temporal replays workflow history to recover state, so workflows must be deterministic. Do not use random numbers, current time, or external API calls directly in workflow code -- use activities instead.
- Not setting appropriate timeouts for activities. Without timeouts, a stuck activity blocks the entire workflow indefinitely. Always set start_to_close_timeout and consider schedule_to_close_timeout.
- Running the dev server in production. The
temporal server start-devcommand is for local development only. Production deployments require Temporal Cloud or a self-hosted cluster with persistence (PostgreSQL, MySQL, or Cassandra).
Preguntas frecuentes
Durable execution means your code runs to completion regardless of infrastructure failures. If a process crashes mid-workflow, Temporal replays the workflow history on a new worker, skipping already-completed steps and resuming from where it left off. No work is lost.
Temporal has official SDKs for Go, TypeScript, Python, Java, and .NET. Each SDK provides native APIs for defining workflows, activities, and workers in idiomatic code for that language.
Message queues handle point-to-point communication but require you to build retry logic, state tracking, and failure handling yourself. Temporal provides a complete orchestration layer where you write sequential code and the platform handles all reliability concerns.
Yes. Temporal Cloud and self-hosted clusters handle millions of concurrent workflows. The architecture separates the server (state management) from workers (code execution), allowing independent scaling of both.
Yes. Temporal supports signals and queries that let external systems interact with running workflows. You can pause a workflow waiting for human approval, then resume it when the approval signal arrives.
Referencias (3)
- Temporal GitHub— Temporal provides durable execution for distributed applications
- Temporal SDK Documentation— SDKs available for Go, TypeScript, Python, Java, .NET
- Temporal Workflow Docs— Workflow replay ensures deterministic recovery from failures
Relacionados en TokRepo
Discusión
Activos relacionados
Restate — Durable Execution Engine for Distributed Applications
Restate is an open-source durable execution engine that makes distributed applications reliable without complex infrastructure. It provides persistent function state, reliable RPC, and workflow orchestration with a lightweight runtime written in Rust.
Cadence — Distributed Workflow Execution Engine by Uber
Cadence is a distributed, scalable, fault-tolerant workflow orchestration engine developed by Uber for executing long-running business logic as durable, stateful workflows that survive process and infrastructure failures.
Conductor — Scalable Workflow Orchestration Engine
Conductor is an event-driven orchestration platform originally built at Netflix for managing complex distributed workflows with durable execution guarantees.
Hatchet — Durable Workflow Engine for Distributed Systems
Hatchet is an open-source durable workflow engine that replaces difficult-to-manage task queues with fault-tolerant, observable DAG-based workflows for background jobs and distributed task execution.