Genesyscloud_wfm_user_schedule 422 - Conflict during bulk apply via Terraform

Could someone explain why genesyscloud_wfm_user_schedule resources are failing with 422 Unprocessable Entity during a large-scale apply in our CI/CD pipeline? We are managing schedule imports for ~500 agents using a for_each loop driven by CSV data. The pipeline uses Terraform v1.9.8 and the Genesys Cloud provider v1.65.0. The error response body contains {"code": "conflict", "message": "Schedule segment overlaps with existing segment", "errors": [{"message": "Cannot add schedule segment due to overlap"}]}. This is confusing because we run terraform plan with -refresh=false to ensure state matches the remote API before applying, and the plan shows no changes to existing segments. We are also using depends_on to ensure the genesyscloud_wfm_user and genesyscloud_wfm_schedule_group exist before applying schedules. The issue appears intermittent, affecting only 10-15% of the apply run. We suspect rate limiting or eventual consistency issues with the WFM schedule import endpoints. We have tried adding time_sleep resources between batches of 50 users, but the 422 errors persist. The JSON payload generated by Terraform matches the OpenAPI spec for the schedule import operation. We are based in Australia/Sydney, so timezone handling is critical. The start and end timestamps in our HCL are UTC formatted. Is there a known issue with the provider’s retry logic for WFM schedule conflicts? Or should we implement a custom retry mechanism in our GitHub Actions workflow using genesyscloud_wfm_user_schedule data sources to validate state before apply? We need a reliable way to automate schedule deployments without manual intervention in the Admin UI.

2 Likes