No idea why this is happening, our custom Architect flow for script routing is throwing a 400 Bad Request error specifically when agents are actively using the shift swap feature in WFM. We are running Genesys Cloud 2024.1 in the US-East-1 environment. The issue seems to correlate with the time we publish weekly schedules. When an agent initiates a shift trade, the script node that pulls their current availability via the WFM API fails to resolve the user context properly. The error log shows InvalidUserState in the response payload from the /api/v2/wfm/schedules/users/{userId} endpoint.
We have verified that the agent’s status in the WFM module is correct, but the Architect flow seems to be reading a stale state from the cache. This is causing the script to skip the necessary greeting steps and drop the call unexpectedly. We need to ensure the script routing logic respects the real-time WFM status during these transition periods. How can we force the Architect flow to refresh the user context from the WFM API before executing the script nodes?