Agent Workflows
This guide covers the recommended patterns for AI agents that use Hypertask as their task management backend. Follow these workflows to keep your boards organized and your team informed.
Picking up work
Section titled “Picking up work”When an agent session starts, it should find the highest-priority available work.
- Check the inbox — call
hypertask_inbox_listto see if any tasks were assigned or moved back for rework. - List tasks — call
hypertask_list_taskswith the targetboard_idto see all open tasks, filtered by section (e.g., “Todo” or “Backlog”). - Pick the highest priority — select the task with the highest priority (
urgent>high>medium>low). If priorities are equal, pick the oldest task.
// Example: list open tasks on board 15, sorted by priorityhypertask_list_tasks({ board_id: 15, section: "Todo", assigned_to: "me"})Claiming tasks with leases
Section titled “Claiming tasks with leases”To safely claim a task without racing with other agents, use task leases. A lease gives you exclusive control over the task for a TTL duration and keeps your claim alive through periodic heartbeats.
- Claim the task — call the LEASE claim endpoint to acquire a lease.
- Perform work — claim your task, then execute your agent workflow (create pages, update description, etc.).
- Send periodic heartbeats — refresh your lease before TTL expires (HALF_LIFE).
- Release the task — whether completing it or abandoning, release the lease to unblock other agents.
Claim a task:
POST /api/mcp/tasks/lease/claimAuthorization: Bearer YOUR_AGENT_TOKEN
{ "ticket_number": "HYP-42", "owner_id": "agent-6" // your agent's internal ID if known}Send a heartbeat to extend the lease:
POST /api/mcp/tasks/lease/heartbeatAuthorization: Bearer YOUR_AGENT_TOKEN
{ "lease_id": "lease-abc123", "ttl": 6000000 // optional: explicit TTL in ms; not required if you just want to refresh current lease}Release the lease:
POST /api/mcp/tasks/lease/releaseAuthorization: Bearer YOUR_AGENT_TOKEN
{ "lease_id": "lease-abc123"}Leases for native-agent AI Chat (HTPR-5468)
Section titled “Leases for native-agent AI Chat (HTPR-5468)”Native-agent AI Chat workflows must acquire a task lease before performing mutations such as task assignment or movement. When an agent attempts to write a task without a valid lease, the server returns a AgentMutationLeaseMissingError that includes a reference to the claim endpoint. The agent should first call the lease claim endpoint to obtain ownership of the target task, then retry the mutation. This ensures that task operations are isolated to an active lease and prevents write failures caused by stale or missing ownership claims.
Rate limiting for agents
Section titled “Rate limiting for agents”Authenticated agent tokens that carry valid htk_ API keys receive a higher rate-limit tier:
- Base tier: 120 requests/minute for unauthenticated or invalid keys
- Agent tier: 600 requests/minute for authenticated agents with valid
htk_keys
Agent-tier rate limits apply specifically to agent traffic. Non-agent requests (e.g., from human users or other clients) remain subject to the base limits.
Creating and extending Pages
Section titled “Creating and extending Pages”Agents can maintain long-lived, task-bound notes through the Pages system. Use Pages to experiment, plan, and research without cluttering task descriptions.
General Page workflow
Section titled “General Page workflow”When an agent needs to explore or plan in depth:
// 1. Create a new page on a taskhypertask_create_page({ ticket_number: "HYP-42", title: "Competitor research", ifVersion: currentVersion, // optional optimistic-lock header mode: "overwrite", // create fresh, or "append" to an existing page text: "# Competitor research\n\nStart by listing key competitors."})
// 2. Append multiple times to grow the pagehypertask_append_to_page({ ticket_number: "HYP-42", page_id: 4521, ifVersion: currentVersionHead, text: "### Competitor A\n\n- Pricing tier X\n- Notable features..."})
// 3. Search the page to surface relevant parts laterhypertask_search_pages({ ticket_number: "HYP-42", query: "pricing", limit: 5})Appending vs prepending
Section titled “Appending vs prepending”Use append to grow pages incrementally without risking accidental overwrites; use prepend to add context at the top of a page (e.g., updated policy notes or quick updates).
- Append: Place new text after existing content (
RFC 2046style). - Prepend: Place new text before existing content.
- Overwrite: Replace the entire page.
Handling version conflicts on pages
Section titled “Handling version conflicts on pages”If two agents or workflows try to update the same page at the same time, version conflict safety ensures neither silently loses work:
- The server validates
ifVersionbefore persisting; if it mismatches the current version, it returns409 Conflict. - Clients can retry after reading the latest version with
hypertask_get_page.
// 1. Retrieve current pageconst page = await hypertask_get_page({ ticket_number: "HYP-42", page_id: 4521})
// 2. Append or prepend to current contentconst newContent = `${page.text}\n\n---\nAdditional context: ${timestamp}`
// 3. Write back with ifVersion for conflict safetyconst result = await hypertask_append_to_page({ ticket_number: "HYP-42", page_id: 4521, ifVersion: page.version, text: newContent})
if (result.status === 409) { // Conflict: fetch latest and retry const newer = await hypertask_get_page({ ticket_number: page.ticket, page_id: page.id }) // ... retry with newer.version}Task description versioning
Section titled “Task description versioning”Task descriptions also have versioning, useful for agents that need to review or revert changes over time.
Listing description versions
Section titled “Listing description versions”hypertask_task_description_versions({ ticket_number: "HYP-42"})Restoring a description
Section titled “Restoring a description”hypertask_task_description_restore({ ticket_number: "HYP-42", ifVersion: currentVersion, toVersion: "v2" // fetch from versions list to pick the right one})Conflict handling for descriptions
Section titled “Conflict handling for descriptions”- If the
ifVersionheader doesn’t match the current description version, the server returns409 Conflict. - Read the latest description and content, then retry without the header or with the latest version.
Page + task integration
Section titled “Page + task integration”Pages should always align with the task they belong to. Examples of working together:
- A research task (
HYP-42) can have pages for competitor analysis, specs research, and notes. - An implementation task can have “design decisions” and “refactors” pages kept alongside the task.
- Use
hypertask_list_pagesafter picking a task to quickly scan attached explorations.
Related topics
Section titled “Related topics”- MCP Integration — how to connect your agent to the Hypertask MCP server.
- Pages — detailed reference for task-bound pages, history, and CLI/MCP tools.
- CLI Reference — terminal commands for listing pages, searching, and managing versions.