# `Jido.Messaging.Onboarding.Worker`
[🔗](https://github.com/agentjido/jido_messaging/blob/v1.0.0/lib/jido_messaging/onboarding/worker.ex#L1)

Runtime process for a single onboarding flow.

The worker restores persisted flow state, applies state-machine transitions,
and persists changes when the flow advances.

# `state`

```elixir
@type state() :: %{
  instance_module: module(),
  onboarding_id: String.t(),
  flow: Jido.Messaging.Onboarding.Flow.t()
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get_flow`

```elixir
@spec get_flow(pid(), timeout()) ::
  {:ok, Jido.Messaging.Onboarding.Flow.t()} | {:error, term()}
```

Returns the current onboarding flow state from a worker.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Starts an onboarding worker registered by onboarding ID.

# `transition`

```elixir
@spec transition(
  pid(),
  Jido.Messaging.Onboarding.StateMachine.transition(),
  map(),
  keyword(),
  timeout()
) ::
  {:ok,
   %{
     flow: Jido.Messaging.Onboarding.Flow.t(),
     transition: Jido.Messaging.Onboarding.StateMachine.transition_result()
   }}
  | {:error, term()}
```

Applies an onboarding transition and persists the updated flow.

# `whereis`

```elixir
@spec whereis(module(), String.t()) :: pid() | nil
```

Returns the worker process for `onboarding_id`, if it is running.

---

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