Execution progress updates are currently delivered over WebSockets.
However, execution events are strictly server → client. The client does not need to continuously send data back to the server over the same connection, making WebSockets unnecessarily complex for this use case.
Migrating to Server-Sent Events (SSE) would simplify the implementation while reducing resource usage and maintenance overhead.
Problem
WebSockets provide full-duplex communication, but execution monitoring only requires one-way event streaming.
Using WebSockets introduces unnecessary complexity such as:
- WebSocket connection lifecycle management
- Ping/Pong heartbeat handling
- Additional memory usage per active connection
- More complex reconnection logic
- Higher operational overhead for infrastructure that only pushes events
For a feature that only streams execution updates, this is more capability than we actually require.
Proposed Solution
Replace the execution update transport layer with Server-Sent Events (SSE).
Execution flow would become:
- Client starts an execution (HTTP)
- Client opens an SSE stream for that execution
- Server streams execution lifecycle events
- Connection closes automatically when execution completes
Benefits
Reduced Resource Usage
- Lower memory footprint per connection
- Less protocol overhead
- No bidirectional socket management
Simpler Implementation
- Native browser
EventSource
- Automatic reconnection
- Plain HTTP endpoint
- Easier debugging using standard HTTP tooling
Better Fit for the Use Case
Execution updates are naturally append-only events flowing from server to client.
SSE is purpose-built for this communication pattern.
Considerations
- User actions (cancel execution, retry, etc.) should continue using standard HTTP endpoints.
- Existing event payloads should remain unchanged where possible to minimize frontend changes.
- Streaming endpoint should terminate once execution reaches a terminal state.
- Authentication should match existing HTTP authentication middleware.
Execution progress updates are currently delivered over WebSockets.
However, execution events are strictly server → client. The client does not need to continuously send data back to the server over the same connection, making WebSockets unnecessarily complex for this use case.
Migrating to Server-Sent Events (SSE) would simplify the implementation while reducing resource usage and maintenance overhead.
Problem
WebSockets provide full-duplex communication, but execution monitoring only requires one-way event streaming.
Using WebSockets introduces unnecessary complexity such as:
For a feature that only streams execution updates, this is more capability than we actually require.
Proposed Solution
Replace the execution update transport layer with Server-Sent Events (SSE).
Execution flow would become:
Benefits
Reduced Resource Usage
Simpler Implementation
EventSourceBetter Fit for the Use Case
Execution updates are naturally append-only events flowing from server to client.
SSE is purpose-built for this communication pattern.
Considerations