Skip to main content

ConditionDefinition

A registered, versioned condition definition.

Stored in the definitions table with definition_type='condition'. The body JSONB column holds the serialisation of this model.

Immutability: once registered, a (condition_id, version) pair is permanent. Updates require a new version. The unique constraint on the definitions table enforces this at the DB level.

Deprecation: deprecated conditions are retained for audit. All existing task references continue to resolve. deprecated=True is advisory — the runtime does not automatically reject deprecated conditions, but the rebinding validation step warns when a task is being rebound to a deprecated condition version.

condition_idCondition Id (string)required
versionVersion (string)required
concept_idConcept Id (string)required
concept_versionConcept Version (string)required
strategy objectrequired
typerequired

Possible values: [change, composite, equals, percentile, threshold, z_score]

params objectrequired

change strategy parameters.

direction: 'increase' | 'decrease' | 'any' value: percentage change threshold (must be >= 0) window: lookback duration string (default '1d')

Note: parameter key is 'value' (not 'threshold' or 'cutoff').

directionChangeDirection (string)required

Possible values: [increase, decrease, any]

valueValue (number)required

Possible values: >= 0

windowWindow (string)
Default value: 1d
namespaceNamespace (string)required

Possible values: [personal, team, org, global]

created_at object
anyOf
string<date-time>
deprecatedDeprecated (boolean)
Default value: false
ConditionDefinition
{
"condition_id": "string",
"version": "string",
"concept_id": "string",
"concept_version": "string",
"strategy": {
"type": "threshold",
"params": {
"direction": "above",
"value": 0
}
},
"namespace": "personal",
"created_at": "2024-07-29T15:51:28.071Z",
"deprecated": false
}