Task State
Task state tracks the progress of a specific task from start to finish. It is separate from conversation state and focuses on the execution steps rather than the dialogue.
Task State vs Conversation State
Conversation state records the dialogue between the user and the agent. It answers: 'What was said?'
Task state records the execution of a specific goal. It answers: 'What was done?'
A single conversation may spawn multiple tasks. Each task has its own task state.
Example:
Conversation: User asks to 'prepare a monthly sales report and send it to the team.'
This creates two tasks:
1. Generate the report (task state: steps, data gathered, report status)
2. Send to team (task state: recipients, send status, confirmation)
The conversation state records the user's request and the agent's confirmations. The task states record what actually happened in each execution.
Task Status Lifecycle
- pending: task has been created but not started yet
- running: agent is actively executing steps
- waiting: agent is paused for human approval or an external event
- complete: task finished successfully with a result
- failed: task encountered an unrecoverable error
- cancelled: task was stopped before completion by a user or system
- escalated: task was handed to a human agent for resolution
Key Takeaways
- Task state tracks the progress of a specific task from start to finish.
- pending: task has been created but not started yet
- running: agent is actively executing steps
- waiting: agent is paused for human approval or an external event