{
 "name": "[노드 한 장] Compare Datasets · 어제 할인 목록 vs 오늘",
 "nodes": [
  {
   "id": "c1",
   "name": "Run manually",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    200
   ],
   "parameters": {}
  },
  {
   "id": "c2",
   "name": "Yesterday (10/24 record)",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    260,
    60
   ],
   "parameters": {
    "jsCode": "// 10/24 22:37 KST 실행 #71379 에서 가져온 Steam 할인 목록 (저장된 기록)\nconst yesterday = [{\"id\": 1091500, \"name\": \"Cyberpunk 2077\", \"final_price\": 1799, \"discount_percent\": 70}, {\"id\": 2138330, \"name\": \"Cyberpunk 2077: Phantom Liberty\", \"final_price\": 1799, \"discount_percent\": 40}, {\"id\": 1203620, \"name\": \"Enshrouded\", \"final_price\": 3599, \"discount_percent\": 10}, {\"id\": 4954910, \"name\": \"Scam With Your Friends\", \"final_price\": 899, \"discount_percent\": 10}, {\"id\": 1449690, \"name\": \"The Walking Dead: The Telltale Definitive Series\", \"final_price\": 499, \"discount_percent\": 90}, {\"id\": 2929250, \"name\": \"over the hill\", \"final_price\": 1999, \"discount_percent\": 20}, {\"id\": 3764200, \"name\": \"Resident Evil Requiem\", \"final_price\": 4899, \"discount_percent\": 30}, {\"id\": 1566200, \"name\": \"Tape to Tape\", \"final_price\": 1799, \"discount_percent\": 10}, {\"id\": 2183900, \"name\": \"Warhammer 40,000: Space Marine 2\", \"final_price\": 1499, \"discount_percent\": 75}, {\"id\": 3240220, \"name\": \"Grand Theft Auto V Enhanced\", \"final_price\": 1499, \"discount_percent\": 50}];\nreturn yesterday.map(g => ({ json: g }));"
   }
  },
  {
   "id": "c3",
   "name": "Today: Steam specials",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    260,
    340
   ],
   "parameters": {
    "url": "https://store.steampowered.com/api/featuredcategories?cc=us&l=english",
    "options": {}
   }
  },
  {
   "id": "c4",
   "name": "Split into games",
   "type": "n8n-nodes-base.splitOut",
   "typeVersion": 1,
   "position": [
    500,
    340
   ],
   "parameters": {
    "fieldToSplitOut": "specials.items",
    "options": {}
   }
  },
  {
   "id": "c5",
   "name": "Keep 4 fields",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    740,
    340
   ],
   "parameters": {
    "assignments": {
     "assignments": [
      {
       "id": "a1",
       "name": "id",
       "type": "number",
       "value": "={{ $json.id }}"
      },
      {
       "id": "a2",
       "name": "name",
       "type": "string",
       "value": "={{ $json.name }}"
      },
      {
       "id": "a3",
       "name": "final_price",
       "type": "number",
       "value": "={{ $json.final_price }}"
      },
      {
       "id": "a4",
       "name": "discount_percent",
       "type": "number",
       "value": "={{ $json.discount_percent }}"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "c6",
   "name": "Compare by id",
   "type": "n8n-nodes-base.compareDatasets",
   "typeVersion": 2.3,
   "position": [
    1000,
    200
   ],
   "parameters": {
    "mergeByFields": {
     "values": [
      {
       "field1": "id",
       "field2": "id"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "c7",
   "name": "Gone today",
   "type": "n8n-nodes-base.noOp",
   "typeVersion": 1,
   "position": [
    1300,
    0
   ],
   "parameters": {}
  },
  {
   "id": "c8",
   "name": "Same",
   "type": "n8n-nodes-base.noOp",
   "typeVersion": 1,
   "position": [
    1300,
    140
   ],
   "parameters": {}
  },
  {
   "id": "c9",
   "name": "Changed",
   "type": "n8n-nodes-base.noOp",
   "typeVersion": 1,
   "position": [
    1300,
    280
   ],
   "parameters": {}
  },
  {
   "id": "c10",
   "name": "New today",
   "type": "n8n-nodes-base.noOp",
   "typeVersion": 1,
   "position": [
    1300,
    420
   ],
   "parameters": {}
  }
 ],
 "connections": {
  "Run manually": {
   "main": [
    [
     {
      "node": "Yesterday (10/24 record)",
      "type": "main",
      "index": 0
     },
     {
      "node": "Today: Steam specials",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Yesterday (10/24 record)": {
   "main": [
    [
     {
      "node": "Compare by id",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Today: Steam specials": {
   "main": [
    [
     {
      "node": "Split into games",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Split into games": {
   "main": [
    [
     {
      "node": "Keep 4 fields",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Keep 4 fields": {
   "main": [
    [
     {
      "node": "Compare by id",
      "type": "main",
      "index": 1
     }
    ]
   ]
  },
  "Compare by id": {
   "main": [
    [
     {
      "node": "Gone today",
      "type": "main",
      "index": 0
     }
    ],
    [
     {
      "node": "Same",
      "type": "main",
      "index": 0
     }
    ],
    [
     {
      "node": "Changed",
      "type": "main",
      "index": 0
     }
    ],
    [
     {
      "node": "New today",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "timezone": "Asia/Seoul",
  "executionOrder": "v1"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}