{
 "name": "[노드 한 장] Switch · Steam 할인율 세 갈래",
 "nodes": [
  {
   "id": "s1",
   "name": "Run manually",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    200
   ],
   "parameters": {}
  },
  {
   "id": "s2",
   "name": "Get Steam specials",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    240,
    200
   ],
   "parameters": {
    "url": "https://store.steampowered.com/api/featuredcategories?cc=us&l=english",
    "options": {}
   }
  },
  {
   "id": "s3",
   "name": "Split into games",
   "type": "n8n-nodes-base.splitOut",
   "typeVersion": 1,
   "position": [
    480,
    200
   ],
   "parameters": {
    "fieldToSplitOut": "specials.items",
    "options": {}
   }
  },
  {
   "id": "s4",
   "name": "Discount level?",
   "type": "n8n-nodes-base.switch",
   "typeVersion": 3.2,
   "position": [
    720,
    200
   ],
   "parameters": {
    "mode": "rules",
    "rules": {
     "values": [
      {
       "conditions": {
        "options": {
         "caseSensitive": true,
         "leftValue": "",
         "typeValidation": "strict",
         "version": 2
        },
        "conditions": [
         {
          "id": "70%+",
          "leftValue": "={{ $json.discount_percent }}",
          "rightValue": 70,
          "operator": {
           "type": "number",
           "operation": "gte"
          }
         }
        ],
        "combinator": "and"
       },
       "renameOutput": true,
       "outputKey": "70%+"
      },
      {
       "conditions": {
        "options": {
         "caseSensitive": true,
         "leftValue": "",
         "typeValidation": "strict",
         "version": 2
        },
        "conditions": [
         {
          "id": "30-69%",
          "leftValue": "={{ $json.discount_percent }}",
          "rightValue": 30,
          "operator": {
           "type": "number",
           "operation": "gte"
          }
         }
        ],
        "combinator": "and"
       },
       "renameOutput": true,
       "outputKey": "30-69%"
      },
      {
       "conditions": {
        "options": {
         "caseSensitive": true,
         "leftValue": "",
         "typeValidation": "strict",
         "version": 2
        },
        "conditions": [
         {
          "id": "under 30%",
          "leftValue": "={{ $json.discount_percent }}",
          "rightValue": 30,
          "operator": {
           "type": "number",
           "operation": "lt"
          }
         }
        ],
        "combinator": "and"
       },
       "renameOutput": true,
       "outputKey": "under 30%"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "l1",
   "name": "Big deal",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    1000,
    40
   ],
   "parameters": {
    "includeOtherFields": false,
    "assignments": {
     "assignments": [
      {
       "id": "l11",
       "name": "label",
       "type": "string",
       "value": "🔥 대박 할인"
      },
      {
       "id": "l12",
       "name": "name",
       "type": "string",
       "value": "={{ $json.name }}"
      },
      {
       "id": "l13",
       "name": "discount_percent",
       "type": "number",
       "value": "={{ $json.discount_percent }}"
      },
      {
       "id": "l14",
       "name": "price_usd",
       "type": "number",
       "value": "={{ $json.final_price / 100 }}"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "l2",
   "name": "Good deal",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    1000,
    200
   ],
   "parameters": {
    "includeOtherFields": false,
    "assignments": {
     "assignments": [
      {
       "id": "l21",
       "name": "label",
       "type": "string",
       "value": "👍 괜찮은 할인"
      },
      {
       "id": "l22",
       "name": "name",
       "type": "string",
       "value": "={{ $json.name }}"
      },
      {
       "id": "l23",
       "name": "discount_percent",
       "type": "number",
       "value": "={{ $json.discount_percent }}"
      },
      {
       "id": "l24",
       "name": "price_usd",
       "type": "number",
       "value": "={{ $json.final_price / 100 }}"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "l3",
   "name": "Skip for now",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    1000,
    360
   ],
   "parameters": {
    "includeOtherFields": false,
    "assignments": {
     "assignments": [
      {
       "id": "l31",
       "name": "label",
       "type": "string",
       "value": "⏳ 아직 기다리기"
      },
      {
       "id": "l32",
       "name": "name",
       "type": "string",
       "value": "={{ $json.name }}"
      },
      {
       "id": "l33",
       "name": "discount_percent",
       "type": "number",
       "value": "={{ $json.discount_percent }}"
      },
      {
       "id": "l34",
       "name": "price_usd",
       "type": "number",
       "value": "={{ $json.final_price / 100 }}"
      }
     ]
    },
    "options": {}
   }
  }
 ],
 "connections": {
  "Run manually": {
   "main": [
    [
     {
      "node": "Get Steam specials",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Get Steam specials": {
   "main": [
    [
     {
      "node": "Split into games",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Split into games": {
   "main": [
    [
     {
      "node": "Discount level?",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Discount level?": {
   "main": [
    [
     {
      "node": "Big deal",
      "type": "main",
      "index": 0
     }
    ],
    [
     {
      "node": "Good deal",
      "type": "main",
      "index": 0
     }
    ],
    [
     {
      "node": "Skip for now",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "timezone": "Asia/Seoul",
  "executionOrder": "v1"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}