API Reference
Complete API reference for Compozy tasks, including all task types, configurations, and event handlers.
JSON Schema
Task Configuration
Properties
Unique identifier for the task within the workflow
Human-readable name for the task
Task type identifier. One of: basic
, parallel
, decision
, collection
, wait
, map
, composite
. See Task Types for detailed information about each type.
Task implementation reference. Can be specified in three formats:
"repo/package"
(e.g.,"compozy/tasks:web-search"
)"repo:package@version"
(e.g.,"compozy/tasks:web-search@1.0.0"
)- Object with
repo
andpackage
fields
Path to external task definition file. Can be a local file path or a package reference.
Schema definition for task input validation
Task type-specific configuration
Retry configuration for failed tasks
Event Handlers
Handler called when task starts
Handler called when task succeeds
Handler called when task fails
Handler called after task completes (success or error)
Type-specific Event Handlers
Collection task specific handlers
Parallel task specific handlers
Decision task specific handlers
Wait task specific handlers
Map task specific handlers
Composite task specific handlers
State Information
Current task status: running
, success
, or error
Task execution duration in milliseconds
ISO timestamp of when task started
ISO timestamp of when task completed
Number of retry attempts made
Error information if task failed
Task output data
Expression Context
Current task ID
Task type
Task status
Task input data
Task output data
Error information
Access to other task data
Returns current timestamp
Environment variables
Type-specific Context
Current item in collection task
Current index in collection task
Current batch index in collection task
Current operation ID in parallel task