For AI agents: a documentation index is available at https://docs.parallel.ai/llms.txt. The full text of all docs is at https://docs.parallel.ai/llms-full.txt. You may also fetch any page as Markdown by appending
.md to its URL or sending Accept: text/markdown.Overview
Task Runs support Server-Sent Events (SSE) at the run level, allowing you to receive real-time updates on ongoing research conducted by our processors during execution. For streaming events related to Task Groups, see the streaming endpoints on the Task Group API. Task Group streams provide aggregate group status updates and non-active run state changes. Task Run streams provide detailed events for individual task runs. For a more comprehensive list of differences, see here.Enabling Events Streaming
To enable periodic event publishing for a task run, set theenable_events flag to true
when creating the task run. If not specified, events may still be available, but frequent updates are not guaranteed.
Create a Task Run with events aggregation enabled explicitly:
/v1/tasks/runs/{run_id}/events endpoint:
- All Task API processors starting from
proand above have event streaming enabled by default. - Event streams remain open for up to 570 seconds and close earlier when the run becomes non-active.
Stream Behavior
While a run is active, starting or reconnecting to its stream replays the reasoning messages recorded so far before continuing with new updates. This lets clients reconnect without persisting every reasoning message themselves. Non-active runs behave differently, as described below.For Running Tasks
When connecting to a stream for a task that is still running:- Complete reasoning trace: You receive all reasoning messages (
task_run.progress_msg.*) from the beginning of the task execution, regardless of when you connect to the stream - Latest progress stats: You receive only the current aggregate state via
task_run.progress_statsevents, not historical progress snapshots - Real-time updates: As the task continues, you’ll receive new reasoning messages and updated progress statistics
- Closing status: Before the connection closes—because the run became non-active or the 570-second window ended—the stream emits a
task_run.stateevent. If the run completed successfully, the event includes the complete output
For Non-Active Tasks
When connecting to a run that is alreadycompleted, failed, cancelled, or action_required:
- Current status only: You receive one
task_run.stateevent with the run’s current status - Immediate result: If the run completed successfully, that status event includes the complete task output in the
outputfield, so you don’t also need to use the result endpoint - No trace replay: Reasoning messages and progress statistics are not replayed after the run becomes non-active
Reconnection Behavior
- Event streams are not resumable - there are no sequence numbers or cursors to resume from a specific point
-
If you disconnect and reconnect to the same task:
- Running tasks: You get the reasoning trace recorded so far plus current progress stats
- Non-active tasks: You get the current status event only
-
Every connection starts with a
task_run.stateevent indicating the current status
Supported Events
Currently, four types of events are supported:-
Run Status Events (
task_run.state): Indicate the current status of the run. These are sent at the beginning of every stream and when the run transitions to a non-active status. -
Progress Statistics Events (
task_run.progress_stats): Provide point-in-time updates on the number of sources considered and other aggregate statistics. Only the current state is provided, not historical snapshots. -
Message Events (
task_run.progress_msg.*): Communicate progress at various stages of task run execution. While progress data is available, the sequence from the beginning of execution is provided. Subtypes include.plan(planning),.tool_call(tool use),.result(intermediate findings),.exec_status(execution status), and.search(search activity).- Search events (
task_run.progress_msg.search) record what the run searched for. Eachmessageis prefixedObjective:(the goal being researched at that step) orQuery:(a web search query that was run). A search step typically produces oneObjective:line followed by one or moreQuery:lines. Reasoning messages such as.plan/.tool_callmay be limited onlite; search events are emitted onbaseand above.
- Search events (
-
Error Events (
error): Report errors that occur during execution.
Surfaced search queries reflect what the engine searched for at each step, for auditability and observability. When a step issues no explicit query, only the
Objective: line appears.- Event streams always start and end with a status event; for an already non-active run, one event serves as both
- The final status event for completed tasks always includes the complete output in the
outputfield - Events within the reasoning trace maintain their original timestamps, allowing you to understand the execution timeline
- After a run becomes non-active, reconnecting to the event stream returns its current status but does not replay the reasoning trace.