# `Jido.Composer.Workflow.Strategy`
[🔗](https://github.com/lostbean/jido_composer/blob/main/lib/jido/composer/workflow/strategy.ex#L1)

Jido.Agent.Strategy implementation for deterministic FSM-based workflows.

Drives a `Jido.Composer.Workflow.Machine` through its states by emitting
directives. Keeps `cmd/3` pure — no side effects.

## Error Propagation

The strategy preserves original error reasons via the `error_reason` field in
strategy state. When a node fails, the actual error (action error struct,
child agent error, or transition error) is stored and threaded through to
observability spans and the DSL's `check_terminal` function. Callers receive
the original error rather than a generic `:workflow_failed` atom.

Every path that sets `status: :failure` also closes the agent observability
span, ensuring telemetry is emitted on all failure scenarios.

# `strip_for_checkpoint`

```elixir
@spec strip_for_checkpoint(map()) :: map()
```

Strategy-specific closure stripping for checkpoint serialization.

Called by `Checkpoint.prepare_for_checkpoint/1` via delegation.
Workflows have no nested closures, so this just strips top-level functions.

---

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