WebSocket API

Real-time workflow updates via WebSocket connections.

Connection

Terminal
const ws = new WebSocket('ws://localhost:8000/ws');

ws.onopen = () => {
  // Subscribe to workflow updates
  ws.send(JSON.stringify({
    type: 'subscribe',
    workflow_id: 'uuid'
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log(data);
};

Events

WebSocket sends real-time events for workflow progress:

progress

Workflow progress updates

stage_change

Workflow stage changes

completed

Workflow completion

error

Error notifications