WebRTC softphone connection drops during servicenow ticket creation via architect flow

How should I properly to handle web rtc softphone disconnects when triggering a service now ticket creation from an architect flow. we have a flow that uses a data action to call the servicenow rest api for incident creation. the issue is that if the agent is on a webrtc call and the data action takes longer than 5 seconds the softphone client in the browser throws a network error and the audio cuts out. this seems to be related to the browser suspending the websocket connection for the softphone while the main thread is blocked or busy with the http request. we are using the genesys cloud sdk v3. the error in the browser console is “websocket closed unexpectedly” and the softphone status goes to offline. we have tried using the async pattern for the data action but the agent still experiences audio dropouts. is there a configuration in architect or the softphone settings to prevent this. we are in europe/london timezone and seeing this consistently on chrome 120. any help would be appreciated as this is causing issues with our sla metrics.

If you check the docs, they mention that browser-based WebRTC sessions are sensitive to main-thread blocking, especially when heavy synchronous API calls occur within the same context. When a data action for ServiceNow execution takes more than five seconds, the JavaScript event loop gets blocked, causing the WebSocket heartbeat for the softphone to miss its timeout window. This results in the connection dropping before the API call even completes. To fix this, you need to decouple the long-running API call from the user interface thread. One effective method is to use an asynchronous pattern where the flow immediately returns a “pending” status to the client while the actual ServiceNow integration runs in the background using a webhook or a queued task. Alternatively, if you must keep it synchronous, ensure the data action is optimized to return faster than two seconds by reducing payload size or using pagination. Another approach is to configure the browser to keep the WebSocket alive by implementing a simple keep-alive mechanism in the custom wrapper, though this is harder to control in standard Genesys Cloud deployments. From a load testing perspective, I have seen similar issues when pushing high concurrent volumes through JMeter tests, where the server-side processing delay causes client-side timeouts. The key is to minimize the time the browser spends waiting for a response. If the ServiceNow API is slow, consider caching common data or using a faster intermediate database to store the ticket details temporarily. This way, the architect flow can complete quickly, and a separate process can handle the actual ServiceNow integration. This reduces the risk of WebRTC disconnections and improves overall user experience during high-concurrency scenarios. Always test these changes under load to ensure the solution scales properly.