Loop block in Architect fails to iterate over JSON array from Data Action

Docs state: “The Loop block iterates over the items in an array. The input must be a valid JSON array.” I’ve got a Data Action configured to call an internal endpoint that returns a simple list of user IDs. The HTTP status is 200, and the response body is definitely a JSON array. I’ve verified this in Postman.

Here’s the payload I’m seeing in the debug logs:

["12345-abc", "67890-def", "11111-ghi"]

I’m mapping the Data Action’s response directly into the Loop block’s input variable. The variable type is set to String. When I run the flow, the Loop block executes, but it only processes the first item, then exits. It doesn’t loop through the rest. I’ve checked the loop counter, and it stops at 1.

I’ve tried changing the variable type to JSON Object, but that throws a type mismatch error in the Data Action mapping. The docs mention that the input must be an array, but they don’t specify how to handle the type conversion between the HTTP response and the Loop block.

I’ve also tried parsing the JSON string in a prior Set Variable block using the JSON.parse expression, but Architect doesn’t support that natively in expressions. I’m stuck. The Loop block seems to expect a specific format that the Data Action isn’t providing, even though the raw data looks correct.

Is there a specific way to format the output from a Data Action so that the Loop block recognizes it as an iterable array? Or is this a known limitation with how Architect handles JSON arrays from external calls? I’ve spent hours on this, and the documentation is silent on the exact data type expectations for the Loop input when sourced from a Data Action.

The issue is likely how you’re mapping the raw HTTP response body into the Architect variable. The Data Action returns a string, and if that string isn’t explicitly parsed into a JSON array object before hitting the Loop block, it treats the input as a single string value instead of an iterable list. You need to ensure the variable holding the IDs is actually a JSON array type, not just a string containing brackets. Try adding a Set Variable block immediately after the Data Action to parse the response. Use this expression to force the conversion:

{{parseJSON(DataAction.Response.Body)}}

Then pass that new variable into the Loop block’s “Items” field. If the source is already an array but Architect still chokes, check if there are invisible whitespace characters in the response body causing a silent parse error. Sometimes trimming the string first helps: {{parseJSON(trim(DataAction.Response.Body))}}. It’s a common gotcha when dealing with external REST calls in Architect.