Skip to main content
A render farm is a thing that changes constantly, and asking it what changed is the wrong shape. RenderFlow has one WebSocket, and it is the same one the operator UI runs on.
Turn on TLS on the server and the same farm answers on wss://10.11.30.40:44445/api/v1/socket instead. Both SDKs wrap this, so if you are writing TypeScript or Python you can stop reading:
The rest of this page is the protocol, for a client in another language, a dashboard in a browser, or a service of your own.

The handshake

The first message must be the credential, and nothing flows before it:
An empty string is right from the machine running the service, where the peer address is the proof, exactly as it is over HTTP. The farm answers with the reach the credential has:
An API key is told public. A connection from the machine itself, with the empty string, is told private, and so is a machine of the farm using its own credential. A connection that has not authenticated within five seconds is closed with 4401. That is not a grace period to lean on: an unauthenticated socket must not be a way to hold a slot open on a render farm.

Subscribe

Several in one message is fine, and an unfiltered subscription is the whole collection. Unsubscribing matches on the filter as well as the entity, so it has to be the same filter you sent. A subscription the farm will not accept answers with a message rather than closing the connection, because one bad entity name is not a reason to drop a working socket:

Filters

A value may name several ids, comma separated, and that is one subscription rather than several:
That is what a paged table wants: watch the machines on the screen, not the three thousand that are not. Unfiltered, a large farm sends about six hundred hardware samples a second, and a client that discards them still paid for them.

The frames

An update is a patch and not the row, for most entities, and that is a deliberate saving rather than an omission. A task update measured 553 bytes with the document attached and a rendering farm writes hundreds a second, so the document is sent only where a client genuinely replaces the row whole.

The entities

Every one of these but commands mirrors a public REST route, so an API key sees on the socket exactly what it can read over HTTP.

Resync

There is no replay. When events are missed, the farm says so and the answer is to read the collection again:
Three things mean the same thing, and a correct client treats them identically:
  1. A resync frame naming collections.
  2. A gap in seq. You got 41 and then 43.
  3. A reconnect. Whatever happened while you were away is gone.
A client that ignores resync is a client that drifts, and it drifts silently: the screen keeps updating, and it is showing a farm that no longer exists. This is the one part of the protocol worth getting right before anything else.
Why it exists rather than a buffer: a client that stops reading gets nothing appended past one megabyte of unsent data, and when its buffer drains below 64 kilobytes it gets one resync frame and a clean slate. Admitting the gap costs a flag. Holding memory for one stalled client on behalf of a farm that keeps working costs the farm.

Staying alive

Every thirty seconds the farm sends a protocol ping and a frame you can see from script:
Ignore it, or use it. A client’s own silence watchdog wants the second one, because a protocol ping is invisible to JavaScript, and a link that died without closing looks exactly like a farm with nothing to say. Anything inbound counts as proof of life, and after ninety seconds of silence the farm closes the connection with 1001 rather than writing into a socket that is not being read.

Closing

Refusing to retry a 4401 matters more than it sounds: a reconnect loop on a bad key is a loop that never ends and never says why, and on a farm with three thousand machines it is a loop that also floods a log.

Example

The shape that is correct rather than the shortest: sequence checking, resync, backoff, and no retry on a refused credential.