8
n8n 中文网amn8n.com

RSS 到 LinkedIn 自动发布器

高级

这是一个Social Media, Multimodal AI领域的自动化工作流,包含 19 个节点。主要使用 If, Code, LinkedIn, Aggregate, HttpRequest 等节点。 使用 RSS + Gemini AI + Templated.io 自动策划并发布到 LinkedIn 公司页面

前置要求
  • LinkedIn API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移

无法加载工作流预览

导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "name": "RSS 到 LinkedIn 自动发布器",
  "nodes": [
    {
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -360
      ],
      "parameters": {
        "width": 384,
        "height": 704,
        "content": "## 🧠 工作流概览"
      },
      "typeVersion": 1
    },
    {
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        176
      ],
      "parameters": {
        "color": 7,
        "width": 464,
        "height": 80,
        "content": "## 内容筛选器"
      },
      "typeVersion": 1
    },
    {
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 464,
        "height": 80,
        "content": "## 创建器与优化器"
      },
      "typeVersion": 1
    },
    {
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2176,
        160
      ],
      "parameters": {
        "color": 7,
        "width": 464,
        "height": 80,
        "content": "## 设计师与发布器"
      },
      "typeVersion": 1
    },
    {
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 11 * * TUE"
            },
            {
              "field": "cronExpression",
              "expression": "0 11 * * THU"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "name": "RSS 读取",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        224,
        300
      ],
      "parameters": {
        "url": "https://blog.hubspot.com/marketing/rss.xml",
        "options": {}
      },
      "retryOnFail": true,
      "typeVersion": 1.2
    },
    {
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        448,
        300
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "title"
            },
            {
              "fieldToAggregate": "content"
            },
            {
              "fieldToAggregate": "link"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "name": "将新闻分组为 1 个项目",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        300
      ],
      "parameters": {
        "jsCode": "// Inputs expected from Aggregate/RSS: arrays: title[], content[], link[]\nconst all = items[0].json;              // aggregated item\nconst titles = all.title || [];\nconst contents = all.content || [];\nconst links = all.link || [];\n\nconst articles = [];\nconst lines = [];\n\nconst maxLen = Math.max(titles.length, contents.length, links.length);\nfor (let i = 0; i < maxLen; i++) {\n  const obj = {\n    id: i + 1,                          // stable ID (1..N). Use guid if you have one.\n    title: titles[i] ?? \"\",\n    content: contents[i] ?? \"\",\n    link: links[i] ?? \"\"\n  };\n  articles.push(obj);\n  // Short preview for the AI to choose from:\n  const preview = (obj.content || \"\").replace(/\\s+/g, \" \").slice(0, 220);\n  lines.push(`${obj.id}. ${obj.title}\\n${preview}${preview.length === 220 ? \"…\" : \"\"}`);\n}\n\nreturn [\n  {\n    json: {\n      articles,                         // keep the structured mapping\n      forAI: lines.join(\"\\n\\n\")         // human-readable list for the model\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "name": "最佳文章查找器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        896,
        300
      ],
      "parameters": {
        "text": "=You are (company name) content curator. Select the BEST article for our audience.\n\nCOMPANY AUDIENCE:\n\n\nSELECTION CRITERIA:\nCHECK:\n- Can someone practically apply this TODAY or is it just knowledge?\n- Will they want to save this?\n\nSKIP ARTICLES ABOUT:\n- Pure theory without practical steps\n\nPick only 1 and give only {{ $json.articles[0].link }} as output\n\n{{ $json.forAI }}\n\n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        968,
        524
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-1.5-flash"
      },
      "typeVersion": 1
    },
    {
      "name": "Google Gemini 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1320,
        400
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "name": "内容创建器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1248,
        176
      ],
      "parameters": {
        "text": "=Turn blog into quick byte below 200 words. \n\nCOMPANY AUDIENCE:\n\n\nWRITING RULES:\n- Write for the audience keeping in mind that they need opinion/insights, they don't have time to spare so be very on point and crisp and profound\n- Include specific numbers/time when possible\n- Keep it to the point like in news/bulletin \n- Always use bullets/classified structure, no extra output needed\n\nHere is the blog to use:  {{ $json.output }}",
        "options": {},
        "promptType": "define"
      },
      "retryOnFail": true,
      "typeVersion": 2.2
    },
    {
      "name": "帖子优化器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1600,
        176
      ],
      "parameters": {
        "text": "=Analyze this post deeply\n\nPost = {{ $json.output }}\n\nCHECK & OPTIMIZE FOR:\n- Can someone practically apply this TODAY or is it just knowledge?\n- Will THEY want to save this?\n- Does this have fluff/filler words that inflate sentences? Keep sentences small and easy to read.\n- Does it look AI Generated? Prefer human sentence construction\n- No emoji, use → or other symbols for bullets, don't use * or em dash in post, space after every bullet\n- Analyze First line: should not be in text:text format, only mention crux like \"loop marketing strategy\", or use title like \"here's why you need loop marketing\"\n\nAlso create a headline for image for this post, keep it crisp and catchy\n\nOUTPUT:\n{\n  \"final_post\": \"[LinkedIn-ready post]\",\n\"image_text\": \"[Headline for image= what the post is about]\"\n  \"confidence_score\": [1-10],\n  \"post_now\": [true if score >= 7]\n} ",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 2.2
    },
    {
      "name": "Google Gemini 聊天模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1608,
        400
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-1.5-pro"
      },
      "typeVersion": 1
    },
    {
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1736,
        400
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"final_post\": \"[LinkedIn-ready post]\",\n  \"image_text\": \"[Image Title Catcy]\",\n  \"confidence_score\": [10],\n  \"post_now\": [true]\n} "
      },
      "typeVersion": 1.3
    },
    {
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        1952,
        300
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.output.post_now[0] }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "name": "Templated",
      "type": "n8n-nodes-templated.templated",
      "position": [
        2176,
        300
      ],
      "parameters": {
        "layers": {
          "layer": [
            {
              "text": "={{ $json.output.image_text }}",
              "layerName": "paragraph-text"
            }
          ]
        },
        "template": "",
        "requestOptions": {}
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "name": "创建帖子",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        2624,
        300
      ],
      "parameters": {
        "text": "={{ $('Post optimizer').item.json.output.final_post }}",
        "postAs": "organization",
        "organization": "",
        "additionalFields": {},
        "shareMediaCategory": "IMAGE"
      },
      "typeVersion": 1
    },
    {
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2400,
        300
      ],
      "parameters": {
        "url": "={{ $json.render_url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Templated",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Best Article finder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RSS Read": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "group the news into 1 item",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Templated": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Create a post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post optimizer": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Content Creator": {
      "main": [
        [
          {
            "node": "Post optimizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "RSS Read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Best Article finder": {
      "main": [
        [
          {
            "node": "Content Creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Best Article finder",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Post optimizer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Content Creator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Post optimizer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "group the news into 1 item": {
      "main": [
        [
          {
            "node": "Best Article finder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 社交媒体, 多模态 AI

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流