# `Squidie.Runtime.Journal.Cancellation`
[🔗](https://github.com/dark-trench/squidie/blob/main/lib/squidie/runtime/journal/cancellation.ex#L2)

Journal-backed workflow cancellation.

Cancellation appends a terminal run fact to the run thread. Dispatch
projections already overlay terminal run facts from run threads, so stale
claims and later completions are fenced by the same durable source of truth.
The configured queue selects the returned dispatch projection; cancellation
itself is scoped by the globally unique run id.

# `cancel_error`

```elixir
@type cancel_error() ::
  :not_found
  | :invalid_run_id
  | {:invalid_option, term()}
  | {:invalid_transition, atom(), :cancelling}
  | term()
```

# `cancel`

```elixir
@spec cancel(
  String.t(),
  keyword()
) :: {:ok, Squidie.ReadModel.Inspection.Snapshot.t()} | {:error, cancel_error()}
```

Cancels a journal-backed workflow run.

---

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