Parallel Execution
Run multiple coding tasks concurrently with the /invoke/stdout endpoint.
Overview
The /invoke/stdout
endpoint supports parallel execution, allowing you to run multiple coding tasks concurrently for faster development workflows. Each task runs independently, and you can track its output in real-time.
Request Structure
To run tasks in parallel, provide a parallel_tasks
array in your request to the /invoke/stdout
endpoint. See the Quickstart for details on authentication and other request parameters.
Task Configuration
Each object in the parallel_tasks
array requires the following fields:
Field | Type | Required | Description |
---|---|---|---|
prompt | string | ✅ | The prompt/query for this task. |
task_name | string | ✅ | A unique identifier for the task. |
Example
This example runs two tasks in parallel. The stream will contain interleaved custom
events from each task, identified by task_name
.
Response Stream
The API returns a stream of Server-Sent Events (SSE). You can distinguish between outputs from different parallel tasks by checking the task_name
in the data
payload of custom
events.
Example custom
event from the “testing” task:
Refer to the Quickstart for more details on the response stream.