{
  "name": "Reddit social listening radar",
  "nodes": [
    {
      "parameters": {
        "operation": "getAll",
        "subreddit": "={{ $json.subreddit }}",
        "limit": "={{ $json.limits.redditPosts }}",
        "filters": {
          "category": "new"
        }
      },
      "type": "n8n-nodes-base.reddit",
      "typeVersion": 1,
      "position": [
        -288,
        0
      ],
      "id": "f0f71586-6b9d-414e-bef3-37b4e122ae99",
      "name": "Get many posts",
      "credentials": {
        "redditOAuth2Api": {
          "name": "Reddit account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8e5b3fdb-2590-419d-a4f7-616c570fb6bf",
              "name": "postId",
              "value": "={{ $json.id }}",
              "type": "string"
            },
            {
              "id": "cf181ba4-dad1-4f44-ba09-eb6296974554",
              "name": "title",
              "value": "={{ $json.title }}",
              "type": "string"
            },
            {
              "id": "4a918032-0ccc-4d39-8c28-27663d25d32f",
              "name": "content",
              "value": "={{ $json.selftext.slice(0,4000) || $json.url }}",
              "type": "string"
            },
            {
              "id": "5fb5b2ee-9d46-4e65-b510-e116a8a6c3de",
              "name": "subreddit",
              "value": "={{ $json.subreddit }}",
              "type": "string"
            },
            {
              "id": "25cb355f-bd02-44d0-9acd-22a50de53f6c",
              "name": "link",
              "value": "=https://reddit.com{{ $json.permalink }}",
              "type": "string"
            },
            {
              "id": "2b1f5864-4d86-4801-8ca0-b436c79db28b",
              "name": "createdTime",
              "value": "={{ $json.created_utc }}",
              "type": "number"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -64,
        0
      ],
      "id": "ddbeaa1a-26da-4a37-ad06-ddb3fe408729",
      "name": "Post Info"
    },
    {
      "parameters": {
        "operation": "getTimeBetweenDates",
        "startDate": "={{ $json.createdTime }}",
        "endDate": "={{ $now }}",
        "units": [
          "hour"
        ],
        "outputFieldName": "postAge",
        "options": {}
      },
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 2,
      "position": [
        160,
        0
      ],
      "id": "b442a8ec-4696-40b7-96bb-8dc939b9d2a0",
      "name": "Get Post Age"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "17655ea6-fc30-4b8f-861b-35a28eef5a66",
              "leftValue": "={{ $json.postAge.hours }}",
              "rightValue": 1024,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        384,
        0
      ],
      "id": "77d0ff34-2e8b-4bb5-b408-2c6fc1f59cfc",
      "name": "Remove Posts Older than 4h"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=# Post Title\n\n{{ $('Post Info').item.json.title }}\n\n# Post Content \n\n{{ $('Post Info').item.json.content }}",
        "messages": {
          "messageValues": [
            {
              "message": "=You are a marketing research assistant for {{ $('CONFIGURATION').item.json.offer.name }}.\n\nGoal\nReview ONE reddit post and decide if it’s a good opportunity for a helpful, non-promotional reply that builds trust and may lead to work.\n\nContext\n- Engagement preference: {{ $('CONFIGURATION').item.json.offer.type }}\n- Region: EU/DACH and remote\n- Offer description: {{ $('CONFIGURATION').item.json.offer.description }}\n- Use-cases/problems we solve:\n{{ $('CONFIGURATION').item.json.offer[\"use-cases / problem it solves\"] }}\n- Important info:\n{{ $('CONFIGURATION').item.json.offer[\"important features / information\"] }}\n\nDecision rules — answer “yes” only if ALL hold\n1) The post is relevant to the offer/use-cases or directly requests related help/hiring.\n2) Remote or EU/DACH feasible.\n3) Subreddit allows advice/discussion; assume no links in the reply. If CTAs are banned, end with “feel free to contact me in DM for more help.”\n4) We can add real value in a few lines (diagnosis, steps to test, pitfalls, concise pattern).\n\nExclude (answer “no”)\n- Off-topic stacks without your topic angle.\n- Homework/assignment.\n- Roles requiring on-site outside EU/DACH with no remote option.\n- Threads forbidding self-promotion/job-seeking in comments.\n\nOutput JSON only (no prose, no code fences):\n{ \"suitableForReply\": \"yes\" | \"no\", \"explanation\": \"one short reason\" }\n\nNever include links. Prefer “no” when rules or fit are unclear.\n"
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        1184,
        0
      ],
      "id": "654cb14e-face-4506-b81e-b2ff9d69bc69",
      "name": "Classify Posts"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-5",
          "mode": "list",
          "cachedResultName": "gpt-5"
        },
        "options": {
          "responseFormat": "json_object"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1184,
        160
      ],
      "id": "8d4c03e8-9624-4bc6-a121-315ee27b5c45",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a478a012-f81e-4e60-8b8e-6843a8d4cff4",
              "name": "evaluation[\"suitable for reply\"]",
              "value": "={{ $json.suitableForReply }}",
              "type": "string"
            },
            {
              "id": "fbcca72e-6fe3-4edb-bc28-16f8474d10d9",
              "name": "evaluation.explanation",
              "value": "={{ $json.explanation }}",
              "type": "string"
            },
            {
              "id": "f1fe8531-5122-49ef-9bbb-5db574915dde",
              "name": "post.title",
              "value": "={{ $('Post Info').item.json.title }}",
              "type": "string"
            },
            {
              "id": "3b00e3be-68ee-4988-9f86-1ba17705344d",
              "name": "post.content",
              "value": "={{ $('Post Info').item.json.content }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1536,
        0
      ],
      "id": "fe525f2e-482c-46a2-b7e0-860c6995b3e9",
      "name": "Post Classification Data"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=# Post Title\n\n{{ $('Post Info').item.json.title }}\n\n# Post Content \n\n{{ $('Post Info').item.json.content }}",
        "messages": {
          "messageValues": [
            {
              "message": "=You are a reddit post pre-filter for {{ $('CONFIGURATION').item.json.offer.name }}.\n\nYour task is to look at ONE post from r/{{ $('Post Info').item.json.subreddit }} and decide if it’s relevant for a short, link-free, helpful reply that could lead to freelance/contract work first, and strong full-time roles second.\n\nScope\n- Languages: {{ $('CONFIGURATION').item.json.language || '[\"en\",\"de\"]' }}\n- Region: EU/DACH or remote\n- Topic focus: {{ $('CONFIGURATION').item.json.prefilter.topic }}\n- Subtopics to match strongly include:\n{{ $('CONFIGURATION').item.json.prefilter.subtopic }}\n\nSay “yes” only if all apply:\n1) Relevance. The post is about the focus/subtopics above, or it’s a hiring/contract/freelance request in that area, or it’s a troubleshooting/Q&A thread you can help with.\n2) Value potential. There’s enough technical context to add a concise, high-signal, link-free comment.\n\nStrong positive signals\n- Keywords: {{ $('CONFIGURATION').item.json.keywordsInclude || '[\"your\",\"topic\",\"keywords\",\"here\"]' }}\n- Hiring cues: freelance, contractor, consultant, project, gig, Freiberuflich, Werkvertrag, Projekt, Auftrag.\n- Location fit: EU, DACH, Germany, remote.\n\nCommon exclusions (say “no”)\n- Posts with no clear connection to your topic.\n- Homework/“do my assignment”.\n- Unpaid or equity-only work.\n- On-site outside EU/DACH with no remote option.\n- Matches any of: {{ $('CONFIGURATION').item.json.keywordsExclude || '[]' }}\n\nOutput JSON only (no prose, no code fences):\n{ \"isRelated\": \"yes\" | \"no\", \"explanation\": \"brief reason\" }\n\nBe strict. If information is missing or ambiguous, return “no”.\n"
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        608,
        0
      ],
      "id": "2f3b5079-fa04-4df0-839e-bc18881b6cab",
      "name": "AI Pre-Filter"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-5-mini",
          "mode": "list",
          "cachedResultName": "gpt-5-mini"
        },
        "options": {
          "responseFormat": "json_object"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        608,
        160
      ],
      "id": "0e8e0cbd-e999-41f3-aed5-b29471f91a71",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "7df5f170-9655-4aef-9d9c-b5cc18f554c3",
              "leftValue": "={{ $json.isRelated }}",
              "rightValue": "yes",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        960,
        0
      ],
      "id": "0680e2e2-67a6-4507-85c8-6dac3a66673c",
      "name": "Remove non-relevant Posts"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "2df34594-dbc9-4cfe-a162-541668b44ae5",
              "name": "subreddit",
              "value": "=yoursubreddit",
              "type": "string"
            },
            {
              "id": "266d29a1-ad33-4779-98ef-ae9ed327f59f",
              "name": "limits.redditPosts",
              "value": 50,
              "type": "number"
            },
            {
              "id": "a77b9bc5-55e3-4f96-9381-c6fccc3d3329",
              "name": "limits.analyzedPosts",
              "value": 5,
              "type": "number"
            },
            {
              "id": "9d303727-17fb-4bee-b234-1286e5985995",
              "name": "prefilter.topic",
              "value": "=Your product or service topic",
              "type": "string"
            },
            {
              "id": "a45cd092-7d5d-4f90-8dc8-13b9ed45f033",
              "name": "prefilter.subtopic",
              "value": "=\"Subtopic 1\",\n\"Subtopic 2\",\n\"Subtopic 3\"",
              "type": "string"
            },
            {
              "id": "fd9f1c05-7205-4b6c-9ae3-106667ead78d",
              "name": "offer.name",
              "value": "=Your Name — What You Offer",
              "type": "string"
            },
            {
              "id": "95c1a06d-e811-4db9-995d-385608540fcd",
              "name": "offer.type",
              "value": "=Describe your offer type (consulting, product, service)",
              "type": "string"
            },
            {
              "id": "3160171d-8628-4dc1-84b1-eca1204e2d9f",
              "name": "offer.description",
              "value": "=One or two sentences describing what you sell and to whom.",
              "type": "string"
            },
            {
              "id": "3c1b227c-5a17-4a93-bcc0-f7a8139dd5c2",
              "name": "offer[\"use-cases / problem it solves\"]",
              "value": "=\"Use case 1\",\n\"Use case 2\",\n\"Use case 3\"",
              "type": "string"
            },
            {
              "id": "6c7924d9-2115-461e-8b38-317a6e420dd7",
              "name": "offer[\"important features / information\"]",
              "value": "=\"Where you are based\",\n\"Languages you work in\",\n\"Any outreach rules you follow\"",
              "type": "string"
            },
            {
              "id": "f6f8d923-9dc5-44ee-b6b7-b690976cf9df",
              "name": "language",
              "value": "=[\"en\"]",
              "type": "string"
            },
            {
              "id": "d1d1c58b-e6c8-428f-b5e9-65491abfefa3",
              "name": "keywordsExclude",
              "value": "=[\"irrelevant\",\"keywords\",\"here\"]",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -512,
        0
      ],
      "id": "8897cf52-497a-4867-b90c-1b30ef623f1c",
      "name": "CONFIGURATION"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 4
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -736,
        0
      ],
      "id": "006ce3c8-4e64-4181-8f0b-6367dc2f3044",
      "name": "Every 4 Hours"
    }
  ],
  "connections": {
    "Get many posts": {
      "main": [
        [
          {
            "node": "Post Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Info": {
      "main": [
        [
          {
            "node": "Get Post Age",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Post Age": {
      "main": [
        [
          {
            "node": "Remove Posts Older than 4h",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Posts Older than 4h": {
      "main": [
        [
          {
            "node": "AI Pre-Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Classify Posts",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Classify Posts": {
      "main": [
        [
          {
            "node": "Post Classification Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Pre-Filter": {
      "main": [
        [
          {
            "node": "Remove non-relevant Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Pre-Filter",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Remove non-relevant Posts": {
      "main": [
        [
          {
            "node": "Classify Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CONFIGURATION": {
      "main": [
        [
          {
            "node": "Get many posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every 4 Hours": {
      "main": [
        [
          {
            "node": "CONFIGURATION",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false
}