Skip to main content
Tasks represent individual annotation or labeling jobs within Avala projects. They track work assignments, progress, and completion status.

Overview

A task is a unit of work assigned within a project. Tasks enable you to:
  • Assign specific annotation jobs to team members
  • Track progress and status of labeling work
  • Organize work by task type and project
  • Monitor completion and quality

Task structure

interface Task {
  uid: string;
  type: string | null;
  name: string | null;
  status: string | null;
  project: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}

Properties

uid
string
Unique identifier for the task
type
string
Task type (e.g., ‘annotation’, ‘review’, ‘qa’)
name
string
Human-readable task name
status
string
Current task status (e.g., ‘pending’, ‘in_progress’, ‘completed’)
project
string
UID of the parent project
createdAt
string
ISO 8601 timestamp of task creation
updatedAt
string
ISO 8601 timestamp of last update

Listing tasks

Retrieve tasks with optional filters:
const page = await avala.tasks.list({
  project: 'proj_123',
  status: 'completed',
  limit: 50
});

for (const task of page.items) {
  console.log(`${task.name}: ${task.status}`);
}

Filter options

Return only tasks belonging to a specific project:
const tasks = await avala.tasks.list({
  project: 'proj_abc123'
});
Return only tasks with a specific status:
const tasks = await avala.tasks.list({
  status: 'in_progress'
});
Use multiple filters together:
const tasks = await avala.tasks.list({
  project: 'proj_abc123',
  status: 'completed',
  limit: 100
});

Pagination

Tasks use cursor-based pagination:
let allTasks = [];
let cursor: string | null = null;

do {
  const page = await avala.tasks.list({
    limit: 100,
    cursor: cursor || undefined
  });
  
  allTasks.push(...page.items);
  cursor = page.nextCursor;
} while (cursor);

console.log(`Total tasks: ${allTasks.length}`);
Always check hasMore to determine if additional pages exist.

Getting a task

Retrieve detailed information about a specific task:
const task = await avala.tasks.get('task_uid_here');

console.log(`Task: ${task.name}`);
console.log(`Type: ${task.type}`);
console.log(`Status: ${task.status}`);
console.log(`Project: ${task.project}`);

Task lifecycle

Tasks progress through various status values:
1

Pending

Task is created but not yet started
2

In progress

Task is actively being worked on
3

Review

Task work is complete and awaiting review
4

Completed

Task has been finished and approved
5

Rejected

Task was rejected and needs rework

Common workflows

// Get all tasks for a project
const tasks = await avala.tasks.list({
  project: 'proj_123'
});

// Count by status
const statusCounts = tasks.items.reduce((acc, task) => {
  acc[task.status || 'unknown'] = (acc[task.status || 'unknown'] || 0) + 1;
  return acc;
}, {} as Record<string, number>);

console.log(statusCounts);
// { pending: 5, in_progress: 3, completed: 12 }

Integration with agents

Tasks can be automated using AI agents:
// Agents can target specific task types
interface Agent {
  uid: string;
  name: string;
  taskTypes: string[];
  project: string | null;
  // ...
}
Configure agents to automatically process tasks of specific types within your projects.

Response format

List operations return paginated results:
interface CursorPage<Task> {
  items: Task[];
  nextCursor: string | null;
  previousCursor: string | null;
  hasMore: boolean;
}

Best practices

Filter by project

Always filter tasks by project UID for better organization and performance

Monitor status

Track task status to measure progress and identify bottlenecks

Use pagination

Handle pagination properly when working with large task lists

Track timestamps

Use createdAt and updatedAt to measure task duration and performance
Combine project and status filters to efficiently query specific subsets of tasks.
  • Projects: Tasks belong to projects - see Projects
  • Agents: Automate task processing with AI agents
  • Quality Targets: Set quality standards for task completion

Build docs developers (and LLMs) love