Public entrypoint for the Squid Mesh runtime.
The API exposed here stays focused on declarative workflow operations. Host applications start, inspect, and later control runs through this surface without needing to work directly with persistence internals.
Summary
Functions
Approves a paused approval step and resumes the run through its success path.
Requests cancellation for an eligible workflow run.
Loads Squid Mesh configuration from the application environment with optional runtime overrides.
Loads Squid Mesh configuration and raises if required keys are missing.
Explains the current runtime state of one workflow run.
Fetches one workflow run by id.
Lists workflow runs with optional filters.
Rejects a paused approval step and resumes the run through its rejection path.
Creates a new run from a prior run and links it to the original run.
Starts a new workflow run with the given payload through the workflow's default trigger.
Starts a new workflow run through a named trigger with the given payload.
Resumes a run that is intentionally paused for manual intervention.
Functions
@spec approve_run(Ecto.UUID.t(), map(), keyword()) :: {:ok, SquidMesh.Run.t()} | {:error, :not_found | :invalid_run_id | {:missing_config, [atom()]} | SquidMesh.RunStore.transition_error() | term()}
Approves a paused approval step and resumes the run through its success path.
@spec cancel_run( Ecto.UUID.t(), keyword() ) :: {:ok, SquidMesh.Run.t()} | {:error, :not_found | :invalid_run_id | {:missing_config, [atom()]} | SquidMesh.RunStore.transition_error()}
Requests cancellation for an eligible workflow run.
@spec config(keyword()) :: {:ok, SquidMesh.Config.t()} | {:error, {:missing_config, [atom()]}}
Loads Squid Mesh configuration from the application environment with optional runtime overrides.
@spec config!(keyword()) :: SquidMesh.Config.t()
Loads Squid Mesh configuration and raises if required keys are missing.
@spec explain_run( Ecto.UUID.t(), keyword() ) :: {:ok, SquidMesh.RunExplanation.t()} | {:error, :not_found | :invalid_run_id | SquidMesh.Config.config_error()}
Explains the current runtime state of one workflow run.
The result is structured diagnostic data for host apps, CLIs, and dashboards.
Use inspect_run/2 for the factual run snapshot and explain_run/2 when an
operator-facing surface needs the reason, evidence, and valid next actions for
the run's current state.
@spec inspect_run( Ecto.UUID.t(), keyword() ) :: {:ok, SquidMesh.Run.t()} | {:error, :not_found | :invalid_run_id | {:missing_config, [atom()]}}
Fetches one workflow run by id.
@spec list_runs( SquidMesh.RunStore.list_filters(), keyword() ) :: {:ok, [SquidMesh.Run.t()]} | {:error, {:missing_config, [atom()]}}
Lists workflow runs with optional filters.
@spec reject_run(Ecto.UUID.t(), map(), keyword()) :: {:ok, SquidMesh.Run.t()} | {:error, :not_found | :invalid_run_id | {:missing_config, [atom()]} | SquidMesh.RunStore.transition_error() | term()}
Rejects a paused approval step and resumes the run through its rejection path.
@spec replay_run( Ecto.UUID.t(), keyword() ) :: {:ok, SquidMesh.Run.t()} | {:error, :not_found | :invalid_run_id | {:missing_config, [atom()]} | SquidMesh.RunStore.replay_error()} | {:error, {:dispatch_failed, term()}}
Creates a new run from a prior run and links it to the original run.
Replays are blocked by default once the source run completed an irreversible
or non-compensatable step. Pass allow_irreversible: true only after an
operator has reviewed the side effect and accepted re-execution.
@spec start_run(module(), map()) :: {:ok, SquidMesh.Run.t()} | {:error, {:missing_config, [atom()]}} | {:error, SquidMesh.RunStore.create_error()} | {:error, {:dispatch_failed, term()}}
Starts a new workflow run with the given payload through the workflow's default trigger.
@spec start_run(module(), map(), keyword()) :: {:ok, SquidMesh.Run.t()} | {:error, {:missing_config, [atom()]}} | {:error, SquidMesh.RunStore.create_error()} | {:error, {:dispatch_failed, term()}}
@spec start_run(module(), atom(), map()) :: {:ok, SquidMesh.Run.t()} | {:error, {:missing_config, [atom()]}} | {:error, SquidMesh.RunStore.create_error()} | {:error, {:dispatch_failed, term()}}
Starts a new workflow run through a named trigger with the given payload.
@spec start_run(module(), atom(), map(), keyword()) :: {:ok, SquidMesh.Run.t()} | {:error, {:missing_config, [atom()]}} | {:error, SquidMesh.RunStore.create_error()} | {:error, {:dispatch_failed, term()}}
@spec unblock_run(Ecto.UUID.t()) :: {:ok, SquidMesh.Run.t()} | {:error, :not_found | :invalid_run_id | {:missing_config, [atom()]} | SquidMesh.RunStore.transition_error() | term()}
Resumes a run that is intentionally paused for manual intervention.
@spec unblock_run( Ecto.UUID.t(), keyword() ) :: {:ok, SquidMesh.Run.t()} | {:error, :not_found | :invalid_run_id | {:missing_config, [atom()]} | SquidMesh.RunStore.transition_error() | term()}
@spec unblock_run(Ecto.UUID.t(), map()) :: {:ok, SquidMesh.Run.t()} | {:error, :not_found | :invalid_run_id | {:missing_config, [atom()]} | SquidMesh.RunStore.transition_error() | term()}
@spec unblock_run(Ecto.UUID.t(), map(), keyword()) :: {:ok, SquidMesh.Run.t()} | {:error, :not_found | :invalid_run_id | {:missing_config, [atom()]} | SquidMesh.RunStore.transition_error() | term()}