Connection Protocol
Architecture
The platform creates a virtualized WhatsApp client for each instance. This client runs in a sandboxed environment and bridges the formatWebSocket (WhatsApp)↔HTTP Webhook (Cortex).
Session Lifecycle
CREATED
Container provisioned. QR code fetching initialized. No session data yet.
CONNECTING / QR_READY
QR stream active. Waiting for mobile device handshake.
CONNECTED
Session established. Keys exchanged. Ready to process frames.
Troubleshooting Connections
Multidevice Conflict
WhatsApp limits linked devices to 4 per number. If you cannot scan the QR connection, check your mobile app and unlink unused sessions.
Stream Latency
The QR code rotates every 20-30 seconds for security. If the code expires before you scan:
Technical Note: Persistence
Sessions are persistent. If the server restarts, it will attempt to restore the session from disk using the saved Auth Keys. You do not need to rescan the QR code unless the session is explicitly logged out or invalidated by the phone.