8
n8n 中文网amn8n.com

使用 Apify 和 GPT-4.1 从 Skool 社区发现互动机会

高级

这是一个Social Media, AI Summarization领域的自动化工作流,包含 18 个节点。主要使用 Set, Filter, Airtable, SplitOut, HttpRequest 等节点。 通过 Apify 和 GPT-4.1 从 Skool 社区发现互动机会

前置要求
  • Airtable API Key
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "638c66f7dba65e767f3bbdca0571085c3b0f378be7062f284b8b1840b332ce48",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "bfc28649-af1b-4dcc-ace6-31e631b04a93",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -288
      ],
      "parameters": {
        "color": 4,
        "width": 256,
        "height": 432,
        "content": "## 从选定社区获取帖子+评论"
      },
      "typeVersion": 1
    },
    {
      "id": "93cf8510-9bd8-4c8f-8398-f6f42727d27b",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1144,
        -288
      ],
      "parameters": {
        "color": 5,
        "height": 432,
        "content": "## 提取数据"
      },
      "typeVersion": 1
    },
    {
      "id": "c3645f17-79b4-4b40-9a34-af6fd7c8c632",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1472,
        208
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "pYrY40uieQQ0KNHA",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "43f6566d-ab87-48f1-880b-8e1239fa9d41",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1600,
        208
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"opportunity\": true,\n  \"reason\": \"The user is overwhelmed managing manual booking and lead response, which can be easily automated.\",\n  \"trigger_sentence\": \"I can't keep up with replying to all DMs and booking calls manually.\",\n  \"suggested_comment\": \"I totally get that—juggling messages and scheduling is exhausting. Have you looked into using automation tools to streamline that flow?\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "6e740eaf-7448-4f32-b84c-60670caff939",
      "name": "获取配置",
      "type": "n8n-nodes-base.airtable",
      "position": [
        96,
        -16
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appImGQn0rh53oCPE",
          "cachedResultUrl": "https://airtable.com/appImGQn0rh53oCPE",
          "cachedResultName": "Skool comments"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblfSVVKzXJxrOXEY",
          "cachedResultUrl": "https://airtable.com/appImGQn0rh53oCPE/tblfSVVKzXJxrOXEY",
          "cachedResultName": "config"
        },
        "options": {},
        "operation": "search"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "9uiZQNs5rb3wcFIX",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "bfa95924-c9fa-434f-9371-b7517cf3eaad",
      "name": "提取配置",
      "type": "n8n-nodes-base.set",
      "position": [
        544,
        -16
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4db9375d-ca80-4421-8025-145ddabc2ba0",
              "name": "Skool URLs",
              "type": "array",
              "value": "={{ $json['Skool URLs'].split(',').map(item => ({\n\"url\": item.replaceAll(\"\\n\",\"\").trim(),\n})) }}"
            },
            {
              "id": "97bd58cf-83b1-4ff2-bcb0-5ba6a912d26d",
              "name": "cookies",
              "type": "string",
              "value": "={{ $json.cookies.replaceAll(\"\\n\",\"\").trim() }}"
            },
            {
              "id": "b41ff8da-e638-4b21-84e0-2526ce143489",
              "name": "Domain of Activity",
              "type": "string",
              "value": "={{ $json['Domain of Activity'] }}"
            },
            {
              "id": "caf22e0b-acbc-4bfb-9be5-0102f49c10d6",
              "name": "Tools Used",
              "type": "string",
              "value": "={{ $json['Tools Used'] }}"
            },
            {
              "id": "0acc3cc2-80cf-421d-b67a-898d0d4e1f11",
              "name": "Name",
              "type": "string",
              "value": "={{ $json.Name }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "62ffe1f8-383f-4fc1-952f-fc5a0d7c4bc8",
      "name": "获取Skool帖子",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        992,
        -16
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/memo23~skool-posts-with-comments-scraper/run-sync-get-dataset-items",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"commentsLimit\": 20,\n    \"cookies\":{{ $json.cookies }}\n    \"includeComments\": true,\n    \"includeMedia\": false,\n    \"itemStartDate\": \"{{$now.minus(24,'hours')}}\",\n    \"proxy\": {\n        \"useApifyProxy\": true\n    },\n   \"startUrls\": [\n       { \n        \"url\":\"{{ $json['Skool URLs'].url }}\"\n        }\n    ],\n    \"tab\": \"community\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "c6JAh6mPlHzGRyan",
          "name": "apify 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "af39e0d1-8151-4eae-bfa3-e5f62114d1c7",
      "name": "提取帖子数据",
      "type": "n8n-nodes-base.set",
      "position": [
        1216,
        -16
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ab379ef2-7aa7-46f3-943b-134f29a192b4",
              "name": "name",
              "type": "string",
              "value": "={{ $json.name }}"
            },
            {
              "id": "7fa6eb26-75de-48e4-abda-82c2045e3592",
              "name": "content",
              "type": "string",
              "value": "={{ $json.metadata.content }}"
            },
            {
              "id": "97e3e1e9-2378-4caf-b8e7-301675b11518",
              "name": "comments",
              "type": "array",
              "value": "={{ $json.comments.map(item => item.post.metadata.content).filter(item => item.length>50) }}"
            },
            {
              "id": "ff6a31c4-a656-4612-9f25-4aebf8441224",
              "name": "likes",
              "type": "number",
              "value": "={{ $json.metadata.upvotes }}"
            },
            {
              "id": "f1e2cc9e-58e4-4d4e-979d-271a86a07df8",
              "name": "createdAt",
              "type": "string",
              "value": "={{ $json.createdAt }}"
            },
            {
              "id": "b3a98244-7117-42e4-b704-c24df45b3192",
              "name": "postType",
              "type": "string",
              "value": "={{ $json.postType }}"
            },
            {
              "id": "f9d85eb1-5764-437b-8ed2-89665ab6738d",
              "name": "url",
              "type": "string",
              "value": "={{ $json.url }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "282cd9dd-889e-44c9-a803-83346096a180",
      "name": "评估机会并生成评论",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1440,
        -16
      ],
      "parameters": {
        "text": "=Post content: {{ $json.content }}\nComments: {{ $json.comments }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "type": "AIMessagePromptTemplate",
              "message": "=user_domain:{{ $('Extract Config').first().json['Domain of Activity'] }}\nuser_tool: {{ $('Extract Config').first().json['Tools Used'] }}\n\n\n🧑‍💼 Role\nAct as a stealth engagement strategist who identifies precise opportunities to insert insightful, helpful comments into Skool posts and comments. Your contributions subtly demonstrate expertise in {user_domain} without explicitly promoting your own community or product.\n\n🎯 Task\nAnalyze a post or comment and determine whether it offers a relevant opportunity to engage with a valuable, helpful comment related to {user_domain}. Return the result as JSON.\n\n📌 Specifics\nOutput must follow this JSON schema:\n\njson\nCopy\nEdit\n{\n  \"opportunity\": true | false,\n  \"reason\": \"why this is or isn't a fit for {user_domain} support\",\n  \"trigger_sentence\": \"exact phrase or sentence from the post/comment indicating need\",\n  \"suggested_comment\": \"only include this if opportunity is true, respond in the same language as the original post\"\n}\nThink like a value-driven expert spotting inefficiencies or challenges where {user_domain} could help.\n\nAlways suggest {user_tool} if a tool is mentioned.\nHelping here could spark a valuable connection. Respond with heart and clarity.\n\nDo not promote yourself or your community directly. Be insightful, curious, and helpful.\n\n🌍 Context\nYou are using this automation to grow visibility by helping users who express challenges or frustrations that {user_domain} can solve. Your smart, relevant comments will inspire profile visits and interest in your expertise—organically and trust-based.\n\n🧪 Examples\n✅ Opportunity Exists\njson\nCopy\nEdit\n{\n  \"opportunity\": true,\n  \"reason\": \"The user is overwhelmed managing manual tasks, which can be streamlined using {user_tool}.\",\n  \"trigger_sentence\": \"I can't keep up with replying to all DMs and booking calls manually.\",\n  \"suggested_comment\": \"I totally get that—juggling messages and scheduling is exhausting. You might want to try using a tool like user_tool}} to automate that flow and save hours each week.\"\n}\n❌ No Opportunity\njson\nCopy\nEdit\n{\n  \"opportunity\": false,\n  \"reason\": \"The post is purely motivational with no mention of workflows, tools, or pain points that {user_domain} could solve.\",\n  \"trigger_sentence\": \"Just stay consistent and the results will come!\"\n}\n📝 Notes\nTranslate suggested_comment to match the post’s original language.\n\nBe helpful, not salesy.\n\nIf a tool is mentioned, always recommend {user_tool}.\n\nIf there's no clear problem or inefficiency, set \"opportunity\": false.\n\n"
            },
            {
              "message": "You're an engagement strategist"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "0448f716-a891-4677-97f7-7339b4625c84",
      "name": "合并AI回答与提取数据",
      "type": "n8n-nodes-base.set",
      "position": [
        1840,
        -16
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fea627fd-6fed-4913-8297-566326e5df1d",
              "name": "opportunity",
              "type": "boolean",
              "value": "={{ $json.output.opportunity }}"
            },
            {
              "id": "e11d151c-63ea-4096-a95e-c2029d9b398b",
              "name": "reason",
              "type": "string",
              "value": "={{ $json.output.reason }}"
            },
            {
              "id": "8bcdfa3b-1b6e-4fa9-9276-9764b9d40391",
              "name": "trigger_sentence",
              "type": "string",
              "value": "={{ $json.output.trigger_sentence }}"
            },
            {
              "id": "75353e12-7795-420d-ac3e-2acbbe6c6fbe",
              "name": "suggested_comment",
              "type": "string",
              "value": "={{ $json.output.suggested_comment }}"
            },
            {
              "id": "be81a3ae-ebe0-48f2-b329-0f0e64141cb9",
              "name": "name",
              "type": "string",
              "value": "={{ $('Extract Post Data').item.json.name }}"
            },
            {
              "id": "05983218-c090-45e2-8d30-5d2be725b350",
              "name": "createdAt",
              "type": "string",
              "value": "={{ $('Extract Post Data').item.json.createdAt }}"
            },
            {
              "id": "74815fe9-f761-4496-913a-b757042a80b7",
              "name": "url",
              "type": "string",
              "value": "={{ $('Extract Post Data').item.json.url }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6546a6b7-d53e-40b8-ac21-1e90d65b3b13",
      "name": "筛选评论机会",
      "type": "n8n-nodes-base.filter",
      "position": [
        2064,
        -16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "2a0b06dd-f7c0-412e-916a-f8fe89b1f97e",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.opportunity }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "211d371b-1193-4920-b35e-e7f610df7cb1",
      "name": "记录结果",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2288,
        -16
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appImGQn0rh53oCPE",
          "cachedResultUrl": "https://airtable.com/appImGQn0rh53oCPE",
          "cachedResultName": "Skool comments"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblkB1UJ5dihXvDoi",
          "cachedResultUrl": "https://airtable.com/appImGQn0rh53oCPE/tblkB1UJ5dihXvDoi",
          "cachedResultName": "Table 1"
        },
        "columns": {
          "value": {
            "url": "={{ $json.url }}",
            "date": "={{ $now }}",
            "title": "={{ $json.name }}",
            "config": "=[\"{{ $('Extract Config').first().json.Name }}\"]",
            "reason": "={{ $json.reason }}",
            "trigger": "={{ $json.trigger_sentence }}",
            "suggested answer": "={{ $json.suggested_comment }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reason",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "trigger",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "trigger",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "suggested answer",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "suggested answer",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Select",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "not commented",
                  "value": "not commented"
                },
                {
                  "name": "commented",
                  "value": "commented"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Select",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "config",
              "type": "array",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "config",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "title"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "upsert"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "9uiZQNs5rb3wcFIX",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f884d6b6-d2a7-4645-aa76-8165aeb17331",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        -288
      ],
      "parameters": {
        "width": 1072,
        "height": 432,
        "content": "## 获取配置"
      },
      "typeVersion": 1
    },
    {
      "id": "b38546ec-218e-4cb6-9e58-19d4435c6aee",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        -288
      ],
      "parameters": {
        "color": 3,
        "width": 816,
        "height": 432,
        "content": "## 使用AI分析帖子"
      },
      "typeVersion": 1
    },
    {
      "id": "f7d2a5ab-41d3-4ce4-b0c7-06489b81c5b3",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -128,
        -16
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 19
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c23eb77f-60e4-4f0e-b37d-19d1db708566",
      "name": "拆分输出1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        768,
        -16
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "Skool URLs"
      },
      "typeVersion": 1
    },
    {
      "id": "a622f65e-ca43-4a1e-9fcd-5456b61485ca",
      "name": "是否活跃?",
      "type": "n8n-nodes-base.filter",
      "position": [
        320,
        -16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "95a95eba-ab46-481c-8754-8c6c8b75df5a",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.active }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "80e966f3-06e9-47e3-9e72-e09e6923162e",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -528
      ],
      "parameters": {
        "color": 4,
        "content": "## Airtable模板"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Get Config": {
      "main": [
        [
          {
            "node": "Is Active?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Active?": {
      "main": [
        [
          {
            "node": "Extract Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out1": {
      "main": [
        [
          {
            "node": "Get Skool Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Config": {
      "main": [
        [
          {
            "node": "Split Out1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Record Results": {
      "main": [
        []
      ]
    },
    "Get Skool Posts": {
      "main": [
        [
          {
            "node": "Extract Post Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Post Data": {
      "main": [
        [
          {
            "node": "EvaluateOpportunities And Generate Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "EvaluateOpportunities And Generate Comments",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "EvaluateOpportunities And Generate Comments",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Filter Opportunities To Comment": {
      "main": [
        [
          {
            "node": "Record Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge AI Answers With Extracted Data": {
      "main": [
        [
          {
            "node": "Filter Opportunities To Comment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EvaluateOpportunities And Generate Comments": {
      "main": [
        [
          {
            "node": "Merge AI Answers With Extracted Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 社交媒体, AI 摘要总结

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量18
分类2
节点类型10
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

外部链接
在 n8n.io 查看

分享此工作流