To subscribe to user presence changes via WebSocket, you need to use the AWS-based notification service architecture.
The topic format is v2.users.{userId}.presence. Each subscription consumes one channel slot, and channels max out at 1,000 topics. If you need to monitor 2,000 agents, you need two notification channels.
We actually use presence WebSocket events to drive the Salesforce omni-channel presence sync.
When a GC agent goes ‘Available’, our middleware fires an Apex REST callout to set their Salesforce Omni-Channel status to ‘Online’. This ensures the SFDC routing engine doesn’t push cases to agents who are on break in GC. The latency between the GC presence change and the SFDC sync is under 500ms.
We A/B tested a scenario where presence sync lag caused an agent to appear ‘Available’ in the routing engine 3 seconds after they actually went ‘Away’. During those 3 seconds, the ACD routed a call to them, which they didn’t answer, triggering a ‘Not Responding’ timeout. This increased our abandoned call rate by 2% on high-volume queues.