Persistence adapter contract for workflow instances.
Summary
Callbacks
Deletes a workflow instance by its unique identifier.
Retrieves a workflow instance by its unique identifier.
Persists a workflow instance.
Returns all workflow instances that match the given filters.
Callbacks
@callback delete(instance_id :: String.t()) :: :ok
Deletes a workflow instance by its unique identifier.
The operation is idempotent — deleting a non-existent instance is not an error.
@callback get(instance_id :: String.t()) :: {:ok, Hephaestus.Core.Instance.t()} | {:error, :not_found}
Retrieves a workflow instance by its unique identifier.
Returns {:ok, instance} if found, or {:error, :not_found} if no instance
matches the given instance_id.
@callback put(instance :: Hephaestus.Core.Instance.t()) :: :ok
Persists a workflow instance.
Inserts the instance if it does not exist, or overwrites it if an instance with the same ID is already stored.
@callback query(filters :: keyword()) :: [Hephaestus.Core.Instance.t()]
Returns all workflow instances that match the given filters.
filters is a keyword list where each key corresponds to an instance field
(e.g., :status, :workflow). Only instances matching all provided filters
are returned. An empty filter list returns all stored instances.