NextStepDecision is a structured data object used by an agent’s task handler to choose how processing continues. It represents either an instruction for another sub-step or the result of the completed task. section 4.2.1
In the task-processing flow:
- The handler uses the previous sub-step result and the execution history to request a NextStepDecision from the backbone LLM. section 4.2.3
- The decision’s kind determines whether the handler returns a new TaskStep or the final TaskResult. section 4.2.1 section 4.2.3
Implement NextStepDecision as a Pydantic BaseModel for use as structured output inside TaskHandler.get_next_step(). section 4.2.2
A one-step Hailstone task
An agent calls a Hailstone tool with 5, receives 16, and reports that the task is complete. In the processing flow, the decision can represent the overall result rather than another step instruction. section 4.2.3 section 4.2.1
Figure 4.8 UML class diagrams for TaskStep, TaskStepResult, NextStepDecision, and TaskHandler

The class diagram places NextStepDecision alongside the task-step and task-handler types that use it. section 4.2.2
