8
n8n 中文网amn8n.com

YouTube 转录、摘要与翻译到 Google 文档

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 10 个节点。主要使用 Code, Webhook, GoogleDocs, HttpRequest, ChainLlm 等节点。 使用 Gemini AI 将 YouTube 转录和翻译至 Google 文档

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "2fWnDQqsPy4mECqD",
  "meta": {
    "instanceId": "14e4c77104722ab186539dfea5182e419aecc83d85963fe13f6de862c875ebfa",
    "templateCredsSetupCompleted": true
  },
  "name": "YouTube 转录、摘要与翻译到 Google 文档",
  "tags": [],
  "nodes": [
    {
      "id": "15dc0183-3cf9-4538-b8ae-061e1447932e",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -462,
        -320
      ],
      "parameters": {
        "width": 1780,
        "height": 480,
        "content": "## YouTube 转录、摘要与翻译到 Google 文档"
      },
      "typeVersion": 1
    },
    {
      "id": "3b60bfc9-4b53-485d-a27f-acf34936d61b",
      "name": "附加摘要和翻译",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1116,
        -200
      ],
      "parameters": {
        "actionsUi": {
          "actionFields": [
            {
              "text": "={{ $('Summarize and Translate Text').item.json.text }}",
              "action": "insert",
              "locationChoice": "location"
            }
          ]
        },
        "operation": "update",
        "documentURL": "={{ $json.id }}"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "id": "ZvA06wLb0dNuPHl3",
          "name": "Google Docs account 3"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "838ac98e-e39d-4123-9128-a18382ff6127",
      "name": "创建输出文档",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        896,
        -200
      ],
      "parameters": {
        "title": "={{ $('Format Webhook Input').item.json.videoId }}_{{ $('Format Webhook Input').item.json.language }}",
        "folderId": "1FM-kd1_Xi2ikKpK7xAULFWYc_qVH2wwc"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "id": "ZvA06wLb0dNuPHl3",
          "name": "Google Docs account 3"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "c1464a7e-5f7d-4fc5-9021-dd3560565c50",
      "name": "总结和翻译文本",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        520,
        -200
      ],
      "parameters": {
        "text": "=This is a transcription that needs processing.\n\nPlease do the following:\n\n1. Generate a complete and accurate translation of the transcript into the specified language.\n2. Generate a concise and clear summary of the transcript’s key points in the same language.\n\nTarget Language:\n{{ $('Combine Transcription Content').item.json.language }}\n\nTranscript:\n{{ $('Combine Transcription Content').item.json.mergedTranscript }}\n\nOutput Format:\nPlease return the result strictly in this JSON structure, with both values written in the target language:\n\n{\n  \"translation\": \"Full translated version of the transcript in the specified language.\",\n  \"summary\": \"Clear and concise summary of the transcript in the same language.\"\n}\n\nMake sure:\n- Both \"translation\" and \"summary\" keys are present.\n- The summary should not be skipped or embedded inside the translation.\n- Do NOT include markdown formatting (no triple backticks or code blocks).\n- Output must be valid JSON only.\n",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "c4f73e8b-91fd-48d3-8843-98ce83c8e592",
      "name": "合并转录内容",
      "type": "n8n-nodes-base.code",
      "position": [
        300,
        -200
      ],
      "parameters": {
        "jsCode": "// Get the transcript JSON array from previous node\nconst data = $json[\"content\"];\n\n// Merge all text entries into a single string\nconst mergedText = data.map(entry => entry.text).join(\" \");\n\nreturn [\n  {\n    json: {\n      mergedTranscript: mergedText\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "44103ed5-30af-45ea-b909-9ac8400d627e",
      "name": "转录 YouTube 视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        80,
        -200
      ],
      "parameters": {
        "url": "https://api.supadata.ai/v1/youtube/transcript?",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "videoId",
              "value": "={{ $json.videoId }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "18941114-4d44-4c6c-a01f-a9d15bcd498a",
      "name": "格式化 Webhook 输入",
      "type": "n8n-nodes-base.code",
      "position": [
        -140,
        -200
      ],
      "parameters": {
        "jsCode": "const url = $json[\"body\"][\"youtube_url\"];\nconst match = url.match(/(?:v=|\\/)([0-9A-Za-z_-]{11})/);\nconst videoId = match ? match[1] : null;\n\nreturn [\n  {\n    json: {\n      videoId,\n      language: $json[\"body\"][\"language\"],\n      enable_summary: $json[\"body\"][\"enable_summary\"],\n      originalUrl: url\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "18b57cc6-5713-44cb-ace2-8d773c18f99e",
      "name": "触发 YouTube 处理请求",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -360,
        -200
      ],
      "webhookId": "9b151e87-749b-4ef2-82b4-5c3fec1657cc",
      "parameters": {
        "path": "youtube",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "b5a33cf4-b3fd-4397-ac2f-de67b275fdf8",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -460,
        200
      ],
      "parameters": {
        "width": 1780,
        "height": 500,
        "content": "# **节点分解与描述:**"
      },
      "typeVersion": 1
    },
    {
      "id": "f6c249d4-7924-4d53-be62-2f6aef324ee2",
      "name": "Google Gemini 用于总结和翻译文本",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        608,
        20
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-1.5-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "z5bwgGNZFyahaeS7",
          "name": "Google Gemini(PaLM) Api account 4"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ded3d472-ec65-4166-ae4c-cf62179b6684",
  "connections": {
    "Format Webhook Input": {
      "main": [
        [
          {
            "node": "Transcribe YouTube Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Output Document": {
      "main": [
        [
          {
            "node": "Append Summary and Translation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe YouTube Video": {
      "main": [
        [
          {
            "node": "Combine Transcription Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize and Translate Text": {
      "main": [
        [
          {
            "node": "Create Output Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Transcription Content": {
      "main": [
        [
          {
            "node": "Summarize and Translate Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger YouTube Processing Request": {
      "main": [
        [
          {
            "node": "Format Webhook Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini To Summarize and Translate Text": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize and Translate Text",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
WeblineIndia

WeblineIndia

@weblineindia

A Leading Software Engineering, Consulting & Outsourcing Services Company in USA & India serving Clients Globally since 1999.

外部链接
在 n8n.io 查看

分享此工作流