8
n8n 中文网amn8n.com

我的工作流9_旧版

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 31 个节点。主要使用 If, Set, Code, Wait, Limit 等节点。 使用MagicHour和Gemini从Google Sheets每日创建YouTube视频

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "l0DWacMq9HsRdfZK",
  "meta": {
    "instanceId": "89f857783d94f88de198b7de991dc13cb9f9288d07a0818751d10e53e6f4a74d"
  },
  "name": "我的工作流 9_旧版",
  "tags": [],
  "nodes": [
    {
      "id": "db899b52-e3ef-4902-aef7-d00d768604fa",
      "name": "表格行已添加",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -2368,
        240
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1x-2u3o5ZTbF9LkdJ0r9U0wQXdTX5nk2VTRexECb-qcU"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "zMsnSX7qN7xPttZ6",
          "name": "Google Sheets Trigger account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e0d4bd28-2dc5-4a21-b032-f9662aaf9224",
      "name": "聊天输入",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1888,
        432
      ],
      "webhookId": "8afa2591-4310-4a74-85d5-9dc6bbe1bc29",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "6298a14e-cf94-44b7-89cd-7ee04261fe68",
      "name": "规范化输入",
      "type": "n8n-nodes-base.set",
      "position": [
        -1696,
        320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "prompt_id",
              "name": "Prompt",
              "type": "string",
              "value": "={{ $json.Prompt || $json.chatInput }}"
            },
            {
              "id": "source_id",
              "name": "source",
              "type": "string",
              "value": "={{ $json.Prompt ? 'sheet' : 'chat' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e3ff7b59-a0d7-4d3b-98dc-2508c79d4c21",
      "name": "生成视频参数",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1472,
        320
      ],
      "parameters": {
        "text": "=You will receive ONE free-text prompt from a Google Sheet:\n\nRAW_PROMPT: \"{{$json.Prompt}}\"\n\nGoal: Produce ONLY a valid JSON body for MagicHour Text-to-Video (no prose, no backticks). Infer missing details from context and common sense.\n\nDefaults (if not stated or implied):\n- end_seconds: 5\n- orientation: \"landscape\" (use \"portrait\" if RAW_PROMPT implies vertical / mobile, e.g., \"vertical\", \"reel\", \"tiktok\", \"portrait\"; use \"square\" if it says \"square\")\n- resolution: \"720p\" (use \"720p\" if RAW_PROMPT mentions HD; use \"1080p\" if it mentions Full HD / 1080)\n- fps: 24\n- guidance_scale: 7.5\n- model: \"magichour-v1\"\n- music: false\n- seed: omit unless explicitly given\n- negative_prompt: omit unless clearly implied (e.g., \"no blur\", \"avoid text\")\n\nInterpretation rules:\n- Clean grammar; turn shorthand into a clear cinematic description.\n- Expand vague phrases into specific, natural language visuals (subject, action, setting, lighting, mood).\n- Respect indirect hints: \n  - \"handheld\", \"POV\", \"selfie\" → informal, closer framing.\n  - \"cinematic\", \"film look\", \"bokeh\", \"depth of field\" → add cinematic phrasing.\n  - Time of day words (sunset/night/morning) → include lighting.\n  - Platform hints (\"vertical\", \"reel\", \"story\") → orientation \"portrait\".\n- Never add brands, gore, or unsafe/NSFW content.\n\nOutput schema (ONLY these keys):\n{\n  \"name\": string,                           // short job name based on the prompt\n  \"end_seconds\": integer,                   // 1–120\n  \"orientation\": \"landscape\"|\"portrait\"|\"square\",\n  \"resolution\": \"480p\"|\"720p\"|\"1080p\",\n  \"fps\": integer,                           // 12–60\n  \"guidance_scale\": number,                 // 0–20\n  \"model\": string,\n  \"music\": boolean,\n  \"style\": {\n    \"prompt\": string,                       // enriched, camera-ready description\n    \"negative_prompt\": string               // OPTIONAL; omit if none\n  },\n  \"webhook_url\": string                     // OPTIONAL; omit if unknown\n}\n\nNaming rule:\n- name = first 5–8 meaningful words of the enriched prompt, lower case.\n\nReturn ONLY the JSON object.",
        "options": {
          "systemMessage": "You are an assistant inside an n8n workflow. Your job is to read a single Google Sheet row and produce a STRICT JSON object that matches the Text-to-Video request body for the MagicHour API.\n\nRules:\n- Output ONLY JSON (no prose, no backticks).\n- Validate and normalize user inputs. Apply sensible defaults when values are missing or invalid.\n- Do not invent fields that are not in the schema below.\n- Trim whitespace; coalesce empty strings to null; remove keys whose value becomes null unless required.\n\nReturn EXACTLY one JSON object conforming to the schema provided in the Structured Output Parser."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "e1ab9b74-77e1-495c-b17d-1c165f6edd02",
      "name": "视频参数解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1312,
        544
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"name\": \"video clip\",\n  \"end_seconds\": 5,\n  \"orientation\": \"landscape\",\n  \"resolution\": \"720p\",\n  \"fps\": 24,\n  \"guidance_scale\": 7.5,\n  \"model\": \"magichour-v1\",\n  \"music\": false,\n  \"style\": {\n    \"prompt\": \"cinematic description\"\n  }\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "3fa0edce-0495-4cd6-b684-d71b02db889d",
      "name": "创建视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1120,
        320
      ],
      "parameters": {
        "url": "https://api.magichour.ai/v1/text-to-video",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ $json.output }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "typeVersion": 4.2,
      "continueOnFail": true
    },
    {
      "id": "52246df7-31a1-4b16-a64b-e7aa83505dda",
      "name": "初始化重试计数器",
      "type": "n8n-nodes-base.set",
      "position": [
        -896,
        320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "video_id",
              "name": "video_id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "retry_count",
              "name": "retry_count",
              "type": "number",
              "value": "=0"
            },
            {
              "id": "max_retries",
              "name": "max_retries",
              "type": "number",
              "value": "=20"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0d180549-7797-4676-a536-e71b9e23d44e",
      "name": "检查视频状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -672,
        320
      ],
      "parameters": {
        "url": "=https://api.magichour.ai/v1/video-projects/{{ $json.video_id }}",
        "options": {
          "timeout": 10000
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "v3NjdfxikoD7NPHW",
          "name": "Bearer YOUR_TOKEN_HERE account 2"
        }
      },
      "typeVersion": 4.2,
      "continueOnFail": true
    },
    {
      "id": "ca6c413d-e2a4-4ff9-a49c-164e4a204d15",
      "name": "视频完成?",
      "type": "n8n-nodes-base.if",
      "position": [
        -448,
        304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6b723249-19f5-4d67-b2b2-8cff4d2f3b44",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "complete"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "526d14c8-8a6f-495e-b90d-885652ffce9b",
      "name": "等待并重试",
      "type": "n8n-nodes-base.wait",
      "position": [
        -224,
        496
      ],
      "webhookId": "c5a2cf81-313c-4305-a6d1-032744e9611e",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "b2732e93-2aa5-4631-bcf3-a02b685cd962",
      "name": "下载视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -224,
        160
      ],
      "parameters": {
        "url": "={{ $json.downloads[0].url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2,
      "continueOnFail": true
    },
    {
      "id": "6660692e-54a6-4b75-9faf-59bfeedd0070",
      "name": "准备元数据",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        304
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "original_prompt",
              "name": "original_prompt",
              "type": "string",
              "value": "={{ $('Normalize Input').item.json.Prompt }}"
            },
            {
              "id": "video_description",
              "name": "video_description",
              "type": "string",
              "value": "={{ $('Generate Video Parameters').item.json.output.style.prompt }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8f92cd49-26a2-4f05-a24e-54c03bd1c019",
      "name": "生成 YouTube 数据",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        224,
        304
      ],
      "parameters": {
        "text": "=Generate YouTube metadata for this video:\n\n**Original Prompt:** {{ $json.original_prompt }}\n**Video Description:** {{ $json.video_description }}\n\nCreate an engaging YouTube title (max 100 chars), detailed description (include keywords naturally), and relevant tags (comma-separated).\n\nReturn ONLY a JSON object with this exact structure:\n{\n  \"youtube_title\": \"Your title here\",\n  \"youtube_description\": \"Your description here\",\n  \"youtube_tags\": \"tag1, tag2, tag3, tag4, tag5\"\n}",
        "options": {
          "systemMessage": "You are a YouTube SEO expert. Generate optimized metadata for videos. Always return ONLY valid JSON without any additional text or formatting."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "0eeffa8c-9896-42b9-a402-18d07d1de200",
      "name": "YouTube JSON 解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        368,
        528
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"youtube_title\": \"Amazing Video Title\",\n  \"youtube_description\": \"Detailed description...\",\n  \"youtube_tags\": \"tag1, tag2, tag3\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "9ddabdd7-c757-4271-9990-e9edf69d8b83",
      "name": "准备表格更新",
      "type": "n8n-nodes-base.set",
      "position": [
        1248,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "youtube_url",
              "name": "Youtube URL",
              "type": "string",
              "value": "=https://www.youtube.com/watch?v={{ $json.uploadId }}"
            },
            {
              "id": "upload_status",
              "name": "upload_status",
              "type": "string",
              "value": "complete"
            },
            {
              "id": "video_title",
              "name": "Youtube Title",
              "type": "string",
              "value": "={{ $('Generate YouTube Data').item.json.output.youtube_title }}"
            },
            {
              "id": "uploaded_at",
              "name": "uploaded_at",
              "type": "string",
              "value": "={{ new Date().toISOString() }}"
            },
            {
              "id": "ae7a42b3-7066-44ef-aa84-510c8f261756",
              "name": "Youtube Tags",
              "type": "string",
              "value": "={{ $('Generate YouTube Data').item.json.output.youtube_tags }}"
            },
            {
              "id": "e64805ec-aa6a-4672-b64e-e346cb254048",
              "name": "Youtube Description",
              "type": "string",
              "value": "={{ $('Generate YouTube Data').item.json.output.youtube_description }}"
            },
            {
              "id": "63b49ec9-999d-4bdf-bcd0-15e989849314",
              "name": "Download URL",
              "type": "string",
              "value": "={{ $('Check Video Status').item.json.downloads[0].url }}"
            },
            {
              "id": "54ca1aba-85ec-496e-8468-7745f1d5994c",
              "name": "Prompt",
              "type": "string",
              "value": "={{ $('Normalize Input').item.json.Prompt }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f02805ee-fc64-4ea9-ab20-27c765c24fef",
      "name": "更新结果",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1472,
        160
      ],
      "parameters": {
        "columns": {
          "value": {
            "Prompt": "={{ $json.Prompt }}",
            "Youtube URL": "={{ $json['Youtube URL'] }}",
            "Download URL": "={{ $json['Download URL'] }}",
            "Youtube Tags": "={{ $json['Youtube Tags'] }}",
            "Youtube Title": "={{ $json['Youtube Title'] }}",
            "Youtube Description": "={{ $json['Youtube Description'] }}"
          },
          "schema": [
            {
              "id": "Prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Download URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Download URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Youtube Title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Youtube Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Youtube Tags",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Youtube Tags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Youtube Description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Youtube Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Youtube URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Youtube URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Prompt"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "value": "1x-2u3o5ZTbF9LkdJ0r9U0wQXdTX5nk2VTRexECb-qcU"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "42be420e-d832-4e24-a4c8-048d10991d6c",
      "name": "Gemini AI 模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        240,
        528
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "abb1a3f1-4f7c-4d0e-9636-43fc09703208",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1472,
        544
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "36aca885-9df1-45e0-b729-95c319acaa0f",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        592,
        160
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "324140f6-6443-4734-b9ea-fdee1b3f5b9d",
      "name": "编辑字段",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "dcc88ab6-4c5e-4b2b-b92f-bde26c5fcd00",
              "name": "video_id",
              "type": "string",
              "value": "={{ $('Initialize Retry Counter').item.json.video_id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2d74bb48-2c46-4af6-8e6c-071db4ddd660",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        -2144,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d850f36e-8dc0-475d-a8bc-87f7b61bbba8",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json[\"Download URL\"] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "abbb3edf-0de7-4264-9766-c3088be7270a",
      "name": "限制",
      "type": "n8n-nodes-base.limit",
      "position": [
        -1920,
        224
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "92e396db-e6bb-4277-b8a3-a9470df8f77a",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        800,
        160
      ],
      "webhookId": "185bbb0b-4331-4010-9975-9e15841d9a9a",
      "parameters": {
        "amount": 20
      },
      "typeVersion": 1.1
    },
    {
      "id": "775fd4f0-074e-4780-b133-be549e6cf36f",
      "name": "上传视频",
      "type": "n8n-nodes-base.youTube",
      "position": [
        1024,
        160
      ],
      "parameters": {
        "title": "={{ $json.output.youtube_title }}",
        "options": {
          "tags": "={{ $json.output.youtube_tags }}",
          "description": "={{ $json.output.youtube_description }}",
          "privacyStatus": "public"
        },
        "resource": "video",
        "operation": "upload",
        "categoryId": "17",
        "regionCode": "IN"
      },
      "typeVersion": 1
    },
    {
      "id": "97029081-9c96-4050-a4c1-6d474b349a03",
      "name": "混合音频",
      "type": "n8n-nodes-mediafx.mediaFX",
      "position": [
        288,
        0
      ],
      "parameters": {
        "resource": "audio",
        "operation": "mixAudio",
        "mixAudioSourceUrl": "https://freepd.com/music/Adventure.mp3",
        "mixVideoSourceUrl": "={{ $json.videoUrl }}"
      },
      "typeVersion": 1
    },
    {
      "id": "0723650f-fe54-47ed-9bac-7521cd061fa4",
      "name": "JavaScript代码",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        0
      ],
      "parameters": {
        "jsCode": "// Get binary video data\nconst binaryData = $input.first().binary?.data;\n\nif (!binaryData) {\n  throw new Error(\"No binary data found\");\n}\n\n// Create data URL\nconst base64Video = binaryData.data;\nconst mimeType = binaryData.mimeType || 'video/mp4';\nconst dataUrl = `data:${mimeType};base64,${base64Video}`;\n\nreturn {\n  json: {\n    videoUrl: dataUrl\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "0f8f6cd3-920c-4c8c-8638-c927dfedd7c2",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2496,
        368
      ],
      "parameters": {
        "width": 352,
        "height": 544,
        "content": "Google 表格应包含 YouTube URL、YouTube 标题、YouTube 标签、YouTube 描述、下载 URL,并通过原始 Prompt 值匹配以更新正确的行。"
      },
      "typeVersion": 1
    },
    {
      "id": "a785fb65-46db-45ed-a4f3-999efed0c8cf",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        672
      ],
      "parameters": {
        "width": 288,
        "height": 176,
        "content": "在 Google AI Studio 中创建密钥(或设置 Vertex AI + API 密钥/服务账户)。"
      },
      "typeVersion": 1
    },
    {
      "id": "58d63a90-befa-44ca-8649-b918943239fd",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        496
      ],
      "parameters": {
        "width": 528,
        "height": 272,
        "content": "注册/登录 MagicHour 并打开开发者/API 仪表板。"
      },
      "typeVersion": 1
    },
    {
      "id": "cede0ba1-9b30-4467-9cde-9a54ebd6f8d3",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        336
      ],
      "parameters": {
        "width": 320,
        "height": 256,
        "content": "在同一个 Google Cloud 项目中,启用 YouTube Data API v3。"
      },
      "typeVersion": 1
    },
    {
      "id": "38203cda-bb9a-44d5-b125-e5c009206c95",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -144
      ],
      "parameters": {
        "content": "这是免费音频,仅当您拥有 n8n pro 或在 PC 上托管时才能使用"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "51bed7a3-b2da-4764-937c-22dd7b024ace",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Upload a video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Normalize Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat Input": {
      "main": [
        [
          {
            "node": "Normalize Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video": {
      "main": [
        [
          {
            "node": "Initialize Retry Counter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait & Retry": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video": {
      "main": [
        [
          {
            "node": "Prepare Metadata",
            "type": "main",
            "index": 0
          },
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MixAudio audio": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Upload a video": {
      "main": [
        [
          {
            "node": "Prepare Sheet Update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini AI Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate YouTube Data",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Input": {
      "main": [
        [
          {
            "node": "Generate Video Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sheet Row Added": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video Complete?": {
      "main": [
        [
          {
            "node": "Download Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait & Retry",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Metadata": {
      "main": [
        [
          {
            "node": "Generate YouTube Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Video Status": {
      "main": [
        [
          {
            "node": "Video Complete?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "MixAudio audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video Params Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Video Parameters",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "YouTube JSON Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate YouTube Data",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Sheet Update": {
      "main": [
        [
          {
            "node": "Update Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate YouTube Data": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Video Parameters",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Initialize Retry Counter": {
      "main": [
        [
          {
            "node": "Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Video Parameters": {
      "main": [
        [
          {
            "node": "Create Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Divyansh Chauhan

Divyansh Chauhan

@divch

divshiv87@gmail.com

外部链接
在 n8n.io 查看

分享此工作流