Requires Dify Enterprise 3.11.1 or later.
Enable Collaboration
Set the switch in your Helm chart values:extraEnv wiring is needed:
- Deploys a dedicated Socket.IO service (
<release>-api-websocket) that handles all realtime collaboration traffic. - Routes
/socket.ioon the gateway to that service. - Sets
ENABLE_COLLABORATION_MODEon both the API and Web ConfigMaps. - Derives
NEXT_PUBLIC_SOCKET_URLfor the Web frontend fromglobal.consoleApiDomainandglobal.useTLS(wss://when TLS is enabled).
How It Works
Collaboration traffic uses the Socket.IO protocol (WebSocket with HTTP long-polling fallback) on the/socket.io path of the console API domain. The chart runs it in a dedicated deployment separate from the main API pods:
The websocket deployment is intentionally fixed at 1 replica with 1 gunicorn worker and uses the
Recreate update strategy. Socket.IO authentication sessions live in process memory, so all socket traffic must share a single process. Do not scale this deployment; room events are fanned out through the existing Redis configuration, so the main API and worker deployments scale independently as usual.
Resource Configuration
Override resources for the websocket pod undercollaboration.websocket:
Prerequisites
global.consoleApiDomainmust be reachable from editors’ browsers; the frontend connects towss://<consoleApiDomain>/socket.io(orws://without TLS).- Any load balancer or ingress in front of the gateway must allow WebSocket upgrades on the console API domain.
Upgrading from Manual Configuration
If you previously enabled collaboration by injectingENABLE_COLLABORATION_MODE / NEXT_PUBLIC_SOCKET_URL through extraEnv, remove those entries and set collaboration.enabled: true instead. Leaving the old extraEnv entries in place is harmless but redundant — container-level extraEnv values take precedence over the ConfigMap values the chart now generates.