Database tables for tasks
This page lists the columns of tasks, task_members, task_repos, task_blocks, task_holds and task_attempts. Database tables says how to read the columns.
The unit of work a person or a pipeline asks for. It holds the work’s configuration, such as the instructions and the agent. A task has many sessions over time.
| Column | Type | Notes |
|---|---|---|
id |
uuid |
key |
team_id |
uuid |
references teams |
slug |
text |
|
title |
text |
|
instructions |
text |
default '' |
owner_id |
uuid |
optional; references people |
agent_id |
uuid |
optional; references agents |
conversation_id |
uuid |
optional; references conversations |
source_message_id |
uuid |
optional; references messages |
phase |
text |
optional |
source |
text |
optional |
visibility |
text |
default 'team'; one of team, private |
archived_at |
timestamptz |
optional |
created_at |
timestamptz |
default now() |
project_id |
uuid |
optional; references projects |
priority |
smallint |
default 2 |
done_at |
timestamptz |
optional |
asked_by_turn |
uuid |
optional; references turns |
Unique (team_id, slug). Check ((priority >= 0) AND (priority <= 4)).
task_members
Section titled “task_members”A person who may edit or comment on a task that is not shared with the whole team.
| Column | Type | Notes |
|---|---|---|
task_id |
uuid |
references tasks |
person_id |
uuid |
references people |
role |
text |
one of edit, comment |
Primary key (task_id, person_id).
task_repos
Section titled “task_repos”A repo a task works in. One repo of a task is the primary.
| Column | Type | Notes |
|---|---|---|
task_id |
uuid |
references tasks |
repo_id |
uuid |
references repos |
is_primary |
boolean |
default false |
Primary key (task_id, repo_id).
task_blocks
Section titled “task_blocks”A task blocked by another of its team’s tasks until that one is done. The API refuses an edge that would close a cycle.
| Column | Type | Notes |
|---|---|---|
team_id |
uuid |
references teams |
blocked_id |
uuid |
references tasks |
blocker_id |
uuid |
references tasks |
reason |
text |
optional |
created_by |
uuid |
optional; references people |
created_at |
timestamptz |
default now() |
Primary key (blocked_id, blocker_id). Check ((reason <> '') AND (reason !~ '[\r\n]')). Check (blocked_id <> blocker_id).
task_holds
Section titled “task_holds”A task paused on purpose, with what kind of wait, why in one line, and until when. The hold lapses on its until date, by the server’s date.
| Column | Type | Notes |
|---|---|---|
task_id |
uuid |
key; references tasks |
team_id |
uuid |
references teams |
kind |
text |
one of decision, external, load, parked, future |
reason |
text |
|
until |
date |
optional |
held_by |
uuid |
optional; references people |
created_at |
timestamptz |
default now() |
Check ((reason <> '') AND (reason !~ '[\r\n]')).
task_attempts
Section titled “task_attempts”One attempt at a task, on the branch task/<slug>-<n>, on a coding computer of its own.
| Column | Type | Notes |
|---|---|---|
id |
uuid |
key |
team_id |
uuid |
references teams |
task_id |
uuid |
references tasks |
n |
integer |
|
status |
text |
default 'waiting'; one of waiting, starting, working, picked, discarded, failed |
wait |
text |
optional; one of queued, team_limit, host_full |
requested_by |
uuid |
optional; references people |
requested_at |
timestamptz |
default clock_timestamp() |
instance_id |
uuid |
optional; references instances |
workspace_id |
uuid |
optional; references workspaces |
session_id |
uuid |
optional; references sessions |
claude_account |
text |
optional; one of person, team |
account_person_id |
uuid |
optional; references people |
error |
text |
optional |
claimed_at |
timestamptz |
optional |
started_at |
timestamptz |
optional |
ended_at |
timestamptz |
optional |
Unique (task_id, n). Unique (instance_id) where (instance_id IS NOT NULL). Unique (task_id) where (status = 'picked'). Check ((claude_account = 'person') OR (account_person_id IS NULL)). Check ((n >= 1) AND (n <= 8)). Check ((status <> 'waiting') OR ((instance_id IS NULL) AND (session_id IS NULL))). Check ((status <> ALL (ARRAY['starting', 'working', 'picked'])) OR ((instance_id IS NOT NULL) AND (claimed_at IS NOT NULL))). Check ((status <> ALL (ARRAY['working', 'picked'])) OR ((workspace_id IS NOT NULL) AND (session_id IS NOT NULL) AND (claude_account IS NOT NULL) AND (started_at IS NOT NULL))). Check ((status = 'failed') = (error IS NOT NULL)). Check ((status = 'waiting') = (wait IS NOT NULL)). Check ((status = ANY (ARRAY['discarded', 'failed'])) = (ended_at IS NOT NULL)).