kind: Asset
A unit of data that Nagi evaluates against a declared desired state and converges through Sync. The central resource of the reconciliation loop.
yaml
apiVersion: nagi.io/v1alpha1
kind: Asset
metadata:
name: daily-sales
labels:
dbt/finance: ""
dbt/daily: ""
spec:
connection: my-bigquery
upstreams:
- raw-sales
onDrift:
- conditions: daily-sla
sync: dbt-default
with:
selector: "+daily_sales"
- conditions: sales-quality
sync: sales-full-reload
autoSync: true
Each entry in onDrift specifies a pair of Conditions and Sync names. Entries are evaluated from top to bottom, and the sync of the first entry that evaluates to Drifted is executed (first-match). If all entries evaluate to Ready, the Asset is Ready.
Tip
An Asset with no onDrift defined is always treated as Ready, and no Sync is executed.
Attributes
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
autoSync |
boolean | — | true | Controls automatic sync execution in nagi serve. Defaults to true. |
connection |
string | — | - | Name of the Connection resource for DB access. |
evaluateCacheTtl |
Duration | — | - | Default evaluate cache TTL for all conditions in this Asset. Conditions can override this with their own evaluateCacheTtl. |
onDrift |
list[OnDriftEntry] | — | [] | Condition-sync pairs evaluated in order. First entry whose conditions detect drift determines which sync to run. When omitted, the Asset is always Ready. |
upstreams |
list[string] | — | [] | Names of upstream Asset resources. |
OnDriftEntry
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
conditions |
string | Yes | - | Name of the kind: Conditions resource whose conditions define drift. |
sync |
string | Yes | - | Name of the Sync resource to execute when drift is detected. |
mergePosition |
MergePosition | — | beforeOrigin | Controls insertion position during overlay merge. Not included in compiled output. |
with |
map[string, string] | — | {} | Template variables passed to the Sync and Conditions resources for argument interpolation. |