TOOL WIKI · RUNTIME & DEPLOYMENT

Temporal

Runs durable workflows with persisted progress and recovery mechanisms.

Download example files Code + setup + checks in a ZIP
Jump to a section 10 sections

EXAMPLE USE CASE

Execute a recoverable order lookup activity

A developer needs a concrete execution environment for a background task, browser operation or service, with a visible terminal result.

Input
A workflow invocation with A104, a worker and a five-second activity deadline.
Expected output
A packed result plus persisted workflow/activity history.
  • Success check: The workflow returns packed and its history includes one lookup activity.
  • Try a failure: Stop/restart the worker and inspect history/retry behavior instead of sending a new unrelated workflow.

Example scope: Actual Temporal SDK/runtime integration; the activity is a read-only fixture rather than a remote write.

Official reference · Temporal

WHAT IT ISDurable workflow platform
WHERE IT FITSRuntime & deployment
SEE HOW THE SYSTEM FITS TOGETHERSELECT A COMPONENT
inputprocessresultcheckoutputTask requestGoal + resource budgetTemporalDurable workflow platformWorker environmentScoped executionExternal operationsAuthorized servicesArtifacts + outcomeValidate the resultLifecyclePersist or clean up
  1. Set the allowed runtime, network access, credentials, and maximum duration.

  2. Long-lived tasks with retries, waits, and external operations. Design side effects for idempotency and keep workflow execution rules explicit.

  3. Run only the workload and dependencies required for the task.

  4. Check permissions at each resource service and reconcile uncertain writes.

  5. Inspect files, records, and task-level acceptance criteria.

  6. Retain required artifacts, release temporary compute, and expire task credentials.

    Result or stopping point
Temporal

Long-lived tasks with retries, waits, and external operations. Design side effects for idempotency and keep workflow execution rules explicit.

Follow the arrows, then select a component to inspect its responsibility. On mobile, downward arrows connect the next step; bent arrows identify branches and return paths. Select a destination to jump to that component.

When to consider it

  • Long-lived tasks with retries, waits, and external operations.

A design decision to make

  • Design side effects for idempotency and keep workflow execution rules explicit.

Prerequisites and setup

  • Python 3.11+ and the official Temporal CLI. The start-dev service is a local development configuration.
Shell
python3 -m venv .venv
source .venv/bin/activate
pip install temporalio
# Terminal 1: leave the local development service running.
temporal server start-dev

Try a small integration

workflows.py

Python · workflows.py
from datetime import timedelta
from temporalio import activity, workflow
from temporalio.common import RetryPolicy

@activity.defn
def lookup_order(order_id: str) -> str:
    return {"A104":"packed"}.get(order_id,"not_found")

@workflow.defn
class OrderWorkflow:
    @workflow.run
    async def run(self, order_id: str) -> str:
        return await workflow.execute_activity(lookup_order,order_id,
            start_to_close_timeout=timedelta(seconds=5),retry_policy=RetryPolicy(maximum_attempts=3))

worker.py

Python · worker.py
import asyncio
from temporalio.client import Client
from temporalio.worker import Worker
from workflows import OrderWorkflow, lookup_order

async def main():
    client = await Client.connect("localhost:7233")
    async with Worker(client,task_queue="asg-orders",workflows=[OrderWorkflow],activities=[lookup_order]):
        await asyncio.Event().wait()

if __name__ == "__main__":
    asyncio.run(main())

start.py

Python · start.py
import asyncio
from uuid import uuid4
from temporalio.client import Client
from workflows import OrderWorkflow

async def main():
    client = await Client.connect("localhost:7233")
    result = await client.execute_workflow(OrderWorkflow.run,"A104",
        id="asg-"+str(uuid4()),task_queue="asg-orders")
    print(result)

asyncio.run(main())

Run and check the result

Shell
# Terminal 2
python worker.py
# Terminal 3
python start.py
  • The workflow returns packed and its history includes one lookup activity.
  • Stop/restart the worker while a job is queued; it should resume from durable service state.

Common failures

  • A worker accepting a job does not establish completion. Inspect the task result, failure and retry history.
  • Do not expose a development control plane or unauthenticated execution endpoint publicly.

Production decisions

  • Use bounded CPU/memory/time, restricted filesystem mounts and network access, short-lived secrets and per-user isolation.
  • Preserve run/operation identifiers, cancellation and terminal states. Retryable remote writes need provider idempotency or reconciliation.
  • Keep workflow code replay-safe and non-deterministic I/O in activities. Version workers/workflows and set retry/time limits for every activity.

Keep exploring

An agent that can pause and resumeA browser or coding agent in a sandbox

Explore the same layer

InngestTrigger.devE2BDaytona

Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.