Skip to main content
All Docs
API ReferenceSaaS FactoryUpdated March 28, 2026

Agent Workspace Stream API

Agent Workspace Stream API

GET /api/agent-workspace/stream

Fleet-wide Server-Sent Events (SSE) stream delivering real-time pipeline state and agent log output for all accessible products.

Authentication

Requires a valid session cookie. Returns 401 Unauthorized if not authenticated.

Response

Content-Type: text/event-stream

The connection stays open indefinitely. The server pushes events as they occur.


Events

fleet_snapshot

Emitted once on initial connection. Contains the full current state of all active pipeline runs (up to 50) plus the 300 most-recent log lines.

event: fleet_snapshot
data: [<PipelineSnapshot>, ...]

Emits an empty array ([]) if there are no active runs.


fleet_update

Emitted during polling (every 3 seconds) when one or more pipelines have changed state. Only pipelines whose fingerprint has changed are included.

event: fleet_update
data: [<PipelineSnapshot>, ...]

A fingerprint covers: status, per-job status values, and the count of pending interventions. No event is emitted when nothing has changed.


fleet_logs

Emitted when new agent log entries are available for any active run.

event: fleet_logs
data: [<AgentLog>, ...]

Up to 50 new log entries are included per poll cycle per pipeline.


heartbeat

Emitted every 15 seconds to keep the connection alive through proxies and load balancers.

event: heartbeat
data: {"ts": 1718000000000}

error

Emitted when the server fails to load the initial state.

event: error
data: {"message": "Failed to load initial state"}

Data Types

PipelineSnapshot

FieldTypeDescription
idstringPipeline run ID
projectIdstringAssociated project ID
projectNamestringHuman-readable project name
statusstring | nullCurrent pipeline status
startedAtstring | nullISO timestamp of run start
triggerstringWhat triggered the run
triggerDataunknownTrigger payload
jobsSlimJob[]Agent jobs in this run
pendingInterventionsSlimIntervention[]Unresolved human interventions

SlimJob

FieldTypeDescription
idstringJob ID
pipelineRunIdstringParent run ID
agentTypestringType of agent (e.g. implementing)
statusstring | nullJob status
startedAtDate | nullJob start time
completedAtDate | nullJob completion time
errorstring | nullError message if failed

SlimIntervention

FieldTypeDescription
idstringIntervention ID
pipelineRunIdstringTarget pipeline run
typestringOne of: interrupt, inject, take_over, resume, note
messagestring | nullOptional instruction or note text
statusstringpending or resolved
createdAtDateCreation timestamp

Active Pipeline Statuses

The stream only includes runs whose status is one of: queued, researching, architecting, designing, implementing, testing, awaiting_approval, releasing, marketing, documenting, syncing_branches

Completed or failed runs are excluded.


Runtime Notes

  • Runtime: Node.js (runtime = "nodejs")
  • Max duration: 300 seconds (per serverless function invocation limit)
  • Poll interval: 3 000 ms
  • Heartbeat interval: 15 000 ms (every 5th poll tick)
  • Recommended headers for proxies: The response includes X-Accel-Buffering: no to disable Nginx buffering.