{
  "name": "n8n-intent-lead-alerts",
  "active": false,
  "nodes": [
    {
      "id": "manual",
      "name": "Manual test",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "run",
      "name": "Run capped Reddit monitor",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        240,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/suslabs~reddit-scraper-monitor/run-sync-get-dataset-items?memory=512&timeout=60&maxTotalChargeUsd=0.05",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer REPLACE_WITH_YOUR_APIFY_TOKEN"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\"mode\": \"monitor\", \"monitorName\": \"n8n-leads\", \"subreddits\": [\"SaaS\", \"startups\"], \"keywordsAny\": [\"alternative to\", \"recommend\"], \"maxItems\": 20, \"maxPages\": 1, \"maxSeconds\": 50}"
      }
    },
    {
      "id": "map",
      "name": "Map to Slack and Sheets",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        0
      ],
      "parameters": {
        "jsCode": "return $input.all().filter(x => (x.json.intent?.score ?? 0) >= 30).map(x => ({json: {title: x.json.title ?? x.json.postTitle, subreddit: x.json.subreddit, score: x.json.score, intent: x.json.intent?.score, keywords: x.json.matchedKeywords?.join(', '), url: x.json.permalink}}));"
      }
    },
    {
      "id": "slack",
      "name": "Slack choose your connection",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        740,
        -80
      ],
      "disabled": true,
      "parameters": {
        "resource": "message",
        "operation": "post",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "REPLACE_CHANNEL_ID"
        },
        "text": "={{ $json.title + \" | intent \" + $json.intent + \" | \" + $json.url }}"
      }
    },
    {
      "id": "sheets",
      "name": "Sheets choose your connection",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        740,
        100
      ],
      "disabled": true,
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "REPLACE_SHEET_ID"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Leads"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": []
        }
      }
    }
  ],
  "connections": {
    "Manual test": {
      "main": [
        [
          {
            "node": "Run capped Reddit monitor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run capped Reddit monitor": {
      "main": [
        [
          {
            "node": "Map to Slack and Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map to Slack and Sheets": {
      "main": [
        [
          {
            "node": "Slack choose your connection",
            "type": "main",
            "index": 0
          },
          {
            "node": "Sheets choose your connection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}