We are trying to build a routing strategy in Genesys Cloud Architect that depends on the day of the week. The goal is to route calls to a specific queue on business days and to a voicemail queue on weekends. We have been using the DateTimeDiff function to calculate the difference between the current time and a fixed reference date, then using modulo arithmetic to determine the day. However, we are finding this approach brittle and hard to maintain.
We tried using GetDayOfWeek directly in the routing expression. The documentation suggests it returns an integer from 0 to 6. We tested this in a Data Action with a simple assignment:
{
"actions": [
{
"name": "SetDay",
"type": "Assign",
"assignments": [
{
"variable": "flow.data.dayOfWeek",
"value": "GetDayOfWeek(CurrentDateTime())"
}
]
}
]
}
When we log the value of flow.data.dayOfWeek, it returns 6 on a Monday. This is unexpected. We assumed 0 would be Sunday or Monday based on standard ISO 8601 or JavaScript conventions. The routing logic breaks because we are checking flow.data.dayOfWeek < 5 for business days. On Monday, the check fails.
We are running this in a flow with the following environment specs:
- Genesys Cloud Org ID: 123456
- Architect Version: Latest
- Flow Type: IVR
- Timezone: Europe/Berlin
We have tried adjusting the modulo logic to account for the offset, but it feels like a hack. Is there a documented mapping for GetDayOfWeek? We need to know if 0 is Sunday or Monday to fix the expression. We also tried using DateTimeDiff with a known Monday date and dividing by 7, but the result varies depending on DST changes.
Can someone confirm the return value mapping for GetDayOfWeek? We need a reliable way to check for weekends in the routing expression without hardcoding offsets.