# `Codex.Voice.Workflow`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/voice/workflow.ex#L1)

Behaviour for voice workflows.

A workflow processes transcribed text and generates text responses
to be synthesized as speech.

## Example

    defmodule MyWorkflow do
      @behaviour Codex.Voice.Workflow

      defstruct [:context]

      @impl true
      def run(%__MODULE__{} = _workflow, transcription) do
        # Return a stream of text responses
        ["I heard you say: #{transcription}"]
      end

      @impl true
      def on_start(%__MODULE__{}) do
        ["Hello! I'm ready to help."]
      end
    end

# `on_start`
*optional* 

```elixir
@callback on_start(workflow :: struct()) :: Enumerable.t()
```

Called at the start of a multi-turn session.

Override to provide an initial greeting. Returns an empty list by default.

# `run`

```elixir
@callback run(workflow :: struct(), transcription :: String.t()) :: Enumerable.t()
```

Process a transcription and return text responses.

The returned value should be an enumerable of strings that will
be synthesized as speech.

---

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