WorkflowStem.Adapters.PersistenceAdapter behaviour (workflow_stem v0.2.0)

Copy Markdown View Source

Interface adapter for execution persistence and checkpoint storage.

The stem runtime is shared across tenants; persistence must remain tenant-scoped.

Summary

Callbacks

get_execution(tenant_id, execution_id)

@callback get_execution(WorkflowStem.Types.tenant_id(), WorkflowStem.Types.execution_id()) ::
  {:ok, map()} | {:error, term()}

list_executions(tenant_id, map)

@callback list_executions(WorkflowStem.Types.tenant_id(), map()) ::
  {:ok, [map()]} | {:error, term()}

save_checkpoint(tenant_id, execution_id, map)

@callback save_checkpoint(
  WorkflowStem.Types.tenant_id(),
  WorkflowStem.Types.execution_id(),
  map()
) ::
  {:ok, map()} | {:error, term()}

save_execution(tenant_id, map)

@callback save_execution(WorkflowStem.Types.tenant_id(), map()) ::
  {:ok, map()} | {:error, term()}