{
  "name": "Reddit Monitor Tool",
  "nodes": [
    {
      "parameters": {},
      "id": "e4e0caad-f74f-4307-bded-62b062b86195",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -1504,
        256
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 15
            }
          ]
        }
      },
      "id": "660aad93-27e0-4bfb-80ef-f8b57fc911ad",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -1504,
        448
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "d64c7527-26a1-4bf3-a9ec-c7f0b3095960",
        "options": {}
      },
      "id": "c284b5f9-1f2d-485b-8db9-c75cde0cd4af",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        -1504,
        640
      ]
    },
    {
      "parameters": {
        "jsCode": "const staticData = $getWorkflowStaticData('global');\nstaticData.redditCalls = 0;\nreturn [{\n  json: {\n    startTime: new Date().getTime(),\n    redditCalls: 0,\n    scannedCount: 0,\n    newCount: 0\n  }\n}];"
      },
      "id": "85cdb1e1-e115-435b-a803-15352068eba5",
      "name": "Record Start Time",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        -1280,
        448
      ]
    },
    {
      "parameters": {
        "jsCode": "return [{\n  json: {\n    icp_description: \"Our ideal customer is a SaaS founder, agency owner, freelancer, or marketer looking for: payment alternatives, invoicing automation, workflow optimization, or lead generation tools. Key pain points include Stripe/Square deactivation, high processor fees, manual invoicing overhead, or lead prospecting bottlenecks.\",\n    target_roles: [\"Founder\", \"CEO\", \"Owner\", \"Freelancer\", \"Marketer\", \"Operator\"]\n  }\n}];"
      },
      "id": "33376aed-c7ee-4b64-98e2-8101f39cee4f",
      "name": "Define ICP Profile",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        -1056,
        448
      ]
    },
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "appPKGU5OMe5HKqD6",
          "mode": "list",
          "cachedResultName": "Reddit",
          "cachedResultUrl": "https://airtable.com/appPKGU5OMe5HKqD6"
        },
        "table": "Config",
        "options": {}
      },
      "id": "b4ad8eea-d4c0-48fc-9fdd-4e27962a2859",
      "name": "Read Config Airtable",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "position": [
        -384,
        304
      ],
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "pending_scans"
      },
      "id": "3bd49738-cb67-4a3c-a851-c817b7118cd9",
      "name": "Fetch Pending Scans",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        -832,
        528
      ],
      "alwaysOutputData": true,
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}"
            }
          ]
        },
        "options": {}
      },
      "id": "00e24b20-c1e6-483f-b46e-da9fe231fb82",
      "name": "Is Real Scan?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        -608,
        528
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "tableId": "pending_scans",
        "filters": {
          "conditions": [
            {
              "condition": "eq",
              "keyValue": "={{ $json.id || 0 }}"
            }
          ]
        },
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldValue": "processing"
            },
            {
              "fieldValue": "={{ new Date().toISOString() }}"
            }
          ]
        }
      },
      "id": "5823e86a-f20d-47a8-a4d3-a20c74ca4dbb",
      "name": "Mark Pending Scans Processing",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        -384,
        592
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "id": "642318d8-abaa-46e3-bb58-d1eb6a6a9cf4",
      "name": "Merge Scans and Configs",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 1,
      "position": [
        -160,
        448
      ]
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nconst processed = [];\nfor (const item of items) {\n  let sub = item.json.subreddit;\n  let kw = item.json.keywords;\n  if (!sub || !kw) continue;\n  \n  sub = sub.trim();\n  if (sub.includes('/r/')) {\n    const parts = sub.split('/r/');\n    if (parts.length > 1) {\n      sub = parts[1];\n    }\n  } else if (sub.toLowerCase().startsWith('r/')) {\n    sub = sub.substring(2);\n  }\n  \n  // Clean trailing slashes and subpaths (e.g. \"SaaS/\" or \"SaaS/comments/...\")\n  sub = sub.split('/')[0].trim();\n  \n  if (sub && kw) {\n    processed.push({\n      json: {\n        ...item.json,\n        subreddit: sub,\n        keywords: kw.trim()\n      }\n    });\n  }\n}\nreturn processed;"
      },
      "id": "12d61d95-4408-4b36-ad41-a4f5b930b161",
      "name": "Filter Config List",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        64,
        448
      ]
    },
    {
      "parameters": {
        "batchSize": 1,
        "options": {}
      },
      "id": "c4c5ccef-a3d1-4406-9c32-3fc23d3155a1",
      "name": "Loop Over Configs",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        288,
        448
      ]
    },
    {
      "parameters": {
        "jsCode": "const staticData = $getWorkflowStaticData('global');\nconst currentConfig = $input.first().json;\nconst limitExceeded = (staticData.redditCalls || 0) >= 30;\nreturn [{\n  json: {\n    ...currentConfig,\n    limitExceeded\n  }\n}];"
      },
      "id": "1c2181ba-f420-421d-9929-72c89f6f37ea",
      "name": "Rate Limiter Check",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        512,
        384
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.limitExceeded }}"
            }
          ]
        },
        "options": {}
      },
      "id": "383321c9-3644-4953-b0b7-970f9fc3b234",
      "name": "Check Rate Limit",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        736,
        384
      ]
    },
    {
      "parameters": {
        "tableId": "pending_scans",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "subreddit",
              "fieldValue": "={{ $json.subreddit }}"
            },
            {
              "fieldId": "keywords",
              "fieldValue": "={{ $json.keywords }}"
            },
            {
              "fieldId": "priority",
              "fieldValue": "={{ $json.priority }}"
            },
            {
              "fieldId": "status",
              "fieldValue": "pending"
            }
          ]
        }
      },
      "id": "9a274bda-0539-4ffa-b1da-7a395fc639f9",
      "name": "Queue Pending Scan",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        960,
        480
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}"
            }
          ]
        },
        "options": {}
      },
      "id": "056f3e6b-5e76-4591-98ae-adb1e2af7b2e",
      "name": "Check Queue Error",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        1184,
        480
      ]
    },
    {
      "parameters": {
        "channel": "#reddit-monitor",
        "text": "=\ud83d\udea8 *Queue Pending Scan Failed*\n*Error:* {{ $json.error?.message || \"Unknown error during insert\" }}\n*Subreddit:* {{ $('Loop Over Configs').item.json.subreddit }}\n*Keywords:* {{ $('Loop Over Configs').item.json.keywords }}",
        "otherOptions": {},
        "attachments": []
      },
      "id": "0dd5e338-cb37-4e1f-9649-711b6e63413a",
      "name": "Queue Error Alert",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        1408,
        544
      ],
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "url": "https://api.zernio.com/v1/reddit/search",
        "options": {},
        "queryParametersUi": {
          "parameter": [
            {
              "name": "q",
              "value": "={{ $json.keywords }}"
            },
            {
              "name": "subreddit",
              "value": "={{ $json.subreddit }}"
            },
            {
              "name": "accountId",
              "value": "={{ $json.zernio_account_id || \"6a22ca6d2b2567671ae23132\" }}"
            },
            {
              "name": "sort",
              "value": "new"
            },
            {
              "name": "limit",
              "value": "25"
            }
          ]
        }
      },
      "id": "09b3f562-b697-4f4f-8c45-9348d04895c6",
      "name": "Search Reddit",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1184,
        240
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const staticData = $getWorkflowStaticData('global');\nstaticData.redditCalls = (staticData.redditCalls || 0) + 1;\nreturn $input.all();"
      },
      "id": "5c372c89-b6dc-4416-ac35-97bed6bff5af",
      "name": "Increment Rate Counter",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        1408,
        240
      ]
    },
    {
      "parameters": {
        "unit": "seconds"
      },
      "id": "472f25e3-9df1-4d29-8401-406ad5acd64c",
      "name": "Wait 1s",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        1632,
        400
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $('Loop Over Configs').context.noItemsLeft }}"
            }
          ]
        },
        "options": {}
      },
      "id": "dafb86b1-c6ac-4570-adf3-1f050d7cb9c8",
      "name": "Loop Check IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        1856,
        544
      ]
    },
    {
      "parameters": {
        "jsCode": "const allPosts = [];\nlet items = [];\ntry {\n  items = $('Search Reddit').all();\n} catch (e) {\n  // Search Reddit hasn't been executed\n}\nfor (const item of items) {\n  const data = item.json;\n  if (!data) continue;\n  \n  let posts = [];\n  if (Array.isArray(data)) {\n    posts = data;\n  } else if (data.items && Array.isArray(data.items)) {\n    posts = data.items;\n  } else if (data.posts && Array.isArray(data.posts)) {\n    posts = data.posts;\n  } else if (data.data && Array.isArray(data.data)) {\n    posts = data.data;\n  } else if (data.data && data.data.children && Array.isArray(data.data.children)) {\n    posts = data.data.children.map(c => c.data || c);\n  } else if (typeof data === 'object') {\n    posts = [data];\n  }\n  \n  for (const p of posts) {\n    if (p) {\n      allPosts.push(p);\n    }\n  }\n}\n\nconst seenIds = new Set();\nconst uniquePosts = [];\nfor (const post of allPosts) {\n  const id = post.id || post._id || post.post_id || post.postId;\n  if (id && !seenIds.has(id)) {\n    seenIds.add(id);\n    uniquePosts.push(post);\n  }\n}\n\nreturn uniquePosts.map(p => ({ json: p }));"
      },
      "id": "d566e162-6d00-4892-8aa0-ee1c93f14cc0",
      "name": "Gather Posts",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        2080,
        544
      ]
    },
    {
      "parameters": {
        "jsCode": "let crypto;\ntry {\n  crypto = require('crypto');\n} catch (e) {}\n\nconst posts = $input.all();\nreturn posts.map(item => {\n  const post = item.json;\n  const id = post.id || post._id || post.post_id || post.postId || '';\n  const title = post.title || post.subject || '';\n  const body = post.selftext || post.body || post.content || '';\n  \n  let url = post.url || post.permalink || '';\n  if (url && url.startsWith('/')) {\n    url = 'https://www.reddit.com' + url;\n  }\n  \n  const subreddit = post.subreddit || '';\n  const upvotes = post.ups || post.upvotes || post.score || 0;\n  \n  let createdTime = post.created_time || post.created_utc || post.createdAt || post.created || '';\n  if (createdTime) {\n    if (typeof createdTime === 'number') {\n      if (createdTime < 1e11) {\n        createdTime = new Date(createdTime * 1000).toISOString();\n      } else {\n        createdTime = new Date(createdTime).toISOString();\n      }\n    } else {\n      try {\n        createdTime = new Date(createdTime).toISOString();\n      } catch (e) {\n        createdTime = new Date().toISOString();\n      }\n    }\n  } else {\n    createdTime = new Date().toISOString();\n  }\n  \n  const textToHash = (title + body).trim().toLowerCase();\n  \n  let hash = '';\n  if (crypto) {\n    hash = crypto.createHash('md5').update(textToHash).digest('hex');\n  } else {\n    let hval = 0x811c9dc5;\n    for (let i = 0; i < textToHash.length; i++) {\n      hval ^= textToHash.charCodeAt(i);\n      hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);\n    }\n    hash = (hval >>> 0).toString(16).padStart(8, '0');\n  }\n  \n  return {\n    json: {\n      post_id: id,\n      title: title,\n      body: body,\n      url: url,\n      subreddit: subreddit,\n      upvotes: upvotes,\n      created_time: createdTime,\n      content_hash: hash,\n      source: 'reddit'\n    }\n  };\n});"
      },
      "id": "d94255f3-bf71-419c-a441-240b306a76b4",
      "name": "Prepare Post Hashes",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        2304,
        544
      ]
    },
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "seen_posts",
        "filters": {
          "conditions": [
            {
              "keyName": "post_id",
              "condition": "eq",
              "keyValue": "={{ $json.post_id }}"
            },
            {
              "keyName": "content_hash",
              "condition": "eq",
              "keyValue": "={{ $json.content_hash }}"
            }
          ]
        }
      },
      "id": "cd6a8b7d-a991-4233-a530-5e60b0270b56",
      "name": "Check Seen Status",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        2528,
        544
      ],
      "alwaysOutputData": true,
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "string",
                "operation": "isEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}"
            }
          ]
        },
        "options": {}
      },
      "id": "b8febad6-9baf-4a98-ade7-0eb78b35a2f6",
      "name": "Filter New Posts",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        2752,
        544
      ]
    },
    {
      "parameters": {
        "tableId": "seen_posts",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "post_id",
              "fieldValue": "={{ $json.post_id }}"
            },
            {
              "fieldId": "content_hash",
              "fieldValue": "={{ $json.content_hash }}"
            },
            {
              "fieldId": "source",
              "fieldValue": "reddit"
            },
            {
              "fieldId": "subreddit",
              "fieldValue": "={{ $json.subreddit }}"
            }
          ]
        }
      },
      "id": "eb80c302-0a6b-46c8-851f-7ad06e4d7781",
      "name": "Insert Seen Post",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        2976,
        640
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "jsonParameters": true,
        "options": {}
      },
      "id": "80037bc1-adce-4948-a688-5409dc392a34",
      "name": "OpenAI Direct API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        3200,
        640
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const response = $input.first().json;\nconst content = response.choices && response.choices[0] && response.choices[0].message ? response.choices[0].message.content : '{}';\n\nlet parsed;\ntry {\n  const cleanJson = content.replace(/\\`\\`\\`json\\n?/g, '').replace(/\\`\\`\\`\\n?/g, '').trim();\n  parsed = JSON.parse(cleanJson);\n} catch (e) {\n  parsed = {\n    summary: 'Parse error: ' + content.substring(0, 100),\n    sentiment: 'neutral',\n    intent: 'unknown',\n    relevance_score: 0,\n    urgency: 'low',\n    business_opportunity_score: 0,\n    recommended_action: 'archive',\n    competitor_mentioned: 'no',\n    brand_mentioned: 'no',\n    pain_point_category: 'None',\n    pain_point_description: 'None',\n    pain_point_severity: 0\n  };\n}\n\nreturn [{\n  json: {\n    ...parsed,\n    raw_response: content\n  }\n}];"
      },
      "id": "0c5c71fc-88f8-4ef5-a8f6-5129c3ac9f42",
      "name": "Parse AI Response",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        3424,
        640
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "post_id",
              "value": "={{ $('Prepare Post Hashes').item.json.post_id }}"
            },
            {
              "name": "title",
              "value": "={{ $('Prepare Post Hashes').item.json.title }}"
            },
            {
              "name": "body",
              "value": "={{ $('Prepare Post Hashes').item.json.body }}"
            },
            {
              "name": "url",
              "value": "={{ $('Prepare Post Hashes').item.json.url }}"
            },
            {
              "name": "subreddit",
              "value": "={{ $('Prepare Post Hashes').item.json.subreddit }}"
            },
            {
              "name": "upvotes",
              "value": "={{ $('Prepare Post Hashes').item.json.upvotes }}"
            },
            {
              "name": "created_time",
              "value": "={{ $('Prepare Post Hashes').item.json.created_time }}"
            },
            {
              "name": "content_hash",
              "value": "={{ $('Prepare Post Hashes').item.json.content_hash }}"
            },
            {
              "name": "summary",
              "value": "={{ $json.summary }}"
            },
            {
              "name": "sentiment",
              "value": "={{ $json.sentiment }}"
            },
            {
              "name": "intent",
              "value": "={{ $json.intent }}"
            },
            {
              "name": "relevance_score",
              "value": "={{ $json.relevance_score }}"
            },
            {
              "name": "urgency",
              "value": "={{ $json.urgency }}"
            },
            {
              "name": "business_opportunity_score",
              "value": "={{ $json.business_opportunity_score }}"
            },
            {
              "name": "recommended_action",
              "value": "={{ $json.recommended_action }}"
            },
            {
              "name": "competitor_mentioned",
              "value": "={{ $json.competitor_mentioned }}"
            },
            {
              "name": "brand_mentioned",
              "value": "={{ $json.brand_mentioned }}"
            },
            {
              "name": "pain_point_category",
              "value": "={{ $json.pain_point_category }}"
            },
            {
              "name": "pain_point_description",
              "value": "={{ $json.pain_point_description }}"
            },
            {
              "name": "pain_point_severity",
              "value": "={{ $json.pain_point_severity }}"
            }
          ]
        },
        "options": {}
      },
      "id": "7889a066-a3d8-4830-93c9-c80200115e25",
      "name": "Pass Post Data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        3648,
        640
      ]
    },
    {
      "parameters": {
        "rules": {
          "rules": [
            {},
            {},
            {}
          ]
        }
      },
      "id": "7766f04d-154b-4b11-8021-04c4d4e5fdbf",
      "name": "Route Analysis",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 1,
      "position": [
        3872,
        416
      ]
    },
    {
      "parameters": {
        "tableId": "posts",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "post_id",
              "fieldValue": "={{ $json.post_id }}"
            },
            {
              "fieldId": "subreddit",
              "fieldValue": "={{ $json.subreddit }}"
            },
            {
              "fieldId": "title",
              "fieldValue": "={{ $json.title }}"
            },
            {
              "fieldId": "body",
              "fieldValue": "={{ $json.body }}"
            },
            {
              "fieldId": "url",
              "fieldValue": "={{ $json.url }}"
            },
            {
              "fieldId": "upvotes",
              "fieldValue": "={{ $json.upvotes }}"
            },
            {
              "fieldId": "created_time",
              "fieldValue": "={{ $json.created_time }}"
            },
            {
              "fieldId": "sentiment",
              "fieldValue": "={{ $json.sentiment }}"
            },
            {
              "fieldId": "intent",
              "fieldValue": "={{ $json.intent }}"
            },
            {
              "fieldId": "relevance_score",
              "fieldValue": "={{ $json.relevance_score }}"
            },
            {
              "fieldId": "urgency",
              "fieldValue": "={{ $json.urgency }}"
            },
            {
              "fieldId": "business_opportunity_score",
              "fieldValue": "={{ $json.business_opportunity_score }}"
            },
            {
              "fieldId": "recommended_action",
              "fieldValue": "alert"
            },
            {
              "fieldId": "competitor_mentioned",
              "fieldValue": "={{ $json.competitor_mentioned }}"
            },
            {
              "fieldId": "brand_mentioned",
              "fieldValue": "={{ $json.brand_mentioned }}"
            },
            {
              "fieldId": "summary",
              "fieldValue": "={{ $json.summary }}"
            },
            {
              "fieldId": "pain_point_category",
              "fieldValue": "={{ $json.pain_point_category }}"
            },
            {
              "fieldId": "pain_point_description",
              "fieldValue": "={{ $json.pain_point_description }}"
            },
            {
              "fieldId": "pain_point_severity",
              "fieldValue": "={{ $json.pain_point_severity }}"
            }
          ]
        }
      },
      "id": "65accf1e-c9d1-41c5-8656-05c7bb7c70c4",
      "name": "Insert Post (Immediate)",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        4096,
        160
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "channel": "#reddit-monitor",
        "text": "=\ud83d\udea8 *Immediate Lead Alert: High Relevance Opportunity*\n*Subreddit:* r/{{ $json.subreddit }}\n*Title:* {{ $json.title }}\n*Relevance Score:* {{ $json.relevance_score }}/100 | *Opportunity Score:* {{ $json.business_opportunity_score }}/10\n*Summary:* {{ $json.summary }}\n*Sentiment:* {{ $json.sentiment }} | *Intent:* {{ $json.intent }}\n*Link:* {{ $json.url }}",
        "otherOptions": {},
        "attachments": []
      },
      "id": "ff268b34-df2d-46a7-af7f-c8a95faa058b",
      "name": "Send Slack Alert",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        4320,
        160
      ],
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "url": "https://api.clickup.com/api/v2/list/YOUR_CLICKUP_LIST_ID/task",
        "jsonParameters": true,
        "options": {}
      },
      "id": "5fa47cd0-8252-4dd2-96ce-276381aa48f6",
      "name": "Create ClickUp Task",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        4544,
        160
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "tableId": "alerts",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "post_id",
              "fieldValue": "={{ $json.post_id }}"
            },
            {
              "fieldId": "channel",
              "fieldValue": "slack+gmail+crm"
            },
            {
              "fieldId": "status",
              "fieldValue": "sent"
            }
          ]
        }
      },
      "id": "b1526f0f-7ceb-49c8-8f84-ccc4ed177a6c",
      "name": "Log Alert Sent",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        4768,
        160
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "base": "appPKGU5OMe5HKqD6",
        "table": "Weekly-Report",
        "options": {}
      },
      "id": "4f6d63f9-5618-407d-8a29-538326457138",
      "name": "Log Immediate to Airtable",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "position": [
        4992,
        160
      ],
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "tableId": "posts",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "post_id",
              "fieldValue": "={{ $json.post_id }}"
            },
            {
              "fieldId": "subreddit",
              "fieldValue": "={{ $json.subreddit }}"
            },
            {
              "fieldId": "title",
              "fieldValue": "={{ $json.title }}"
            },
            {
              "fieldId": "body",
              "fieldValue": "={{ $json.body }}"
            },
            {
              "fieldId": "url",
              "fieldValue": "={{ $json.url }}"
            },
            {
              "fieldId": "upvotes",
              "fieldValue": "={{ $json.upvotes }}"
            },
            {
              "fieldId": "created_time",
              "fieldValue": "={{ $json.created_time }}"
            },
            {
              "fieldId": "sentiment",
              "fieldValue": "={{ $json.sentiment }}"
            },
            {
              "fieldId": "intent",
              "fieldValue": "={{ $json.intent }}"
            },
            {
              "fieldId": "relevance_score",
              "fieldValue": "={{ $json.relevance_score }}"
            },
            {
              "fieldId": "urgency",
              "fieldValue": "={{ $json.urgency }}"
            },
            {
              "fieldId": "business_opportunity_score",
              "fieldValue": "={{ $json.business_opportunity_score }}"
            },
            {
              "fieldId": "recommended_action",
              "fieldValue": "digest"
            },
            {
              "fieldId": "competitor_mentioned",
              "fieldValue": "={{ $json.competitor_mentioned }}"
            },
            {
              "fieldId": "brand_mentioned",
              "fieldValue": "={{ $json.brand_mentioned }}"
            },
            {
              "fieldId": "summary",
              "fieldValue": "={{ $json.summary }}"
            },
            {
              "fieldId": "pain_point_category",
              "fieldValue": "={{ $json.pain_point_category }}"
            },
            {
              "fieldId": "pain_point_description",
              "fieldValue": "={{ $json.pain_point_description }}"
            },
            {
              "fieldId": "pain_point_severity",
              "fieldValue": "={{ $json.pain_point_severity }}"
            }
          ]
        }
      },
      "id": "d8f5071a-2679-4326-8ec8-c5e20ace2ff8",
      "name": "Insert Post (Digest)",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        4544,
        352
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "tableId": "digest_queue",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "post_id",
              "fieldValue": "={{ $json.post_id }}"
            },
            {
              "fieldId": "status",
              "fieldValue": "pending"
            }
          ]
        }
      },
      "id": "04d1359b-298a-4e93-928b-9f44d00ade7c",
      "name": "Add to Digest Queue",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        4768,
        352
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "base": "appPKGU5OMe5HKqD6",
        "table": "Weekly-Report",
        "options": {}
      },
      "id": "62757ac2-65ea-4a7e-b146-86c30150921f",
      "name": "Log Digest to Airtable",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "position": [
        4992,
        352
      ],
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "tableId": "posts",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "post_id",
              "fieldValue": "={{ $json.post_id }}"
            },
            {
              "fieldId": "subreddit",
              "fieldValue": "={{ $json.subreddit }}"
            },
            {
              "fieldId": "title",
              "fieldValue": "={{ $json.title }}"
            },
            {
              "fieldId": "body",
              "fieldValue": "={{ $json.body }}"
            },
            {
              "fieldId": "url",
              "fieldValue": "={{ $json.url }}"
            },
            {
              "fieldId": "upvotes",
              "fieldValue": "={{ $json.upvotes }}"
            },
            {
              "fieldId": "created_time",
              "fieldValue": "={{ $json.created_time }}"
            },
            {
              "fieldId": "sentiment",
              "fieldValue": "={{ $json.sentiment }}"
            },
            {
              "fieldId": "intent",
              "fieldValue": "={{ $json.intent }}"
            },
            {
              "fieldId": "relevance_score",
              "fieldValue": "={{ $json.relevance_score }}"
            },
            {
              "fieldId": "urgency",
              "fieldValue": "={{ $json.urgency }}"
            },
            {
              "fieldId": "business_opportunity_score",
              "fieldValue": "={{ $json.business_opportunity_score }}"
            },
            {
              "fieldId": "recommended_action",
              "fieldValue": "trend_analysis"
            },
            {
              "fieldId": "competitor_mentioned",
              "fieldValue": "={{ $json.competitor_mentioned }}"
            },
            {
              "fieldId": "brand_mentioned",
              "fieldValue": "={{ $json.brand_mentioned }}"
            },
            {
              "fieldId": "summary",
              "fieldValue": "={{ $json.summary }}"
            },
            {
              "fieldId": "pain_point_category",
              "fieldValue": "={{ $json.pain_point_category }}"
            },
            {
              "fieldId": "pain_point_description",
              "fieldValue": "={{ $json.pain_point_description }}"
            },
            {
              "fieldId": "pain_point_severity",
              "fieldValue": "={{ $json.pain_point_severity }}"
            }
          ]
        }
      },
      "id": "7be7af87-cbb9-4e98-9c10-fb5d3806f89f",
      "name": "Insert Post (Trend)",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        4544,
        544
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "tableId": "trend_analysis",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "post_id",
              "fieldValue": "={{ $json.post_id }}"
            },
            {
              "fieldId": "status",
              "fieldValue": "pending"
            }
          ]
        }
      },
      "id": "effbc030-ca89-4495-aa96-d0dbc43bc786",
      "name": "Add to Trend Queue",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        4768,
        544
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "base": "appPKGU5OMe5HKqD6",
        "table": "Weekly-Report",
        "options": {}
      },
      "id": "3cda6c56-24fd-4199-a034-90c7337135c7",
      "name": "Log Trend to Airtable",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "position": [
        4992,
        544
      ],
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "tableId": "posts",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "post_id",
              "fieldValue": "={{ $json.post_id }}"
            },
            {
              "fieldId": "subreddit",
              "fieldValue": "={{ $json.subreddit }}"
            },
            {
              "fieldId": "title",
              "fieldValue": "={{ $json.title }}"
            },
            {
              "fieldId": "body",
              "fieldValue": "={{ $json.body }}"
            },
            {
              "fieldId": "url",
              "fieldValue": "={{ $json.url }}"
            },
            {
              "fieldId": "upvotes",
              "fieldValue": "={{ $json.upvotes }}"
            },
            {
              "fieldId": "created_time",
              "fieldValue": "={{ $json.created_time }}"
            },
            {
              "fieldId": "sentiment",
              "fieldValue": "={{ $json.sentiment }}"
            },
            {
              "fieldId": "intent",
              "fieldValue": "={{ $json.intent }}"
            },
            {
              "fieldId": "relevance_score",
              "fieldValue": "={{ $json.relevance_score }}"
            },
            {
              "fieldId": "urgency",
              "fieldValue": "={{ $json.urgency }}"
            },
            {
              "fieldId": "business_opportunity_score",
              "fieldValue": "={{ $json.business_opportunity_score }}"
            },
            {
              "fieldId": "recommended_action",
              "fieldValue": "archive"
            },
            {
              "fieldId": "competitor_mentioned",
              "fieldValue": "={{ $json.competitor_mentioned }}"
            },
            {
              "fieldId": "brand_mentioned",
              "fieldValue": "={{ $json.brand_mentioned }}"
            },
            {
              "fieldId": "summary",
              "fieldValue": "={{ $json.summary }}"
            },
            {
              "fieldId": "pain_point_category",
              "fieldValue": "={{ $json.pain_point_category }}"
            },
            {
              "fieldId": "pain_point_description",
              "fieldValue": "={{ $json.pain_point_description }}"
            },
            {
              "fieldId": "pain_point_severity",
              "fieldValue": "={{ $json.pain_point_severity }}"
            }
          ]
        }
      },
      "id": "4c7e0ad1-1908-487b-8771-fc8a8435ea1d",
      "name": "Insert Post (Archive)",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        4768,
        736
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "base": "appPKGU5OMe5HKqD6",
        "table": "Weekly-Report",
        "options": {}
      },
      "id": "9ed5786a-73c0-4f7f-9f41-a7ebd43f1175",
      "name": "Log Archive to Airtable",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "position": [
        4992,
        736
      ],
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "number",
                "operation": "greaterEqual",
                "singleValue": true
              },
              "leftValue": "={{ $json.pain_point_severity }}",
              "rightValue": 5
            }
          ]
        },
        "options": {}
      },
      "id": "67aae48b-3fde-4752-88ef-a9ffab35fa8b",
      "name": "Is Pain Point?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        3872,
        880
      ]
    },
    {
      "parameters": {
        "channel": "#reddit-pain-points",
        "text": "=\ud83d\udd25 *New Industry Pain Point Identified* (Severity: {{ $json.pain_point_severity }}/10)\n*Subreddit:* r/{{ $json.subreddit }}\n*Category:* {{ $json.pain_point_category }}\n*Analysis:* {{ $json.pain_point_description }}\n*Post Title:* {{ $json.title }}\n*Link:* {{ $json.url }}",
        "otherOptions": {},
        "attachments": []
      },
      "id": "62353c91-0408-4579-9254-123714b54eb4",
      "name": "Send Pain Point Slack Alert",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        4096,
        880
      ],
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "base": "appPKGU5OMe5HKqD6",
        "table": "Pain-Points",
        "options": {}
      },
      "id": "7d4f68af-b731-42cc-aa76-0b981fb74faa",
      "name": "Log Pain Point to Airtable",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "position": [
        4320,
        880
      ],
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "numberInputs": 5
      },
      "id": "048f075f-fd90-49c1-870c-9c60996bd3ae",
      "name": "Consolidate Run Data",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3,
      "position": [
        5216,
        336
      ]
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nconst newPosts = items.filter(item => item.json.recommended_action !== undefined);\nlet totalScanned = 0;\ntry { totalScanned = $('Gather Posts').all().length; } catch(e) {}\nconst duration = new Date().getTime() - ($('Record Start Time').first().json.startTime || Date.now());\nconst newPostsCount = newPosts.length;\nconst aiCost = newPostsCount * 0.0002;\n\nreturn [{\n  json: {\n    duration_ms: duration,\n    posts_scanned: totalScanned,\n    new_posts_found: newPostsCount,\n    ai_cost: aiCost,\n    run_timestamp: new Date().toISOString()\n  }\n}];"
      },
      "id": "fccf53ea-e4a9-4d4e-a2c9-3a6e2850e816",
      "name": "Calculate Health Stats",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        5440,
        384
      ]
    },
    {
      "parameters": {
        "tableId": "monitor_health",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "duration_ms",
              "fieldValue": "={{ $json.duration_ms }}"
            },
            {
              "fieldId": "posts_scanned",
              "fieldValue": "={{ $json.posts_scanned }}"
            },
            {
              "fieldId": "new_posts_found",
              "fieldValue": "={{ $json.new_posts_found }}"
            },
            {
              "fieldId": "ai_cost",
              "fieldValue": "={{ $json.ai_cost }}"
            }
          ]
        }
      },
      "id": "05fbbe2b-ab17-44a8-8004-3265d9369e19",
      "name": "Log Run Stats",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        5664,
        384
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "base": "appPKGU5OMe5HKqD6",
        "table": "Run-Stats",
        "options": {}
      },
      "id": "20900f7d-fbe2-4a99-8c9c-05253c0e5f18",
      "name": "Log Run Stats to Airtable",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "position": [
        5888,
        384
      ],
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {},
      "id": "0243cbbc-29a0-434a-9fb7-da75d0fc5313",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "typeVersion": 1,
      "position": [
        -1504,
        1104
      ]
    },
    {
      "parameters": {
        "channel": "#reddit-monitor",
        "text": "=\ud83d\udea8 *Reddit Monitor Master Failure*\n*Error Name:* {{ $json.execution.error.name }}\n*Error Message:* {{ $json.execution.error.message }}\n*Workflow ID:* {{ $json.workflow.id }}\n*Execution ID:* {{ $json.execution.id }}",
        "otherOptions": {},
        "attachments": []
      },
      "id": "c38740e4-6c3e-4b30-b1d2-ac89236c08dd",
      "name": "Slack Error Notification",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        -1280,
        1104
      ],
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Record Start Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Record Start Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Record Start Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Record Start Time": {
      "main": [
        [
          {
            "node": "Define ICP Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define ICP Profile": {
      "main": [
        [
          {
            "node": "Read Config Airtable",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Pending Scans",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Pending Scans": {
      "main": [
        [
          {
            "node": "Is Real Scan?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Real Scan?": {
      "main": [
        [
          {
            "node": "Mark Pending Scans Processing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge Scans and Configs",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Mark Pending Scans Processing": {
      "main": [
        [
          {
            "node": "Merge Scans and Configs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Config Airtable": {
      "main": [
        [
          {
            "node": "Merge Scans and Configs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Scans and Configs": {
      "main": [
        [
          {
            "node": "Filter Config List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Config List": {
      "main": [
        [
          {
            "node": "Loop Over Configs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Configs": {
      "main": [
        [
          {
            "node": "Rate Limiter Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limiter Check": {
      "main": [
        [
          {
            "node": "Check Rate Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Rate Limit": {
      "main": [
        [
          {
            "node": "Queue Pending Scan",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Search Reddit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Queue Pending Scan": {
      "main": [
        [
          {
            "node": "Check Queue Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Queue Error": {
      "main": [
        [
          {
            "node": "Queue Error Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 1s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Queue Error Alert": {
      "main": [
        [
          {
            "node": "Wait 1s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Reddit": {
      "main": [
        [
          {
            "node": "Increment Rate Counter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Increment Rate Counter": {
      "main": [
        [
          {
            "node": "Wait 1s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 1s": {
      "main": [
        [
          {
            "node": "Loop Check IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Check IF": {
      "main": [
        [
          {
            "node": "Gather Posts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Configs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gather Posts": {
      "main": [
        [
          {
            "node": "Prepare Post Hashes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Post Hashes": {
      "main": [
        [
          {
            "node": "Check Seen Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Seen Status": {
      "main": [
        [
          {
            "node": "Filter New Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter New Posts": {
      "main": [
        [
          {
            "node": "Insert Seen Post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Consolidate Run Data",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "Insert Seen Post": {
      "main": [
        [
          {
            "node": "OpenAI Direct API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Direct API": {
      "main": [
        [
          {
            "node": "Parse AI Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Response": {
      "main": [
        [
          {
            "node": "Pass Post Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pass Post Data": {
      "main": [
        [
          {
            "node": "Route Analysis",
            "type": "main",
            "index": 0
          },
          {
            "node": "Is Pain Point?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Pain Point?": {
      "main": [
        [
          {
            "node": "Send Pain Point Slack Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Pain Point Slack Alert": {
      "main": [
        [
          {
            "node": "Log Pain Point to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Analysis": {
      "main": [
        [
          {
            "node": "Insert Post (Immediate)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Insert Post (Digest)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Insert Post (Trend)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Insert Post (Archive)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Post (Immediate)": {
      "main": [
        [
          {
            "node": "Send Slack Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Slack Alert": {
      "main": [
        [
          {
            "node": "Create ClickUp Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create ClickUp Task": {
      "main": [
        [
          {
            "node": "Log Alert Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Alert Sent": {
      "main": [
        [
          {
            "node": "Log Immediate to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Immediate to Airtable": {
      "main": [
        [
          {
            "node": "Consolidate Run Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Post (Digest)": {
      "main": [
        [
          {
            "node": "Add to Digest Queue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Digest Queue": {
      "main": [
        [
          {
            "node": "Log Digest to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Digest to Airtable": {
      "main": [
        [
          {
            "node": "Consolidate Run Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Insert Post (Trend)": {
      "main": [
        [
          {
            "node": "Add to Trend Queue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Trend Queue": {
      "main": [
        [
          {
            "node": "Log Trend to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Trend to Airtable": {
      "main": [
        [
          {
            "node": "Consolidate Run Data",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Insert Post (Archive)": {
      "main": [
        [
          {
            "node": "Log Archive to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Archive to Airtable": {
      "main": [
        [
          {
            "node": "Consolidate Run Data",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Consolidate Run Data": {
      "main": [
        [
          {
            "node": "Calculate Health Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Health Stats": {
      "main": [
        [
          {
            "node": "Log Run Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Run Stats": {
      "main": [
        [
          {
            "node": "Log Run Stats to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Slack Error Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "2a5bc7d9-7c8b-4472-9d59-1f79cc2e0c3d",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodeGroups": [],
  "id": "t2sCHEynvtWAgz1Z",
  "tags": [
    {
      "updatedAt": "2026-06-15T05:30:49.219Z",
      "createdAt": "2026-06-15T05:30:49.219Z",
      "id": "Xv9hFhzrY07Pa5tS",
      "name": "monitor"
    },
    {
      "updatedAt": "2026-06-05T09:34:26.417Z",
      "createdAt": "2026-06-05T09:34:26.417Z",
      "id": "noMmQXBaL8o0AIjH",
      "name": "reddit"
    }
  ]
}