# `SquidMesh.Workflow.Validation`
[🔗](https://github.com/ccarvalho-eng/squid_mesh/blob/main/lib/squid_mesh/workflow/validation.ex#L1)

Compile-time validation and normalization for workflow modules.

This module keeps contract enforcement in one place so the DSL in
`SquidMesh.Workflow` can remain compact and declarative.

# `derive_retries`

```elixir
@spec derive_retries([map()]) :: [map()]
```

Derives workflow retry declarations from per-step retry configuration.

# `entry_step!`

```elixir
@spec entry_step!(map(), Macro.Env.t()) :: atom() | nil
```

Returns the single workflow entry step for transition-based workflows.

Dependency-based workflows return `nil` because they may declare multiple root
steps instead of one singular entry step.

# `entry_steps!`

```elixir
@spec entry_steps!(map(), Macro.Env.t()) :: [atom()]
```

Returns the workflow entry steps or raises when the workflow declaration does
not define a valid entry set.

# `initial_step!`

```elixir
@spec initial_step!(map(), Macro.Env.t()) :: atom()
```

Returns the first step to schedule for runtime dispatch.

# `normalize_triggers!`

```elixir
@spec normalize_triggers!(map()) :: [map()]
```

Converts trigger declarations into the normalized runtime trigger shape.

# `validate!`

```elixir
@spec validate!(map(), Macro.Env.t()) :: :ok
```

Validates a compiled workflow definition and raises a compile error when the
declaration is invalid.

# `workflow_payload!`

```elixir
@spec workflow_payload!([map()]) :: [map()]
```

Returns the canonical workflow payload contract derived from the trigger set.

---

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