8
n8n 中文网amn8n.com

自动化 YouTube 视频转博客文章,集成 Gemini AI 转录

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 12 个节点。主要使用 Set, Webhook, ReadWriteFile, ExecuteCommand, Agent 等节点。 自动化 YouTube 视频转博客文章,集成 Gemini AI 转录

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "afca6c018fd85ecd6bb793dc620b1f9d2de9ea7edb2532dd2708b1a0cf01d640",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e45b22bd-caa4-4adc-8da0-5229cea720cf",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        624,
        -112
      ],
      "parameters": {
        "text": "=Please create a blog post from the following video transcript. Identify the key themes, structure the content logically, and generate a title, category, and tags.\n\nTranscript:\n{{ $json.content.parts[0].text }}",
        "options": {
          "systemMessage": "=You are an expert content strategist and editor. Your task is to transform a raw video transcript into a well-structured and engaging blog post.\n\nYou must adhere to the following rules:\n1.  Your entire response must be a single JSON object enclosed in a markdown code block (```json ... ```).\n2.  Do NOT include any introductory phrases, explanations, apologies, or any text whatsoever outside of the JSON markdown block.\n3.  The tone should be informative, clear, and engaging, transforming the conversational transcript into polished written content.\n4.  The language of all generated text in the output JSON must match the primary language of the input transcript.\n5.  The JSON object must have this exact structure:\n{\n  \"category\": \"A single, top-level category based on the content.\",\n  \"tags\": [\n    \"An array of 3 to 5 relevant, lowercase string tags.\"\n  ],\n  \"title\": \"A creative, compelling title for the blog post.\",\n  \"short_description\": \"A concise, one-to-two sentence summary of the blog post, optimized for search engines (around 150-160 characters).\",\n  \"body\": \"The full blog post content formatted in HTML, including <h1>, <h2>, and <p> tags.\"\n}\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "b5606a62-9672-41f0-9a97-26994256e409",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        672,
        240
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "vppVWKsiofTY92Ht",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "74a9a1c6-af62-4e4e-8295-86550691525f",
      "name": "多表:您可以连接多个表以实现有组织的数据结构",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        768,
        96
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"category\": \"Travel\",\n  \"tags\": [\n    \"breda\",\n    \"summer travel\",\n    \"netherlands\",\n    \"city trip\",\n    \"north brabant\"\n  ],\n  \"title\": \"Soaking Up the Last Days of Summer: A Weekend Guide to Breda\",\n  \"short_description\": \"Don't let summer slip away! Discover the best things to do in Breda for a perfect late-summer weekend, from historic sites to vibrant terrace cafes.\",\n  \"body\": \"<h1>Soaking Up the Last Days of Summer: A Weekend Guide to Breda</h1><p>As the golden light of late August settles over the Netherlands, there's no better place to capture the final, perfect moments of the season than Breda. This historic city in North Brabant, with its relaxed atmosphere and beautiful scenery, is the ideal destination for a memorable summer weekend. Here’s how to make the most of it.</p><h2>Morning: History and Coffee on the Grote Markt</h2><p>Start your day in the heart of the city, the Grote Markt. The square is dominated by the impressive Grote Kerk (Great Church), a must-see landmark. After exploring the church, find a spot at one of the many bustling terrace cafes. Ordering a coffee and watching the city wake up is a quintessential Breda experience.</p><h2>Afternoon: A Royal Stroll in Valkenberg Park</h2><p>Escape the midday heat with a walk through the shady paths of Valkenberg Park. This stunning park, once the garden of the Castle of Breda, is filled with ancient trees, fountains, and remnants of the old city fortifications. It's the perfect place for a picnic or simply to relax with a book and enjoy the sunshine.</p><h2>Evening: Sunset by the Harbor</h2><p>As the day winds down, head to Breda's charming harbor (Haven). The waterfront comes alive in the evening, with boats gently bobbing and restaurant lights reflecting on the water. Enjoy dinner with a view or simply take a stroll along the dock to watch a beautiful late-summer sunset.</p>\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "e81db094-9445-4953-81c6-45ddf7c8f68f",
      "name": "下载 YouTube 音频",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -176,
        -112
      ],
      "parameters": {
        "command": "=yt-dlp -x --audio-format mp3 -o output-{{ $json.now_unix }}.mp3 '{{ $('Get Youtube Url').item.json.body.videoUrl }}'\n"
      },
      "typeVersion": 1
    },
    {
      "id": "362d280b-bf10-4ad6-9d9a-2274ed2747fb",
      "name": "读取输出 MP3 二进制数据",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        32,
        -112
      ],
      "parameters": {
        "options": {},
        "fileSelector": "=output-{{ $('Get Time').item.json.now_unix }}.mp3"
      },
      "typeVersion": 1
    },
    {
      "id": "d37ff911-4ebf-4acc-9d66-1be48921d71a",
      "name": "回复博客文章",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1376,
        -112
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.4
    },
    {
      "id": "09d024f5-9c8e-4332-bbb6-5a58d735152d",
      "name": "获取 YouTube 网址",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -704,
        -112
      ],
      "webhookId": "57fddbda-a118-4546-a223-8e91a7d53ff6",
      "parameters": {
        "path": "57fddbda-a118-4546-a223-8e91a7d53ff6",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "3e1d9f4b-a1e0-4f02-9928-4ddab3a474dc",
      "name": "转录录音",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        320,
        -112
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-1.5-flash",
          "cachedResultName": "models/gemini-1.5-flash"
        },
        "options": {},
        "resource": "audio",
        "inputType": "binary"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "vppVWKsiofTY92Ht",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "646309f5-7b01-41d1-be78-67894e062540",
      "name": "将视频网址添加到输出",
      "type": "n8n-nodes-base.set",
      "position": [
        1136,
        -112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f7f8a432-f6a3-4594-8048-53e170b46db6",
              "name": "videoUrl",
              "type": "string",
              "value": "={{ $('Get Youtube Url').item.json.body.url }}"
            },
            {
              "id": "b441eb26-15bb-43c6-afea-fa4733a100b5",
              "name": "fulltext",
              "type": "string",
              "value": "={{ $('Transcribe a recording').item.json.content.parts[0].text }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "04bc9c1f-e198-42f9-9fb1-31fa391aed43",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -256
      ],
      "parameters": {
        "color": 3,
        "width": 464,
        "height": 336,
        "content": "## 获取 YouTube 视频音频"
      },
      "typeVersion": 1
    },
    {
      "id": "f1c784d9-01f4-4219-876e-1fa2da37d687",
      "name": "获取时间",
      "type": "n8n-nodes-base.set",
      "position": [
        -464,
        -112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1573616e-c70d-468b-ba22-1e0a337dbfa0",
              "name": "now_unix",
              "type": "number",
              "value": "={{ new Date().getTime() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1c821513-2683-48bf-a015-67f02d5c671a",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        -288
      ],
      "parameters": {
        "color": 5,
        "width": 512,
        "height": 688,
        "content": "## 准备博客文章"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Add Video Url to Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Time": {
      "main": [
        [
          {
            "node": "Download the Youtube Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Youtube Url": {
      "main": [
        [
          {
            "node": "Get Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Output MP3 Binary": {
      "main": [
        [
          {
            "node": "Transcribe a recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe a recording": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Video Url to Output": {
      "main": [
        [
          {
            "node": "Respond The Blog Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Download the Youtube Audio": {
      "main": [
        [
          {
            "node": "Read Output MP3 Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者

Hi 👋 I design automation workflows with n8n, AI, and custom APIs. My focus is on building reliable systems that save time and boost productivity. Always happy to answer questions about my templates.

外部链接
在 n8n.io 查看

分享此工作流