{
 "name": "[노드 한 장] Merge · Steam 가격을 원화로",
 "nodes": [
  {
   "id": "m1",
   "name": "Run manually",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    160
   ],
   "parameters": {}
  },
  {
   "id": "m2",
   "name": "Get Steam top sellers",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    240,
    0
   ],
   "parameters": {
    "url": "https://store.steampowered.com/api/featuredcategories?cc=us&l=english",
    "options": {}
   }
  },
  {
   "id": "m3",
   "name": "Split into games",
   "type": "n8n-nodes-base.splitOut",
   "typeVersion": 1,
   "position": [
    480,
    0
   ],
   "parameters": {
    "fieldToSplitOut": "top_sellers.items",
    "options": {}
   }
  },
  {
   "id": "m4",
   "name": "Remove duplicates",
   "type": "n8n-nodes-base.removeDuplicates",
   "typeVersion": 2,
   "position": [
    720,
    0
   ],
   "parameters": {
    "compare": "selectedFields",
    "fieldsToCompare": "id",
    "options": {}
   }
  },
  {
   "id": "m5",
   "name": "Get USD exchange rate",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    240,
    320
   ],
   "parameters": {
    "url": "https://open.er-api.com/v6/latest/USD",
    "options": {}
   }
  },
  {
   "id": "m6",
   "name": "Keep KRW rate",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    480,
    320
   ],
   "parameters": {
    "assignments": {
     "assignments": [
      {
       "id": "k1",
       "name": "usd_krw",
       "type": "number",
       "value": "={{ $json.rates.KRW }}"
      },
      {
       "id": "k2",
       "name": "rate_updated",
       "type": "string",
       "value": "={{ $json.time_last_update_utc }}"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "m7",
   "name": "Merge",
   "type": "n8n-nodes-base.merge",
   "typeVersion": 3,
   "position": [
    980,
    160
   ],
   "parameters": {
    "mode": "combine",
    "combineBy": "combineAll",
    "options": {}
   }
  },
  {
   "id": "m8",
   "name": "Price in KRW",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    1220,
    160
   ],
   "parameters": {
    "assignments": {
     "assignments": [
      {
       "id": "p1",
       "name": "checked_at",
       "type": "string",
       "value": "={{ $now.setZone('Asia/Seoul').toFormat('yyyy-MM-dd HH:mm') }}"
      },
      {
       "id": "p2",
       "name": "rank",
       "type": "number",
       "value": "={{ $itemIndex + 1 }}"
      },
      {
       "id": "p3",
       "name": "name",
       "type": "string",
       "value": "={{ $json.name }}"
      },
      {
       "id": "p4",
       "name": "price_usd",
       "type": "number",
       "value": "={{ $json.final_price / 100 }}"
      },
      {
       "id": "p5",
       "name": "usd_krw",
       "type": "number",
       "value": "={{ Math.round($json.usd_krw * 100) / 100 }}"
      },
      {
       "id": "p6",
       "name": "price_krw",
       "type": "number",
       "value": "={{ Math.round($json.final_price / 100 * $json.usd_krw) }}"
      },
      {
       "id": "p7",
       "name": "discount_percent",
       "type": "number",
       "value": "={{ $json.discount_percent }}"
      },
      {
       "id": "p8",
       "name": "app_id",
       "type": "number",
       "value": "={{ $json.id }}"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "m9",
   "name": "Save to Google Sheets",
   "type": "n8n-nodes-base.googleSheets",
   "typeVersion": 4.2,
   "position": [
    1460,
    160
   ],
   "parameters": {
    "operation": "append",
    "documentId": {
     "__rl": true,
     "mode": "id",
     "value": "YOUR_GOOGLE_SHEET_ID"
    },
    "sheetName": {
     "__rl": true,
     "mode": "id",
     "value": "gid=0"
    },
    "columns": {
     "mappingMode": "autoMapInputData",
     "value": {},
     "matchingColumns": [],
     "schema": []
    },
    "options": {}
   }
  }
 ],
 "connections": {
  "Run manually": {
   "main": [
    [
     {
      "node": "Get Steam top sellers",
      "type": "main",
      "index": 0
     },
     {
      "node": "Get USD exchange rate",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Get Steam top sellers": {
   "main": [
    [
     {
      "node": "Split into games",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Split into games": {
   "main": [
    [
     {
      "node": "Remove duplicates",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Remove duplicates": {
   "main": [
    [
     {
      "node": "Merge",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Get USD exchange rate": {
   "main": [
    [
     {
      "node": "Keep KRW rate",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Keep KRW rate": {
   "main": [
    [
     {
      "node": "Merge",
      "type": "main",
      "index": 1
     }
    ]
   ]
  },
  "Merge": {
   "main": [
    [
     {
      "node": "Price in KRW",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Price in KRW": {
   "main": [
    [
     {
      "node": "Save to Google Sheets",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "timezone": "Asia/Seoul",
  "executionOrder": "v1"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}