Looking for advice on WFM schedule publishing via API.
Using Genesys Cloud WFM SDK v1.2.4 and Terraform provider gc-provider v2.0.8. The deployment pipeline fails with a 422 Unprocessable Entity when pushing complex shift patterns for a multi-site contact center. The error payload indicates a conflict in resource allocation, but the HCL configuration seems valid according to the schema.
The issue arises when a single agent is assigned to two overlapping shift patterns within the same schedule. The POST to /api/v2/wfm/schedules/{scheduleId}/publish returns the following error:
{
"errors": [
{
"code": "INVALID_SCHEDULE",
"message": "Agent {agentId} has overlapping shifts in pattern {patternId1} and {patternId2}.",
"details": "Shift start times conflict within the defined time zone Australia/Sydney."
}
]
}
The Terraform configuration uses the genesyscloud_wfm_schedule resource with nested schedule_pattern blocks. The start_time and end_time are calculated dynamically based on agent availability, but the API rejects the payload even when the times do not explicitly overlap in UTC. It seems the API is interpreting the times in local time before validation, causing a false positive for overlaps during daylight saving transitions.
Here is a snippet of the HCL:
resource "genesyscloud_wfm_schedule" "main" {
name = "Prod-Schedule"
description = "Auto-generated via IaC"
schedule_pattern {
pattern_id = "pattern_1"
start_time = "09:00:00"
end_time = "17:00:00"
timezone_id = "Australia/Sydney"
}
schedule_pattern {
pattern_id = "pattern_2"
start_time = "13:00:00"
end_time = "21:00:00"
timezone_id = "Australia/Sydney"
}
}
The GC CLI v2.0.8 confirms the schedule is valid when run locally with --validate-only, but the actual API call fails. Is there a known issue with time zone handling in the WFM API during DST transitions, or is the Terraform provider not correctly serializing the timezone offset? Need a workaround to ensure successful deployment without manual intervention in the UI.