What it does
The AI work queue is the ordered list of tasks an agent is allowed to pick up next. Agents claim the top ready task in one atomic call, and the AI Queue page shows you exactly what is ready, what is waiting, and why.
Who needs it
Anyone running an AI worker (Claude Code, a routine, a script) against a Space, and the Owners and Admins who want to see and steer what that worker does next.
Why use it
The queue rules are the same everywhere: the AI Queue page, get_next_tasks and the claim call all use one ranking, so what you see is what the agent gets. Two workers never receive the same task.
How it works
The queue is built per Space from the Space's To Do list. A task is ready when its status is Open, it has no open blocker (a dependency that is not done), and its start time has arrived.
Ranking
Ready tasks are ordered by: priority (Urgent first, none last), then the manual order you set by dragging on the AI Queue page, then due date (undated last), then creation time. Manual order is a tie-break: it only orders tasks of equal priority. The AI Queue page groups tasks by priority and only lets you drag within a group; change a task's priority to move it between groups. The reorder API (POST /api/v1/agent-queue/reorder) returns 400 if the ids span more than one priority.
Start-time gating
A task's start date is a wall-clock value in the workspace timezone (Work Schedule). The task is held back until that moment arrives: a date-only start begins at the start of that day, and a start of Friday 3pm begins at 15:00. Held-back tasks are listed as waiting with the time they start; a task with no start date is always eligible.
Waiting reasons
The AI Queue page (/{slug}/agent-queue, in the sidebar) lists waiting tasks with a reason: Blocked (with the open blockers), NotStarted (with the start time), NeedsHuman (status Needs Human, never handed to an AI), or Excluded (the task's environment does not match the worker's slot).
Claim and release
POST /api/v1/agent-queue/claim (also an MCP operation through the bridge) picks the top ready task, sets it In Progress, assigns the caller, and returns the full task with description, checklists and dependencies. Two concurrent callers never get the same task. Optional spaceId narrows to one Space and slotId makes the pick slot-aware. When nothing is ready the response is { "claimed": false, "nextStartAt": ... }, where nextStartAt is the earliest future start (UTC) so the worker can sleep until then. It needs a user-scoped write key.
POST /api/v1/agent-queue/release takes a taskId and a required reason, moves an In Progress task back to Open, clears the claim, unassigns the caller and records the reason as a comment. Only the assignee or an Owner/Admin can release.
Environments and Slots
Under Settings, Environments (work environments, API /api/v1/work-environments) describe where work runs and Slots are the workers that run it (with a heartbeat that shows when a slot has gone stale). Passing a slotId to the queue filters out tasks for other environments and sets an at-capacity flag when too many slots are already working a Space; the flag never blocks a claim.
taskReady webhook
Instead of polling, create a webhook (Settings > Webhooks) subscribed to the taskReady event. It fires once when a task in a To Do queue becomes ready, whether its start time arrived, its last blocker closed, or it was moved or set to Open. A task that stays ready does not fire again; if it leaves the ready set it can fire again later. The check runs about once a minute, and the first pass for a workspace only records what is already ready.
Connect a worker
Settings > Connect an agent shows the MCP connector URL, a link to create a Space-scoped API key, and copy-paste loop instructions for Claude Code (/loop) and Claude routines (/schedule): claim the next task, work it, release it with a status, and sleep until nextStartAt when nothing is ready.