Skip to main content

Tag evaluation runs

Tags are (re)computed by a tag evaluation run — manual, scheduled, or via API. A run evaluates the active rules (or a specific subset), then creates assignments for newly matching entities and removes assignments that no longer match.
FieldMeaning
statusPENDING → RUNNING → SUCCESS / FAILED.
triggerTypeMANUAL, SCHEDULED, or API.
ruleIdsThe rules to evaluate (null = all active rules).
stats{ rulesEvaluated, assignmentsCreated, assignmentsRemoved, durationMs }.
logsStructured entries (DEBUG/INFO/WARN/ERROR), capped at 5000 per run.
Because a run reconciles assignments (adds and removes), tags stay in sync with your data over time — an entity that stops matching loses the tag on the next run.

Complete example

Tag inventory items projected to run out within 7 days.
{
  "name": "Auto-tag: Stockout in 7 days",
  "tagId": "<resolved-uuid>",
  "conditions": {
    "operator": "AND",
    "rules": [
      {
        "type": "METRIC",
        "metricId": "<days-of-stock-metric-uuid>",
        "conditionOperator": "LOWER_OR_EQUAL",
        "thresholdValue": 7,
        "periodFilter": null
      }
    ]
  },
  "scope": { "entityType": "INVENTORY_ITEM" },
  "isActive": true
}
What to notice
  • A single metric condition (days of stock ≤ 7) under an AND group.
  • Scope is just entityType: INVENTORY_ITEM — no brand/taxonomy restriction, no propagation (defaults to entity-only).
  • On each evaluation run, matching inventory items receive the tag; items that recover (more than 7 days of stock) lose it.
A second, mixed example — new-season menswear that sold 50+ units last month:
{
  "conditions": {
    "operator": "AND",
    "rules": [
      { "type": "METRIC", "metricId": "<gross-sales-qty>", "conditionOperator": "GREATER_OR_EQUAL", "thresholdValue": 50, "periodFilter": { "type": "LAST_30_DAYS" } },
      { "type": "COLUMN", "columnId": "dim_products.gender_full_path_1", "columnOperator": "STARTS_WITH", "value": "M" }
    ]
  },
  "scope": { "entityType": "PRODUCT", "propagationMode": "CASCADE_DOWN" }
}
Here a metric and a column condition combine, and CASCADE_DOWN propagates the tag from each matching product to its variants.
Once entities are tagged, point alerts and workflow triggers at those tags to monitor or automate against them.