Post
Basics and Advanced Temporal Design Patterns
Who, what, when, where, and why is Temporal?
Temporal is workflow orchestration software for long-running processes and asynchronous tasks. It is a bit like a cron job with far more power, state, retry behavior, and operational visibility.
After using Temporal heavily at Borderless, the most important concept I came back to was deterministic execution. Workflow code must be replayable and produce the same decisions from the same history. That means common tools like random numbers and wall-clock time need to be handled through Temporal-safe APIs or moved outside workflow logic.
Temporal basics
Temporal has two core concepts: workflows and activities. Workflows hold orchestration logic and can run for a long time. Activities hold the unsafe or side-effecting work: database writes, HTTP calls, random values, local time, and integration code.
Activities should be written as idempotent operations. They can be retried, rerun, and resumed under failure conditions, so correctness needs to survive repetition.
Pattern: generator and processor
A useful pattern for queue-like systems is to split generation from processing. In one version, an API writes invoice rows, one workflow generates payout attempts, and another workflow processes each attempt.
This keeps the high-level orchestration readable while giving each unit of work its own retry, visibility, and failure boundary.