{
 "name": "[노드 한 장] Date & Time · 할인 마감까지 며칠?",
 "nodes": [
  {
   "id": "d1",
   "name": "Run manually",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ],
   "parameters": {}
  },
  {
   "id": "d2",
   "name": "Get Steam deals",
   "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": "d3",
   "name": "Split deals",
   "type": "n8n-nodes-base.splitOut",
   "typeVersion": 1,
   "position": [
    440,
    0
   ],
   "parameters": {
    "fieldToSplitOut": "specials.items",
    "options": {}
   }
  },
  {
   "id": "d4",
   "name": "Keep game + end",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    660,
    0
   ],
   "parameters": {
    "assignments": {
     "assignments": [
      {
       "id": "a1",
       "name": "game",
       "type": "string",
       "value": "={{ $json.name }}"
      },
      {
       "id": "a2",
       "name": "discount",
       "type": "number",
       "value": "={{ $json.discount_percent }}"
      },
      {
       "id": "a3",
       "name": "ends_unix",
       "type": "number",
       "value": "={{ $json.discount_expiration }}"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "d5",
   "name": "Unix to Korea time",
   "type": "n8n-nodes-base.dateTime",
   "typeVersion": 2,
   "position": [
    880,
    0
   ],
   "parameters": {
    "operation": "formatDate",
    "date": "={{ $json.ends_unix }}",
    "format": "custom",
    "customFormat": "yyyy-MM-dd HH:mm",
    "outputFieldName": "ends_kst",
    "options": {
     "timezone": "Asia/Seoul",
     "includeInputFields": true
    }
   }
  },
  {
   "id": "d6",
   "name": "Now",
   "type": "n8n-nodes-base.dateTime",
   "typeVersion": 2,
   "position": [
    1100,
    0
   ],
   "parameters": {
    "operation": "getCurrentDate",
    "includeTime": true,
    "outputFieldName": "now",
    "options": {
     "timezone": "Asia/Seoul",
     "includeInputFields": true
    }
   }
  },
  {
   "id": "d7",
   "name": "Time left",
   "type": "n8n-nodes-base.dateTime",
   "typeVersion": 2,
   "position": [
    1320,
    0
   ],
   "parameters": {
    "operation": "getTimeBetweenDates",
    "startDate": "={{ $json.now }}",
    "endDate": "={{ $json.ends_unix }}",
    "units": [
     "day",
     "hour"
    ],
    "outputFieldName": "time_left",
    "options": {
     "includeInputFields": true
    }
   }
  }
 ],
 "connections": {
  "Run manually": {
   "main": [
    [
     {
      "node": "Get Steam deals",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Get Steam deals": {
   "main": [
    [
     {
      "node": "Split deals",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Split deals": {
   "main": [
    [
     {
      "node": "Keep game + end",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Keep game + end": {
   "main": [
    [
     {
      "node": "Unix to Korea time",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Unix to Korea time": {
   "main": [
    [
     {
      "node": "Now",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Now": {
   "main": [
    [
     {
      "node": "Time left",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "timezone": "Asia/Seoul",
  "executionOrder": "v1"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}