8
n8n 中文网amn8n.com

使用 Google Sheets 安排和自动发布视频到 Instagram、LinkedIn 和 TikTok

高级

这是一个自动化工作流,包含 20 个节点。主要使用 If, Set, Code, Telegram, GoogleSheets 等节点。 使用 Google Sheets 安排和自动发布视频到 Instagram、LinkedIn 和 TikTok

前置要求
  • Telegram Bot Token
  • Google Sheets API 凭证

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "7de9c03c5df732f2294cfa53379db42b70689739afb5ed84c40dd844fed72f02"
  },
  "nodes": [
    {
      "id": "5f5bd65b-479b-47e9-ae78-68dc6d169082",
      "name": "格式化云端硬盘内容",
      "type": "n8n-nodes-base.set",
      "position": [
        1120,
        720
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "97b7d7fa-1c7e-480c-8a01-52f63cab87bb",
              "name": "Title",
              "type": "string",
              "value": "={{ $('Google Sheets').item.json.Title }}"
            },
            {
              "id": "72e6c291-ddc2-46f1-960a-ac2036c80105",
              "name": "Copy",
              "type": "string",
              "value": "={{ $('Google Sheets').item.json.Copy }}"
            },
            {
              "id": "f50748ec-1027-458d-b263-1b9c132bd5d2",
              "name": "Status",
              "type": "string",
              "value": "={{ $('Google Sheets').item.json.Status }}"
            },
            {
              "id": "e1a2b3c4-d5e6-f7g8-h9i0-j1k2l3m4n5o6",
              "name": "video_url",
              "type": "string",
              "value": "={{ $('Google Sheets').item.json[\"Video Link\"] }}"
            },
            {
              "id": "f1g2h3i4-j5k6-l7m8-n9o0-p1q2r3s4t5u6",
              "name": "is_drive_file",
              "type": "boolean",
              "value": true
            },
            {
              "id": "row-number-drive",
              "name": "row_number",
              "type": "number",
              "value": "={{ $('Google Sheets').item.json.row_number }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2d6766c2-f247-465b-828f-0e9509eab52a",
      "name": "社交媒体账户ID",
      "type": "n8n-nodes-base.set",
      "position": [
        1312,
        720
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9eeb5af9-55a3-47ab-ab27-a87bbd91755c",
              "name": "facebook id (Page Id)",
              "type": "string",
              "value": ""
            },
            {
              "id": "7e3308c5-bf44-4b1e-8d63-8efaccd4f763",
              "name": "board id (Pinterest)",
              "type": "string",
              "value": ""
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "42b31498-cacd-4306-b50f-cdbe147a1f97",
      "name": "Google Sheets1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1808,
        768
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "Posteado",
            "row_number": "={{ $('Google Sheets').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Copy",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Copy",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Video Link",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Video Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Plataforma",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Plataforma",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Fecha.Hora",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Fecha.Hora",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Día",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Día",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZKbnD7GM6eAHKzyDY98cvz9jMUib1HLU7d9gohYkR3s/edit#gid=0",
          "cachedResultName": "Video"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "1ZKbnD7GM6eAHKzyDY98cvz9jMUib1HLU7d9gohYkR3s"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "e2IAoPzl326S7AXl",
          "name": "JOSE IA"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "de1b0952-97a3-4548-97c6-429506562615",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        880,
        736
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "057ea0fb-bba4-4394-bcda-c66fe860467b",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json['Readable time'] }}",
              "rightValue": "={{ $('Google Sheets').item.json[\"Fecha.Hora\"] }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "58fd593a-55e3-43f3-8a83-2e5c30faf08a",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        624,
        784
      ],
      "parameters": {
        "jsCode": "// Obtener la fecha del Schedule Trigger\nconst triggerData = $('Schedule Trigger').first().json;\nconst originalDate = new Date(triggerData.scheduled || triggerData.timestamp || new Date());\n\n// Convertir a zona horaria de Santiago de Chile\nconst santiagoDate = new Date(originalDate.toLocaleString(\"en-US\", {timeZone: \"America/Santiago\"}));\n\n// Arrays para traducir al español\nconst meses = [\n  'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',\n  'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'\n];\n\nconst diasSemana = [\n  'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'\n];\n\n// Extraer componentes de la fecha\nconst dia = santiagoDate.getDate();\nconst mes = meses[santiagoDate.getMonth()];\nlet horas = santiagoDate.getHours();\nconst ampm = horas >= 12 ? 'pm' : 'am';\n\n// Convertir a formato de 12 horas\nhoras = horas % 12;\nhoras = horas ? horas : 12; // la hora '0' debe ser '12'\n\nconst diaSemana = diasSemana[santiagoDate.getDay()];\n\n// Crear el formato deseado: \"22 de Junio a las 9 am\"\nconst readableTime = `${dia} de ${mes} a las ${horas} ${ampm}`;\n\nreturn [{\n  json: {\n    \"Readable time\": readableTime,\n    \"Day of week\": diaSemana\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "67e4c47c-6c50-4db7-980a-9f9d90c02171",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        64,
        704
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            },
            {
              "triggerAtHour": 21
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1d12a289-2338-4c17-ae47-03eb3e3029f0",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        368,
        768
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "Listo para postear ",
              "lookupColumn": "Status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZKbnD7GM6eAHKzyDY98cvz9jMUib1HLU7d9gohYkR3s/edit#gid=0",
          "cachedResultName": "Video"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "1ZKbnD7GM6eAHKzyDY98cvz9jMUib1HLU7d9gohYkR3s"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "e2IAoPzl326S7AXl",
          "name": "JOSE IA"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "b1fa7e04-f27a-4ad4-b1ea-705e5f4e0c57",
      "name": "发送文本消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2160,
        736
      ],
      "webhookId": "6a86891a-9444-45ed-9ff4-b20d3fc71f58",
      "parameters": {
        "text": "=**📹 Resultados de publicación:**\n\n🎯 **Plataforma:** {{ $('Upload a video').item.json.results[0].platform }}\n🔗 **URL:** {{ $('Upload a video').item.json.results[0].post_url }}\n✅ **Éxito:** {{ $('Upload a video').item.json.results[0].success }}\n\n---\n\n🎯 **Plataforma:** {{ $('Upload a video').item.json.results[1].platform }}\n🔗 **URL:** {{ $('Upload a video').item.json.results[1].post_url }}\n✅ **Éxito:** {{ $('Upload a video').item.json.results[1].success }}\n\n---\n\n🎯 **Plataforma:** {{ $('Upload a video').item.json.results[2].platform }}\n🔗 **URL:** {{ $('Upload a video').item.json.results[2].post_url }}\n✅ **Éxito:** {{ $('Upload a video').item.json.results[2].success }}",
        "chatId": "Your Chat Id ",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "tz3EoKfwx1hYbf7e",
          "name": "Multiagent"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d8a3d499-d080-4b05-a72f-21b335807127",
      "name": "上传视频",
      "type": "n8n-nodes-upload-post.uploadPost",
      "position": [
        1520,
        720
      ],
      "parameters": {
        "user": "JoseAI",
        "title": "={{ $('Social Media Account IDs').item.json.Title }}\n\n{{ $('Social Media Account IDs').item.json.Copy }}",
        "video": "={{ $('Social Media Account IDs').item.json.video_url }}",
        "platform": [
          "instagram",
          "linkedin",
          "tiktok"
        ],
        "operation": "uploadVideo"
      },
      "credentials": {
        "uploadPostApi": {
          "id": "rm9qzLTD8cDPhmOC",
          "name": "Upload Post account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e7b9ce97-22ad-4d42-a900-355fe8e88a8c",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        416
      ],
      "parameters": {
        "width": 280,
        "height": 416,
        "content": "## ⏰ 自动触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "5238bc52-83b7-46cb-9bc6-99ce206f3d76",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        384
      ],
      "parameters": {
        "width": 220,
        "height": 544,
        "content": "## 📊 获取计划发布的帖子"
      },
      "typeVersion": 1
    },
    {
      "id": "9a9c2db6-b679-4692-9575-e1f119ba11ae",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        304
      ],
      "parameters": {
        "width": 236,
        "height": 672,
        "content": "## 🕐 时间格式化器"
      },
      "typeVersion": 1
    },
    {
      "id": "eefaa4a9-1e27-4420-94d0-05d5d84ffaca",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        240
      ],
      "parameters": {
        "width": 188,
        "height": 624,
        "content": "## ✅ 时间验证"
      },
      "typeVersion": 1
    },
    {
      "id": "a7cb50a7-4b55-4e95-af31-289703097eb2",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        256
      ],
      "parameters": {
        "width": 204,
        "height": 624,
        "content": "## 📝 数据准备"
      },
      "typeVersion": 1
    },
    {
      "id": "df4652fc-c2a2-4857-8a12-64a9394eb3bf",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        432
      ],
      "parameters": {
        "width": 188,
        "height": 464,
        "content": "## 🆔 账户配置"
      },
      "typeVersion": 1
    },
    {
      "id": "47ed06b8-1c25-43e1-9c83-a04da050c2d3",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        272
      ],
      "parameters": {
        "width": 252,
        "height": 608,
        "content": "## 🎬 多平台上传"
      },
      "typeVersion": 1
    },
    {
      "id": "6e65eca8-544a-425a-be1f-3dbde7ac67d1",
      "name": "便签 8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        368
      ],
      "parameters": {
        "width": 300,
        "height": 560,
        "content": "## 📊 更新表格状态"
      },
      "typeVersion": 1
    },
    {
      "id": "6c0d0d18-73b6-4e52-814c-b394708410c9",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        288
      ],
      "parameters": {
        "width": 300,
        "height": 624,
        "content": "## 📱 Telegram 通知"
      },
      "typeVersion": 1
    },
    {
      "id": "98854a34-69db-46da-9714-90f85110eb9c",
      "name": "便签主体",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "color": 3,
        "width": 2432,
        "height": 1248,
        "content": "# 自动化社交媒体视频发布"
      },
      "typeVersion": 1
    },
    {
      "id": "642ec7b5-a698-485e-a12e-c5add5bbe1f9",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        1024
      ],
      "parameters": {
        "height": 192,
        "content": "## Google Sheets"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Format Drive Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload a video": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Drive Content": {
      "main": [
        [
          {
            "node": "Social Media Account IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Social Media Account IDs": {
      "main": [
        [
          {
            "node": "Upload a video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

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

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

作者
Jose Bossa

Jose Bossa

@bossa

AI consultant with over 3 months and high ticket salesman over 2 years.

外部链接
在 n8n.io 查看

分享此工作流