8
n8n 中文网amn8n.com

YouTube短视频脚本自动化

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 11 个节点。主要使用 Set, Telegram, Supadata, TelegramTrigger, ChainLlm 等节点。 使用Gemini AI和Telegram从视频链接创建YouTube短视频脚本

前置要求
  • Telegram Bot Token
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "0b3sNR7VKXCSn2Fq",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "YT 脚本自动化",
  "tags": [],
  "nodes": [
    {
      "id": "fc5a9462-5e0c-4425-9e24-bf7794da0974",
      "name": "发送摘要",
      "type": "n8n-nodes-base.telegram",
      "position": [
        980,
        400
      ],
      "parameters": {
        "text": "={{ $json.output.title }}\n\n{{ $json.output.script }}",
        "chatId": "={{ $('Input URL').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "hL07rM7CcHcgYZre",
          "name": "youtube_script_maker_bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "be08404f-7005-46dc-bda0-9fa3bcd638f9",
      "name": "输入 URL",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        0,
        400
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "hL07rM7CcHcgYZre",
          "name": "youtube_script_maker_bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9a74e5e6-e063-4c2d-aeeb-f627a1c8a878",
      "name": "制作转录",
      "type": "n8n-nodes-supadata.supadata",
      "position": [
        160,
        400
      ],
      "parameters": {
        "videoId": "={{ $json.message.text }}",
        "operation": "getTranscript"
      },
      "credentials": {
        "supadataApi": {
          "id": "3CjkrDlWjpILdztV",
          "name": "Supadata account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1fc965aa-ed57-48b5-8185-1e163a9dd7b2",
      "name": "解析",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        800,
        580
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"title\": \"ここに動画のタイトルが入ります\",\n  \"script\": \"ここに動画の台本(全文)が入ります\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "d7699f35-e66d-43ae-b0e7-5182cf89b6f0",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        320
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 340,
        "content": "## 获取视频链接和转录视频"
      },
      "typeVersion": 1
    },
    {
      "id": "acd8d2c1-1949-4ac5-a788-69fe154d1fca",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        320
      ],
      "parameters": {
        "color": 5,
        "width": 620,
        "height": 420,
        "content": "## AI 解析和发送脚本"
      },
      "typeVersion": 1
    },
    {
      "id": "6630067d-5175-41f5-be71-833f27c43cb1",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        100
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 200,
        "content": "## 此模板免费✨"
      },
      "typeVersion": 1
    },
    {
      "id": "7c9fb068-f93d-4836-be6d-031a1a96cafc",
      "name": "脚本映射",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f523292a-168d-4f06-9d99-5d5969b1b09e",
              "name": "full_script",
              "type": "string",
              "value": "={{ $json.content.map(item => item.text).join('\\n') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c5c3e290-df5b-43b7-a2b8-1aaaf88b5a06",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        620,
        580
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-pro"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Dc4myFSoHsGJrGZP",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "522ed972-2fb6-4c39-b9d7-bf8c2aaa5399",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        100
      ],
      "parameters": {
        "width": 600,
        "height": 200,
        "content": "## 必需的 API 密钥:"
      },
      "typeVersion": 1
    },
    {
      "id": "5e57ee04-c618-4afb-8bf8-f4ddfe13c04c",
      "name": "创建脚本",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        620,
        400
      ],
      "parameters": {
        "text": "=#background information\n{{ $json.full_script }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=You are a professional scriptwriter for YouTube Shorts, specializing in trivia across various genres.\nBased on the background information from the YouTube transcript provided by the user, you will create the ultimate script to captivate viewers. Your expertise lies in crafting scripts that interestingly convey fascinating trivia hidden in science, nature, culture, and daily life. Please use an intelligent yet friendly narrative style.\n\n#Conditions\n\nThe content must be based on accurate information.\n\nStructure the script to introduce a lot of trivia at a good tempo, minimizing transitional words.\n\nSpeak intelligently in a casual tone.\n\nThe script should be approximately 170-200 words.\n\nThe opening sentence must be a shocking fact or a line that strongly stimulates the viewer's curiosity. Get straight to the point.\n\nDo not include narration or timestamps; generate only the pure script text.\n\nCreate the script based on the background information from the provided YouTube transcript.\n\nDo not use bold text.\n\nUse periods to break lines appropriately.\n\n#Output Format\ntitle:\nscript:"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b464a592-ac27-4c62-aaaf-11b0b970d895",
  "connections": {
    "Parsing": {
      "ai_outputParser": [
        [
          {
            "node": "Create Script",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Input URL": {
      "main": [
        [
          {
            "node": "Make Transcribe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Create Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Summary": {
      "main": [
        []
      ]
    },
    "Create Script": {
      "main": [
        [
          {
            "node": "Send Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Make Transcribe": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Create Script",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 内容创作, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
中级
节点数量11
分类2
节点类型8
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流