Skip to main content

Task

Canonical task model. Represents both the DB row and the API response.

Lifecycle ───────── Creation → task_id is None; populated by TaskStore.create() from DB default. Read → all fields populated from the DB row. Update → TaskStore.update() enforces IMMUTABLE_TASK_FIELDS and optimistic locking via the version field. Delete → status transitions to 'deleted'; the row is never hard-deleted. Preview → status='preview'; TaskStore.create() must reject these rows.

Internal fields (excluded from JSON serialisation) ────────────────────────────────────────────────── version — optimistic locking counter. Read before UPDATE, increment in WHERE clause. Never exposed to API callers. updated_at — DB-managed timestamp. Not in the API spec; internal only.

task_id object
anyOf
string
intentIntent (string)required
concept_idConcept Id (string)required
concept_versionConcept Version (string)required
condition_idCondition Id (string)required
condition_versionCondition Version (string)required
action_idAction Id (string)required
action_versionAction Version (string)required
entity_scopeEntity Scope (string)required
delivery objectrequired

Describes how a triggered condition delivers its alert.

Validation rules (enforced at model construction time): webhook → endpoint is required notification → channel is required email → channel is required workflow → workflow_id is required

typeDeliveryType (string)required

Possible values: [webhook, notification, email, workflow]

endpoint object
anyOf
string
channel object
anyOf
string
workflow_id object
anyOf
string
statusTaskStatus (string)

Full set of task statuses.

active — evaluated by the application on its own schedule. paused — skipped; no evaluation or alerts until resumed. deleted — soft-deleted; retained for audit, no evaluation. Irreversible via API. preview — dry_run result only; MUST NEVER be persisted to the DB.

Possible values: [active, paused, deleted, preview]

Default value: active
created_at object
anyOf
string<date-time>
last_triggered_at object
anyOf
string<date-time>
context_version object
anyOf
string
context_warning object
anyOf
string
guardrails_version object
anyOf
string
Task
{
"task_id": "string",
"intent": "string",
"concept_id": "string",
"concept_version": "string",
"condition_id": "string",
"condition_version": "string",
"action_id": "string",
"action_version": "string",
"entity_scope": "string",
"delivery": {
"type": "webhook",
"endpoint": "string",
"channel": "string",
"workflow_id": "string"
},
"status": "active",
"created_at": "2024-07-29T15:51:28.071Z",
"last_triggered_at": "2024-07-29T15:51:28.071Z",
"context_version": "string",
"context_warning": "string",
"guardrails_version": "string"
}