# `AshWorkflow.Entities.Transition`
[🔗](https://github.com/team-alembic/ash_workflow/blob/v0.12.0/lib/ash_workflow/entities/transition.ex#L1)

A named transition from a manual step to another step.

Simple transitions have a static `to` target:

    transition :approve, to: :done

Conditional transitions have `routes` instead — multiple targets with `when` conditions:

    transition :complete do
      route :training, when: expr(path_type == :agency)
      route :ready, when: expr(path_type == :family)
    end

A transition must have either `to` or at least one route, not both.

Routes are evaluated in declaration order and the first match wins.
Conditions see the record as it was loaded with the transition's `accept`
list applied, so a route can branch on an attribute the same call accepted,
while an attribute written by the action's own changes stays invisible:

    transition :decide do
      accept [:decision]
      route :approved, when: expr(decision == :approve)
      route :rejected, when: expr(decision == :reject)
    end

# `t`

```elixir
@type t() :: %AshWorkflow.Entities.Transition{
  __spark_metadata__: term(),
  accept: [atom()],
  emits: [AshWorkflow.Entities.Emit.t()],
  name: atom(),
  routes: [AshWorkflow.Entities.Route.t()],
  to: atom() | nil,
  undoable?: boolean()
}
```

# `all_targets`

# `attribute_schema`

# `conditional?`

---

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