8
n8n 中文网amn8n.com

从 Reddit 帖子中寻找热门的 LinkedIn 帖子创意

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 21 个节点。主要使用 Set, Merge, Filter, Reddit, Aggregate 等节点。 使用 GPT-4o 和 Google Sheets 将 Reddit 讨论转换为 LinkedIn 帖子创意

前置要求
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "etfXGaxuiLBSiZ2M",
  "meta": {
    "instanceId": "fbf1ec16a63dada018a910f6d4b03285e60de303ab56ff5a3e3ea4e53751d505",
    "templateId": "2978",
    "templateCredsSetupCompleted": true
  },
  "name": "从 Reddit 帖子中寻找热门的 LinkedIn 帖子创意",
  "tags": [],
  "nodes": [
    {
      "id": "e9a000b6-2f35-4928-a8d8-aa2d8cc27513",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1620,
        -1200
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "HRU1sZBC51I4yup5",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f78fbea9-5f7f-4a88-bde1-7c3f01613892",
      "name": "输出结果",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3480,
        -340
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "fgf",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "fgf",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Post Content",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Post Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Comments",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Comments",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Insights",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Insights",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Linkedin post ideas",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Linkedin post ideas",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "fgf"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Create spreadsheet').item.json.spreadsheetUrl }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "YCan8DcqSC2Ddj8Y",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "72b30080-e1f2-48b4-b816-ff43542cc6f1",
      "name": "获取帖子",
      "type": "n8n-nodes-base.reddit",
      "position": [
        -320,
        -680
      ],
      "parameters": {
        "keyword": "={{ $('On form submission').item.json['What to search for in the subreddit'] }}",
        "operation": "search",
        "subreddit": "={{ $('On form submission').item.json.Subreddit }}",
        "additionalFields": {}
      },
      "credentials": {
        "redditOAuth2Api": {
          "id": "7McJuaq5X8fijYkQ",
          "name": "Reddit account 2"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e0729fbb-c530-46da-b8af-e4685d415dd9",
      "name": "获取帖子中的多条评论",
      "type": "n8n-nodes-base.reddit",
      "position": [
        340,
        -760
      ],
      "parameters": {
        "postId": "={{ $json.id }}",
        "resource": "postComment",
        "operation": "getAll",
        "subreddit": "={{ $json.subreddit }}"
      },
      "credentials": {
        "redditOAuth2Api": {
          "id": "7McJuaq5X8fijYkQ",
          "name": "Reddit account 2"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4c00ccd3-a984-4136-a1d1-21c2b61c53ba",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        100,
        -760
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3,
      "alwaysOutputData": true
    },
    {
      "id": "00d17970-3195-4290-bb02-9956f31ecc8f",
      "name": "建议帖子主题",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2480,
        -740
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=You are a senior LinkedIn content strategist.\n\n### Input  \nAnalysisMarkdown: |\n {{ $json.output }}\n\n### Tasks  \n1. **Extract Insights**  \n   • Parse the supplied Markdown to understand the central theme, five pains, and the synthesis section.  \n   • Identify which pains or angles will resonate most with a professional (B2B / SaaS / tech) audience.\n\n2. **Generate Post Topics**  \n   • Propose **3–5 distinct LinkedIn post topics** that tackle the most compelling pains or insights.  \n   • Vary the angles (e.g., tactical advice, thought-leadership, myth-busting, data-driven take).\n\n3. **Outline Key Points**  \n   For **each** topic provide:  \n   • **Headline** – ≤ 70 characters, designed to stop the scroll.  \n   • **Key Points** – 3–4 concise bullets (≤ 25 words each) covering what the post should include.  \n   • **Hook** – 1-sentence opener to grab attention (≤ 30 words).  \n   • **CTA** – 1-sentence question or prompt that invites comments.\n\n### Output (Markdown)"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "HRU1sZBC51I4yup5",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "aa7f4cd0-c9dd-42c4-8b93-ebac8aa1598d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2420,
        -940
      ],
      "parameters": {
        "width": 840,
        "height": 720,
        "content": "# 生成帖子创意"
      },
      "typeVersion": 1
    },
    {
      "id": "1a99fdaa-6857-4210-a695-71ce531c1fa0",
      "name": "生成洞察分析",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1620,
        -1360
      ],
      "parameters": {
        "text": "=You are an expert content analyst.\n\n### Input\nPostContent: |\n  {{ $json.postContent }}\n\nCommentContentJSON: |\n  {{ $json.commentText }}\n\n### Tasks\n1. **Central Theme**  \n   Summarize the main topic or question driving the discussion (≤ 30 words).\n\n2. **Pain-Point Extraction**  \n   • Scan the post and comments for frustrations, blockers, or unmet needs.  \n   • List **exactly five** pains, ordered by frequency.  \n   • For each pain, add a short supporting quote (≤ 20 words).\n\n3. **Insight Synthesis**  \n   • Write a 150–200 word narrative capturing consensus, disagreements, surprising angles, data points, or anecdotes.  \n   • Tag the overall sentiment (e.g., “optimistic”, “skeptical”, “frustrated”).\n\n4. **LinkedIn Opportunity**  \n   • Propose one punchy LinkedIn post title (≤ 70 characters) that tackles the top pain.  \n   • Give three concise bullet points to cover (each ≤ 25 words).  \n   • Suggest a one-sentence CTA to spark discussion.\n\n5. **Relevance Check**  \n   Explain in ≤ 40 words why this topic matters right now to B2B / SaaS / tech professionals.\n\n### Output (strict Markdown)\n\n## Central Theme\n<central theme>\n\n## Pain Points\n1. **<pain #1>**  \n   - Quote: “<quote>”\n2. **<pain #2>**  \n   - Quote: “<quote>”\n3. **<pain #3>**  \n   - Quote: “<quote>”\n4. **<pain #4>**  \n   - Quote: “<quote>”\n5. **<pain #5>**  \n   - Quote: “<quote>”\n\n## Insights\n<150–200 word synthesis paragraph>\n\n## LinkedIn Angle\n**Headline:** <LinkedIn title>\n\n- <bullet 1>  \n- <bullet 2>  \n- <bullet 3>\n\n**CTA:** <call to action>\n\n## Relevance\n<why it’s timely>\n\n### Constraints\n* Use **only** the supplied text—no external knowledge.  \n* Keep quotes verbatim but truncate with “…” if needed.  \n* Preserve anonymity (no usernames).  \n* Follow the exact Markdown structure above—no extra sections or commentary.",
        "agent": "conversationalAgent",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "1a203a66-b727-41f4-b215-d321860720e7",
      "name": "仅筛选带评论的帖子",
      "type": "n8n-nodes-base.filter",
      "position": [
        -100,
        -680
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b7132a05-1f02-4d2d-9eba-d23d636c1f09",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.num_comments }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cf8f8254-9295-43ca-9e3f-5a7f348eb3ac",
      "name": "将评论聚合到单个字段",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        560,
        -760
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "body"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b2a4f6ad-1b1f-4d15-a872-fc96fb562cfc",
      "name": "构建包含评论对象的帖子",
      "type": "n8n-nodes-base.set",
      "position": [
        780,
        -760
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "74de4fe8-9e37-40c1-86b5-d646bedaaf52",
              "name": "commentText",
              "type": "array",
              "value": "={{ $json.body }}"
            },
            {
              "id": "67bdb6fe-36d1-4357-89f9-855282c4ba70",
              "name": "postId",
              "type": "string",
              "value": "={{$(\"Loop Over Items\").item.json.id}}"
            },
            {
              "id": "247b3e29-6048-484a-a5fe-388bd54e635d",
              "name": "postContent",
              "type": "string",
              "value": "={{$(\"Loop Over Items\").item.json.selftext}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "60991de9-ad29-484c-9233-966cc1980a03",
      "name": "将洞察分析与帖子内容和评论合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1960,
        -1080
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3
    },
    {
      "id": "595870aa-09d4-4fbe-94a3-c6ccf2896b41",
      "name": "构建帖子创意",
      "type": "n8n-nodes-base.set",
      "position": [
        2840,
        -740
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "77032901-551e-4260-be47-fe90ed5906d0",
              "name": "postIdeas",
              "type": "string",
              "value": "={{ $json.message.content }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0a26ec15-eeaa-421c-9007-6e88fcf49b48",
      "name": "构建洞察分析",
      "type": "n8n-nodes-base.set",
      "position": [
        2800,
        -520
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "adbb373d-9644-41d6-ab15-7ff127de3f1d",
              "name": "contentAnalysis",
              "type": "string",
              "value": "={{ $json.output }}"
            },
            {
              "id": "04742d30-475e-4c46-83eb-a06fa1a0bb3c",
              "name": "commentText",
              "type": "array",
              "value": "={{ $json.commentText }}"
            },
            {
              "id": "1e152425-8fed-4d06-a208-193fa9324d4d",
              "name": "postId",
              "type": "string",
              "value": "={{ $json.postId }}"
            },
            {
              "id": "126fd80c-cf2b-48ca-b581-5400bf491bbf",
              "name": "postContent",
              "type": "string",
              "value": "={{ $json.postContent }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "655255e4-3395-4e41-923c-7dc7c32ef3b4",
      "name": "合并洞察分析和帖子建议",
      "type": "n8n-nodes-base.merge",
      "position": [
        3040,
        -660
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "a99b51fd-3499-428c-a30d-6c5ea586ee47",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -1420
      ],
      "parameters": {
        "color": 4,
        "width": 840,
        "height": 720,
        "content": "# 生成洞察分析"
      },
      "typeVersion": 1
    },
    {
      "id": "5019794e-ddd2-4697-8c86-733f5018a4a7",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -940
      ],
      "parameters": {
        "color": 3,
        "width": 1300,
        "height": 700,
        "content": "# 获取帖子和评论"
      },
      "typeVersion": 1
    },
    {
      "id": "728fd2b7-66a3-4c48-a286-70611d79f5cf",
      "name": "表单提交时",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1080,
        -1020
      ],
      "webhookId": "eee92062-0440-4ea0-894c-f60b2a5c076c",
      "parameters": {
        "options": {},
        "formTitle": "Post ideas generation",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Subreddit",
              "placeholder": "marketing",
              "requiredField": true
            },
            {
              "fieldLabel": "What to search for in the subreddit"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9e73f274-0d0d-41a0-83e8-3cd9118cdc57",
      "name": "创建电子表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -640,
        -1100
      ],
      "parameters": {
        "title": "=post_ideas_{{ $json.Subreddit }}_{{ $json['What to search for in the subreddit'] }}_{{$now.format('yyyy_MM_dd_HH_mm_ss')}}",
        "options": {},
        "resource": "spreadsheet"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "YCan8DcqSC2Ddj8Y",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "4370f63c-29c3-4fa4-bde7-9bd6af1616c3",
      "name": "准备输出列",
      "type": "n8n-nodes-base.set",
      "position": [
        3220,
        -580
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d31c7eaf-ef32-4f47-ac9d-4726737ba749",
              "name": "Post Content",
              "type": "string",
              "value": "={{ $json.postContent }}"
            },
            {
              "id": "02dbd93a-954d-46f4-9b44-c092bdaae529",
              "name": "Comments",
              "type": "string",
              "value": "={{ $json.commentText.join('\\n\\n\\n\\n--------\\n\\n\\n') }}"
            },
            {
              "id": "ad4491d0-6d5a-49d3-8b1e-e5def682e567",
              "name": "Insights",
              "type": "string",
              "value": "={{ $json.contentAnalysis }}"
            },
            {
              "id": "924eb630-3164-42f6-8141-89c15ee5344f",
              "name": "Linkedin post ideas",
              "type": "string",
              "value": "={{ $json.postIdeas }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "05d1102b-8638-4fcc-a009-2dfb11819258",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1240,
        -2040
      ],
      "parameters": {
        "width": 1200,
        "height": 740,
        "content": "# 从 Reddit 帖子中寻找热门的 LinkedIn 帖子创意"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {},
  "versionId": "de345aef-1aef-4f86-8668-d165c5a15b75",
  "connections": {
    "Get Posts": {
      "main": [
        [
          {
            "node": "Filter only posts with comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Get many comments in a post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate insights": {
      "main": [
        [
          {
            "node": "Merge insights with post content and comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate insights",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Construct insights": {
      "main": [
        [
          {
            "node": "Merge insights and post suggestions",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Create spreadsheet": {
      "main": [
        [
          {
            "node": "Get Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Create spreadsheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output The Results": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Suggest post topics": {
      "main": [
        [
          {
            "node": "Construct post ideas",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Construct post ideas": {
      "main": [
        [
          {
            "node": "Merge insights and post suggestions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare output columns": {
      "main": [
        [
          {
            "node": "Output The Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many comments in a post": {
      "main": [
        [
          {
            "node": "Aggregate comments to single field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter only posts with comments": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate comments to single field": {
      "main": [
        [
          {
            "node": "Construct post with comment object",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Construct post with comment object": {
      "main": [
        [
          {
            "node": "Generate insights",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge insights with post content and comments",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge insights and post suggestions": {
      "main": [
        [
          {
            "node": "Prepare output columns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge insights with post content and comments": {
      "main": [
        [
          {
            "node": "Suggest post topics",
            "type": "main",
            "index": 0
          },
          {
            "node": "Construct insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 内容创作, 多模态 AI

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流