# `Hephaestus.Runtime.Storage`
[🔗](https://github.com/hephaestus-org/hephaestus_core/blob/v0.3.1/lib/hephaestus/runtime/storage.ex#L1)

Persistence adapter contract for workflow instances.

# `delete`

```elixir
@callback delete(instance_id :: String.t()) :: :ok
```

Deletes a workflow instance by its unique identifier.

The operation is idempotent — deleting a non-existent instance is not an error.

# `get`

```elixir
@callback get(instance_id :: String.t()) ::
  {:ok, Hephaestus.Core.Instance.t()} | {:error, :not_found}
```

Retrieves a workflow instance by its unique identifier.

Returns `{:ok, instance}` if found, or `{:error, :not_found}` if no instance
matches the given `instance_id`.

# `put`

```elixir
@callback put(instance :: Hephaestus.Core.Instance.t()) :: :ok
```

Persists a workflow instance.

Inserts the instance if it does not exist, or overwrites it if an instance with
the same ID is already stored.

# `query`

```elixir
@callback query(filters :: keyword()) :: [Hephaestus.Core.Instance.t()]
```

Returns all workflow instances that match the given filters.

`filters` is a keyword list where each key corresponds to an instance field
(e.g., `:status`, `:workflow`). Only instances matching **all** provided filters
are returned. An empty filter list returns all stored instances.

---

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