{
 "schema_version": "1.0",
 "nodes": [
  {
   "id": "products",
   "type": "input/bundle_manifest",
   "label": "Products",
   "parameters": {
    "validation": "fail",
    "verifyChecksum": "always",
    "allowExternalUrls": false,
    "manifest": "__PRODUCTS__"
   }
  },
  {
   "id": "brand_colors",
   "type": "input/text",
   "label": "Brand colours",
   "parameters": {
    "text": "#1F3A6E, #2F55A4, #F2EBDD, #C9963B",
    "required": true
   }
  },
  {
   "id": "assets",
   "type": "utility/extract",
   "label": "Assets",
   "parameters": {
    "path": "assets",
    "expected_type": "json",
    "on_missing": "fail"
   }
  },
  {
   "id": "each",
   "type": "enumerate/json",
   "label": "Each product",
   "parameters": {
    "jsonConfig": {
     "arrayPath": "(root)",
     "properties": [
      {
       "sourcePath": "metadata.name",
       "outputPort": "name",
       "outputType": "text",
       "selected": true,
       "label": "Name"
      },
      {
       "sourcePath": "storageRef",
       "outputPort": "photo",
       "outputType": "image",
       "selected": true,
       "label": "Photo"
      }
     ]
    },
    "emptyBehavior": "fail"
   }
  },
  {
   "id": "rep",
   "type": "workflow/repeat",
   "label": "Until on brand",
   "parameters": {
    "max_attempts": 3,
    "on_exhausted": "best",
    "workflow": "__BODY__"
   }
  },
  {
   "id": "o_img",
   "type": "output/image",
   "label": "pictures",
   "parameters": {
    "output_name": "pictures"
   }
  },
  {
   "id": "o_disp",
   "type": "output/text",
   "label": "dispositions",
   "parameters": {
    "output_name": "dispositions"
   }
  },
  {
   "id": "o_rep",
   "type": "output/json",
   "label": "reports",
   "parameters": {
    "output_name": "reports"
   }
  }
 ],
 "connections": [
  {
   "from_node": "products",
   "from_output": "bundle",
   "to_node": "assets",
   "to_input": "json"
  },
  {
   "from_node": "assets",
   "from_output": "value",
   "to_node": "each",
   "to_input": "json"
  },
  {
   "from_node": "each",
   "from_output": "photo",
   "to_node": "rep",
   "to_input": "product"
  },
  {
   "from_node": "brand_colors",
   "from_output": "text",
   "to_node": "rep",
   "to_input": "brand_colours"
  },
  {
   "from_node": "rep",
   "from_output": "candidate",
   "to_node": "o_img",
   "to_input": "image"
  },
  {
   "from_node": "rep",
   "from_output": "disposition",
   "to_node": "o_disp",
   "to_input": "text"
  },
  {
   "from_node": "rep",
   "from_output": "report",
   "to_node": "o_rep",
   "to_input": "json"
  }
 ],
 "layout": {
  "nodes": {
   "products": {
    "x": 80,
    "y": 80
   },
   "brand_colors": {
    "x": 80,
    "y": 280
   },
   "assets": {
    "x": 420,
    "y": 80
   },
   "each": {
    "x": 760,
    "y": 80
   },
   "rep": {
    "x": 1100,
    "y": 80
   },
   "o_img": {
    "x": 1440,
    "y": 80
   },
   "o_disp": {
    "x": 1440,
    "y": 280
   },
   "o_rep": {
    "x": 1440,
    "y": 480
   }
  }
 }
}
