{
  "id": "gauteMKS8RC8zIGb",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Social Media Monitoring",
  "tags": [],
  "nodes": [
    {
      "id": "7167c958-e821-4082-a13e-eda76c27c0be",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1840,
        432
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c26d107c-d1b4-40ae-b983-a66a7b9f81c8",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        864,
        448
      ],
      "parameters": {
        "numberInputs": 4
      },
      "typeVersion": 3.2
    },
    {
      "id": "e83df4cd-aaa2-4536-be7e-350aa0414f0e",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1232,
        768
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3009f7cc-fee2-48d4-b886-a81aaaad393e",
      "name": "AnySite Get Reddit Post",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        48,
        112
      ],
      "parameters": {
        "url": "https://api.anysite.io/api/reddit/posts",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "timeout",
              "value": "300"
            },
            {
              "name": "post_url",
              "value": "={{ $json.url }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "access-token"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.3
    },
    {
      "id": "7d5e9846-8979-48d8-8e2f-7e1bfc752297",
      "name": "AnySite Search Reddit Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1200,
        160
      ],
      "parameters": {
        "url": "https://api.anysite.io/api/reddit/search/posts",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "timeout",
              "value": "300"
            },
            {
              "name": "query",
              "value": "={{ $json.word }}"
            },
            {
              "name": "sort",
              "value": "relevance"
            },
            {
              "name": "count",
              "value": "2"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "access-token"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "c00051fb-d3a3-4100-8c1f-4c60c06cf130",
      "name": "AnySite Get Reddit Post Comment",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        48,
        304
      ],
      "parameters": {
        "url": "https://api.anysite.io/api/reddit/posts/comments",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "timeout",
              "value": "300"
            },
            {
              "name": "post_url",
              "value": "={{ $json.url }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "access-token"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "a422b95c-2f44-4652-b420-46a15a3f3d86",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1328,
        480
      ],
      "parameters": {
        "text": "=\u0421\u043f\u0438\u0441\u043e\u043a post_id: {{ $json.post_ids_str }}",
        "options": {
          "systemMessage": "=\n\nYou are a social media intelligence analyst inside an n8n workflow. Your job: given post_ids and/or pre-fetched posts plus user-defined keywords, you must retrieve records for each post_id from the internal database if needed, normalize and analyze them, generate a concise yet exhaustive report, and send that report by email using the provided email tool. Do not browse the web. Do not invent data.\n\nTools\n\nYou will be provided one or more tools. Prefer these canonical names if available; otherwise use whichever exact email tool is exposed to you in this runtime:\n\t\u2022\tsend_email\n\n\t\u2022\tfetch_posts_by_ids \nReturns an array of Post objects.\n\nIf a tool is unavailable, skip it and proceed with what you have; record any missing post_ids in missing_ids.\n\nInput (user message JSON)\n\n{\n  \"post_ids\": [\"...\"],                 // required if \"posts\" is absent\n  \"keywords\": [\"rocket\",\"anysite\"],    // required (one or more)\n  \"time_range\": {\"from\":\"ISO\",\"to\":\"ISO\"}, // optional\n  \"language\": \"en\",                    // report language; default \"en\"\n  \"time_zone\": \"Europe/Amsterdam\",     // default \"Europe/Amsterdam\"\n  \"email_to\": \"user@example.com\",      // required to send the email\n  \"context\": {\"brand\":\"...\",\"campaign\":\"...\",\"notes\":\"...\"}, // optional\n  \"posts\": [ { ... } ]                 // optional: full post objects already provided\n}\n\nData handling\n\t\u2022\tIf posts present \u2192 use directly.\n\t\u2022\tIf only post_ids \u2192 call fetch_posts_by_ids. Record any misses in missing_ids.\n\t\u2022\tAnalyze only provided/returned data. No external calls.\n\nExpected post fields (may vary)\n\ntype, title, text, url, created_at (Unix or ISO), comment_count, vote_count/like_count/repost_count, platform-specific (subreddit_*, comments (array or JSON string), post_id, word, etc.).\n\nNormalization\n\t1.\tConvert created_at to ISO8601 localized to time_zone (default Europe/Amsterdam).\n\t2.\tParse comments if JSON string \u2192 array.\n\t3.\tDeduplicate by post_id or url.\n\t4.\tInfer platform from type.\n\t5.\tDetect post language; if different from report language, include a brief 1\u20132 line translation.\n\t6.\tMap each post to matched keyword(s): from word and actual matches in title/text.\n\t7.\tDisambiguate keyword senses with confidence:\n\t\u2022\trocket \u2192 space/launch, brands (e.g., Rocket Mortgage), games/memes, autos (e.g., BRABUS Rocket), food (arugula), fashion/other.\n\t\u2022\tanysite \u2192 product/brand vs generic phrase \u201cany site\u201d.\n\nPer-post analytics\n\nFor every post compute:\n\t\u2022\tengagement_proxy: sum of available counters (comment_count + vote_count/like_count/repost_count). If parsed comments array exists, you may add its length. Missing counters \u2192 0.\n\t\u2022\trecency_hours: hours since created_at to now.\n\t\u2022\tkeyword_match_strength: \"strong\" (title/exact), \"medium\" (body), \"weak\" (comments/tags), \"meta\" (only via word).\n\t\u2022\tsentiment: positive / neutral / negative + 1-sentence rationale.\n\t\u2022\tentities: notable brands/people/products/places if inferable.\n\t\u2022\trisks: toxicity, misinformation/rumors, controversy, compliance issues.\n\t\u2022\tdrivers: short notes on what likely drove engagement (e.g., striking media, controversy, timing, celebrity/brand mention).\n\t\u2022\tconfidence: high / medium / low based on data completeness, clarity, and sense disambiguation.\n\nAggregations (deeper detail)\n\t\u2022\tTotals: count of posts; split by platform.\n\t\u2022\tBy keyword: count and share (% of total), plus average engagement_proxy and sentiment mix per keyword.\n\t\u2022\tSenses distribution per keyword (counts, shares, example posts).\n\t\u2022\tPlatform breakdown: per platform totals, median and 75th-percentile engagement (approximate via sorted ranks), top topics.\n\t\u2022\tTrend narrative over time_range: textual description of spikes/dips (hourly/daily as appropriate).\n\t\u2022\tTopic clusters/themes: derive 3\u20137 themes using simple keyword co-occurrence (e.g., {\u201cspace/test/launch\u201d}, {\u201cauto/brabus/edition\u201d}, {\u201csecurity/telemetry/ads\u201d}); list 1\u20132 representative posts per theme.\n\t\u2022\tInfluential accounts/authors: where author info is available, rank by contribution to engagement.\n\t\u2022\tRisks & watchouts: consolidated list across posts with brief why-it-matters.\n\t\u2022\tRecommended actions: prioritized, actionable next steps (max per limits.max_actions), with impact/effort tags.\n\t\u2022\tConfidence & data quality: summarize coverage, missing counters, inferred senses.\n\nReport composition (rich)\n\t\u2022\tSubject: Social Media Report \u2022 {YYYY-MM-DD} \u2022 {keywords} \u2022 {posts_count}\n\t\u2022\tHTML body (inline CSS; no external assets). Include these sections in order:\n\t1.\tHeader\n\t\u2022\tTitle, date, time window, time zone, optional context (brand/campaign).\n\t2.\tExecutive summary (5\u20139 bullets)\n\t\u2022\tKey shifts, top themes, standout posts, immediate risks, recommended next actions (1\u20133).\n\t3.\tKey metrics (KPI grid + table)\n\t\u2022\tTotals, by-platform split, by-keyword split (counts, shares, avg engagement, sentiment mix).\n\t\u2022\tUse simple CSS bars (e.g., <div style=\"background:#eee\"><div style=\"width:XX%\"></div></div>) to visualize shares.\n\t4.\tKeyword senses\n\t\u2022\tTable of senses per keyword with counts, examples, and confidence notes.\n\t5.\tTrends & themes\n\t\u2022\tShort narrative of volume/engagement over time.\n\t\u2022\t3\u20137 themes/clusters with 1\u20132 representative links each.\n\t6.\tTop posts\n\t\u2022\tUp to limits.max_top_posts overall and up to limits.top_posts_per_platform per platform.\n\t\u2022\tFor each: platform, title/summary, link, localized timestamp, engagement_proxy, sentiment, matched keyword(s) & sense, 1\u20132 brief quotes/comments, drivers, risks (if any).\n\t7.\tPlatform insights\n\t\u2022\tPer-platform highlights: what content resonated, posting times, tone/style patterns.\n\t8.\tRisks & watchouts\n\t\u2022\tBullet list (\u2264 limits.max_risks) with brief mitigation ideas.\n\t9.\tRecommended actions\n\t\u2022\tPrioritized list with Impact / Effort tags (e.g., High/Low), owner suggestion if inferable from context.\n\t10.\tMethodology & limitations\n\t\u2022\tData source (workflow), missing counters treated as 0, heuristic senses, no external sources, confidence statement.\n\t\u2022\tPlain text: same flow as HTML in clean Markdown/ASCII.\n\nHTML tips (email-safe)\n\t\u2022\tInline CSS only; no external fonts/images/JS.\n\t\u2022\tUse simple tables and <div> bars for shares.\n\t\u2022\tKeep quotes \u22642 lines; truncate long text with ellipsis.\n\nCSV attachments (if supported by tool)\n\nAttach up to four CSVs:\n\t1.\tsummary.csv: keyword,count,share,avg_engagement,positive,neutral,negative\n\t2.\tposts.csv: platform,created_at,url,engagement_proxy,sentiment,keyword,sense,match_strength\n\t3.\ttop_comments.csv: platform,post_url,author,created_at,excerpt\n\t4.\tentities.csv: entity,type,frequency,example_post_url\n\nQuality & constraints\n\t\u2022\tNo fabricated data. Missing counters \u2192 0 (note in methodology).\n\t\u2022\tAbsolute timestamps with time_zone.\n\t\u2022\tKeep paragraphs tight and scannable.\n\t\u2022\tLanguage = language (default \"en\").\n\nError handling\n\t\u2022\tIf email_to missing \u2192 do not send; respond with status \"error\" and reason.\n\t\u2022\tIf email tool fails \u2192 return \"error\" with the tool\u2019s message.\n\nFinal action \u2014 you MUST send the email\n\t1.\tBuild subject, html, text per spec (depth per depth:\n\t\u2022\tstandard: sections 1\u20133, 6, 10\n\t\u2022\textended (default): all sections except 7 (optional)\n\t\u2022\tmax: include all sections with fuller detail within limits)\n\t2.\tCall the email tool with:\n\t\u2022\tto = email_to\n\t\u2022\tsubject, html, text\n\t\u2022\tattachments if supported\n\t3.\tAfter sending, reply with a single compact JSON acknowledgment (do not echo the full HTML):\n\nReturn exactly one JSON object:\n\n{\n  \"status\": \"sent\" | \"error\",\n  \"to\": \"string\",\n  \"subject\": \"string\",\n  \"totals\": {\n    \"posts\": 0,\n    \"platforms\": {\"reddit\":0,\"x\":0,\"linkedin\":0,\"instagram\":0},\n    \"by_keyword\": [{\"keyword\":\"...\",\"count\":0,\"share\":0.0}],\n    \"time_window\": {\"from\":\"ISO\",\"to\":\"ISO\",\"time_zone\":\"Europe/Amsterdam\"}\n  },\n  \"missing_ids\": [\"...\"],\n  \"notes\": [\"...\"]   // e.g., \"Engagement counters missing on some platforms; treated as 0.\"\n}\n\nPre-send checklist\n\t\u2022\tSubject has date, keywords, post count.\n\t\u2022\tHTML uses inline CSS only.\n\t\u2022\tTotals match analyzed posts.\n\t\u2022\tTime zone consistent.\n\t\u2022\temail_to present and non-empty.\n\n\n\u2e3b\n\nMinimal HTML skeleton you can adapt\n\n<html>\n  <body style=\"font-family: Arial, sans-serif; color:#111; line-height:1.5; margin:0; padding:24px;\">\n    <h1 style=\"margin:0 0 8px;\">Social Media Report</h1>\n    <p style=\"margin:0 0 16px; color:#555;\">Date: {{DATE}} \u2022 Window: {{FROM}} \u2014 {{TO}} ({{TZ}})</p>\n    {{#if CONTEXT}}<p style=\"margin:0 0 16px; color:#555;\">Context: {{CONTEXT}}</p>{{/if}}\n\n    <h2 style=\"margin:24px 0 8px;\">Executive summary</h2>\n    <ul style=\"margin:0 0 16px; padding-left:20px;\">{{BULLETS}}</ul>\n\n    <h2 style=\"margin:24px 0 8px;\">Key metrics</h2>\n    <table cellpadding=\"6\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse; width:100%; font-size:14px;\">\n      <thead><tr><th align=\"left\" style=\"border-bottom:1px solid #ddd;\">Metric</th><th align=\"left\" style=\"border-bottom:1px solid #ddd;\">Value</th></tr></thead>\n      <tbody>\n        {{KPI_ROWS}}\n      </tbody>\n    </table>\n\n    <h2 style=\"margin:24px 0 8px;\">By keyword</h2>\n    {{KEYWORD_ROWS}} <!-- Include share bars like: -->\n    <!--\n    <div style=\"margin:6px 0;\">\n      <strong>rocket</strong> \u2014 65% (13 posts)\n      <div style=\"background:#eee; height:8px; width:100%; border-radius:4px;\">\n        <div style=\"background:#444; height:8px; width:65%; border-radius:4px;\"></div>\n      </div>\n    </div>\n    -->\n\n    <h2 style=\"margin:24px 0 8px;\">Keyword senses</h2>\n    {{SENSE_TABLE}}\n\n    <h2 style=\"margin:24px 0 8px;\">Trends & themes</h2>\n    <p style=\"margin:0 0 8px;\">{{TREND_NARRATIVE}}</p>\n    <ul style=\"margin:0 0 16px; padding-left:20px;\">{{THEME_BULLETS}}</ul>\n\n    <h2 style=\"margin:24px 0 8px;\">Top posts</h2>\n    {{TOP_POST_CARDS}}\n\n    <h2 style=\"margin:24px 0 8px;\">Platform insights</h2>\n    {{PLATFORM_SECTIONS}}\n\n    <h2 style=\"margin:24px 0 8px;\">Risks & watchouts</h2>\n    <ul style=\"margin:0 0 16px; padding-left:20px;\">{{RISK_BULLETS}}</ul>\n\n    <h2 style=\"margin:24px 0 8px;\">Recommended actions</h2>\n    <ol style=\"margin:0 0 16px; padding-left:20px;\">{{ACTION_ITEMS}}</ol>\n\n    <h2 style=\"margin:24px 0 8px;\">Methodology & limitations</h2>\n    <p style=\"margin:0; color:#555;\">Data analyzed exactly as provided by the workflow (no external sources). Missing counters treated as 0. Keyword senses and themes inferred heuristically. Confidence: {{CONFIDENCE}}.</p>\n  </body>\n</html>\n\nRemember: analyze only provided data, send the email yourself via the tool, then return the compact JSON acknowledgment."
        },
        "promptType": "define"
      },
      "typeVersion": 3
    },
    {
      "id": "fe4be382-803a-4829-8fcb-9b492861ae3b",
      "name": "Get word's list",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -1600,
        544
      ],
      "parameters": {
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "VrIDpq4HXFQBRTU7",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/VrIDpq4HXFQBRTU7",
          "cachedResultName": "Brand Monitoring Words"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e9b7166d-312a-4dd0-8afa-c40e0d13069b",
      "name": "AnySite Search LinkedIn Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1200,
        400
      ],
      "parameters": {
        "url": "https://api.anysite.io/api/linkedin/search/posts",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "keywords",
              "value": "={{ $json.word }}"
            },
            {
              "name": "count",
              "value": "2"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "access-token"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "aa8c0794-6012-40ae-894e-a5972d1db244",
      "name": "AnySite Get LinkedIn Post Comments",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        48,
        544
      ],
      "parameters": {
        "url": "https://api.anysite.io/api/linkedin/post/comments",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "timeout",
              "value": "300"
            },
            {
              "name": "urn",
              "value": "=urn:li:activity:{{ $json.post_id }}"
            },
            {
              "name": "sort",
              "value": "recent"
            },
            {
              "name": "count",
              "value": "30"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "access-token"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.3,
      "alwaysOutputData": true
    },
    {
      "id": "64714aa4-379b-43f5-9ce8-625ea769abde",
      "name": "AnySite Search Instagram Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1200,
        624
      ],
      "parameters": {
        "url": "https://api.anysite.io/api/twitter/search/posts",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{ $json.word }}"
            },
            {
              "name": "count",
              "value": "2"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "access-token"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "cfd2abac-84f3-49cf-8be0-887be12a46a5",
      "name": "AnySite Search X Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1200,
        848
      ],
      "parameters": {
        "url": "https://api.anysite.io/api/instagram/search/posts",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "timeout",
              "value": "300"
            },
            {
              "name": "query",
              "value": "={{ $json.word }}"
            },
            {
              "name": "count",
              "value": "2"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "access-token"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "67395f5a-9712-4a44-91c2-c38b44d23a28",
      "name": "If LinkedIn post does not exist1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -592,
        400
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "post_id",
              "keyValue": "={{ $json.urn.value }}"
            }
          ]
        },
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring Posts"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ed0c57df-bc57-40bc-b220-7bfeaeaa8365",
      "name": "If Reddit post does not exist",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -592,
        160
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "post_id",
              "keyValue": "={{ $json.id }}"
            }
          ]
        },
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring Posts"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6b7d65ec-3ac2-4ee5-a5e6-4049952c8d47",
      "name": "If X post does not exist3",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -592,
        848
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "post_id",
              "keyValue": "={{ $json.id }}"
            }
          ]
        },
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring Posts"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "85f7b4f1-9191-4397-a296-d45e15c371e2",
      "name": "If Instagram post does not exist2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -592,
        624
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "post_id",
              "keyValue": "={{ $json.id }}"
            }
          ]
        },
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring Posts"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cfb6bc47-eb96-4f0a-91c4-2916ae51da44",
      "name": "Insert Reddit post ",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -368,
        160
      ],
      "parameters": {
        "columns": {
          "value": {
            "url": "={{ $json.url }}",
            "type": "={{ $json['@type'] }}",
            "word": "={{ $('Get word\\'s list').item.json.word }}",
            "title": "={{ $json.title }}",
            "post_id": "={{ $json.id }}",
            "created_at": "={{ $json.created_at }}",
            "vote_count": "={{ $json.vote_count }}",
            "subreddit_id": "={{ $json.subreddit.id }}",
            "comment_count": "={{ $json.comment_count }}",
            "subreddit_url": "={{ $json.subreddit.url }}",
            "subreddit_alias": "={{ $json.subreddit.alias }}",
            "subreddit_description": "={{ $json.subreddit.description }}",
            "subreddit_member_count": "={{ $json.subreddit.member_count }}"
          },
          "schema": [
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false
            },
            {
              "id": "created_at",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false
            },
            {
              "id": "subreddit_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_id",
              "defaultMatch": false
            },
            {
              "id": "subreddit_alias",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_alias",
              "defaultMatch": false
            },
            {
              "id": "subreddit_url",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_url",
              "defaultMatch": false
            },
            {
              "id": "subreddit_description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_description",
              "defaultMatch": false
            },
            {
              "id": "comment_count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "comment_count",
              "defaultMatch": false
            },
            {
              "id": "vote_count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "vote_count",
              "defaultMatch": false
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false
            },
            {
              "id": "comments",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "comments",
              "defaultMatch": false
            },
            {
              "id": "subreddit_member_count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_member_count",
              "defaultMatch": false
            },
            {
              "id": "post_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "post_id",
              "defaultMatch": false
            },
            {
              "id": "word",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "word",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "161c4a0f-5b7e-463b-8731-8b9f4569562c",
      "name": "Insert LinkedIn post ",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -368,
        400
      ],
      "parameters": {
        "columns": {
          "value": {
            "url": "={{ $json.url }}",
            "text": "={{ $json.text }}",
            "type": "={{ $json['@type'] }}",
            "word": "={{ $('Get word\\'s list').item.json.word }}",
            "post_id": "={{ $json.urn.value }}",
            "created_at": "={{ $json.created_at }}",
            "vote_count": "={{ $json.reactions[0].count }}",
            "comment_count": "={{ $json.comment_count }}"
          },
          "schema": [
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false
            },
            {
              "id": "created_at",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false
            },
            {
              "id": "subreddit_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_id",
              "defaultMatch": false
            },
            {
              "id": "subreddit_alias",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_alias",
              "defaultMatch": false
            },
            {
              "id": "subreddit_url",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_url",
              "defaultMatch": false
            },
            {
              "id": "subreddit_description",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_description",
              "defaultMatch": false
            },
            {
              "id": "comment_count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "comment_count",
              "defaultMatch": false
            },
            {
              "id": "vote_count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "vote_count",
              "defaultMatch": false
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false
            },
            {
              "id": "comments",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "comments",
              "defaultMatch": false
            },
            {
              "id": "subreddit_member_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_member_count",
              "defaultMatch": false
            },
            {
              "id": "post_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "post_id",
              "defaultMatch": false
            },
            {
              "id": "word",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "word",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "13d26f5f-7303-4ae7-b6ae-4b3d59952b7a",
      "name": "Insert Instagram post",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -368,
        624
      ],
      "parameters": {
        "columns": {
          "value": {
            "url": "={{ $json.url }}",
            "text": "={{ $json.text }}",
            "type": "={{ $json[\"@type\"] }}",
            "word": "={{ $('Get word\\'s list').item.json.word }}",
            "post_id": "={{ $json.id }}",
            "created_at": "={{ $json.created_at }}",
            "vote_count": "={{ $json.retweet_count }}",
            "comment_count": "={{ $json.reply_count }}"
          },
          "schema": [
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false
            },
            {
              "id": "created_at",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false
            },
            {
              "id": "subreddit_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_id",
              "defaultMatch": false
            },
            {
              "id": "subreddit_alias",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_alias",
              "defaultMatch": false
            },
            {
              "id": "subreddit_url",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_url",
              "defaultMatch": false
            },
            {
              "id": "subreddit_description",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_description",
              "defaultMatch": false
            },
            {
              "id": "comment_count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "comment_count",
              "defaultMatch": false
            },
            {
              "id": "vote_count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "vote_count",
              "defaultMatch": false
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false
            },
            {
              "id": "comments",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "comments",
              "defaultMatch": false
            },
            {
              "id": "subreddit_member_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_member_count",
              "defaultMatch": false
            },
            {
              "id": "post_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "post_id",
              "defaultMatch": false
            },
            {
              "id": "word",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "word",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c5a56796-dd48-440a-923f-7fd3a4ffc434",
      "name": "Insert X post",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -368,
        848
      ],
      "parameters": {
        "columns": {
          "value": {
            "url": "={{ $json.url }}",
            "text": "={{ $json.text }}",
            "type": "={{ $json[\"@type\"] }}",
            "word": "={{ $('Get word\\'s list').item.json.word }}",
            "post_id": "={{ $json.id }}",
            "created_at": "={{ $json.created_at }}",
            "vote_count": "={{ $json.like_count }}",
            "comment_count": "={{ $json.comment_count }}"
          },
          "schema": [
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false
            },
            {
              "id": "created_at",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false
            },
            {
              "id": "subreddit_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_id",
              "defaultMatch": false
            },
            {
              "id": "subreddit_alias",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_alias",
              "defaultMatch": false
            },
            {
              "id": "subreddit_url",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_url",
              "defaultMatch": false
            },
            {
              "id": "subreddit_description",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_description",
              "defaultMatch": false
            },
            {
              "id": "comment_count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "comment_count",
              "defaultMatch": false
            },
            {
              "id": "vote_count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "vote_count",
              "defaultMatch": false
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false
            },
            {
              "id": "comments",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "comments",
              "defaultMatch": false
            },
            {
              "id": "subreddit_member_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_member_count",
              "defaultMatch": false
            },
            {
              "id": "post_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "post_id",
              "defaultMatch": false
            },
            {
              "id": "word",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "word",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "11713917-d244-4d96-abfc-160f67143a01",
      "name": "Update Reddit post details",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        256,
        32
      ],
      "parameters": {
        "columns": {
          "value": {
            "text": "={{ $json.text }}"
          },
          "schema": [
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false
            },
            {
              "id": "created_at",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false
            },
            {
              "id": "subreddit_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_id",
              "defaultMatch": false
            },
            {
              "id": "subreddit_alias",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_alias",
              "defaultMatch": false
            },
            {
              "id": "subreddit_url",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_url",
              "defaultMatch": false
            },
            {
              "id": "subreddit_description",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_description",
              "defaultMatch": false
            },
            {
              "id": "comment_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "comment_count",
              "defaultMatch": false
            },
            {
              "id": "vote_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "vote_count",
              "defaultMatch": false
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false
            },
            {
              "id": "comments",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "comments",
              "defaultMatch": false
            },
            {
              "id": "subreddit_member_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_member_count",
              "defaultMatch": false
            },
            {
              "id": "post_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "post_id",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "post_id",
              "keyValue": "={{ $json.id }}"
            }
          ]
        },
        "options": {},
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring Posts"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "36dfff36-e33d-4d00-a7d8-003fc99825ca",
      "name": "Convert comments to the string",
      "type": "n8n-nodes-base.code",
      "position": [
        256,
        224
      ],
      "parameters": {
        "jsCode": "const MAX_LEN = 0; \n\nfunction toArrayMaybe(json) {\n  if (Array.isArray(json)) return json;\n  if (Array.isArray(json?.comments)) return json.comments;\n  if (typeof json === 'string') {\n    try {\n      const parsed = JSON.parse(json);\n      if (Array.isArray(parsed)) return parsed;\n      if (Array.isArray(parsed?.comments)) return parsed.comments;\n    } catch (_) {}\n  }\n  if (typeof json?.data === 'string') {\n    try {\n      const parsed = JSON.parse(json.data);\n      if (Array.isArray(parsed)) return parsed;\n    } catch (_) {}\n  }\n  return null;\n}\n\nfunction getIncomingComments(items) {\n  const looksLikeSingleComment =\n    items.length > 1 ||\n    (items[0]?.json && items[0].json['@type'] === '@reddit_comment');\n  if (looksLikeSingleComment) {\n    return items\n      .map(i => i.json)\n      .filter(v => v && typeof v === 'object');\n  }\n  const payload = items[0]?.json;\n  const arr = toArrayMaybe(payload);\n  if (arr) return arr;\n  return [];\n}\n\nfunction formatDate(unix) {\n  if (!unix && unix !== 0) return null;\n  const date = new Date(unix * 1000);\n  return date.toLocaleString('ru-RU', {\n    year: 'numeric', month: '2-digit', day: '2-digit',\n    hour: '2-digit', minute: '2-digit', second: '2-digit'\n  });\n}\n\nfunction transformComment(comment) {\n  if (!comment || comment.is_deleted || !comment.text) return null;\n  return {\n    author: comment.author?.name || '[deleted]',\n    created_at_unix: comment.created_at,\n    created_at: formatDate(comment.created_at),\n    text: comment.text,\n    replies: (comment.replies || [])\n      .map(transformComment)\n      .filter(Boolean),\n  };\n}\n\nfunction stringifySafe(obj) {\n  const s = JSON.stringify(obj);\n  if (MAX_LEN > 0 && s.length > MAX_LEN) {\n    return s.slice(0, MAX_LEN - 3) + '...';\n  }\n  return s;\n}\n\nconst allComments = getIncomingComments(items);\n\nconst topLevel = allComments.filter(\n  c => c && typeof c.parent_id === 'string' && c.parent_id.startsWith('t3_')\n);\n\nconst byPost = {};\nfor (const c of topLevel) {\n  const postId = c.parent_id;\n  const t = transformComment(c);\n  if (!t) continue;\n  if (!byPost[postId]) byPost[postId] = [];\n  byPost[postId].push(t);\n}\n\nconst out = Object.entries(byPost).map(([post_id, comments]) => {\n  return {\n    json: {\n      post_id,\n      comments_count: comments.length,\n      comments_json: stringifySafe(comments)\n    }\n  };\n});\n\nreturn out.length ? out : [{ json: { post_id: null, comments_count: 0, comments_json: '[]' } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "29671c8b-fd0b-4970-9324-5e43072f1158",
      "name": "Update Reddit post comments",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        448,
        224
      ],
      "parameters": {
        "columns": {
          "value": {
            "comments": "={{ $json.comments_json }}"
          },
          "schema": [
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false
            },
            {
              "id": "created_at",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false
            },
            {
              "id": "subreddit_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_id",
              "defaultMatch": false
            },
            {
              "id": "subreddit_alias",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_alias",
              "defaultMatch": false
            },
            {
              "id": "subreddit_url",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_url",
              "defaultMatch": false
            },
            {
              "id": "subreddit_description",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_description",
              "defaultMatch": false
            },
            {
              "id": "comment_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "comment_count",
              "defaultMatch": false
            },
            {
              "id": "vote_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "vote_count",
              "defaultMatch": false
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false
            },
            {
              "id": "comments",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "comments",
              "defaultMatch": false
            },
            {
              "id": "subreddit_member_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_member_count",
              "defaultMatch": false
            },
            {
              "id": "post_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "post_id",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "post_id",
              "keyValue": "={{ $json.post_id }}"
            }
          ]
        },
        "options": {},
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring Posts"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5d0d8f1b-d5f3-47b5-91ef-1a8dc8a2fbad",
      "name": "Convert LN comments to the string",
      "type": "n8n-nodes-base.code",
      "position": [
        256,
        496
      ],
      "parameters": {
        "jsCode": "const MAX_LEN = 0;\n\nfunction toArrayMaybe(json) {\n  if (Array.isArray(json)) return json;\n  if (Array.isArray(json?.comments)) return json.comments;\n  if (typeof json === 'string') {\n    try {\n      const parsed = JSON.parse(json);\n      if (Array.isArray(parsed)) return parsed;\n      if (Array.isArray(parsed?.comments)) return parsed.comments;\n    } catch (_) {}\n  }\n  if (typeof json?.data === 'string') {\n    try {\n      const parsed = JSON.parse(json.data);\n      if (Array.isArray(parsed)) return parsed;\n    } catch (_) {}\n  }\n  return null;\n}\n\nfunction getIncoming(items) {\n  const looksLikeFlat =\n    items.length > 1 ||\n    (items[0]?.json && String(items[0].json['@type'] || '').includes('@linkedin_post_comment'));\n  if (looksLikeFlat) {\n    return items.map(i => i.json).filter(v => v && typeof v === 'object');\n  }\n  const payload = items[0]?.json;\n  const arr = toArrayMaybe(payload);\n  if (arr) return arr;\n  return [];\n}\n\nfunction formatDateSmart(ts) {\n  if (ts == null) return null;\n  const isMs = Math.abs(ts) > 1e12;\n  const d = new Date((isMs ? ts : ts * 1000));\n  return d.toLocaleString('ru-RU', {\n    year: 'numeric', month: '2-digit', day: '2-digit',\n    hour: '2-digit', minute: '2-digit', second: '2-digit'\n  });\n}\n\nfunction extractPostIdFromUrnValue(val) {\n  if (typeof val !== 'string') return null;\n  const m = val.match(/(?:activity|ugcPost):(\\d+)/);\n  return m ? m[1] : null;\n}\n\nfunction extractPostIdAny(c) {\n  let id = extractPostIdFromUrnValue(c?.urn?.value);\n  if (id) return id;\n  id = extractPostIdFromUrnValue(c?.parent?.value);\n  if (id) return id;\n  id = extractPostIdFromUrnValue(c?.url);\n  if (id) return id;\n  try {\n    const decoded = decodeURIComponent(c?.url || '');\n    id = extractPostIdFromUrnValue(decoded);\n    if (id) return id;\n  } catch (_) {}\n  return null;\n}\n\nfunction stringifySafe(obj) {\n  const s = JSON.stringify(obj);\n  if (MAX_LEN > 0 && s.length > MAX_LEN) return s.slice(0, MAX_LEN - 3) + '...';\n  return s;\n}\n\nfunction transformLinkedInComment(c) {\n  if (!c || !c.text) return null;\n  const post_id = extractPostIdAny(c) || 'unknown_post';\n  const created_at_raw = c.created_at ?? null;\n  return {\n    post_id,\n    author: c.author?.name || '[unknown]',\n    author_url: c.author?.url || null,\n    text: c.text,\n    created_at_raw,\n    created_at: formatDateSmart(created_at_raw),\n    reactions: Array.isArray(c.reactions) ? c.reactions : null,\n    is_commenter_post_author: !!c.is_commenter_post_author,\n    replies: [],\n  };\n}\n\nconst raw = getIncoming(items);\nconst normalized = raw.map(transformLinkedInComment).filter(Boolean);\n\nconst byPost = {};\nfor (const t of normalized) {\n  const key = t.post_id || 'unknown_post';\n  if (!byPost[key]) byPost[key] = [];\n  byPost[key].push({\n    author: t.author,\n    author_url: t.author_url,\n    text: t.text,\n    created_at_raw: t.created_at_raw,\n    created_at: t.created_at,\n    reactions: t.reactions,\n    is_commenter_post_author: t.is_commenter_post_author,\n    replies: t.replies,\n  });\n}\n\nconst out = Object.entries(byPost).map(([post_id, comments]) => ({\n  json: {\n    post_id,\n    comments_count: comments.length,\n    comments_json: stringifySafe(comments)\n  }\n}));\n\nreturn out.length ? out : [{ json: { post_id: null, comments_count: 0, comments_json: '[]' } }];"
      },
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "f210b1c2-546e-4480-86d5-41d5805e424d",
      "name": "Update LN comments",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        448,
        496
      ],
      "parameters": {
        "columns": {
          "value": {
            "comments": "={{ $json.comments_json }}"
          },
          "schema": [
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false
            },
            {
              "id": "created_at",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false
            },
            {
              "id": "subreddit_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_id",
              "defaultMatch": false
            },
            {
              "id": "subreddit_alias",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_alias",
              "defaultMatch": false
            },
            {
              "id": "subreddit_url",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_url",
              "defaultMatch": false
            },
            {
              "id": "subreddit_description",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_description",
              "defaultMatch": false
            },
            {
              "id": "comment_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "comment_count",
              "defaultMatch": false
            },
            {
              "id": "vote_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "vote_count",
              "defaultMatch": false
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false
            },
            {
              "id": "comments",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "comments",
              "defaultMatch": false
            },
            {
              "id": "subreddit_member_count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "subreddit_member_count",
              "defaultMatch": false
            },
            {
              "id": "post_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "post_id",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "post_id",
              "keyValue": "={{ $json.post_id }}"
            }
          ]
        },
        "options": {},
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring Posts"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "6435b75f-d22f-491d-b4ac-f5cf04019f32",
      "name": "Get post_id for all new posts",
      "type": "n8n-nodes-base.code",
      "position": [
        1072,
        480
      ],
      "parameters": {
        "jsCode": "const FILTER_TYPES = null;\nconst MAX_LEN = 0;\n\nfunction toArrayMaybe(json) {\n  if (Array.isArray(json)) return json;\n  if (typeof json === 'string') {\n    try {\n      const parsed = JSON.parse(json);\n      if (Array.isArray(parsed)) return parsed;\n    } catch (_) {}\n  }\n  if (Array.isArray(json?.data)) return json.data;\n  if (typeof json?.data === 'string') {\n    try {\n      const parsed = JSON.parse(json.data);\n      if (Array.isArray(parsed)) return parsed;\n    } catch (_) {}\n  }\n  return null;\n}\n\nfunction getIncoming(items) {\n  if (items.length > 1 && items.every(i => i?.json && typeof i.json === 'object')) {\n    return items.map(i => i.json);\n  }\n  const payload = items[0]?.json;\n  const arr = toArrayMaybe(payload);\n  if (arr) return arr;\n  if (payload && typeof payload === 'object') return [payload];\n  return [];\n}\n\nfunction cutIfNeeded(str) {\n  if (MAX_LEN > 0 && str.length > MAX_LEN) {\n    return str.slice(0, MAX_LEN - 3) + '...';\n  }\n  return str;\n}\n\nconst posts = getIncoming(items);\n\nconst filtered = Array.isArray(FILTER_TYPES)\n  ? posts.filter(p => FILTER_TYPES.includes(p.type))\n  : posts;\n\nconst idsUnique = Array.from(\n  new Set(\n    filtered\n      .map(p => String(p.post_id ?? '').trim())\n      .filter(v => v.length > 0)\n  )\n);\n\nconst post_ids_str = cutIfNeeded(idsUnique.join(','));\n\nreturn [{\n  json: {\n    total: idsUnique.length,\n    post_ids: idsUnique,\n    post_ids_str\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "9c4d669b-a88b-40cb-a6fc-1da404260ec9",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1840,
        640
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 1
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "703ab5b6-b4e9-4e85-920d-49daaba5e7a8",
      "name": "Send a message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1568,
        768
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {},
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "378a44d5-100d-49f3-8c00-4057ddab5e48",
      "name": "Get Posts Info",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        1424,
        768
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "post_id",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', `post_id`, 'string') }}"
            }
          ]
        },
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "B9xklN5LC5Yv67oC",
          "cachedResultUrl": "/projects/KcvI5ipbOFN8ryQN/datatables/B9xklN5LC5Yv67oC",
          "cachedResultName": "Brand Motitoring Posts"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ccb9423f-734a-456a-a688-a4976bc29bb1",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2496,
        -480
      ],
      "parameters": {
        "color": 4,
        "width": 500,
        "height": 1360,
        "content": "## Social Media Monitoring Workflow with AnySite.io\n\n## Who's it for\nMarketing teams, brand managers, PR specialists, and customer success teams who need real-time brand monitoring across multiple social media platforms for sentiment analysis, crisis management, and competitive intelligence.\n\n## How it works\n1. Schedule trigger runs daily/hourly to monitor brand mentions\n2. Searches across Reddit, LinkedIn, Instagram, and X/Twitter simultaneously\n3. Checks database to avoid duplicate processing\n4. Fetches full post details and comments for new mentions\n5. AI Agent analyzes sentiment and context using GPT-4\n6. Sends email alerts for important mentions via Gmail\n7. Stores all data in PostgreSQL for historical analysis\n\n## Requirements\n- AnySite.io API account with access tokens\n- OpenAI API key (GPT-4 recommended)\n- PostgreSQL database for post tracking\n- Gmail account for notifications\n- n8n self-hosted or cloud instance\n\n## How to set up\n1. **Update AnySite credentials**:\n   - Add your access-token to all AnySite HTTP nodes\n2. **Configure search keywords**:\n   - Update \"Get word's list\" node with your brand terms\n3. **Set up PostgreSQL**:\n   - Create posts table with required schema\n4. **Configure Gmail**:\n   - Connect Gmail OAuth for notifications\n5. **Adjust schedule**:\n   - Set monitoring frequency in Schedule Trigger\n6. **Test with manual trigger first**\n\n## How to customize\n- **Add platforms**: Create new search nodes with AnySite API endpoints\n- **Modify analysis**: Update AI Agent prompts for specific insights\n- **Change alerts**: Replace Gmail with Slack, Discord, or webhook\n- **Add filters**: Insert IF nodes to filter by sentiment/reach\n- **Historical reports**: Add scheduled aggregation nodes\n- **Export data**: Connect to BI tools or data warehouses\n\n## Built with AnySite.io\nThis workflow uses AnySite.io APIs for reliable, scalable social media data extraction."
      },
      "typeVersion": 1
    },
    {
      "id": "2b0a2f31-fbe4-4d49-b044-d9aae1be017c",
      "name": "AnySite.io Attribution",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2496,
        944
      ],
      "parameters": {
        "color": 5,
        "width": 504,
        "height": 376,
        "content": "## \ud83d\ude80 Built with AnySite.io\n\n**Created by:** Andrew Kulikov\n**Company:** AnySite.io\n**Workflow Version:** 1.0\n**Last Updated:** October 2025\n\n**Learn more:** [anysite.io](https://anysite.io)\n**API Docs:** [docs.anysite.io](https://docs.anysite.io)\n**Contact:** andrew@anysite.io"
      },
      "typeVersion": 1
    },
    {
      "id": "42b7955d-b080-4f22-b1bf-228bb4df1d77",
      "name": "Customization Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1984,
        -496
      ],
      "parameters": {
        "color": 5,
        "width": 700,
        "height": 340,
        "content": "\ud83d\udc9a **How to Customize Your Monitoring:**\n\n**Add platforms:**\n- Use AnySite.io APIs for TikTok, YouTube, Facebook\n- Copy existing search node structure\n\n**Modify alerts:**\n- Replace Gmail with Slack, Discord, MS Teams\n- Add webhooks to your CRM/ticketing system\n\n**Change analysis:**\n- Edit AI Agent system prompt for specific insights\n- Add sentiment scores, urgency levels, action items\n\n**Schedule frequency:**\n- Real-time: Every 15 minutes\n- Standard: Hourly\n- Daily digest: Once per day\n\n**Filter results:**\n- Add IF nodes to filter by engagement/sentiment\n- Create priority tiers for different keywords"
      },
      "typeVersion": 1
    },
    {
      "id": "116079d0-8561-4d28-9785-a577e3128ff3",
      "name": "Triggers & Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1952,
        -96
      ],
      "parameters": {
        "color": 7,
        "width": 680,
        "height": 440,
        "content": "## 1. Triggers & Keywords Setup\n[Learn about Schedule Triggers](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/)\n\nWorkflow can be triggered by:\n\u2022 Schedule Trigger - Automated monitoring (hourly/daily)\n\u2022 Manual Trigger - On-demand execution for testing\n\n**Get word's list** node:\n- Define brand keywords to monitor\n- Supports multiple search terms\n- Each term searches across all platforms\n\n\ud83d\udca1 Pro tip: Use brand name variations, product names, and common misspellings"
      },
      "typeVersion": 1
    },
    {
      "id": "c4812c10-83fa-455f-94e8-f0767d6e6fde",
      "name": "Testing Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1712,
        288
      ],
      "parameters": {
        "color": 7,
        "width": 680,
        "height": 476,
        "content": "## \ud83e\uddea Testing Your Workflow\n\n**Initial Test:**\n1. Use Manual Trigger first (not Schedule)\n2. Add 1-2 test keywords in \"Get word's list\"\n3. Execute and verify each stage completes\n4. Check database for inserted records\n5. Verify email notification arrives\n\n**Validate each stage:**\n\u2705 All 4 platform searches return results\n\u2705 Database checks work (duplicates prevented)\n\u2705 Post details fetched correctly\n\u2705 AI analysis runs without errors\n\u2705 Email formatted properly\n\n**Common issues:**\n- Missing access-token \u2192 Check all HTTP nodes\n- Database errors \u2192 Verify schema and connection\n- No email \u2192 Check Gmail OAuth and recipient"
      },
      "typeVersion": 1
    },
    {
      "id": "c53449ea-7e0f-42fd-b5ef-be1d1365dfb6",
      "name": "Cross-Platform Search",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        -432
      ],
      "parameters": {
        "color": 7,
        "width": 424,
        "height": 536,
        "content": "## 2. Cross-Platform Search Phase\n[AnySite.io Platform APIs](https://anysite.io/docs)\n\nParallel searches across:\n\u2022 **Reddit** - Posts and discussions\n\u2022 **LinkedIn** - Professional posts\n\u2022 **Instagram** - Visual content\n\u2022 **X/Twitter** - Real-time conversations\n\nEach platform search:\n- Uses AnySite.io optimized APIs\n- Returns top 2 most relevant posts\n- Includes metadata (author, timestamp, engagement)\n- Sorts by relevance for best matches\n\n\u26a1 All searches run in parallel for speed"
      },
      "typeVersion": 1
    },
    {
      "id": "f6b05865-e713-4be4-8804-084ed7c674bc",
      "name": "Deduplication Check",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -432
      ],
      "parameters": {
        "color": 7,
        "width": 472,
        "height": 520,
        "content": "## 3. Database Deduplication\n[PostgreSQL Integration](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.postgres/)\n\nFor each found post:\n\u2022 Checks if post_id exists in database\n\u2022 Prevents duplicate processing\n\u2022 Saves API calls and AI analysis costs\n\n**If post doesn't exist:**\n\u2192 Proceeds to Insert and Analysis\n\n**If post exists:**\n\u2192 Skips to next post\n\nThis ensures:\n- No duplicate alerts\n- Efficient resource usage\n- Clean historical data"
      },
      "typeVersion": 1
    },
    {
      "id": "22c9055f-d2c1-4295-b0d1-81ee4a6fd172",
      "name": "Data Extraction",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -432
      ],
      "parameters": {
        "color": 7,
        "width": 504,
        "height": 456,
        "content": "## 4. Platform-Specific Data Extraction\n[AnySite.io APIs](https://anysite.io)\n\nFor new posts, fetches complete data:\n\n**Reddit:**\n- Post details (title, author, score, timestamp)\n- All comments and replies\n\n**LinkedIn:**\n- Post content and engagement metrics\n- Comments and reactions\n\n**Updates database with:**\n- Full post text\n- Comment threads (as formatted strings)\n- Metadata for analysis\n\nThis rich context enables accurate AI sentiment analysis."
      },
      "typeVersion": 1
    },
    {
      "id": "512d331c-3530-4f53-b53a-484cc045909b",
      "name": "Setup Required - AI & Gmail",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        -528
      ],
      "parameters": {
        "color": 3,
        "width": 504,
        "height": 404,
        "content": "## \u26a0\ufe0f SETUP REQUIRED (3/3)\n\n**OpenAI Configuration:**\n- Add OpenAI API credentials\n- Recommended: GPT-4o for best results\n- Configure in \"OpenAI Chat Model\" node\n\n**Gmail Setup:**\n- Connect Gmail OAuth credentials\n- Configure recipient in \"Send a message in Gmail\" tool\n- Customize email template in AI Agent prompt\n\n**Test checklist:**\n\u2705 AnySite tokens work\n\u2705 Database connection active\n\u2705 AI Agent can query posts\n\u2705 Gmail sends notifications"
      },
      "typeVersion": 1
    },
    {
      "id": "c3acde67-cfe6-48a8-b550-9dcbe47a4c56",
      "name": "AI Analysis & Alerts",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 776,
        "height": 424,
        "content": "## 5. Intelligent Analysis & Notifications\n[AI Agent Documentation](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)\n\n**AI Agent with Tools:**\n1. **Get Posts Info** - Retrieves all new posts from database\n2. **GPT-4 Analysis** - Analyzes sentiment, urgency, context\n3. **Send Gmail** - Sends alerts for important mentions\n\nThe AI Agent autonomously:\n\u2022 Fetches unprocessed posts\n\u2022 Analyzes sentiment (positive/negative/neutral)\n\u2022 Identifies urgent issues or opportunities\n\u2022 Prioritizes alerts by importance\n\u2022 Sends formatted email summaries\n\n\ud83c\udfaf Customizable prompts for industry-specific insights"
      },
      "typeVersion": 1
    },
    {
      "id": "a8534447-9446-4cc0-b571-d3b3716636c6",
      "name": "Monitoring Best Practices",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        976
      ],
      "parameters": {
        "color": 5,
        "width": 680,
        "height": 320,
        "content": "## \ud83d\udcca Monitoring Best Practices\n\n**Keyword Strategy:**\n\u2022 Brand name + common variations\n\u2022 Product names and SKUs\n\u2022 Competitor mentions\n\u2022 Industry hashtags\n\u2022 Crisis-related terms\n\n**Alert Prioritization:**\n\ud83d\udd34 High Priority:\n- Negative sentiment + high engagement\n- Crisis keywords detected\n- Competitor comparisons\n\n\ud83d\udfe1 Medium Priority:\n- Questions from users\n- Feature requests\n- Neutral discussions\n\n\ud83d\udfe2 Low Priority:\n- Positive mentions\n- General discussions\n\n**Performance Tips:**\n- Monitor 5-10 core keywords\n- Adjust search count per platform\n- Archive old data periodically\n- Set up separate workflows for high-volume terms"
      },
      "typeVersion": 1
    },
    {
      "id": "89ec745b-cdc6-48c7-9fa9-db19b24528d9",
      "name": "Setup Required - AnySite",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        -944
      ],
      "parameters": {
        "color": 3,
        "width": 408,
        "height": 468,
        "content": "## \u26a0\ufe0f SETUP REQUIRED (1/3)\n\n**AnySite.io API Configuration**\n\nAll HTTP Request nodes need your access token:\n1. Find all nodes starting with \"AnySite...\"\n2. Open each node settings\n3. In Headers \u2192 access-token\n4. Replace with your actual token\n\n\ud83d\udcdd Nodes to update:\n- AnySite Search Reddit Posts\n- AnySite Search LinkedIn Posts\n- AnySite Search Instagram Posts\n- AnySite Search X Posts\n- AnySite Get Reddit Post\n- AnySite Get Reddit Post Comment\n- AnySite Get LinkedIn Post Comments\n\n[Get your API token at anysite.io](https://anysite.io/api-keys)"
      },
      "typeVersion": 1
    },
    {
      "id": "0c451224-8fed-4d31-a633-e7702b258232",
      "name": "Setup Required - Database",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -1472
      ],
      "parameters": {
        "color": 3,
        "width": 440,
        "height": 932,
        "content": "## \u26a0\ufe0f SETUP REQUIRED (2/3)\n\n**Data Tables Setup**\n\n#### \ud83d\udccb Brand Monitoring Words\n| Field | Type | Description |\n|-------|------|-------------|\n| `word` | string | Keyword or brand name to track |\n\n#### \ud83d\udcca Brand Monitoring Posts\n| Field | Type | Description |\n|-------|------|-------------|\n| `type` | string | Platform type (reddit, linkedin, x, instagram) |\n| `title` | string | Post title or caption |\n| `url` | string | Post URL |\n| `created_at` | string | Creation date/time |\n| `subreddit_id` | string | (Reddit only) Subreddit ID |\n| `subreddit_alias` | string | (Reddit only) Subreddit alias |\n| `subreddit_url` | string | (Reddit only) Subreddit URL |\n| `subreddit_description` | string | (Reddit only) Subreddit description |\n| `comment_count` | number | Number of comments |\n| `vote_count` | number | Votes, likes, or reactions count |\n| `subreddit_member_count` | number | (Reddit only) Subreddit member count |\n| `post_id` | string | Unique post identifier |\n| `text` | string | Post content text |\n| `comments` | string | Serialized comments (JSON string) |\n| `word` | string | Keyword that triggered capture |\n\n\nUpdate connection in nodes:\n- If post does not exist (checks)\n- Insert post nodes\n- Update post nodes\n- Get post_id for all new posts"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5c7235c1-3745-48c2-9e8b-0734cf64afe3",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Get post_id for all new posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert X post": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Get Posts Info": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get word's list": {
      "main": [
        [
          {
            "node": "AnySite Search Reddit Posts",
            "type": "main",
            "index": 0
          },
          {
            "node": "AnySite Search LinkedIn Posts",
            "type": "main",
            "index": 0
          },
          {
            "node": "AnySite Search Instagram Posts",
            "type": "main",
            "index": 0
          },
          {
            "node": "AnySite Search X Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get word's list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Update LN comments": {
      "main": [
        []
      ]
    },
    "Insert Reddit post ": {
      "main": [
        [
          {
            "node": "AnySite Get Reddit Post Comment",
            "type": "main",
            "index": 0
          },
          {
            "node": "AnySite Get Reddit Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Instagram post": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Insert LinkedIn post ": {
      "main": [
        [
          {
            "node": "AnySite Get LinkedIn Post Comments",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "AnySite Search X Posts": {
      "main": [
        [
          {
            "node": "If X post does not exist3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AnySite Get Reddit Post": {
      "main": [
        [
          {
            "node": "Update Reddit post details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "If X post does not exist3": {
      "main": [
        [
          {
            "node": "Insert X post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Reddit post details": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AnySite Search Reddit Posts": {
      "main": [
        [
          {
            "node": "If Reddit post does not exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Reddit post comments": {
      "main": [
        []
      ]
    },
    "AnySite Search LinkedIn Posts": {
      "main": [
        [
          {
            "node": "If LinkedIn post does not exist1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get post_id for all new posts": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Reddit post does not exist": {
      "main": [
        [
          {
            "node": "Insert Reddit post ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AnySite Search Instagram Posts": {
      "main": [
        [
          {
            "node": "If Instagram post does not exist2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert comments to the string": {
      "main": [
        [
          {
            "node": "Update Reddit post comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AnySite Get Reddit Post Comment": {
      "main": [
        [
          {
            "node": "Convert comments to the string",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If LinkedIn post does not exist1": {
      "main": [
        [
          {
            "node": "Insert LinkedIn post ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert LN comments to the string": {
      "main": [
        [
          {
            "node": "Update LN comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Instagram post does not exist2": {
      "main": [
        [
          {
            "node": "Insert Instagram post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AnySite Get LinkedIn Post Comments": {
      "main": [
        [
          {
            "node": "Convert LN comments to the string",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get word's list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}