Architect Loop block skipping items in JSON array from Data Action

Weird thing happening with the Loop block in Architect. The Data Action returns a standard JSON array, but the Loop only processes the first item. Subsequent iterations just skip or fail silently.

Here’s the payload:

{
 "contacts": [
 {"id": "1", "name": "Alice"},
 {"id": "2", "name": "Bob"},
 {"id": "3", "name": "Charlie"}
 ]
}

I’m using contacts as the input list. The Loop block is set to iterate over the array. The first item processes fine. The second and third items are ignored. The debug log shows the loop counter incrementing but the body of the loop never executes for items 2 and 3.

Tried changing the input to a different variable name. Same result. Tried flattening the JSON. Same result.

Anyone else hit this? Is there a limit on array size in the Loop block? Or is it a bug in the v2 architect engine?

Running on Genesys Cloud 2023-10.

Loop blocks in Architect are notoriously picky about the input format. It doesn’t just want a JSON array. It expects a specific data structure that represents a list of objects, not a raw JSON string or an object containing an array.

If your Data Action returns that JSON structure you posted, contacts is actually a property on the root object. You can’t just feed contacts into the Loop if the Data Action result is treated as a single object. You need to extract the array first.

Try this in your Data Action or a preceding Set Variable block:

// If the Data Action result is in a variable called 'response'
// You need to pass the actual array to the Loop input
set("loopInput", response.contacts)

Then feed loopInput into the Loop block’s “List” input. If you’re passing the raw JSON string, Architect sees it as a single item (the string itself). The Loop iterates once, sees a string, and moves on.

Also check the Data Action configuration. Make sure the “Return Type” is set to json and not text. If it’s text, you’ll need to parse it first using a script or a specific parsing utility before the Loop can touch it.

Here’s a quick sanity check payload for the Loop input:

[
 {"id": "1", "name": "Alice"},
 {"id": "2", "name": "Bob"}
]

Not:

{
 "contacts": [ ... ]
}

If you’re still seeing skips, look at the call flow log. There’s usually a warning about “Invalid input type” or “Non-iterable value” if the structure is off. It’s easy to miss if you’re just looking at the success/fail status of the whole flow.