Porting a Twilio function that parses a JSON array of queue stats into Genesys Architect. The Data Action hits an internal REST endpoint and returns a 200 with a valid JSON payload.
The response body looks like this:
{
"statusCode": 200,
"body": {
"queues": [
{"id": "123", "name": "Sales"},
{"id": "456", "name": "Support"}
]
}
}
I’m trying to iterate over queues using a Loop block. The Data Action is named GetQueueStats. I’ve set the loop variable to {{GetQueueStats.body.queues}}.
The flow fails immediately on the Loop block with the error: Cannot iterate over non-array value. I’ve checked the Data Action logs and the raw response definitely contains the array. I even tried adding a Set Participant Data action to parse the JSON string explicitly, but the Loop still chokes.
Is there a specific syntax for referencing nested arrays in the Loop block that I’m missing? Or does the Data Action need to return the array at the root level?