# `Pixir.WorkflowRun`
[🔗](https://github.com/Ranvier-Technologies/pixir/blob/main/lib/pixir/workflow_run.ex#L1)

In-memory ownership boundary for one Workflow execution.

A WorkflowRun owns the runtime state for one normalized Workflow graph: pending
steps, active child references, completed step records, wave history, and the
run start time used for Workflow-level timeouts.

This is intentionally not a durable GenServer yet. Subagents remain the
execution authority, `Pixir.Workflows` remains the tool-facing projection, and
this module does not emit replayable Workflow events. It is the first safe
backend slice toward a future OTP WorkflowRun process without introducing a
second source of truth.

# `t`

```elixir
@type t() :: %Pixir.WorkflowRun{
  active: map(),
  completed: map(),
  completed_order: [String.t()],
  pending: [map()],
  started_at_ms: integer(),
  wave: non_neg_integer(),
  waves: [[String.t()]],
  workflow_id: String.t()
}
```

# `deadline_exceeded?`

```elixir
@spec deadline_exceeded?(map(), t(), integer() | nil) ::
  {:ok, boolean()} | {:error, map()}
```

Returns whether the Workflow-level deadline has elapsed for this run.

# `new`

```elixir
@spec new(
  map(),
  keyword()
) :: {:ok, t()} | {:error, map()}
```

Builds the runtime state for one normalized Workflow.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
