Skip to main content
Tasks enable agents to break down complex objectives into manageable units of work, track progress, and coordinate execution across multiple steps and agents.

Overview

The Tasks primitive provides a structured way to define, assign, execute, and monitor discrete units of work. Unlike workflows which define processes, tasks represent individual actionable items that can be tracked, prioritized, and completed independently or as part of larger objectives. Tasks are essential for:
  • Work Breakdown: Decompose complex goals into manageable chunks
  • Progress Tracking: Monitor completion status and progress
  • Prioritization: Organize work by importance and urgency
  • Delegation: Assign tasks to specific agents or humans
  • Dependencies: Define task relationships and execution order
  • Accountability: Track who did what and when

Task Creation

Agents can create tasks autonomously or from user requests

Status Tracking

Track task lifecycle from creation to completion

Dependencies

Define task relationships and execution order

Collaboration

Assign tasks to agents or human team members

How Tasks Work

When you enable tasks for an agent:
  1. Creation: Tasks are created with description, priority, and metadata
  2. Assignment: Tasks assigned to agents or humans with appropriate context
  3. Execution: Assigned party works on and completes task
  4. Tracking: Status updates tracked throughout lifecycle
  5. Completion: Task marked complete with results and artifacts
  6. Review: Optional review and approval processes
Persistent State: Tasks persist across sessions and can be resumed at any time, making them ideal for long-running work.

Task States

Lifecycle States

  • pending: Task created but not started
  • in_progress: Actively being worked on
  • blocked: Waiting for dependency or external input
  • completed: Successfully finished
  • cancelled: Abandoned or no longer needed

Priority Levels

Code Examples

Basic Task Creation

Create Task Manually

Task with Dependencies

Assign Task to Agent

Query Tasks

Update Task Status

Recurring Tasks

Task Templates

Use Cases

1. Project Management

Break down projects into trackable tasks:

2. Content Creation Pipeline

Manage content creation workflow:

3. Customer Onboarding

Automate onboarding task creation:

4. Incident Response

Create incident resolution tasks:

5. Daily Standup Automation

Generate daily task summaries:

6. Sales Pipeline Tasks

Track sales activities:

Best Practices

Task Design

Task Management

Review Tasks Regularly: Set up periodic reviews of task lists to update priorities and remove obsolete tasks.

Collaboration

Integration with Other Primitives

With Workflow

Combine tasks with workflows:
Learn more: Workflow Primitive

With Memory

Remember task preferences:
Learn more: Memory Primitive

With Scheduling

Schedule task creation:
Learn more: Scheduling Primitive

Performance Considerations

Task Volume

  • Scalability: System handles thousands of active tasks
  • Query Performance: Index tasks by status, priority, assignee
  • Archival: Archive completed tasks to maintain performance

Real-time Updates

  • Webhooks: Receive real-time task updates
  • Polling: Query for task changes periodically
  • WebSocket: Subscribe to live task updates

Troubleshooting

Problem: Agent doesn’t create tasks as expectedSolutions:
  • Verify tasks capability is enabled
  • Check system prompt includes task creation instructions
  • Ensure agent has permissions to create tasks
  • Review agent response for task creation attempts
Problem: Circular dependencies preventing task completionSolutions:
  • Review task dependency graph
  • Identify circular references
  • Break circular dependencies
  • Update task dependencies
Problem: Too many tasks overwhelming assigneesSolutions:
  • Balance task distribution
  • Adjust priorities
  • Delegate or reassign tasks
  • Extend deadlines

Advanced Patterns

Task Automation

Auto-complete simple tasks:

Task Templates with Variations

Create flexible templates:

Smart Task Routing

Route tasks based on content:

Workflow

Orchestrate multi-step processes with tasks

Scheduling

Schedule recurring task creation

Memory

Remember task patterns and preferences

Multi-Agent

Distribute tasks across specialized agents

Additional Resources

API Reference

Complete tasks API documentation

Task Templates

Pre-built task templates library

Best Practices

Task management strategies
Pro Tip: Use task templates for recurring work patterns. This ensures consistency and saves time on task creation.