8
n8n 中文网amn8n.com

从RSS订阅源重新利用新闻并通过PostPulse发布

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 25 个节点。主要使用 If, Wait, Merge, Function, RssFeedRead 等节点。 通过PostPulse自动化RSS新闻到多平台社交媒体发布

前置要求
  • 无特殊前置要求,导入即可使用
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "lTO5ex53oKKkeT0d",
  "meta": {
    "instanceId": "bf246f909c2b838648f333c22c98b9bde186937bc00a5918bd9a27f4ec3914d3"
  },
  "name": "从RSS订阅源重新利用新闻并通过PostPulse发布",
  "tags": [],
  "nodes": [
    {
      "id": "5225f3e9-d85f-4e3e-900a-e67fbc5ea7ac",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -48,
        -144
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b72c3c2f-7b1d-4925-9dca-720f2353b793",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        720,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bff36021-96e1-421e-9218-81e2117786b1",
              "operator": {
                "type": "dateTime",
                "operation": "afterOrEquals"
              },
              "leftValue": "={{ $json.pubDate }}",
              "rightValue": "={{ $now.minus(1, 'days').startOf('day') }}"
            },
            {
              "id": "8acc637f-1103-4c4f-a80e-428020b3cf41",
              "operator": {
                "type": "dateTime",
                "operation": "beforeOrEquals"
              },
              "leftValue": "={{ $json.pubDate }}",
              "rightValue": "={{ $now.minus(1, 'days').endOf('day') }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3442e809-c9a9-45a0-9088-72a1810355b1",
      "name": "获取已连接的账户",
      "type": "@postpulse/n8n-nodes-postpulse.postPulse",
      "position": [
        784,
        480
      ],
      "parameters": {
        "resource": "account"
      },
      "credentials": {
        "postPulseOAuth2Api": {
          "id": "nrEYznJjQaKGajyK",
          "name": "PostPulse account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2d2d2c5f-32b3-4b7a-8a49-a52e8ac9dea1",
      "name": "媒体检查IF",
      "type": "n8n-nodes-base.if",
      "position": [
        912,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "media-check-condition",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              },
              "leftValue": "={{ (\n          $json.enclosure?.url ||\n          $json['media:content']?.url || \n          $json['media:thumbnail']?.url ||\n          ($json.description && $json.description.match(/<img[^>]+src=[\"']([^\"']+)[\"']/i)?.[1]) ||\n          ($json['content:encoded'] && $json['content:encoded'].match(/<img[^>]+src=[\"']([^\"']+)[\"']/i)?.[1])\n        ) }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "13391fd1-8164-4bc2-b5cd-438c507dffa5",
      "name": "RSS 源读取",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        336,
        -64
      ],
      "parameters": {
        "url": "https://rss.unian.ua/site/gplay_56_ukr.rss",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "eab7ec94-76a3-4840-a89e-f77f2e1991ef",
      "name": "合并(无媒体+账户)",
      "type": "n8n-nodes-base.merge",
      "position": [
        1152,
        224
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "6edb85e6-e42f-486c-8a51-035ea59dbe96",
      "name": "上传媒体",
      "type": "@postpulse/n8n-nodes-postpulse.postPulse",
      "position": [
        1104,
        -176
      ],
      "parameters": {
        "url": "={{ $json.enclosure.url }}",
        "resource": "media",
        "filenameHint": "={{ $json.enclosure.url.split(\"/\").pop() }}",
        "uploadSource": "url"
      },
      "credentials": {
        "postPulseOAuth2Api": {
          "id": "nrEYznJjQaKGajyK",
          "name": "PostPulse account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "13fd97d3-c730-4ad1-9311-58fe5f385c10",
      "name": "获取上传状态",
      "type": "@postpulse/n8n-nodes-postpulse.postPulse",
      "position": [
        1312,
        -208
      ],
      "parameters": {
        "importId": "={{ $json.id }}",
        "resource": "media",
        "operation": "getUploadStatus"
      },
      "credentials": {
        "postPulseOAuth2Api": {
          "id": "nrEYznJjQaKGajyK",
          "name": "PostPulse account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3b3c7fdb-a992-43ac-8478-e42a7e6ec7d9",
      "name": "合并1",
      "type": "n8n-nodes-base.merge",
      "position": [
        2160,
        -64
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "1d049387-8e7b-4cc7-b32d-704f0aba5945",
      "name": "条件判断1",
      "type": "n8n-nodes-base.if",
      "position": [
        1504,
        -304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "44cab27e-ad6e-4320-aea2-ca7e5ebbbf2f",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.state }}",
              "rightValue": "READY"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "804a3503-e23f-4a87-b811-bd552edf94ac",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        1744,
        -304
      ],
      "webhookId": "2a52ba6c-06e9-4cdc-94af-8e9206ad2f0f",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "2c315149-3047-467e-bdb3-e62330aabe10",
      "name": "发布帖子",
      "type": "@postpulse/n8n-nodes-postpulse.postPulse",
      "position": [
        2400,
        -32
      ],
      "parameters": {
        "isDraft": true,
        "publications": {
          "publication": [
            {
              "posts": {
                "post": [
                  {
                    "content": "={{ (function(){\nconst t=$json['content:encodedSnippet'],p=$json.platform;\nlet m=500;if(p==='X_TWITTER')m=280;if(p==='BLUE_SKY')m=300;\nif(t.length<=m)return t;\nconst d=t.lastIndexOf('.',m),e=t.lastIndexOf('!',m),q=t.lastIndexOf('?',m),s=Math.max(d,e,q),l=m*0.6;\nif(s>0&&s>=l)return t.substring(0,s+1);\nconst w=t.lastIndexOf(' ',m);\nreturn t.substring(0,w>0?w:m)+'...';\n})() }}",
                    "attachmentPaths": {
                      "path": [
                        {
                          "value": "={{ $json.s3Key }}"
                        }
                      ]
                    }
                  }
                ]
              },
              "platformSettings": "={{ (function() { const platformMapping = { 'X_TWITTER': 'TWITTER', 'YOUTUBE': 'YOUTUBE', 'THREADS': 'THREADS', 'TIKTOK': 'TIK_TOK', 'INSTAGRAM': 'INSTAGRAM', 'FACEBOOK': 'FACEBOOK', 'LINKEDIN': 'LINKEDIN', 'BLUE_SKY': 'BLUE_SKY', 'TELEGRAM': 'TELEGRAM' }; return JSON.stringify({ \"type\": platformMapping[$json.platform] }); })() }}",
              "socialMediaAccountId": "={{ $json.id }}"
            }
          ]
        },
        "scheduledTime": "={{$now.toUTC()}}"
      },
      "credentials": {
        "postPulseOAuth2Api": {
          "id": "nrEYznJjQaKGajyK",
          "name": "PostPulse account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "abde1db6-6283-472b-8fc6-9d0bd9cfb6eb",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1952,
        -160
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "advanced": true,
        "mergeByFields": {
          "values": [
            {
              "field1": "sourceUrl",
              "field2": "enclosure.url"
            }
          ]
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "c05dd604-c4ee-485b-81f6-d38f67e515b0",
      "name": "发布帖子(仅文本)",
      "type": "@postpulse/n8n-nodes-postpulse.postPulse",
      "position": [
        1776,
        336
      ],
      "parameters": {
        "isDraft": true,
        "publications": {
          "publication": [
            {
              "posts": {
                "post": [
                  {
                    "content": "={{ (function(){\n  const title = $json.title || '';\n  const content = $json['content'] || $json['content:encodedSnippet'] || $json.description || '';\n  const fullText = title + (content ? '\\n\\n' + content : '');\n  const p = $json.platform;\n  let m = 500;\n  if(p==='X_TWITTER') m=280;\n  if(p==='BLUE_SKY') m=300;\n  if(fullText.length <= m) return fullText;\n  const d = fullText.lastIndexOf('.', m), e = fullText.lastIndexOf('!', m), q = fullText.lastIndexOf('?', m);\n  const s = Math.max(d, e, q), l = m*0.6;\n  if(s > 0 && s >= l) return fullText.substring(0, s+1);\n  const w = fullText.lastIndexOf(' ', m);\n  return fullText.substring(0, w>0?w:m) + '...';\n})() }}\n",
                    "attachmentPaths": {
                      "path": [
                        {}
                      ]
                    }
                  }
                ]
              },
              "platformSettings": "={{ (function() { const platformMapping = { 'X_TWITTER': 'TWITTER', 'YOUTUBE': 'YOUTUBE', 'THREADS': 'THREADS', 'TIKTOK': 'TIK_TOK', 'INSTAGRAM': 'INSTAGRAM', 'FACEBOOK': 'FACEBOOK', 'LINKEDIN': 'LINKEDIN', 'BLUE_SKY': 'BLUE_SKY', 'TELEGRAM': 'TELEGRAM' }; return JSON.stringify({ \"type\": platformMapping[$json.platform] }); })() }}",
              "socialMediaAccountId": "={{ $json.id }}"
            }
          ]
        },
        "scheduledTime": "={{$now.toUTC()}}"
      },
      "credentials": {
        "postPulseOAuth2Api": {
          "id": "nrEYznJjQaKGajyK",
          "name": "PostPulse account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d20115e7-11a2-4af9-ab4f-a9c33ea44b99",
      "name": "限制为N个帖子",
      "type": "n8n-nodes-base.function",
      "position": [
        512,
        -48
      ],
      "parameters": {
        "functionCode": "const limit = 1; // Specify the desired\nconst items = $input.all();\n\nreturn items.slice(0, limit);"
      },
      "typeVersion": 1
    },
    {
      "id": "7cf7be4d-1553-4f52-ac23-007a46e73eb8",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -544
      ],
      "parameters": {
        "width": 640,
        "height": 144,
        "content": "## 从RSS订阅源重新利用新闻并通过PostPulse发布"
      },
      "typeVersion": 1
    },
    {
      "id": "8a2f34a4-7099-42c7-82cd-b8291f585e21",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        16
      ],
      "parameters": {
        "width": 272,
        "height": 96,
        "content": "## 计划触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "402d5b7c-a30d-4bef-af05-74d48ef703d7",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -208
      ],
      "parameters": {
        "height": 96,
        "content": "## RSS订阅源读取"
      },
      "typeVersion": 1
    },
    {
      "id": "b02123b2-1751-4e7b-99c9-49dca6c2c653",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        80
      ],
      "parameters": {
        "width": 288,
        "height": 112,
        "content": "## 限制为N个帖子"
      },
      "typeVersion": 1
    },
    {
      "id": "ef97a779-fb99-4d50-9e11-2968dad3e477",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        -208
      ],
      "parameters": {
        "width": 384,
        "content": "## If与媒体检查IF"
      },
      "typeVersion": 1
    },
    {
      "id": "fefe03d9-f87b-43ca-8f17-c5c09fa347ad",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        -448
      ],
      "parameters": {
        "width": 544,
        "height": 112,
        "content": "## PostPulse上传媒体和获取上传状态"
      },
      "typeVersion": 1
    },
    {
      "id": "1e1b08d4-96d7-4229-bdcf-0ac43f58f18c",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        -288
      ],
      "parameters": {
        "width": 336,
        "height": 128,
        "content": "## 合并"
      },
      "typeVersion": 1
    },
    {
      "id": "00692b40-ef2b-4aa8-9f2b-e69a097071d9",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        224
      ],
      "parameters": {
        "width": 320,
        "height": 128,
        "content": "## 发布帖子"
      },
      "typeVersion": 1
    },
    {
      "id": "5ee6e715-62dc-4b82-993a-e35587d76d71",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        640
      ],
      "parameters": {
        "width": 352,
        "content": "## PostPulse获取已连接账户"
      },
      "typeVersion": 1
    },
    {
      "id": "10976fdd-1cc1-4739-bc62-2ab1cb1d71d0",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        48
      ],
      "parameters": {
        "width": 256,
        "content": "## 合并(无媒体+账户)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "018ef9cd-662d-4a33-8efd-f090b888f812",
  "connections": {
    "b72c3c2f-7b1d-4925-9dca-720f2353b793": {
      "main": [
        [
          {
            "node": "2d2d2c5f-32b3-4b7a-8a49-a52e8ac9dea1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "2d2d2c5f-32b3-4b7a-8a49-a52e8ac9dea1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1d049387-8e7b-4cc7-b32d-704f0aba5945": {
      "main": [
        [
          {
            "node": "804a3503-e23f-4a87-b811-bd552edf94ac",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "abde1db6-6283-472b-8fc6-9d0bd9cfb6eb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "804a3503-e23f-4a87-b811-bd552edf94ac": {
      "main": [
        [
          {
            "node": "13fd97d3-c730-4ad1-9311-58fe5f385c10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "abde1db6-6283-472b-8fc6-9d0bd9cfb6eb": {
      "main": [
        [
          {
            "node": "3b3c7fdb-a992-43ac-8478-e42a7e6ec7d9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3b3c7fdb-a992-43ac-8478-e42a7e6ec7d9": {
      "main": [
        [
          {
            "node": "2c315149-3047-467e-bdb3-e62330aabe10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6edb85e6-e42f-486c-8a51-035ea59dbe96": {
      "main": [
        [
          {
            "node": "13fd97d3-c730-4ad1-9311-58fe5f385c10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "13391fd1-8164-4bc2-b5cd-438c507dffa5": {
      "main": [
        [
          {
            "node": "d20115e7-11a2-4af9-ab4f-a9c33ea44b99",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2d2d2c5f-32b3-4b7a-8a49-a52e8ac9dea1": {
      "main": [
        [
          {
            "node": "6edb85e6-e42f-486c-8a51-035ea59dbe96",
            "type": "main",
            "index": 0
          },
          {
            "node": "abde1db6-6283-472b-8fc6-9d0bd9cfb6eb",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "eab7ec94-76a3-4840-a89e-f77f2e1991ef",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d20115e7-11a2-4af9-ab4f-a9c33ea44b99": {
      "main": [
        [
          {
            "node": "b72c3c2f-7b1d-4925-9dca-720f2353b793",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5225f3e9-d85f-4e3e-900a-e67fbc5ea7ac": {
      "main": [
        [
          {
            "node": "3442e809-c9a9-45a0-9088-72a1810355b1",
            "type": "main",
            "index": 0
          },
          {
            "node": "13391fd1-8164-4bc2-b5cd-438c507dffa5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "13fd97d3-c730-4ad1-9311-58fe5f385c10": {
      "main": [
        [
          {
            "node": "1d049387-8e7b-4cc7-b32d-704f0aba5945",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3442e809-c9a9-45a0-9088-72a1810355b1": {
      "main": [
        [
          {
            "node": "eab7ec94-76a3-4840-a89e-f77f2e1991ef",
            "type": "main",
            "index": 1
          },
          {
            "node": "3b3c7fdb-a992-43ac-8478-e42a7e6ec7d9",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "eab7ec94-76a3-4840-a89e-f77f2e1991ef": {
      "main": [
        [
          {
            "node": "c05dd604-c4ee-485b-81f6-d38f67e515b0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者

Hnatiuk Dmytro is a Content Manager at PostPulse, experienced in copywriting, localization, and social media marketing. Skilled in creating engaging content strategies, managing multi-platform campaigns, and optimizing posts for audience engagement. He also has technical skills in HTML, JavaScript, Node.js, and C#, with a background in cybersecurity. Outside of work, Dmytro is a musician, enjoys playing and listening to music, stays active through sports, and values connecting with people

外部链接
在 n8n.io 查看

分享此工作流

分类

分类: 34