Overview
FlowLayer protocol V1 defines how external clients talk to the running server session.
Transport and session model
- Transport: WebSocket on
/ws - Authentication:
Authorization: Bearer <token>on the upgrade request - Each WebSocket connection is an independent session
- No session persistence across reconnects
Message envelope
All messages use the same high-level structure:
{
"type": "<message_type>",
"id": "<correlation_id>",
"name": "<command_or_event_name>",
"payload": {}
}
Envelope fields are optional when not applicable.
Message types
command: client -> server requestack: immediate command acceptance/rejection (private to sender)result: final command outcome (private to sender)event: asynchronous server messageerror: protocol-level error (private to sender)
Command flow
Normal flow:
- client sends
commandwith uniqueid - server sends
ackfor thatid - if
ack.acceptedis true, server sendsresult
ack.accepted = false means the command is rejected and no result follows.
Message scope
- private to command sender:
ack,result,error - private to one connection:
hello,snapshot - broadcast to all sessions:
service_status,log
log events are best-effort and may be dropped under load.
Runtime command catalog
get_snapshotget_logsstart_servicestop_servicerestart_servicestart_allstop_all