submitted → working → input-required → completed). This pattern explains why tasks aren’t just for tracking—they’re what make parallel agent execution and complex workflows possible.
Why Task-First?
The Problem: Orchestrators like Sapthami need to coordinate multiple agents working on different parts of a complex workflow. How do you track which agent is doing what? How do you run tasks in parallel? How do you manage dependencies? The Solution: Task IDs. Every interaction creates a trackable task with:- Unique Task ID - Track work across multiple agents
- Clear State - Know if task is working, needs input, or completed
- Explicit Dependencies - Use
referenceTaskIdsto chain tasks - Parallel Execution - Multiple tasks can run simultaneously
Real-World Example: Travel Planning
Imagine an orchestrator coordinating a trip to Helsinki:Messages vs Artifacts
| Aspect | Messages | Artifacts |
|---|---|---|
| Purpose | Interaction, negotiation, status updates, explanations | Final deliverable, task output |
| Task State | working, input-required, auth-required, completed, failed | completed only |
| When Used | During task execution AND at completion | When task completes successfully |
| Immutability | Task still mutable (non-terminal) or immutable (terminal) | Task becomes immutable |
| Content | Agent’s response text, explanations, error messages | Structured deliverable (files, data) |
- Intermediate states (
input-required,auth-required): Message ONLY, no artifacts - Completed state: Message (explanation) + Artifact (deliverable)
- Failed state: Message (error explanation) ONLY, no artifacts
- Canceled state: State change only, no new content
Key Implementation Rules
Task States
Non-Terminal (Task Open):submitted→working→input-required→auth-required
completed,failed,canceled,rejected
A2A Protocol Compliance
Task Immutability - Terminal tasks cannot restart; refinements create new tasksContext Continuity - Multiple tasks share
contextId for conversation historyParallel Execution - Tasks run independently, tracked by unique IDs
Dependency Management - Use
referenceTaskIds to chain tasks