{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "bc7eb54d-c1bc-4fa7-923d-8799ed128746",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2448,
        720
      ],
      "parameters": {
        "color": 7,
        "width": 920,
        "height": 300,
        "content": "## 2. Research & Insights\nAggregates the scraped data and uses AI to identify recurring problems, generating strategic insights on how to best solve them for the community."
      },
      "typeVersion": 1
    },
    {
      "id": "3c0d8124-121b-4d40-88c3-39aecb092b3c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3104,
        720
      ],
      "parameters": {
        "color": 7,
        "width": 656,
        "height": 304,
        "content": "## 1. Scrape Groups\nRetrieves the list of target Facebook groups from your Google Sheet and triggers the Apify actor to gather the latest user discussions and posts."
      },
      "typeVersion": 1
    },
    {
      "id": "fc971aa2-88d2-4f10-8888-e98ca0a61959",
      "name": "Think1",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -1376,
        1072
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "88993376-07bc-4d2b-8b39-2df337e68643",
      "name": "writer",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "onError": "continueRegularOutput",
      "position": [
        -1456,
        848
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "GPT-4.1"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Write a value packed FB Group Post specificaly for the FB Group:{{ $('Fetch Your FB Groups List').item.json['Group Name'] }} , group niche:{{ $('Fetch Your FB Groups List').item.json['Group Niche'] }}, using the following analysis below. Adhere to the groups grammar, language, tone, style, if any was provided. Avoid general tips by giving specific, real and effective plans including time frames, dates, numbers. \n\n {{ $json.message.content }}\n\nYou MUST output your response in json format usingthe following schema below:\n###\n[\n  {\n    \"problem\": \"Managing time with multiple client projects\",\n    \"solution_summary\": \"Used a simple calendar batching method and Trello to keep tasks organized.\",\n    \"post_variation_1\": \"Hi everyone\u2014just wanted to share something I\u2019ve run into recently. I was having a tough time with keeping track of multiple client projects, and I saw a few others mention the same thing. After trying a bunch of stuff, here\u2019s what finally worked for me (and didn\u2019t break the bank): Started using calendar batching and Trello boards to organize my tasks. Hope this saves someone a headache! If you have other ways to tackle this, I\u2019d love to hear them.\",\n    \"post_variation_2\": \"Hey folks, Noticed a lot of questions lately about juggling multiple client projects. Thought I\u2019d drop what\u2019s worked for me: I batch my calendar and use Trello for each client\u2019s to-dos. Has anyone tried something different? Curious what\u2019s working for others. Hope this helps a few of you out!\"\n  }\n]"
            },
            {
              "role": "system",
              "content": "=LLM Agent Instructions \u2013 Creating Organic, Problem-Solving Community Posts tailered for the specific community group.\n\n1. You are a well learned memeber of the group.\n2. For each problem you select, summarize a practical solution. Make it real, affordable, and easy to follow. If possible, refer to specific tools or specific strategies that suit the community.\n3. Use the same style, tone, grammar, and language that group members use in their posts. Your message should sound like it came from a peer in the {{ $('Fetch Your FB Groups List').item.json['Group Name'] }} group.\n\n4. Write a helpful post that feels like a genuine conversation from an insider of the group as that is what you are. Make sure the advice is clear and not promotional. Avoid asking for anything in return or sounding salesy.\n\n\nFor each chosen problem, create two different post variations using just the format of the templates below\n\nUse the think tool if you need to help you when its hard to make a decision.\n\n\"Variation 1 \u2013 \u201cPersonal Journey\u201d\nHi everyone\u2014just wanted to share something I\u2019ve run into recently. I was having a tough time with [problem], and I saw a few others mention the same thing.\nAfter trying a bunch of stuff, here\u2019s what finally worked for me (and didn\u2019t break the bank):\n\n[Step 1]\n[Resource or tool if any]\n[Step 2] Hope this saves someone a headache! If you have other ways to tackle this, I\u2019d love to hear them.\"\"\n\n\"Variation 2 \u2013 \u201cQuick Tip/Community Sharing\u201d\nHey folks,\nNoticed a lot of questions lately about [problem/topic]. Thought I\u2019d drop what\u2019s worked for me:\n\n[Quick tip or workaround]\n[Link or tool if needed] Has anyone tried something different? Curious what\u2019s working for others. Hope this helps a few of you out!\"\n\n\nGuidelines:\n\nMake sure your posts are friendly, helpful, and practical.\nStick to the group\u2019s usual way of talking as per the user prompt.\nDo not include promotional links or sales tactics.\nWrite as a group member helping others, not as an expert or marketer.\nProvide two post versions for each selected problem.\nUse bullet formatting when possible to help create clarity in your posts.\n\nOutput using the following schema below:\n###\n[\n  {\n    \"problem\": \"Managing time with multiple client projects\",\n    \"solution_summary\": \"Used a simple calendar batching method and Trello to keep tasks organized.\",\n    \"post_variation_1\": \"Hi everyone\u2014just wanted to share something I\u2019ve run into recently. I was having a tough time with keeping track of multiple client projects, and I saw a few others mention the same thing. After trying a bunch of stuff, here\u2019s what finally worked for me (and didn\u2019t break the bank): Started using calendar batching and Trello boards to organize my tasks. Hope this saves someone a headache! If you have other ways to tackle this, I\u2019d love to hear them.\",\n    \"post_variation_2\": \"Hey folks, Noticed a lot of questions lately about juggling multiple client projects. Thought I\u2019d drop what\u2019s worked for me: I batch my calendar and use Trello for each client\u2019s to-dos. Has anyone tried something different? Curious what\u2019s working for others. Hope this helps a few of you out!\"\n  }\n]"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "42756614-eaaf-41a6-b431-776f28100969",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -2304,
        1072
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4c3c64ea-43ea-4fa0-8ed3-da2eed7394b4",
      "name": "Think2",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -1728,
        1072
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4e413069-2f0f-48e5-99c7-c298f313b0b8",
      "name": "Community Insight Agent",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -1808,
        848
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "o3-mini",
          "cachedResultName": "O3-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Below are summaries of several posts from the Facebook group. only consider the content<content field:\n\n{{ $json.content }}\n\nPlease analyze these post summaries by following these steps:\n\nList the main topics that are being discussed in the summaries.\n\nFind the challenges or pain points that come up more than once, and group similar ones together.\n\nWrite down any solutions, tips, or tools that group members often suggest.\n\nNote any unique language, key phrases, or acronyms that the group uses.\n\nFor each main pain point you found, assign it to one or more of these categories if it fits:\nMinimal lead generation\nFounder overwhelm\nChaotic project management\nIneffective sales processes\nReliance on referrals for new business\nLack of a clear offer\nUnclear messaging\nInefficient or costly operations\nOutdated or ineffective software\nPoor client retention\n\n\nFormat your answer like this:\n\nMain 2 topics discussed:\nTop recurring group pain points:\nMost recommended solutions, if any:\nCommon group language and acronyms:\nMapping of pain points to business categories:\n\n\n"
            },
            {
              "role": "system",
              "content": "=You are an AI assistant focused on community insight and problem identification for online groups. Your task is to analyze a collection of post summaries from a Facebook group to identify group-wide pain points, main discussion topics, and preferred solutions\u2014not individual issues. You will synthesize these insights, map recurring pain points to common business problem categories, and note unique language, acronyms, or expressions used within the group. Your output should be concise, clearly organized by theme, and suitable for use in further group engagement or reporting. "
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "09885648-76a2-4403-8037-229efdecaa87",
      "name": "Problem Analyzer",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "onError": "continueRegularOutput",
      "position": [
        -2384,
        848
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "o3-mini",
          "cachedResultName": "O3-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "=Problem Identifier Agent Prompt\n\n\nWHAT YOU MUST DELIVER:\nA. TOP PROBLEM LIST (ranked)  \nB. SUPPORTING EVIDENCE (likes and comments count)  \nC. LANGUAGE BANK (keywords, acronyms, insider phrases)  \nD. AUDIENCE SNAPSHOT (who is speaking, inferred goals, emotional tone)  \nE. CATEGORY MAP (match each problem to one of 10 master business-problem categories)\n\nDETAILED INSTRUCTIONS:\n1. Read all content in these posts thoroughly.  \n2. Identify candidate problems whenever a member expresses frustration, asks \u201chow do I\u2026?\u201d, vents, or repeats a struggle.  \n3. Answer these key questions to guide your research:  \n   - What topics are people discussing?  \n   - What challenges are they encountering?  \n   - What solutions do they prefer?  \n   - What specific language, acronyms, or key phrases do they use?  \n4. Consolidate duplicates, keeping the member\u2019s original phrasing as evidence.  \n5. Rank problems based on:  \n   - Frequency (appears in many threads)  \n   - Intensity (strong emotion, urgent language)  \n   - Monetizability (can a paid solution reasonably solve it?)  \n6. Map each problem to one or more of these master categories:  \n   - 01-Lead_Generation  \n   - 02-Founder_Overwhelm  \n   - 03-Project_Chaos  \n   - 04-Sales_Process  \n   - 05-Referral_Dependency  \n   - 06-No_Offer  \n   - 07-Unclear_Messaging  \n   - 08-Messy_Ops  \n   - 09-Bad_Software  \n   - 10-Client_Retention  \n7. Extract buzzwords, abbreviations, memes, inside jokes, and tools mentioned.  \n8. Build an Audience Snapshot, including:  \n   - Titles, company stages, revenue clues  \n   - Mindset (stressed, hopeful, burnt-out)  \n   - Dominant desires  \n\n\nQUALITY BAR:\n- Use members\u2019 exact words for problems (short direct quotes).  \n- Avoid generic statements; every item must refer to an actual conversation.  \n-Use the think to to help you when you need to make hard decisions.\n- Ensure the Language Bank covers at least 90% of recurring jargon.  \n- Complete and accurate Category Map.  \n- Post Hints should feel native to the group (e.g., informal/formal tone, emoji usage).  \n- Do not invent information\u2014only include what is present in the text."
            },
            {
              "content": "=Analyze the following FB Group posts\nGroup Title: {{ $('Fetch Your FB Groups List').item.json['Group Name'] }}\nPost Date:  {{ $json.post_date }}\nPost Text: {{ $json.caption }}\nUser name: {{ $json.user_details.name }}\nLikes Count: {{ $json.total_reaction.Like }}\nComments count: {{ $json.total_comment_count }}\nTop Comment Text 1, if any, for refrence: {{ $json.top_comments[1].comment_text }}\nTop Comment Text 0, if any, for refrence: {{ $json.top_comments[0].comment_text }}\n\nOutput your summary, with date of post and like count\n\n"
            },
            {
              "role": "assistant",
              "content": "You are the Problem-Identifier. Your goal is to convert raw Facebook-group posts in the user prompts into a clear, organized list of the most painful, monetizable business problems members are actively discussing. Your output must be concise and actionable so the \u201cWriter\u201d agent can create high-value posts that address these issues and attract leads.\n"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "b3d9e178-f87c-431c-b221-7805fb9b9cbc",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2640,
        224
      ],
      "parameters": {
        "width": 1104,
        "height": 448,
        "content": "# \ud83e\udde0 FB Group Problem Solver\n\nThis workflow automates the process of finding what your audience is struggling with and writing helpful content to solve those problems.\n\n### How it works\n1. **Scrape:** It reads Facebook Group links from your Google Sheet and uses Apify to scrape the latest posts.\n2. **Analyze:** AI agents analyze the posts to identify common user pain points and struggles.\n3. **Insight:** A \"Community Insight\" agent determines the best way to add value and solve these specific problems.\n4. **Draft:** The Writer agent creates a ready-to-post solution and saves it back to your Google Sheet.\n\n### Setup steps\n1. **Google Sheet:** Create a sheet with columns for `Group URL` and `Group Name`. Link this sheet in the \"Fetch Your FB Groups\" and \"Save Content\" nodes.\n2. **Apify:** Set up the \"Facebook Groups Scraper\" actor in Apify. Connect your credentials in the \"Scrape Latest Group Posts\" node.\n3. **OpenAI:** Add your API key to the three AI nodes (Analyzer, Insight Agent, Writer).\n4. **Customize:** Open the \"Writer\" node system prompt to adjust the tone of voice to match your personal brand.\n\nHappy Money Making\nNeal J., CTK Industries | https://www.linkedin.com/in/nealjmcleod/"
      },
      "typeVersion": 1
    },
    {
      "id": "9f707f28-d87e-4c8f-b7d5-f007b5394242",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        720
      ],
      "parameters": {
        "color": 7,
        "width": 616,
        "height": 300,
        "content": "## 3. Draft & Save\nTakes the research insights and generates a high-value Facebook post tailored to your niche, then saves the draft to your Google Sheet."
      },
      "typeVersion": 1
    },
    {
      "id": "fac7420c-d8df-4994-8814-b39101e17d79",
      "name": "Start Mining FB Groups",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -3056,
        848
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2a09a25b-101f-4b43-8a25-5a455e464fec",
      "name": "Fetch Your FB Groups List",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2832,
        848
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 203420999,
          "cachedResultUrl": "https://docs.google.YOUR_AWS_SECRET_KEY_HERE_AEHmIntN10pWrc7bqlItG0/edit#gid=203420999",
          "cachedResultName": "Communities"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Hi0935QTdc8th2XZa97S_AEHmIntN10pWrc7bqlItG0",
          "cachedResultUrl": "https://docs.google.YOUR_AWS_SECRET_KEY_HERE_AEHmIntN10pWrc7bqlItG0/edit?usp=drivesdk",
          "cachedResultName": "Automated FB Communities"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "99663a92-4f24-4675-8616-5e514a07ca8b",
      "name": "Scrape Latest Group Posts",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        -2608,
        848
      ],
      "parameters": {
        "actorId": {
          "__rl": true,
          "mode": "id",
          "value": "=Enter the Apify Facebook Scraper iD here"
        },
        "timeout": {},
        "operation": "Run actor and get dataset"
      },
      "typeVersion": 1
    },
    {
      "id": "747702f5-f0c3-4f11-adbb-3fccda8f997a",
      "name": "Bundle All Problems Together",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -2032,
        848
      ],
      "parameters": {
        "options": {
          "mergeLists": true
        },
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "renameField": true,
              "outputFieldName": "content",
              "fieldToAggregate": "message"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5bc17cde-d920-4d54-aafb-5aea813a2bde",
      "name": "Save Your Ready-to-Post Content",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1104,
        848
      ],
      "parameters": {
        "columns": {
          "value": {
            "Problem": "={{ $json.message.content.results[0].problem }}",
            "Date created": "={{ $now.format('yyyy-MM-dd') }}",
            "Post Variation 1": "={{ $json.message.content.results[0].post_variation_1 }}",
            "Post Variation 2": "={{ $json.message.content.results[0].post_variation_2 }}",
            "Solution Summary": "={{ $json.message.content.results[0].solution_summary }}"
          },
          "schema": [
            {
              "id": "Problem",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Problem",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Solution Summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Solution Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Post Variation 1",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Post Variation 1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Post Variation 2",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Post Variation 2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date created",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Date created",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date Posted",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Date Posted",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 684863732,
          "cachedResultUrl": "https://docs.google.YOUR_AWS_SECRET_KEY_HERE_AEHmIntN10pWrc7bqlItG0/edit#gid=684863732",
          "cachedResultName": "High Ticket Coacing"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Hi0935QTdc8th2XZa97S_AEHmIntN10pWrc7bqlItG0",
          "cachedResultUrl": "https://docs.google.YOUR_AWS_SECRET_KEY_HERE_AEHmIntN10pWrc7bqlItG0/edit?usp=drivesdk",
          "cachedResultName": "Automated FB Communities"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    }
  ],
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "Problem Analyzer",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Think1": {
      "ai_tool": [
        [
          {
            "node": "writer",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Think2": {
      "ai_tool": [
        [
          {
            "node": "Community Insight Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "writer": {
      "main": [
        [
          {
            "node": "Save Your Ready-to-Post Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Problem Analyzer": {
      "main": [
        [
          {
            "node": "Bundle All Problems Together",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Mining FB Groups": {
      "main": [
        [
          {
            "node": "Fetch Your FB Groups List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Community Insight Agent": {
      "main": [
        [
          {
            "node": "writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Your FB Groups List": {
      "main": [
        [
          {
            "node": "Scrape Latest Group Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Latest Group Posts": {
      "main": [
        [
          {
            "node": "Problem Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bundle All Problems Together": {
      "main": [
        [
          {
            "node": "Community Insight Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}