{
  "nodes": [
    {
      "id": "5496b8fe-32be-493c-a2ae-fad6d361014f",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1504,
        448
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "59247686-2eda-4469-9d68-0b1f8d52a12e",
      "name": "Set Reddit Posts",
      "type": "n8n-nodes-base.set",
      "position": [
        -1696,
        80
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "63275ce4-a50f-4e00-91d4-bb51e3df36cb",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        -1824,
        448
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "33804ada-8577-4b83-83a0-b74f91104aee",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3392,
        -288
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "684a2d18-25a9-4f34-bb29-b9d46c4b28a5",
      "name": "reddit tool",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -2752,
        896
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "cb8d6327-88e7-4cb9-acfb-84605f13a821",
      "name": "reddit tool webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2448,
        80
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "4ec37d5e-ef00-44ef-8c6b-6d6fd5e2cbd8",
      "name": "Set keywords",
      "type": "n8n-nodes-base.set",
      "position": [
        -2256,
        80
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "9175f95b-f5e2-489a-861c-7949d2db285c",
      "name": "Posted in Last x days",
      "type": "n8n-nodes-base.code",
      "position": [
        -1472,
        80
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "6b7470b4-65aa-4f2c-a008-ed6eef7ba397",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -48
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "263183fe-7b02-4ff1-956d-28bfa15f6d6f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        -48
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0c45491f-4b76-40f0-8410-d551d2621587",
      "name": "Upvotes Requirement Filtering",
      "type": "n8n-nodes-base.if",
      "position": [
        -1200,
        80
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "e1d390d1-29e3-4d31-acae-c4c9bc91e38c",
      "name": "Remove Duplicates",
      "type": "n8n-nodes-base.code",
      "position": [
        -944,
        64
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "13b76f3c-e990-4fbf-886c-a0b2005a8b86",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        352
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b777993a-f03e-4ba4-a813-43802abc1715",
      "name": "Sort by upvotes (descending)",
      "type": "n8n-nodes-base.sort",
      "position": [
        -752,
        64
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a46e9767-a252-4e39-8310-856656f5934f",
      "name": "Set post for Loop",
      "type": "n8n-nodes-base.set",
      "position": [
        -1280,
        432
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "3a50e4ad-90c6-4612-a9d5-ee826eaa68c7",
      "name": "Get Comments",
      "type": "n8n-nodes-base.reddit",
      "onError": "continueRegularOutput",
      "position": [
        -1104,
        432
      ],
      "parameters": {},
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "5bc159c0-bcd8-4d4c-ba1a-17483eaf7585",
      "name": "Format Comments",
      "type": "n8n-nodes-base.code",
      "position": [
        -752,
        432
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "d7c820da-8e61-4237-8efb-96990900b4fe",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -832,
        768
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "36aa471a-8f26-4b89-b372-3ba090616a64",
      "name": "Set Final Report",
      "type": "n8n-nodes-base.set",
      "position": [
        -528,
        432
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "734f851c-f2ff-49f9-9ea0-0999eb0ebe68",
      "name": "Combine Posts",
      "type": "n8n-nodes-base.code",
      "position": [
        -1072,
        768
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "dc9b994c-58cc-4280-8afb-9196d57005a4",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1264,
        768
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 1
    },
    {
      "id": "187745d9-4901-44a3-825d-ccf46a4bd62f",
      "name": "reddit tool webhook subreddit",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2448,
        -128
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "2ac6a250-45cc-45ac-8ac0-a2fcb80f79aa",
      "name": "Set subreddit",
      "type": "n8n-nodes-base.set",
      "position": [
        -2256,
        -128
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "ef67aa90-01e2-4ff4-a8ef-f2ebd1803be7",
      "name": "Get posts from subreddit",
      "type": "n8n-nodes-base.reddit",
      "position": [
        -1984,
        -128
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8aea3692-5840-4aeb-a89c-5c466c1f4b4d",
      "name": "Search for posts by keywords",
      "type": "n8n-nodes-base.reddit",
      "position": [
        -1984,
        80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "932c4490-dfa4-493e-b0c2-dc7bc089d3c8",
      "name": "reddit tool http request (for subreddit)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3312,
        880
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "5f9f3c5b-8632-40bd-94cf-5275f1664145",
      "name": "reddit tool http request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3040,
        896
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "b3ee3ffa-9392-45d6-8e84-dd2b1e5f0184",
      "name": "Extract Top 20 Comments",
      "type": "n8n-nodes-base.code",
      "position": [
        -944,
        432
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2
    }
  ],
  "connections": {
    "Limit": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Combine Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Comments": {
      "main": [
        [
          {
            "node": "Extract Top 20 Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set keywords": {
      "main": [
        [
          {
            "node": "Search for posts by keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Posts": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set subreddit": {
      "main": [
        [
          {
            "node": "Get posts from subreddit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Comments": {
      "main": [
        [
          {
            "node": "Set Final Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set post for Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Final Report": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Reddit Posts": {
      "main": [
        [
          {
            "node": "Posted in Last x days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "Sort by upvotes (descending)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set post for Loop": {
      "main": [
        [
          {
            "node": "Get Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "reddit tool webhook": {
      "main": [
        [
          {
            "node": "Set keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Posted in Last x days": {
      "main": [
        [
          {
            "node": "Upvotes Requirement Filtering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Top 20 Comments": {
      "main": [
        [
          {
            "node": "Format Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get posts from subreddit": {
      "main": [
        [
          {
            "node": "Set Reddit Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search for posts by keywords": {
      "main": [
        [
          {
            "node": "Set Reddit Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort by upvotes (descending)": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upvotes Requirement Filtering": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "reddit tool webhook subreddit": {
      "main": [
        [
          {
            "node": "Set subreddit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}