Quick Start
- Basic Task
- With Handler
Core Parameters
| Parameter | Type | Description |
|---|---|---|
action | str | What the task should accomplish |
expected_output | str | What the output should look like |
agent | Agent | Agent to execute the task |
name | str | Optional identifier |
tools | list | Tools available to the task |
Task Dependencies
Usecontext to chain tasks:
Conditional Execution
Simple Condition (should_run)
When/Then/Else Routing
Loop Support
Iterate over a list:Callbacks
Useon_task_complete for task completion notifications:
The
callback parameter is deprecated. Use on_task_complete instead.Guardrails
Validate task output before accepting:Robustness Features
| Parameter | Type | Description |
|---|---|---|
max_retries | int | Maximum retry attempts (default: 3) |
retry_delay | float | Seconds between retries |
skip_on_failure | bool | Continue workflow if task fails |
Output Configuration
| Parameter | Type | Description |
|---|---|---|
output_file | str | Save output to file |
output_json | BaseModel | Parse output as JSON |
output_pydantic | BaseModel | Validate with Pydantic |
output_variable | str | Store output in workflow variable |
Feature Configs
Enable advanced features per-task:Task Types
| Type | Description |
|---|---|
task | Standard task (default) |
decision | Branching logic with conditions |
loop | Iterate over items |
Async Execution
Full Parameter Reference
All Task Parameters
All Task Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
action | str | - | What the task should do (required) |
expected_output | str | ”Complete successfully” | Expected output format |
agent | Agent | None | Agent to execute |
name | str | None | Task identifier |
tools | list | [] | Available tools |
context | list | [] | Dependent tasks |
depends_on | list | [] | Alias for context |
handler | Callable | None | Custom function |
should_run | Callable | None | Condition to run |
loop_over | str | None | Variable containing list |
loop_var | str | ”item” | Loop variable name |
when | str | None | Condition expression |
then_task | str | None | Task if condition true |
else_task | str | None | Task if condition false |
on_task_complete | Callable | None | Completion callback |
guardrails | Callable/str | None | Output validation |
max_retries | int | 3 | Max retry attempts |
retry_delay | float | 0.0 | Retry delay seconds |
skip_on_failure | bool | False | Continue on failure |
async_execution | bool | False | Run async |
output_file | str | None | Save to file |
output_json | BaseModel | None | JSON output model |
output_pydantic | BaseModel | None | Pydantic validation |
output_variable | str | None | Workflow variable name |
task_type | str | ”task” | task/decision/loop |
routing | dict | Next task routing | |
images | list | [] | Image inputs |
input_file | str | None | Input file path |
memory | Memory | None | Memory instance |
variables | dict | Task variables | |
description | str | - | Deprecated - use action |
Related
Agents
Create and configure agents
AgentTeam
Orchestrate multiple agents
Callbacks
Task completion callbacks
Guardrails
Output validation

