# `WorkflowStem.IR`
[🔗](https://github.com/fosferon/workflow_stem/blob/main/lib/workflow_stem/ir.ex#L1)

Normalization helpers for workflow specs compiled into IR.

Delegates common normalizations (initial_state, states, transitions) to
`Mobus.Stepwise.IR` and adds workflow_stem-specific extensions: multi-profile
support (flow, fsm), route resolution, and routing maps.

# `t`

```elixir
@type t() :: map()
```

# `normalize`

```elixir
@spec normalize(map()) :: t()
```

# `route_for_state`

```elixir
@spec route_for_state(t(), atom() | String.t()) :: tuple() | list() | nil
```

Returns the route tuple declared on a state, or `nil` if the state has none.

Route tuples mirror ALF's DSL macros 1:1 (see `WorkflowStem.SpecBehaviour`):
  * `{:stage, target, opts}`, `{:switch, name, %{branch_key => body}}`,
    `{:composer, module, opts}`, `{:goto, name, opts}`,
    `{:goto_point, name}`, `{:done, name, opts}`, `{:dead_end, name}`,
    `{:from, module, opts}`, `{:plug_with, module, body}`, `{:tbd, name}`

A state's `:route` may also be a LIST of such tuples — return type
reflects that with `list()` as a possible shape.

# `routing_for`

```elixir
@spec routing_for(t(), atom()) :: {module(), atom()} | nil
```

Returns the `{module, function}` resolver tuple for a named route, or `nil`.

---

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