8
n8n 中文网amn8n.com

将新闻稿发布到 Techeela 网站

中级

这是一个Marketing领域的自动化工作流,包含 9 个节点。主要使用 Set, Code, Wordpress, HttpRequest, RssFeedReadTrigger 等节点。 从 RSS 自动发布带特色图片的新闻稿到 WordPress

前置要求
  • 可能需要目标 API 的认证凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "88x49jmELpXBXgy8",
  "meta": {
    "instanceId": "ca7e4439d37f2d7ddaa363ea2b029357e1ee59824d58b9533ac05bf57f803d9d",
    "templateCredsSetupCompleted": true
  },
  "name": "将新闻稿发布到 Techeela 网站",
  "tags": [],
  "nodes": [
    {
      "id": "c762fb88-f496-4ff6-80fc-3da2047096d6",
      "name": "RSS 源触发器",
      "type": "n8n-nodes-base.rssFeedReadTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "feedUrl": "",
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "572e403a-ee70-46ee-ac24-45faf8fe1d98",
      "name": "Wordpress",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        440,
        0
      ],
      "parameters": {
        "title": "={{ $json.title }}",
        "additionalFields": {
          "format": "standard",
          "status": "draft",
          "content": "={{ $json.content }}",
          "authorId": 3,
          "categories": [
            1057
          ],
          "postTemplate": {
            "values": {}
          }
        }
      },
      "credentials": {
        "wordpressApi": {
          "id": "",
          "name": ""
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2ff6ba75-5c55-4203-a670-f6688acf8520",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        220,
        0
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n  const content = item?.json?.content;\n  const srcMatch = content.match(/src=\"(.*?)\"/);\n  item.json.imageSrc = srcMatch ? srcMatch[1] : \"\";\n  return item;\n});\nreturn updatedItems;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1c0c60e0-0f1f-4f64-9186-5640599f62a7",
      "name": "上传图片到 Wordpress",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        0
      ],
      "parameters": {
        "url": "https://xyz.com/wp-json/wp/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Disposition",
              "value": "=attachment; filename=\"cover-image-{{ $('Wordpress').item.json.id }}.jpeg\""
            }
          ]
        },
        "inputDataFieldName": "data",
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "",
          "name": "Wordpress Account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "38326346-0f38-4491-b786-ee1e06b65f96",
      "name": "在 Wordpress 文章上设置图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1240,
        0
      ],
      "parameters": {
        "url": "=https://xyz.com/wp-json/wp/v2/posts/{{ $('Wordpress').item.json.id }}",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "featured_media",
              "value": "={{ $json.id }}"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "",
          "name": "Wordpress Account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "45505c71-ff36-4f4c-be2c-bf705ae0a902",
      "name": "获取图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        840,
        0
      ],
      "parameters": {
        "url": "={{ $json['image-url'] }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "6f1ff8bc-622d-49bb-a172-bf23b6e1baa3",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -80
      ],
      "parameters": {
        "width": 1240,
        "height": 280,
        "content": "## 在 Techeela Wordpress 文章中设置图片和内容"
      },
      "typeVersion": 1
    },
    {
      "id": "8272d49e-cf24-43a0-b948-db29adf5a95f",
      "name": "设置图片 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1f0541df-05ab-4e3d-a5d8-3904579fc8a9",
              "name": "image-url",
              "type": "string",
              "value": "={{ $('Code').item.json.imageSrc }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f6685e58-6c23-495d-9b75-a8066eab8829",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -80
      ],
      "parameters": {
        "color": 4,
        "width": 280,
        "height": 280,
        "content": "## 来自 PR Newswire 的源"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "71481a3f-f3d0-45aa-b039-5f2cdb2e5267",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Wordpress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GET Image": {
      "main": [
        [
          {
            "node": "Upload Image to Wordpress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wordpress": {
      "main": [
        [
          {
            "node": "Set Image URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Image URL": {
      "main": [
        [
          {
            "node": "GET Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RSS Feed Trigger": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image to Wordpress": {
      "main": [
        [
          {
            "node": "Set Image on Wordpress Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 营销

需要付费吗?

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

工作流信息
难度等级
中级
节点数量9
分类1
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Digvijay Dubey

Digvijay Dubey

@digvijay

Results-driven developer with expertise in automation, system integration, and CRM solutions. Skilled in building efficient workflows with n8n, integrating platforms like WordPress, Zoho CRM, and APIs to streamline business processes. Passionate about solving real-world problems with clean, scalable, and automated solutions.

外部链接
在 n8n.io 查看

分享此工作流