This API is in beta and is accessible via the
/v1beta/tasks/groups
endpoint.POST /v1beta/tasks/groups
(Create task-group)POST /v1beta/tasks/groups/{taskgroup_id}/runs
(Add runs)
GET /{taskgroup_id}
and GET /{taskgroup_id}/runs
. Please note that the runs endpoint streams back the requested runs instantly (using SSE) to allow for large payloads without pagination, and it doesn’t wait for runs to complete. Runs in a task group are stored indefinitely, so unless you have high performance requirements, you may not need to keep your own state of the intermediate results. However, it’s recommended to still do so after the task group is completed.
GET /v1beta/tasks/groups/{taskgroup_id}
(Get task-group summary)GET /v1beta/tasks/groups/{taskgroup_id}/runs
(Fetch task group runs)
GET /{taskgroup_id}/events
. To also retrieve the task run result upon completion you can use the task run endpoint
GET /v1beta/tasks/groups/{taskgroup_id}/events
(Stream task-group events)GET /v1/tasks/runs/{run_id}/result
(Get task-run result)
Key Concepts
Task Groups
A Task Group is a container that organizes multiple task runs. Each group has:- A unique
taskgroup_id
for identification - A status indicating overall progress
- The ability to add new Tasks dynamically
Group Status
Track progress with real-time status updates:- Total number of task runs
- Count of runs by status (queued, running, completed, failed)
- Whether the group is still active
- Human-readable status messages
Quick Start
1. Define Types and Task Structure
2. Create a Task Group
3. Add Tasks to the Group
4. Monitor Progress
5. Retrieve Results
Batch Processing Pattern
For large datasets, process Tasks in batches to optimize performance:Error Handling
The Group API provides robust error handling:API Reference
Create Task Group
Add Runs to Group
Get Group Status
Stream Group Results
Task runs are returned in the order they were added to the group. Completed tasks include output, while incomplete tasks include run status andnull
output.