Baton.Artifact (Baton v0.27.4)

Copy Markdown View Source

A large step result spilled out of workflow_nodes.

When a step's result exceeds Baton.Config.inline_threshold_bytes/0, the engine stores the (gzipped) payload here instead of inline on the node row, leaving only a small reference envelope behind. This keeps workflow_nodes — the table every concurrent DAG scans for dependency gating — small, so the hot path never touches TOASTed blobs.

This table is the storage for the built-in Baton.ResultStore.Postgres backend. The bytes live in data; byte_size/sha256 describe the stored (compressed) payload and let the read path verify integrity. Rows are keyed by a unique key and carry workflow_id/oban_job_id so Baton.Retention can clean them up with the same dead-job / by-workflow logic it uses for the other Baton tables.

Summary

Types

t()

@type t() :: %Baton.Artifact{
  __meta__: term(),
  byte_size: integer(),
  codec: String.t(),
  content_type: String.t() | nil,
  data: binary() | nil,
  id: term(),
  inserted_at: term(),
  key: String.t(),
  oban_job_id: integer(),
  sha256: String.t(),
  step_name: String.t(),
  workflow_id: String.t()
}

Functions

changeset(artifact \\ %__MODULE__{}, attrs)