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
- string
- null
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
Possible values: [webhook, notification, email, workflow]
endpoint object
- string
- null
channel object
- string
- null
workflow_id object
- string
- null
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]
activecreated_at object
- string<date-time>
- null
last_triggered_at object
- string<date-time>
- null
context_version object
- string
- null
context_warning object
- string
- null
guardrails_version object
- string
- null
{
"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"
}