{
 "name": "[노드 한 장] Google Sheets · ② Append or Update (app_id 기준)",
 "nodes": [
  {
   "id": "b1",
   "name": "Run manually",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ],
   "parameters": {}
  },
  {
   "id": "b2",
   "name": "Get Steam top sellers",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    220,
    0
   ],
   "parameters": {
    "url": "https://store.steampowered.com/api/featuredcategories?cc=us&l=english",
    "options": {}
   }
  },
  {
   "id": "b3",
   "name": "Split into games",
   "type": "n8n-nodes-base.splitOut",
   "typeVersion": 1,
   "position": [
    440,
    0
   ],
   "parameters": {
    "fieldToSplitOut": "top_sellers.items",
    "options": {}
   }
  },
  {
   "id": "b4",
   "name": "Remove duplicates",
   "type": "n8n-nodes-base.removeDuplicates",
   "typeVersion": 2,
   "position": [
    660,
    0
   ],
   "parameters": {
    "compare": "selectedFields",
    "fieldsToCompare": "id",
    "options": {}
   }
  },
  {
   "id": "b5",
   "name": "Pick fields",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    880,
    0
   ],
   "parameters": {
    "assignments": {
     "assignments": [
      {
       "id": "g1",
       "name": "app_id",
       "type": "number",
       "value": "={{ $json.id }}"
      },
      {
       "id": "g2",
       "name": "name",
       "type": "string",
       "value": "={{ $json.name }}"
      },
      {
       "id": "g3",
       "name": "price_usd",
       "type": "number",
       "value": "={{ $json.final_price / 100 }}"
      },
      {
       "id": "g4",
       "name": "discount_percent",
       "type": "number",
       "value": "={{ $json.discount_percent }}"
      },
      {
       "id": "g5",
       "name": "checked_at",
       "type": "string",
       "value": "={{ $now.setZone('Asia/Seoul').toFormat('yyyy-MM-dd HH:mm:ss') }}"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "b6",
   "name": "Google Sheets",
   "type": "n8n-nodes-base.googleSheets",
   "typeVersion": 4.5,
   "position": [
    1100,
    0
   ],
   "parameters": {
    "operation": "appendOrUpdate",
    "documentId": {
     "__rl": true,
     "mode": "id",
     "value": "YOUR_GOOGLE_SHEET_ID"
    },
    "sheetName": {
     "__rl": true,
     "mode": "id",
     "value": "gid=0"
    },
    "columns": {
     "mappingMode": "autoMapInputData",
     "value": {},
     "matchingColumns": [
      "app_id"
     ],
     "schema": [
      {
       "id": "app_id",
       "displayName": "app_id",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      },
      {
       "id": "name",
       "displayName": "name",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      },
      {
       "id": "price_usd",
       "displayName": "price_usd",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      },
      {
       "id": "discount_percent",
       "displayName": "discount_percent",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      },
      {
       "id": "checked_at",
       "displayName": "checked_at",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      }
     ]
    },
    "options": {}
   }
  }
 ],
 "connections": {
  "Run manually": {
   "main": [
    [
     {
      "node": "Get Steam top sellers",
      "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": "Pick fields",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Pick fields": {
   "main": [
    [
     {
      "node": "Google Sheets",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "timezone": "Asia/Seoul",
  "executionOrder": "v1"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}