Skip to content

Flows (wire format)

A Flow is a host-declared bundle of named screens plus metadata about which screen a fresh player starts on. Engine-agnostic: a Flow is a JSON-safe description, identical whether emitted by Unity, Unreal, or Godot.

Current flow version: 1.

TypeScript shapes

export interface Screen {
widgets: Widget[];
}
export interface Flow {
version: typeof FLOW_VERSION;
id: string;
initial_screen: string;
screens: Record<string, Screen>;
}
export interface ScreenState {
screen_name: string;
data: Payload;
revision: number;
/** Unix ms when the host last sent a transition or update for this player. */
shown_at: number;
}

See flows.ts for the source of truth.

Field notes

  • Flow.id is opaque — useful for telemetry (which flow template is running) but never interpreted by the relay.
  • Flow.initial_screen is what freshly-joined players see before the host sends its first screen.show.
  • ScreenState.revision is monotonic per (session, player_id) globally — not per screen. A screen.show that moves a player to a new screen increments the same counter.

Authoring

Flows are typically created in Unity via Assets → Create → PairKit → Flow Asset. The asset’s editor-time validator (FlowValidator) enforces the same constraints the wire protocol checks at runtime: non-empty screens, unique widget ids per screen, valid initial_screen.

See FlowAsset for the host-side API.