.do
Execution

tasks

Task management and assignment

tasks

Task management system for creating, assigning, and tracking work items with priorities, dependencies, and progress monitoring.

Overview

The tasks primitive provides a comprehensive task management system for coordinating work between humans and agents, with support for workflows, dependencies, and real-time updates.

Parent Primitive: workflows - Multi-step process orchestration

SDK Object Mapping

This primitive integrates with workflows through the workflow and on SDK objects:

import { workflow, on, send, tasks } from 'sdk.do'

// Tasks within workflows
workflow('process-order', async ({ order }) => {
  // Create task for manual review
  const reviewTask = await tasks.create({
    title: 'Review large order',
    description: `Order #${order.id} requires approval`,
    assignee: 'sales-team',
    priority: 'high',
    metadata: { orderId: order.id },
  })

  // Wait for task completion
  await on(`task.${reviewTask.id}.completed`, async ({ result }) => {
    if (result.approved) {
      await processOrder(order)
    } else {
      await send('order.rejected', { order, reason: result.reason })
    }
  })
})

// Auto-create tasks from events
on('error.critical', async ({ error }) => {
  await tasks.create({
    title: `Critical Error: ${error.type}`,
    description: error.message,
    assignee: 'oncall-engineer',
    priority: 'urgent',
    metadata: { errorId: error.id },
  })
})

// Task dependencies in workflows
workflow('deploy-application', async () => {
  const buildTask = await tasks.create({ title: 'Build application' })
  await buildTask.complete()

  const testTask = await tasks.create({
    title: 'Run tests',
    dependsOn: [buildTask.id],
  })
  await testTask.complete()

  const deployTask = await tasks.create({
    title: 'Deploy to production',
    dependsOn: [testTask.id],
  })
  await deployTask.complete()
})

Quick Example

import { tasks } from 'sdk.do'

// Create task
const task = await tasks.create({
  title: 'Review pull request #123',
  description: 'Review code changes for new feature',
  assignee: 'tom',
  priority: 'high',
  dueDate: new Date('2025-11-01'),
})

// Update status
await task.update({ status: 'in-progress' })

// Complete task
await task.complete({
  notes: 'Approved with minor comments',
})

Core Capabilities

  • Task Creation - Create and organize work items
  • Assignment - Assign to humans or agents
  • Dependencies - Define task dependencies and workflows
  • Progress Tracking - Monitor status and completion
  • Notifications - Real-time updates on task changes

Access Methods

SDK

TypeScript/JavaScript library for task management

await tasks.create({ title: 'Review PR #123', assignee: 'tom', priority: 'high' })

SDK Documentation

CLI

Command-line tool for task operations

do task create "Review PR #123" --assignee tom --priority high

CLI Documentation

API

REST/RPC endpoints for task management

curl -X POST https://api.do/v1/tasks -d '{"title":"Review PR #123","assignee":"tom"}'

API Documentation

MCP

Model Context Protocol for AI-driven task management

Create a high-priority task "Review PR #123" assigned to Tom

MCP Documentation

Parent Primitive

  • workflows - Multi-step process orchestration
  • agents - AI agents for task execution
  • queue - Background task processing
  • on - Event handlers for task events
  • user - Task assignment to humans