Lumen
Understand the system

Execution and state

Separate commands, canonical rows, durable events, workflow history, and live delivery.

Four different records

  1. A REST command expresses intent and carries a command ID plus idempotency key.
  2. PostgreSQL current state answers what is true now.
  3. An immutable domain event records an accepted change and gives clients an opaque replay cursor.
  4. Temporal workflow history durably coordinates work but is not a second semantic database.

SSE delivers authorized persisted events after a cursor and then follows new events. A cursor is opaque and strictly ordered within the delivered stream; gaps are legal and clients never do cursor arithmetic.

Independent control dimensions

Later run/task/attempt control separates execution phase, desired state, wait reason, generation, and plan revision. This prevents “waiting for approval,” “paused,” “cancelled,” and “failed” from becoming ambiguous values in one oversized enum. See the generated state reference for the categorical values implemented by current Pydantic contracts.

Failure semantics

A retry creates a new immutable attempt. A late success can remain diagnostic evidence but cannot resurrect a cancelled or newer generation. An external side effect with an ambiguous response is reconciled before retry; the system never assumes a timeout means nothing happened.

On this page