Global configuration options inherited from parent contexts
Includes provider settings, API keys, and other global parameters
env
object
Environment variables available during task execution
Can override or extend workflow-level environment variables
Example: { "API_KEY": "{{ .env.SECRET_KEY }}" }
file_path
string
Absolute file path where this task configuration was loaded from
Set automatically during configuration loading
filter
string
Filter is an optional CEL expression to filter items before processing
Each item is available as 'item' in the expression
Example: "item.status != 'inactive'" or "item.age > 18"
final
boolean
Marks this task as a terminal node in the workflow
No subsequent tasks will execute after a final task
flush_config
object
Configuration for flush operations
Only used when operation is "flush"
health_config
object
Configuration for health check operations
Only used when operation is "health"
id
string
Unique identifier for the task instance within a workflow
Must be unique within the workflow scope
index_var
string
IndexVar is the variable name for the current index (default: "index")
Available in task templates as {{ .index }} or custom name
Zero-based index of the current item
input
object
Schema definition for validating task input parameters
Follows JSON Schema specification for type validation
Format:
type: object
properties:
user_id: { type: string, description: "User identifier" }
required: ["user_id"]
item_var
string
ItemVar is the variable name for the current item (default: "item")
Available in task templates as {{ .item }} or custom name
Example: Set to "user" to access as {{ .user }} in templates
items
string
Items is a template expression that evaluates to an array
The expression should resolve to a list of items to iterate over
Example: "{{ .workflow.input.users }}" or "{{ range(1, 10) }}"
key_template
string
KeyTemplate is a template expression for the memory key
Supports template variables for dynamic key generation
Maximum number of reasoning iterations the agent can perform.
The agent may self-correct and refine its response across multiple iterations
to improve accuracy and address complex multi-step problems.
Default:5 iterations
Trade-offs:
Higher values enable more thorough problem-solving and self-correction
Each iteration consumes additional tokens and increases response latency
Configure based on task complexity, accuracy requirements, and cost constraints
max_keys
integer
MaxKeys limits the number of keys processed
Safety limit to prevent runaway operations
Default: 1,000, Maximum: 50,000
max_workers
integer
MaxWorkers limits the number of concurrent task executions
0 means no limit (all tasks run concurrently)
Example: 5 means at most 5 tasks run at the same time
mcps
array
Model Context Protocol (MCP) server configurations.
MCPs provide standardized interfaces for extending agent capabilities
with external services and data sources through protocol-based communication.
Mode determines if items are processed in parallel or sequentially
Defaults to "parallel"
Options: parallel, sequential
model_config
object
LLM provider configuration defining which AI model to use and its parameters.
Supports multiple providers including OpenAI, Anthropic, Google, Groq, and local models.
Payload data for write/append operations
Can be any JSON-serializable data structure
Required for write and append operations
processor
object
Processor is an optional task configuration to process received signals
Allows custom handling of signal data before continuing
The processor receives the signal payload as input
$ref: inline:#
prompt
string
Prompt provides direct instruction to agents when no specific action is needed
Used for ad-hoc agent interactions without predefined action definitions
Example: "Analyze this code for security issues", "Summarize the following text"
resource
string
Resource reference for the task
Format: "compozy:task:<name>" (e.g., "compozy:task:process-data")
retries
integer
Number of retry attempts for failed task executions
Default: 0 (no retries)
routes
object
Routes maps condition values to task IDs or inline task configurations
The condition field in BaseConfig is evaluated, and its result is used
as the key to select the appropriate route
Values can be:
Signal configuration containing the signal ID and payload
sleep
string
Sleep duration after task completion
Format: "5s", "1m", "500ms", "1h30m"
Useful for rate limiting or giving external systems time to process
stats_config
object
Configuration for statistics operations
Only used when operation is "stats"
strategy
string
Strategy determines how the parallel execution handles task completion
Defaults to "wait_all" if not specified
Options: wait_all, fail_fast, best_effort, race
task
object
Task template for collection tasks
This configuration is replicated for each item in the collection
The item and index are available as template variables
$ref: inline:#
tasks
array
Tasks array for parallel, composite, and collection tasks
Contains the list of sub-tasks to execute
For parallel: tasks run concurrently
For composite: tasks run sequentially
For collection: not used (use Task field instead)
$ref: inline:#
timeout
string
Maximum execution time for parallel or composite tasks
Format: "30s", "5m", "1h"
Task will be canceled if it exceeds this duration
tool
object
Tool configuration for executing specific tool operations
Used when the task needs to execute a predefined tool
Mutually exclusive with Agent field
Tools available to the agent for extending its capabilities.
When tools are defined, the agent automatically has toolChoice set to "auto",
enabling autonomous tool selection and invocation during task execution.
Tool types supported:
File system operations (read, write, list)
API integrations (HTTP requests, webhooks)
Data processing utilities (parsing, transformation)
Custom business logic (TypeScript/JavaScript execution)
Tools are referenced by ID and can be shared across multiple agents.
type
string
Type of task that determines execution behavior
If not specified, defaults to "basic"
wait_for
string
WaitFor specifies the signal ID to wait for
The task will pause until a signal with this ID is received
Must match the ID used in a SignalTask
Example: "user-approved", "payment-completed"
with
object
Input parameters passed to the task at execution time
Can include references to workflow inputs, previous task outputs, etc.