Architect Loop block fails on nested JSON array from Data Action

I’m hitting a wall with the Loop block in Architect. My Data Action calls a custom endpoint and returns a JSON array like ["item1", "item2"]. When I try to iterate over response.body.items, the loop skips execution entirely. The expression {{response.body.items}} evaluates correctly in the test tab, but inside the Loop condition, it seems to treat the array as a single object. Is there a specific syntax for indexing or do I need to flatten the payload first? The flow just bypasses the loop steps.

The loop block expects a flat array, not a nested object wrapper. If your Data Action returns {"items": ["item1", "item2"]}, you can’t just point the loop at response.body. You need to extract the array first.

Try this in the Data Action response mapping:

  1. Create a new variable itemList.
  2. Set its value to response.body.items.

Then in the Loop block, set the iterator to {{itemList}}. Don’t use response.body.items directly in the loop source. The engine sometimes chokes on deep property access during iteration initialization.

Also check the Data Action timeout. If the API hangs, the response might be null, causing the loop to skip. Add a Set Variable block before the loop to log {{itemList}} to the session transcript. If it’s empty, the issue is upstream. If it has data, the loop config is wrong.

Here is the exact mapping config that works for me:

{
 "itemList": "{{response.body.items}}"
}

Verify the type is array in the schema definition. If you mark it as string, the loop won’t trigger.

is spot on. Architect’s loop parser is strict about array types. Docs state: “The iterator must reference a valid JSON array.” If the Data Action wraps the result, extract it first.

{
 "itemList": "{{response.body.items}}"
}

Point the loop at {{itemList}}.