8
n8n 中文网amn8n.com

使用Blotato和GPT 4.1自动生成YouTube Short病毒历史视频

高级

这是一个自动化工作流,包含 16 个节点。主要使用 Set, Wait, HttpRequest, Agent, ScheduleTrigger 等节点。 使用GPT-4o和Blotato创建和发布关于历史假设的YouTube Shorts

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

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "915jekkCa4sU0ZCS",
  "meta": {
    "instanceId": "a287613f1596da776459594685fbf4e2b4a12124f80ab8c8772f5e37bff103ae"
  },
  "name": "使用 Blotato 和 GPT 4.1 自动生成 YouTube Short 病毒历史视频",
  "tags": [],
  "nodes": [
    {
      "id": "841264d0-d54c-4fb8-8a44-06e6b9a36893",
      "name": "上传到 Blotato",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1504,
        16
      ],
      "parameters": {
        "url": "https://backend.blotato.com/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "={{ $('Get Video').item.json.item.mediaUrl }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Prepare for Publish').item.json.blotato_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "05aebcff-fbfd-40f5-ae31-65263e947c2c",
      "name": "定时触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -192,
        16
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 10
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1fe2c097-0199-45c4-b475-b8e72fa0f104",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        832,
        16
      ],
      "webhookId": "1e7c5091-8369-460e-888e-8b8c07d8bcee",
      "parameters": {
        "unit": "minutes",
        "amount": 10
      },
      "typeVersion": 1.1,
      "alwaysOutputData": false
    },
    {
      "id": "5d78cdfe-f6a1-4810-89de-42be6bb087e8",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        -80
      ],
      "parameters": {
        "color": 3,
        "width": 832,
        "height": 340,
        "content": "# 视频生成器"
      },
      "typeVersion": 1
    },
    {
      "id": "04543d7f-1014-4f65-892e-f81d125b9c51",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        -80
      ],
      "parameters": {
        "color": 3,
        "width": 752,
        "height": 340,
        "content": "# YouTube 发布"
      },
      "typeVersion": 1
    },
    {
      "id": "06bd7c2d-6e65-47d4-8ec3-85410157028a",
      "name": "准备发布",
      "type": "n8n-nodes-base.set",
      "position": [
        1280,
        16
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"blotato_api_key\": \"{{ $('Prepare Video').item.json.blotato_api_key }}\",\n  \"instagram_id\": \"\",\n  \"youtube_id\": \"\",\n  \"tiktok_id\": \"\",\n  \"facebook_id\": \"\",\n  \"facebook_page_id\": \"\",\n  \"threads_id\": \"\",\n  \"twitter_id\": \"\",\n  \"linkedin_id\": \"\",\n  \"pinterest_id\": \"\",\n  \"pinterest_board_id\": \"\",\n  \"bluesky_id\": \"\",\n  \"final_text_long\": {{ $('Prepare Video').item.json.script.caption.toJsonString() }},\n  \"final_text_short\": {{ $('Prepare Video').item.json.script.caption.toJsonString() }}\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "abdd8007-d272-4fde-907a-c208de21119f",
      "name": "创建视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        624,
        16
      ],
      "parameters": {
        "url": "https://backend.blotato.com/v2/videos/creations",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"template\": {\n    \"id\": \"{{ $json.template }}\",\n    \"voiceId\": \"{{ $json.voiceId }}\",\n    \"captionPosition\": \"{{ $json.captionPosition }}\"\n  },\n  \"script\": {{ $json.script.script.toJsonString() }},\n  \"style\": \"{{ $json.style }}\",\n  \"animateFirstImage\": {{ $json.animate_first_image }},\n  \"animateAll\": {{ $json.animate_all }},\n  \"textToImageModel\": \"{{ $json.text_to_image_model }}\",\n  \"imageToVideoModel\": \"{{ $json.image_to_video_model }}\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $json.blotato_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "67230c13-2861-4581-874f-534e36b3f160",
      "name": "头脑风暴想法",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -16,
        240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "WbMi3ZLLBnECFAAV",
          "name": "temp"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "32fa5d81-bd22-488f-823e-8a3d9286d319",
      "name": "准备视频",
      "type": "n8n-nodes-base.set",
      "position": [
        416,
        16
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"blotato_api_key\": \"\",\n  \"template\": \"empty\",\n  \"voiceId\": \"elevenlabs/eleven_multilingual_v2/pqHfZKP75CvOlQylNhV4\",\n  \"captionPosition\": \"bottom\",\n  \"script\": {{ $('AI Agent1').item.json.output.toJsonString() }},\n  \"style\": \"cinematic\",\n  \"animate_first_image\": true,\n  \"animate_all\": false,\n  \"text_to_image_model\": \"replicate/recraft-ai/recraft-v3\",\n  \"image_to_video_model\": \"fal-ai/framepack\"\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "3cb260e0-6029-46ba-ba65-163c2966d739",
      "name": "获取视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1056,
        16
      ],
      "parameters": {
        "url": "=https://backend.blotato.com/v2/videos/creations/{{ $json.item.id }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Prepare Video').item.json.blotato_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "8bfe7047-4360-434e-b464-b2226370d6cc",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        176,
        240
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"script\": \"your video script\",\n\t\"caption\": \"short video caption\",\n    \"title\": \"hook title\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "4fc73657-ec43-455a-97a7-29f88619fb74",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        32,
        16
      ],
      "parameters": {
        "text": "=# INSTRUCTIONS\n\n1. Brainstorm 50 different viral faceless video ideas related to theme \"What if history...\".\n\n2. Randomly select 1 of the ideas. Research relevant statistics, dates, and figures related to the specific idea.\n\n3. Write a 60-second video script for a viral faceless video. Use 6th grade language, use active voice, and start with a hook that leaves viewers wanting to know the answer. Do NOT start with a greeting like \"Hey there!\".\n\n4. Write a 2-sentence video caption, use 6th grade language, no emojis, and append 3 relevant hashtags to the end of the caption, including \"#ai\".\n\n# OUTPUT FORMAT\n\nIn JSON format:\n\n1. Output the script.\n2. Output the caption.\n3. Output the hook title",
        "options": {
          "returnIntermediateSteps": false
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "a9e0aa65-bc62-4192-bb03-c96c7a6f7e20",
      "name": "便签说明5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -80
      ],
      "parameters": {
        "color": 3,
        "width": 588,
        "height": 484,
        "content": "# 脚本生成器"
      },
      "typeVersion": 1
    },
    {
      "id": "a053bf39-38c4-4d10-b1d1-f4fb9e08895e",
      "name": "YT 发布",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1728,
        16
      ],
      "parameters": {
        "url": "https://backend.blotato.com/v2/posts",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={\n\"post\": {\n  \"accountId\": \"{{ $('Prepare for Publish').item.json.youtube_id }}\",\n  \"content\": {\n    \"text\": \"{{ $('Prepare for Publish').item.json.final_text_short }}\",\n    \"mediaUrls\": [\n      \"{{ $('Get Video').item.json.item.mediaUrl }}\" \n    ],\n    \"platform\": \"youtube\"\n  },\n  \"target\": {\n    \"targetType\": \"youtube\",\n    \"title\": \"{{ $('AI Agent1').item.json.output.title }}\",\n    \"privacyStatus\": \"public\",\n    \"shouldNotifySubscribers\": true,\n    \"isMadeForKids\": false\n  }\n}\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Prepare for Publish').item.json.blotato_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "aca73112-13e5-43e2-97ca-e0ab80938b88",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        464
      ],
      "parameters": {
        "color": 4,
        "width": 992,
        "height": 976,
        "content": "## 自动化 YT Short 模板说明"
      },
      "typeVersion": 1
    },
    {
      "id": "cf726b47-88ee-4bd6-87b9-48cc2ad8dce0",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        464
      ],
      "parameters": {
        "width": 1104,
        "height": 624,
        "content": "@[youtube](yptHq2J8DmI)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1b02d59e-1d8c-4c42-b9e0-6875018315d7",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Get Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Prepare Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video": {
      "main": [
        [
          {
            "node": "Prepare for Publish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Video": {
      "main": [
        [
          {
            "node": "Create Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Brainstorm Idea": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Blotato": {
      "main": [
        [
          {
            "node": "YT Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare for Publish": {
      "main": [
        [
          {
            "node": "Upload to Blotato",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

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

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

作者
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 查看

分享此工作流