Snapshot of a workflow execution's current state. Returned by
Hourglass.status/2.
Fields:
state— high-level lifecycle state.pending_activities— activities currently scheduled or executing, with attempt count + last failure (if any). Always populated; cheap (single DescribeWorkflowExecution call).recent_failures— list of activity-failure events from the workflow's history, ordered most-recent first. Only populated whenfailures: :includeis passed tostatus/2; walks history (more expensive).nilwhen not requested;[]when requested + empty.start_time— when the workflow started.close_time— when the workflow completed/failed/was terminated;nilwhile running.
Design
User direction: "if the human has to look at temporal, we've failed." This struct is the production-safe observability surface — tests, ops tooling, and GenServers monitoring long-running workflows pull from here without needing the Temporal Web UI.
Summary
Types
@type failure_event() :: %{ activity_type: String.t(), attempt: non_neg_integer(), failure: Temporal.Api.Failure.V1.Failure.t(), event_time: DateTime.t() }
@type pending_activity() :: %{ activity_type: String.t(), attempt: non_neg_integer(), last_failure: Temporal.Api.Failure.V1.Failure.t() | nil }
@type state() ::
:running
| :completed
| :failed
| :continued_as_new
| :timed_out
| :canceled
| :terminated
| :unknown
@type t() :: %Hourglass.WorkflowStatus{ close_time: DateTime.t() | nil, pending_activities: [pending_activity()], recent_failures: [failure_event()] | nil, start_time: DateTime.t() | nil, state: state() }