You could try using a data action to set the "callCounter" variable and continue with the logic check Jason provided?
The below requires the flow id and interval in "YYYY-MM-DDTHH:00:00.000Z/YYYY-MM-DDTHH:00:00.000Z" format to return a single integer for flow entries.
/api/v2/analytics/flows/aggregates/query
Request Body Template:
{
"interval": "${input.Interval}",
"groupBy": [
"flowId"
],
"metrics": [
"tFlow"
],
"filter": {
"predicates": [
{
"type": "dimension",
"dimension": "flowId",
"operator": "matches",
"value": "${input.FlowID}"
}
],
"type": "and"
}
}
Response map:
{
"translationMap": {
"Total": "results[0].data[0].metrics[0].stats.count"
},
"translationMapDefaults": {
"Total": "0"
},
"successTemplate": "{\"Total\": ${Total}}"
}
Not sure if high traffic and latency in updating the metrics might lead to more than 1 call retrieving the same API "Total" result at roughly the same time which would lead to multiple calls following the "forward 4th call to external" path?
------------------------------
Travers Dunne
------------------------------
Original Message:
Sent: 12-24-2025 11:19
From: Roberta Wermer
Subject: How to forward every fourth call to another external number
Hi Jason,
How do you define a variable in Genesys Architect to be system persistent rather than interaction specific?
I had thought the default is that a flow variable only exists within the interaction and for the duration of that interaction. If two calls come in on the same flow, I have assumed they each were agnostic to variable value set for the other interaction when I use Update Data?
In other CCaaS tools I have have had to take additional steps to make the value persistent across calls. I would like to understand how you are doing this in Genesys without creating a table or other external location to set/get/update the variable.
Thanks,
Roberta
------------------------------
Roberta Wermer
Infrastructure Engineer
Original Message:
Sent: 12-24-2025 10:31
From: Jason Kleitz
Subject: How to forward every fourth call to another external number
Hello Jorge,
I believe you should be able to accomplish this in Architect. You would want to create a flow-level counter variable, something like 'callCounter'.
Use a 'Set Variable' action at the start of your flow and set callCounter = $(callCounter) + 1
Add a 'Decision' action to check if it's the 4th call. Use a condition like $(callCounter) % 4 == 0
If the condition is true (meaning it was the 4th call, You can use a 'Transfer to Number' action to forward to your external number
If the condition is false then it should continue as the normal call flow.
------------------------------
Jason Kleitz
Online Community Manager/Moderator
Original Message:
Sent: 12-23-2025 16:00
From: JORGE LOPEZ
Subject: How to forward every fourth call to another external number
Hello Community!
A customer needs to forward every fourth call to a different external number.
Currently, a specific option in the IVR flow forwards the calls to a specific external number, but now, the customer needs every fourth call to be forwarded to a new one external number, resuiting in a scenario of 3 calls per 1 (3 calls to first external number and 1 call to the second external number).
This means that the first three calls will forward to one external number but the each every forth call have to be forwarded to other external number.
Hope this make someone sense and post your feedback.
regards,
#ArchitectandDesign
------------------------------
JORGE LOPEZ
PRESALES
------------------------------