8
n8n 中文网amn8n.com

自动化分发内容到Google Sheet和Slack

中级

这是一个Social Media领域的自动化工作流,包含 12 个节点。主要使用 If, Set, Slack, Twitter, LinkedIn 等节点。 使用Google Sheets和Slack自动化社交媒体内容分发

前置要求
  • Slack Bot Token 或 Webhook URL
  • Twitter API 凭证
  • LinkedIn API 凭证
  • Google Sheets API 凭证
  • Facebook Graph API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "7nrbRUkisTTkK3e8",
  "meta": {
    "instanceId": "a287613f1596da776459594685fbf4e2b4a12124f80ab8c8772f5e37bff103ae",
    "templateCredsSetupCompleted": true
  },
  "name": "自动化分发内容到 Google Sheet 和 Slack",
  "tags": [],
  "nodes": [
    {
      "id": "409d8e05-ad6e-4b6f-ba9e-7e26fe070ec5",
      "name": "Google Sheets 触发器",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "event": "rowUpdate",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "[YOUR_SHEET_NAME]"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/YOUR_SPREADSHEET_ID_HERE/edit"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "y0YhoaKRGXeG1RfK",
          "name": "temp"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f04569fe-ffd0-4ae5-b284-c71ce26a3f43",
      "name": "内容参数",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f2c1b112-f4ae-40ec-a916-2a8d8af0cd76",
              "name": "social_media_text_core",
              "type": "string",
              "value": "={{ $json.Title }} - {{ $json.Short_Description }}\\nRead more: {{ $json.URL }}\\n{{ $json.Hashtags }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3ce6b53b-43ad-4b9f-8a97-5e551501f8d5",
      "name": "检查 Facebook 帖子",
      "type": "n8n-nodes-base.if",
      "position": [
        448,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6b10eac9-d290-4250-a573-8f2b6e0969f5",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.Post_to_Facebook }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "97c1ef75-dcf9-4239-939a-947de498668c",
      "name": "发布消息",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        672,
        -96
      ],
      "parameters": {
        "edge": "={{ $json.social_media_text_core }}",
        "node": "[YOUR_FACEBOOK_PAGE_ID]",
        "options": {},
        "httpRequestMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "cd54bbdc-25b7-47b5-9e84-b9bc94b95e66",
      "name": "检查 Twitter 帖子",
      "type": "n8n-nodes-base.if",
      "position": [
        672,
        96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "097807a3-4bd8-4d58-b2d5-4d07691c8139",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.Post_to_Twitter }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4410a6ce-2687-4400-97fe-05903676325a",
      "name": "创建推文",
      "type": "n8n-nodes-base.twitter",
      "position": [
        896,
        0
      ],
      "parameters": {
        "text": "={{ $json.social_media_text_core }}",
        "additionalFields": {}
      },
      "credentials": {
        "twitterOAuth2Api": {
          "id": "i9ltvI3IKFGSIxYt",
          "name": "temp"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "d71eda0c-5b96-40ac-9e72-0a68c3dff971",
      "name": "检查 LinkedIn 帖子",
      "type": "n8n-nodes-base.if",
      "position": [
        896,
        192
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "35e581d3-16a2-4e9b-88ff-cc8aba9816d2",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.Post_to_LinkedIn }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "930262d9-f0d2-44d1-b702-b95eb8baddcc",
      "name": "分享更新",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        1120,
        192
      ],
      "parameters": {
        "text": "={{ $json.social_media_text_core }}\n{{ $json.URL }}",
        "postAs": "organization",
        "organization": "[YOUR_LINKEDIN_ORG_ID]",
        "additionalFields": {},
        "binaryPropertyName": "=",
        "shareMediaCategory": "IMAGE"
      },
      "credentials": {
        "linkedInOAuth2Api": {
          "id": "XDjElJwF7bJz0ilR",
          "name": "temp"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "699e0dcc-ca88-463e-8cb7-6ed2942c8677",
      "name": "更新发布状态",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1344,
        192
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "[YOUR_SHEET_NAME]"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "[YOUR_GOOGLE_SHEET_CONTENT_ID]"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "MSnszF5oRAiSGHDo",
          "name": "temp"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "6218283b-1cbe-4e22-babe-334073a76ebc",
      "name": "发送Slack通知",
      "type": "n8n-nodes-base.slack",
      "position": [
        1568,
        192
      ],
      "webhookId": "20b1f158-7da3-43f5-ab62-444db7abfca4",
      "parameters": {
        "text": "=New content \"{{ $json.Title }}\" successfully published to social media! 🎉 Check: {{ $json.URL }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "[YOUR_SLACK_CHANNEL_ID]"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "AFKF0YsguyhsagR0",
          "name": "temp"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "1e56067d-18c2-4c40-926c-69e07c78fd9b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        -176
      ],
      "parameters": {
        "color": 3,
        "width": 1840,
        "height": 608,
        "content": "# 流程"
      },
      "typeVersion": 1
    },
    {
      "id": "cb142585-3cfb-4475-95f8-82d4e7ca5742",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        496
      ],
      "parameters": {
        "color": 5,
        "width": 1840,
        "height": 3504,
        "content": "# \"自动化社交媒体内容分发系统\""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3633890b-8499-45ab-ac18-321c35959730",
  "connections": {
    "930262d9-f0d2-44d1-b702-b95eb8baddcc": {
      "main": [
        [
          {
            "node": "699e0dcc-ca88-463e-8cb7-6ed2942c8677",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cd54bbdc-25b7-47b5-9e84-b9bc94b95e66": {
      "main": [
        [
          {
            "node": "4410a6ce-2687-4400-97fe-05903676325a",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "d71eda0c-5b96-40ac-9e72-0a68c3dff971",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f04569fe-ffd0-4ae5-b284-c71ce26a3f43": {
      "main": [
        [
          {
            "node": "3ce6b53b-43ad-4b9f-8a97-5e551501f8d5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3ce6b53b-43ad-4b9f-8a97-5e551501f8d5": {
      "main": [
        [
          {
            "node": "97c1ef75-dcf9-4239-939a-947de498668c",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "cd54bbdc-25b7-47b5-9e84-b9bc94b95e66",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d71eda0c-5b96-40ac-9e72-0a68c3dff971": {
      "main": [
        [
          {
            "node": "930262d9-f0d2-44d1-b702-b95eb8baddcc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "409d8e05-ad6e-4b6f-ba9e-7e26fe070ec5": {
      "main": [
        [
          {
            "node": "f04569fe-ffd0-4ae5-b284-c71ce26a3f43",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "699e0dcc-ca88-463e-8cb7-6ed2942c8677": {
      "main": [
        [
          {
            "node": "6218283b-1cbe-4e22-babe-334073a76ebc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 社交媒体

需要付费吗?

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

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

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

作者
Marth

Marth

@marth

Simplifying Business with Smart Automation. I create and share user-friendly, highly efficient n8n workflow templates for SMEs, focusing on digital marketing, sales, and operational excellence. Get ready to automate, innovate, and elevate your business. Connect me on Linkedin for custom solutions.

外部链接
在 n8n.io 查看

分享此工作流

分类

分类: 34