# `SquidMesh.Runtime.StepExecutor.Outcome`
[🔗](https://github.com/ccarvalho-eng/squid_mesh/blob/main/lib/squid_mesh/runtime/step_executor/outcome.ex#L1)

Persistence and dispatch handling for completed step executions.

`SquidMesh.Runtime.StepExecutor` delegates here after a step finishes so the
orchestration flow stays readable while success, failure, retry, and dispatch
error handling remain together.

# `execution_error`

```elixir
@type execution_error() ::
  :not_found
  | {:invalid_workflow, module() | String.t()}
  | {:invalid_step, atom() | String.t() | nil}
  | {:dispatch_failed, term()}
  | {:invalid_run, Ecto.Changeset.t()}
  | {:invalid_transition, SquidMesh.Run.status(), SquidMesh.Run.status()}
  | {:no_runnable_step, [atom()]}
  | {:unknown_transition, atom(), atom()}
  | {:unknown_step, atom()}
  | {:missing_config, [atom()]}
```

# `apply_execution_result`

```elixir
@spec apply_execution_result(
  {:ok, map(), keyword()} | {:error, term()},
  SquidMesh.Config.t(),
  SquidMesh.Workflow.Definition.t(),
  SquidMesh.Run.t(),
  atom(),
  Ecto.UUID.t(),
  Ecto.UUID.t(),
  pos_integer(),
  integer()
) :: :ok | {:error, execution_error() | term()}
```

# `persist_execution_result`

```elixir
@spec persist_execution_result(
  {:ok, map(), keyword()} | {:error, term()},
  atom(),
  SquidMesh.Config.t(),
  SquidMesh.Workflow.Definition.t(),
  SquidMesh.Run.t(),
  Ecto.UUID.t(),
  Ecto.UUID.t(),
  pos_integer(),
  integer()
) :: :ok | {:error, execution_error() | term()}
```

---

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