Opens a Server-Sent Events (SSE) stream for real-time execution progress.
This is an alternative to polling GET /v1/runs/{runId} — use
whichever fits your architecture better.
Connection: The stream uses standard SSE (text/event-stream). Most HTTP
clients and all modern browsers support this natively.
Event types:
| Event | When | Data payload |
|---|---|---|
progress | Execution status changes (e.g. queued -> running) | Full ExecutionStatus object |
complete | All outputs are ready | Full ExecutionStatus with final values |
error | Execution failed or was cancelled | Full ExecutionStatus with error details |
timeout | Stream exceeded 10-minute limit | { "message": "Stream timeout after 10 minutes" } |
ping | Keepalive every ~15 seconds | Unix timestamp |
Terminal behavior:
completed, failed, cancelled)
when you connect, the stream sends a single complete or error event and closes.timeout event.Agent usage pattern:
const es = new EventSource('/v1/runs/{id}/stream', {
headers: { 'x-api-key': 'lma_...' }
});
es.addEventListener('complete', (e) => {
const result = JSON.parse(e.data);
// result.outputs contains final values
es.close();
});
es.addEventListener('error', (e) => {
const result = JSON.parse(e.data);
console.error(result.errorMessage);
es.close();
});
completed or failed.
Each SSE event contains the current execution state, including per-node output status. The final event carries the full completed (or failed) execution payload, after which the server closes the stream.Workspace API key. Prefix: lma_. Example: lma_abc123...
The run ID returned from the Run App or Content Create endpoint
SSE event stream. Each event is a data: line followed by two newlines.
The response is of type string.