{
  "version": "3.15",
  "name": "Test12: Loop with File Writes + .length",
  "registry": {
    "params": [],
    "vars": ["$files([OBJECT])", "$count(INT)"],
    "files": { "inputs": [], "artifacts": ["Output/*"] }
  },
  "steps": [
    {
      "id": "Set_Files",
      "target": "$files",
      "value": "[{\"name\": \"file_a\", \"body\": \"Content of file A\"}, {\"name\": \"file_b\", \"body\": \"Content of file B\"}, {\"name\": \"file_c\", \"body\": \"Content of file C\"}]",
      "next": "Loop_WriteFiles"
    },
    {
      "id": "Loop_WriteFiles",
      "mode": "parallel",
      "source": "=$files",
      "children": ["Write_OneFile"],
      "next": "Set_Count"
    },
    {
      "id": "Write_OneFile",
      "target": "=\"Output/\" + _item.name + \".txt\"",
      "value": "=_item.body",
      "next": "RETURN"
    },
    {
      "id": "Set_Count",
      "target": "$count",
      "value": "=$files.length",
      "next": "Stop_End"
    },
    { "id": "Stop_End" }
  ]
}
