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.
Keywords and shorthand
Section titled “Keywords and shorthand”Webhook retries
Section titled “Webhook retries”When an agent uses a webhook, failure or dehydration of the target endpoint shouldn't silently drop messages. If your agent's webhook endpoint returns an error, times out, or is unavailable, the server now retries by returning the message to polling so you can continue processing in the next polling cycle. Deleting a webhook also releases any messages it never acknowledged, preventing buildup when the target is removed.
Pull request links
Section titled “Pull request links”Hypertask may reference pull request URLs (for example, via MCP tools) on tasks or other objects. In the past, when Hypertask attempted to verify or interact with such a link and the PR could not be found—for instance, because it was from a private GitHub repository—this resulted in a PullRequestLinkError that was treated as an error and could cause the agent or workflow to create false error tickets. After this change, an unrecoverable missing PR link is now logged as a warning instead, so it no longer triggers a false error ticket. You can still inspect such warnings for manual triage.
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(action: "list") to see if any tasks were assigned or moved back for rework. - List tasks -- call
hypertask_tasks(action: "list") withquery,filter,fields, andlimitso you get only the rows you need. Do not pull a whole board and filter it in context. - Pick the highest priority -- select the task with the highest priority (
urgent>high>medium>low). If priorities are equal, pick the oldest task.
// Example: open tickets in AI Review with a red PR, title and url onlyhypertask_tasks({ action: "list", input: { project_id: 15, filter: { section: "AI Review", has_pr: "red", status: "open" }, fields: ["title", "url"], limit: 20 }})filter.has_pr=red matches the red PR badge on the board: failing checks or a closed pull request. fields returns only those columns, so this call stays small.
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_pages({ action: "create", input: { ticket_number: "HYP-42", title: "Competitor research", content: "# Competitor research\n\nStart by listing key competitors." }})
// 2. Append multiple times to grow the pagehypertask_pages({ action: "update", input: { mode: "append", page_id: 4521, if_version: currentVersionHead, content: "### Competitor A\n\n- Pricing tier X\n- Notable features..." }})
// 3. Search the page to surface relevant parts laterhypertask_pages({ action: "search", limit: 5, input: { query: "pricing" }})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
if_versionbefore persisting; if it mismatches the current version, it returns409 Conflict. - Clients can retry after reading the latest version with
hypertask_pages(action: "get").
// 1. Retrieve current pageconst page = await hypertask_pages({ action: "get", input: { page_id: 4521 }})
// 2. Append or prepend to current contentconst newContent = `${page.text}\n\n---\nAdditional context: ${timestamp}`
// 3. Write back with if_version for conflict safetyconst result = await hypertask_pages({ action: "update", input: { mode: "replace", page_id: 4521, if_version: page.version, content: newContent }})
if (result.status === 409) { // Conflict: fetch latest and retry const newer = await hypertask_pages({ action: "get", input: { 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_tasks({ action: "versions", input: { ticket_number: "HYP-42" }})Restoring a description
Section titled “Restoring a description”hypertask_tasks({ action: "restore", input: { ticket_number: "HYP-42", version_id: 2 // fetch from versions list to pick the right one }})Choosing a description version
Section titled “Choosing a description version”Read the versions response first and pass the selected numeric version_id to restore. Page updates use if_version for optimistic locking; task description restoration selects a saved version instead.
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_pages(action: "list") after 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.
- Agent Webhooks — what wakes an agent, what Hypertask sends, and how to verify it.