Skip to main content
Tasks are units of work that agents execute. Each task has a description, expected output, and optional configuration for routing, retries, and advanced features.

Quick Start


Core Parameters

ParameterTypeDescription
actionstrWhat the task should accomplish
expected_outputstrWhat the output should look like
agentAgentAgent to execute the task
namestrOptional identifier
toolslistTools available to the task
description is deprecated. Use action instead.

Task Dependencies

Use context to chain tasks:

Conditional Execution

Simple Condition (should_run)

When/Then/Else Routing


Loop Support

Iterate over a list:

Callbacks

Use on_task_complete for task completion notifications:
The callback parameter is deprecated. Use on_task_complete instead.

Guardrails

Validate task output before accepting:

Robustness Features

ParameterTypeDescription
max_retriesintMaximum retry attempts (default: 3)
retry_delayfloatSeconds between retries
skip_on_failureboolContinue workflow if task fails

Output Configuration

ParameterTypeDescription
output_filestrSave output to file
output_jsonBaseModelParse output as JSON
output_pydanticBaseModelValidate with Pydantic
output_variablestrStore output in workflow variable

Feature Configs

Enable advanced features per-task:

Task Types

TypeDescription
taskStandard task (default)
decisionBranching logic with conditions
loopIterate over items

Async Execution


Full Parameter Reference

ParameterTypeDefaultDescription
actionstr-What the task should do (required)
expected_outputstr”Complete successfully”Expected output format
agentAgentNoneAgent to execute
namestrNoneTask identifier
toolslist[]Available tools
contextlist[]Dependent tasks
depends_onlist[]Alias for context
handlerCallableNoneCustom function
should_runCallableNoneCondition to run
loop_overstrNoneVariable containing list
loop_varstr”item”Loop variable name
whenstrNoneCondition expression
then_taskstrNoneTask if condition true
else_taskstrNoneTask if condition false
on_task_completeCallableNoneCompletion callback
guardrailsCallable/strNoneOutput validation
max_retriesint3Max retry attempts
retry_delayfloat0.0Retry delay seconds
skip_on_failureboolFalseContinue on failure
async_executionboolFalseRun async
output_filestrNoneSave to file
output_jsonBaseModelNoneJSON output model
output_pydanticBaseModelNonePydantic validation
output_variablestrNoneWorkflow variable name
task_typestr”task”task/decision/loop
routingdictNext task routing
imageslist[]Image inputs
input_filestrNoneInput file path
memoryMemoryNoneMemory instance
variablesdictTask variables
descriptionstr-Deprecated - use action

Agents

Create and configure agents

AgentTeam

Orchestrate multiple agents

Callbacks

Task completion callbacks

Guardrails

Output validation