APIWebSocket Events

WebSocket Events

For live run progress and editor synchronization, BioNodulo streams events in real time. This avoids polling and powers the live canvas updates you see in the editor.

Stub reference describing the intended event shapes.

Connecting

const ws = new WebSocket(
  "wss://api.bionodulo.com/v1/runs/run_456/events?token=" + apiKey,
);
 
ws.onmessage = (e) => {
  const event = JSON.parse(e.data);
  console.log(event.type, event.data);
};

Authenticate with the same API key, passed as a query token or a bearer header on the upgrade request.

Event types

TypePayloadMeaning
run.status{ status, progress }Overall run state changed
node.status{ nodeId, status }A node changed state
node.log{ nodeId, line }A line of node log output
run.credits{ creditsUsed }Running credit tally
run.artifact{ nodeId, name, url }An output artifact is available
run.error{ nodeId, message }A node failed

Example messages

{ "type": "node.status", "data": { "nodeId": "bwa", "status": "running" } }
{ "type": "node.log",    "data": { "nodeId": "bwa", "line": "[M::mem_process] processed 100000 reads" } }
{ "type": "run.status",  "data": { "status": "succeeded", "progress": 1 } }

Transport notes

  • Editor sync uses a bidirectional WebSocket (low latency, room-isolated per user).
  • Progress streaming for runs is also available over lightweight server-sent events (SSE) for environments where WebSockets are blocked — same event shapes, one-way.

Reconnection

If the connection drops, reconnect and the server replays recent events so you don’t miss state. Combine with a GET /v1/runs/{runId} poll on reconnect to re-sync the full state.

See also