{
  "version": "3.15",
  "name": "Test04: Serial Loop",
  "registry": {
    "params": [],
    "vars": ["$items([OBJECT])", "$results([STRING])"]
  },
  "steps": [
    {
      "id": "Set_Items",
      "target": "$items",
      "value": "[{\"name\": \"apple\", \"color\": \"red\"}, {\"name\": \"banana\", \"color\": \"yellow\"}, {\"name\": \"grape\", \"color\": \"purple\"}]",
      "next": "Loop_Describe"
    },
    {
      "id": "Loop_Describe",
      "mode": "serial",
      "source": "=$items",
      "children": ["LLM_Describe"],
      "next": "Stop_End"
    },
    {
      "id": "LLM_Describe",
      "in": {
        "messages": [
          { "role": "user", "content": "=\"In exactly one sentence, describe a \" + _item.color + \" \" + _item.name + \".\"" }
        ]
      },
      "out": { "$results[_index]": "=_result" },
      "next": "RETURN"
    },
    { "id": "Stop_End" }
  ]
}
