8
n8n 中文网amn8n.com

Submagic + 自动发布

高级

这是一个Multimodal AI领域的自动化工作流,包含 21 个节点。主要使用 If, Code, Wait, HttpRequest, GoogleSheets 等节点。 使用Submagic、Postiz和OpenAI自动为视频添加字幕并发布到Instagram和TikTok

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Drive API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "6LCQ1CdkcxmGPWYs",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Submagic + 自动发布",
  "tags": [],
  "nodes": [
    {
      "id": "0a25a595-fde8-41b1-b748-4aaa76dfa3c7",
      "name": "Google Drive 触发器",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -16,
        0
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "<<<GOOGLE_DRIVE_FOLDER_ID>>>",
          "cachedResultUrl": "<<<GOOGLE_DRIVE_FOLDER_URL>>>",
          "cachedResultName": "<<<GOOGLE_DRIVE_FOLDER_NAME>>>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "603fe943-e36c-44f0-82fc-0d419e2571f8",
      "name": "发布到 Submagic",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        0
      ],
      "parameters": {
        "url": "https://api.submagic.co/v1/projects",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "title",
              "value": "My First Video"
            },
            {
              "name": "language",
              "value": "en"
            },
            {
              "name": "videoUrl",
              "value": "={{ $json.webViewLink }}"
            },
            {
              "name": "templateName",
              "value": "Hormozi 2"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "713c3d1c-b739-4298-b3ac-29bd76dde2a9",
      "name": "从 Submagic 获取带字幕视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        672,
        0
      ],
      "parameters": {
        "url": "=https://api.submagic.co/v1/projects/{{ $json.id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "5744f643-fb29-4975-85c3-77d85ea6a35e",
      "name": "下载带字幕视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1136,
        0
      ],
      "parameters": {
        "url": "={{ $json.downloadUrl }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "14e5ea48-6b99-4742-a520-fac3335dcdf6",
      "name": "上传到 Postiz",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1376,
        0
      ],
      "parameters": {
        "url": "https://api.postiz.com/public/v1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "57225264-85f2-4c4c-82f7-9a63022d6d94",
      "name": "发布到 Instagram",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2480,
        0
      ],
      "parameters": {
        "url": "https://api.postiz.com/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"type\": \"now\",\n  \"shortLink\": false,\n  \"date\": \"{{ new Date($now).toISOString() }}\",\n  \"tags\": [],\n  \"posts\": [\n    {\n      \"integration\": { \"id\": \"cmeku38qa00cpo90yfw4ai6lt\" },\n      \"value\": [\n        {\n          \"content\": \"{{ $json.output }}\",\n          \"image\": [\n            {\n              \"id\": \"{{ $node['Upload to Postiz'].json.id }}\",\n              \"path\": \"{{ $node['Upload to Postiz'].json.path }}\"\n            }\n          ]\n        }\n      ],\n      \"settings\": {\n        \"post_type\": \"post\"\n      }\n    }\n  ]\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "814fb8ae-7536-4da9-9217-88e00cb0749c",
      "name": "更新日志",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1568,
        0
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "Video Description / Prompt",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Video Description / Prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Video URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Video URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Caption",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "<<<SHEET_ID>>>",
          "cachedResultUrl": "<<<GOOGLE_SHEET_URL>>>",
          "cachedResultName": "<<<SHEET_NAME>>>"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "<<<GOOGLE_SHEET_ID>>>",
          "cachedResultUrl": "<<<GOOGLE_SHEET_URL>>>",
          "cachedResultName": "<<<SHEET_NAME>>>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "00c8896b-6b79-43fc-b541-13c097ddb72f",
      "name": "OpenAI聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2064,
        224
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5",
          "cachedResultName": "gpt-5"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "30f23841-c8ae-476c-881e-61a05d848e0f",
      "name": "字幕代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2144,
        0
      ],
      "parameters": {
        "text": "={{ $json['Image Prompt'] }}",
        "options": {
          "systemMessage": "You are an expert Instagram caption writer.\nYour task is to take the image prompt provided by the user and generate a short, engaging caption that encourages parents and children to try Larrydoodle — a free online doodle drawing creator for kids. With Larrydoodle, children can design custom coloring pages, print them out, and start coloring instantly.\n\nCaption Guidelines\nKeep captions short, playful, and engaging for parents and kids.\nEmphasize the fun, creativity, and ease of using Larrydoodle.\nRotate the call-to-action (CTA) across posts, using one of these variations:\nCreate your own custom coloring pages for free today at larrydoodle.com\nTry it free and start creating now\nComment below what you created and share your creations with us by tagging #larrydoodle or tagging us in your Instagram Stories (make it lively and inviting)\n\nTone: friendly, imaginative, and encouraging.\n\nOutput Rules\nDo not use special characters like {} ! %$&*\nReturn only one final caption per request.\nDo not include explanations or formatting outside of the caption itself."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "45b0d6d7-a4e2-4bb4-ba0c-47a44437ca64",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        1968,
        0
      ],
      "parameters": {
        "jsCode": "// inputData contains all rows from the previous node\nreturn [items[items.length - 1]];"
      },
      "typeVersion": 2
    },
    {
      "id": "b8abfe9e-c12c-4571-8d84-590c1f73c87f",
      "name": "获取表格中的行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1760,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "<<<SHEET_ID>>>",
          "cachedResultUrl": "<<<GOOGLE_SHEET_URL>>>",
          "cachedResultName": "<<<SHEET_NAME>>>"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "<<<GOOGLE_SHEET_ID>>>",
          "cachedResultUrl": "<<<GOOGLE_SHEET_URL>>>",
          "cachedResultName": "<<<SHEET_NAME>>>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "b361b439-9d7f-45fe-8354-e31be2ba001e",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        880,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "df5cad6d-dcb6-4f43-b8f6-4a5e97950c46",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "1204ab08-7196-45a1-a235-0bab382627cf",
      "name": "等待 15 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        864,
        224
      ],
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "4dde6f5a-ebed-4285-a5ba-eb378ec68293",
      "name": "等待 15 秒1",
      "type": "n8n-nodes-base.wait",
      "position": [
        464,
        0
      ],
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "f51a5eb7-771f-4cc1-b046-7e208d8a6213",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -272
      ],
      "parameters": {
        "color": 5,
        "width": 256,
        "height": 800,
        "content": "Google Drive 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "57355d6c-4880-43ae-be0d-12728e64eb96",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -272
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 800,
        "content": "发布到 Submagic"
      },
      "typeVersion": 1
    },
    {
      "id": "c7de4f8e-7fb8-4d60-933d-1e7ae596d47b",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        -272
      ],
      "parameters": {
        "color": 3,
        "width": 656,
        "height": 800,
        "content": "使用 Submagic 添加字幕"
      },
      "typeVersion": 1
    },
    {
      "id": "fcde94bd-9a82-41a4-8e04-b136aec57293",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        -272
      ],
      "parameters": {
        "color": 4,
        "width": 608,
        "height": 800,
        "content": "上传到 Postiz"
      },
      "typeVersion": 1
    },
    {
      "id": "1366f8ab-0f70-418f-baee-228c764a198c",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        -272
      ],
      "parameters": {
        "color": 5,
        "width": 688,
        "height": 800,
        "content": "Instagram 字幕"
      },
      "typeVersion": 1
    },
    {
      "id": "10f05958-6526-4c41-9e1a-428d1841081f",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2432,
        -272
      ],
      "parameters": {
        "color": 2,
        "width": 320,
        "height": 800,
        "content": "发布到 Instagram"
      },
      "typeVersion": 1
    },
    {
      "id": "cc4a6414-b84e-40c9-8675-2f19a0dad2ab",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        -400
      ],
      "parameters": {
        "width": 672,
        "height": 992,
        "content": "🎥 自动字幕和自动发布视频到 Instagram 和 TikTok"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Download Captioned Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 15 Secs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Caption Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Log": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 15 Secs": {
      "main": [
        [
          {
            "node": "Get Captioned Video from Submagic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Caption Agent": {
      "main": [
        [
          {
            "node": "Post to Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 15 Secs1": {
      "main": [
        [
          {
            "node": "Get Captioned Video from Submagic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post to Submagic": {
      "main": [
        [
          {
            "node": "Wait 15 Secs1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Postiz": {
      "main": [
        [
          {
            "node": "Update Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Caption Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Post to Submagic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Captioned Video": {
      "main": [
        [
          {
            "node": "Upload to Postiz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Captioned Video from Submagic": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 多模态 AI

需要付费吗?

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

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

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

作者
Automate With Marc

Automate With Marc

@marconi

Automating Start-Up and Business processes. Helping non-techies understand and leverage Agentic AI with easy to understand step-by-step tutorials. Check out my educational content: https://www.youtube.com/@Automatewithmarc

外部链接
在 n8n.io 查看

分享此工作流