SquidMesh.Runtime.StepExecutor.Outcome (squid_mesh v0.1.0-alpha.7)

Copy Markdown View Source

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.

Summary

Types

execution_error()

@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()]}

Functions

apply_execution_result(result, config, definition, run, step_name, step_run_id, attempt_id, attempt_number, started_at)

@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(result, step_name, config, definition, run, step_run_id, attempt_id, attempt_number, started_at)

@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()}