{
  "name": "Notify on Discord about new Epic Games free game releases",
  "nodes": [
    {
      "id": "30e06e62-9844-4844-b9ba-08c2759729cf",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -600,
        75
      ]
    },
    {
      "id": "896f4f15-0317-4db2-984c-01bcc0402f3e",
      "name": "Extract offers",
      "type": "n8n-nodes-base.html",
      "position": [
        60,
        0
      ]
    },
    {
      "id": "3969b8a5-24d9-49cd-9c0a-a8ad3d49cbd6",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        500,
        -100
      ]
    },
    {
      "id": "3cccc820-230b-48b3-ba3e-b5d7c1620959",
      "name": "Extract label",
      "type": "n8n-nodes-base.set",
      "position": [
        720,
        0
      ]
    },
    {
      "id": "ac99f6b6-b43d-49f2-9543-1c83a0abd4e5",
      "name": "Prepare data",
      "type": "n8n-nodes-base.merge",
      "position": [
        940,
        -100
      ]
    },
    {
      "id": "6e134e7b-87e9-416b-96fd-d7c35a896be6",
      "name": "Check if changed",
      "type": "n8n-nodes-base.code",
      "position": [
        1160,
        -25
      ]
    },
    {
      "id": "6e8c112d-4c58-4c92-bc6b-0504ec55340f",
      "name": "Only when changed",
      "type": "n8n-nodes-base.filter",
      "position": [
        1380,
        -25
      ]
    },
    {
      "id": "513afa47-30ef-41d4-bc4e-1e2338464d89",
      "name": "Success",
      "type": "n8n-nodes-base.merge",
      "position": [
        2260,
        -100
      ]
    },
    {
      "id": "29137c18-edaa-4f85-b693-6a52a15084bb",
      "name": "Save Static Data",
      "type": "n8n-nodes-base.code",
      "position": [
        2480,
        -100
      ]
    },
    {
      "id": "94960f95-1f2e-44f5-8493-4c4f8a37238e",
      "name": "Set Retries",
      "type": "n8n-nodes-base.set",
      "position": [
        -380,
        75
      ]
    },
    {
      "id": "799a04ba-d271-4826-8d69-e3c72eaad802",
      "name": "Wait between requests",
      "type": "n8n-nodes-base.wait",
      "position": [
        500,
        200
      ]
    },
    {
      "id": "47b3078c-6ef1-44d9-9814-e633ce4cce20",
      "name": "Update Retries",
      "type": "n8n-nodes-base.set",
      "position": [
        720,
        200
      ]
    },
    {
      "id": "d14bbbf8-6120-47c2-bb14-9869a941fa6b",
      "name": "If has Results",
      "type": "n8n-nodes-base.if",
      "position": [
        280,
        0
      ]
    },
    {
      "id": "f06ae481-bcd8-4886-a47e-f088cb60e03b",
      "name": "Wait for conditions",
      "type": "n8n-nodes-base.merge",
      "position": [
        1600,
        -175
      ]
    },
    {
      "id": "0ad18534-0be9-4f48-9b95-3bee8ce05ce2",
      "name": "Notify on error",
      "type": "n8n-nodes-base.discord",
      "position": [
        1160,
        275
      ]
    },
    {
      "id": "e1c45b2a-064a-4c2e-a381-bf7133377fe8",
      "name": "GET Epic Games Free Games page",
      "type": "n8n-nodes-puppeteer.puppeteer",
      "position": [
        -160,
        0
      ]
    },
    {
      "id": "67b0c1e5-84ac-4554-9464-4db3ac1f9e2e",
      "name": "If Has Retries",
      "type": "n8n-nodes-base.if",
      "position": [
        940,
        275
      ]
    },
    {
      "id": "4ff1896d-d301-4b42-a451-ccb53bdfc291",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -200
      ],
      "parameters": {
        "width": 260,
        "height": 360,
        "content": "For some reason sometimes this can return whole page properly but the container with free games is empty. So we repeat few times.\n\nRequires `n8n-nodes-puppeteer` to be installed. Otherwise you get blo"
      }
    },
    {
      "id": "c101d3d3-496e-45f8-97d1-4a52c6ecc4a8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        -240
      ],
      "parameters": {
        "width": 180,
        "height": 240,
        "content": "This can sometimes fail so it will repeat few times."
      }
    },
    {
      "id": "20c9b254-7f61-4faf-9bfb-b9caca65d128",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2220,
        -180
      ],
      "parameters": {
        "width": 180,
        "height": 240,
        "content": "Save only when we are sure user got notification."
      }
    },
    {
      "id": "a399a170-2e5d-45f5-b1ab-49e56c9d0561",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -125
      ],
      "parameters": {
        "width": 180,
        "height": 260,
        "content": "Keeps a 'hash' of changes so that it knows if anything changed between executions."
      }
    },
    {
      "id": "63d94fcd-88ec-4c22-b503-286495bf353f",
      "name": "Extract title and image",
      "type": "n8n-nodes-base.html",
      "position": [
        720,
        -200
      ]
    },
    {
      "id": "69950114-45ea-455b-972d-73018f62cb45",
      "name": "Notify Discord",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2040,
        -175
      ]
    },
    {
      "id": "17676c5a-12dd-4589-a554-1424f343f9f5",
      "name": "Prepare notification",
      "type": "n8n-nodes-base.code",
      "position": [
        1820,
        -175
      ]
    },
    {
      "id": "aefedb1f-cc94-4db7-a606-5d419e07e9da",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        35,
        -200
      ],
      "parameters": {
        "width": 150,
        "height": 360,
        "content": "If the workflow does not work this is most likely the point of failure. It means that they have changed something on their page and css selector has changed."
      }
    },
    {
      "id": "9cc64931-29ba-40e7-adf6-43507420c4c3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1950,
        -615
      ],
      "parameters": {
        "width": 280,
        "height": 600,
        "content": "The notification on Discord consists of Embeds. \nThe Template looks like this:\n\n### Epic Games\nNew games detected\n```\n ______________________\n| GAME 1     [ IMAGE ] |\n| Free Now   [       ] |\n|_______"
      }
    }
  ],
  "connections": {
    "Success": {
      "main": [
        [
          {
            "node": "Save Static Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Extract title and image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract label",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Retries": {
      "main": [
        [
          {
            "node": "GET Epic Games Free Games page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare data": {
      "main": [
        [
          {
            "node": "Check if changed",
            "type": "main",
            "index": 0
          },
          {
            "node": "Wait for conditions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract label": {
      "main": [
        [
          {
            "node": "Prepare data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract offers": {
      "main": [
        [
          {
            "node": "If has Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Has Retries": {
      "main": [
        [
          {
            "node": "Set Retries",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify on error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If has Results": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait between requests",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Discord": {
      "main": [
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Retries": {
      "main": [
        [
          {
            "node": "If Has Retries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify on error": {
      "main": [
        []
      ]
    },
    "Check if changed": {
      "main": [
        [
          {
            "node": "Only when changed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set Retries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only when changed": {
      "main": [
        [
          {
            "node": "Wait for conditions",
            "type": "main",
            "index": 1
          },
          {
            "node": "Success",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Wait for conditions": {
      "main": [
        [
          {
            "node": "Prepare notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare notification": {
      "main": [
        [
          {
            "node": "Notify Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait between requests": {
      "main": [
        [
          {
            "node": "Update Retries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract title and image": {
      "main": [
        [
          {
            "node": "Prepare data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GET Epic Games Free Games page": {
      "main": [
        [
          {
            "node": "Extract offers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}