<!-- description: A task in AgentRQ is a discrete unit of work created by an AI agent, with a title, description, status, and conversation thread that lets humans track and collaborate on agent work. -->

# Task

A **task** in AgentRQ is a discrete unit of work created by an AI [agent](agent). Tasks appear on your [task board](task-board) and serve as the primary collaboration object between the agent and the human — containing a title, description, current [status](task-status), and a full conversation thread.

## Anatomy of a Task

| Field | Description |
|-------|-------------|
| `title` | Short name for the work item |
| `description` | Detailed description of what the agent is doing |
| `status` | Current state: `pending`, `ongoing`, `completed`, `failed` |
| `chat_id` | Unique identifier for the task's conversation thread |
| `attachments` | Files uploaded by the agent or human |
| `messages` | Full conversation history between agent and human |

## Task Lifecycle

```
pending → ongoing → completed
                  ↘ failed
```

1. **Pending** — Task has been created but the agent hasn't started yet
2. **Ongoing** — Agent is actively working on the task
3. **Completed** — Task is finished successfully
4. **Failed** — Task encountered an unrecoverable error

## Creating Tasks via MCP

[Claude Code](claude-code) agents create tasks using the `createTask` [MCP tool](mcp-tool):

```json
{
  "tool": "createTask",
  "params": {
    "title": "Refactor auth middleware",
    "description": "Rewriting the JWT validation logic to fix the token expiry bug",
    "status": "ongoing"
  }
}
```

The task immediately appears on the human's task board with real-time updates.

## Tasks as Collaboration Units

Each task has its own conversation thread. The agent can send messages via `reply`, and the human can respond directly. This makes tasks the natural unit for [human-in-the-loop](human-in-the-loop) oversight — one task per work item, with full history preserved.

## Related Terms

- [Task Board](task-board)
- [Task Status](task-status)
- [Bidirectional Messaging](bidirectional-messaging)
- [Notification](notification)
- [Approval](approval)
