8
n8n 中文网amn8n.com

使用GPT-4o、RunwayML和ElevenLabs的AI旅游视频生成器(用于社交媒体)

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 36 个节点。主要使用 Set, Code, Wait, Limit, Merge 等节点。 GPT-4o、RunwayML、ElevenLabs社交媒体应用

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "4NsA2v65bcNNwBsy",
  "meta": {
    "instanceId": "92e36925b2d06addd7a010605535ce53ac105737436355f7e52e2980c726ed3d",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 GPT-4o、RunwayML 和 ElevenLabs 的 AI 旅游视频生成器(用于社交媒体)",
  "tags": [
    {
      "id": "oKGIn6U0wpeHShTN",
      "name": "working flow",
      "createdAt": "2025-06-02T06:27:44.762Z",
      "updatedAt": "2025-06-02T06:27:44.762Z"
    }
  ],
  "nodes": [
    {
      "id": "4756cd50-a1c1-4fb5-abb6-be184238bfe6",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        100,
        320
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a2fd2a82-3623-4801-a841-89e03c57af90",
      "name": "获取创意",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        320,
        240
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "ToDo",
              "lookupColumn": "video status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE/edit?usp=drivesdk",
          "cachedResultName": "Tour Agent Video Prompts"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "id",
          "name": "Google Sheets account 5"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "a174a0c5-6b5a-4681-b485-18108216f5a0",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        760,
        240
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "content"
      },
      "typeVersion": 1
    },
    {
      "id": "fa2fbbe7-2a8b-4c53-9ab0-97aa792ed916",
      "name": "GPT 4o",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        980,
        460
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "id",
          "name": "OpenAi account 5"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "20e49c87-e841-489e-a7f0-352424d8b71b",
      "name": "图像提示代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        980,
        240
      ],
      "parameters": {
        "text": "=content: {{ $json.content }}\nStyle: {{ $('Set Content').item.json.style }}",
        "options": {
          "systemMessage": "=# Overview\nYou are a master image prompt generator specialized in crafting detailed, high-quality images of tourists and tour destinations prompts for advanced image models like Flux. Your task is to generate vivid, well-structured prompts that accurately depict an awe inspiring touring destination images like the Taj Mahal, Eiffel Tower, Petronas Twin Tower, Opera House Sydney, Bali Beach and the likes in a specified style, with a matching background that complements the theme.\n\n## Instructions:\n- Clearly describe the ambiance and surroundings and details, including details of the localized props and surroundings with warm colours and matching patterns.\n- Specify the mood of freshness that reflect the given style, ensuring they fit naturally.\n- Include details about the background that reinforce the style, creating a cohesive scene.\n- Use rich, descriptive language to enhance visual fidelity.\n- Avoid generic terms—opt for precise, imaginative descriptions that maximize prompt effectiveness.\n- Never output quotation marks (\"\") or newlines (\\n)\n\n## Example \n- Input:\nContent: The Petronas Twin Tower\nStyle: Vivid Night\n\n- Output:\nA vibrant evening with dancing fountains and lights under the majestic petronas twin tower glowing brightly in the powerful floodlight, higlighting pride. \n\n## IMPORTANT\n- All prompts must be family friendly, no sensitive words should be used.\n- No references to weapons (even toy guns).\n- No reference of “showdowns\" or violent events.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "79ce2476-a1a5-414c-9687-dfb44155ab51",
      "name": "移除 \\n",
      "type": "n8n-nodes-base.code",
      "position": [
        1340,
        240
      ],
      "parameters": {
        "jsCode": "// N8N Code Node to remove all newline characters from previous node outputs\n\n// Process all items in the array\n// This will work regardless of whether we're running once for all items or once per item\nfor (let i = 0; i < items.length; i++) {\n  const currentItem = items[i];\n  \n  // Check if the item has an output property\n  if (currentItem.json && currentItem.json.output !== undefined) {\n    // Replace all newline characters with empty string\n    // Using a global regex to catch ALL instances of \\n\n    currentItem.json.output = currentItem.json.output.replace(/\\\\n/g, '');\n    \n    // Also replace actual newline characters if they exist\n    currentItem.json.output = currentItem.json.output.replace(/\\n/g, '');\n  }\n}\n\n// Return the processed items array\nreturn items;"
      },
      "typeVersion": 2
    },
    {
      "id": "3efc9636-d199-4c3b-a71c-97fdbdcb173b",
      "name": "设置提示词",
      "type": "n8n-nodes-base.set",
      "position": [
        1540,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3f7846c8-2c7f-440f-8245-71bf158ea311",
              "name": "prompts",
              "type": "string",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f31d0698-57c5-4c0f-9975-76cf6619c918",
      "name": "生成图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        80,
        720
      ],
      "parameters": {
        "url": "https://api.piapi.ai/api/v1/task",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"model\": \"Qubico/flux1-dev\",\n    \"task_type\": \"txt2img\",\n    \"input\": {\n        \"prompt\": \"{{ $json.prompts }}\",\n        \"width\": 540, \n        \"height\": 960\n    } \n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "id",
          "name": "ImagetoText FluxAPI"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c3f40fee-9147-4cb7-a5a2-e92c62a9f211",
      "name": "90 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        260,
        720
      ],
      "webhookId": "1782cebb-76e1-4998-ba19-95db8dc4f2bd",
      "parameters": {
        "amount": 90
      },
      "typeVersion": 1.1
    },
    {
      "id": "f2afadc1-b3b7-4d37-aca9-f1fc4c4d6ffb",
      "name": "获取图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        440,
        720
      ],
      "parameters": {
        "url": "=https://api.piapi.ai/api/v1/task/{{ $json.data.task_id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "id",
          "name": "ImagetoText FluxAPI"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a3bd8a9c-ed7b-474d-ad3c-1dedccfbbcaa",
      "name": "限制",
      "type": "n8n-nodes-base.limit",
      "position": [
        40,
        1020
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0ded53eb-c91a-4fcc-9b26-eaab9ed863ba",
      "name": "视频状态",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        180,
        1020
      ],
      "parameters": {
        "columns": {
          "value": {
            "row_number": "={{ $('Grab Idea').item.json.row_number }}",
            "video status": "Created"
          },
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content1",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content2",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content3",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content3",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content4",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content4",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "style",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "style",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "caption",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "video status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "video status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "publish status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "publish status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "videoLink",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "videoLink",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10xqt5ZhD6B2BIa0MwqPD05S6XmcpbfD7qshgtCKIZlU/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE/edit?usp=drivesdk",
          "cachedResultName": "Tour Agent Video Prompts"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "id",
          "name": "Google Sheets account 5"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "49cc7e99-d43c-42fb-882a-ac59850f34b0",
      "name": "声音代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        340,
        1020
      ],
      "parameters": {
        "text": "=Style: {{ $('Grab Idea').item.json.style }}",
        "options": {
          "systemMessage": "=# Overview\nYou are a master sound prompt generator. Given a style, generate a vivid one-to-two sentence prompt that describes the ambiance, tone, and key sound elements to create an immersive audio scene. Use evocative language to capture the essence of the style.\n\n## Example\n- Style: soft melody\n- Output: A laughter and  rejoicing and clapping as people talk and dance. A mood of celebration, a mood of joy and happiness"
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "ba9efe21-6feb-4971-9fa2-93fcf87e1943",
      "name": "设置音频",
      "type": "n8n-nodes-base.set",
      "position": [
        660,
        1020
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "5bf4beb2-3a46-4825-9292-13de8ed56400",
              "name": "audio",
              "type": "string",
              "value": "={{ $json.output.trimEnd() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d51378a3-1f3d-4a5c-abee-2dba1f3c303c",
      "name": "生成音频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        800,
        1020
      ],
      "parameters": {
        "url": "https://api.elevenlabs.io/v1/sound-generation",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "text",
              "value": "={{ $json.audio }}"
            },
            {
              "name": "duration_seconds",
              "value": "20"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "Og1dedehMDlK32uM",
          "name": "Elevenlabs"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e330d36c-2246-4153-b633-bd2c7cddd6a1",
      "name": "上传到 Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        940,
        1020
      ],
      "parameters": {
        "name": "={{ $('Grab Idea').item.json.style }}.mp3",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1oGmtM9LXXKfblOQgyJiLCAr3DphJuAFY",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1oGmtM9LXXKfblOQgyJiLCAr3DphJuAFY",
          "cachedResultName": "AudioFile"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "id",
          "name": "name"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d16aa62c-bde6-4f4f-ab97-8696b1a1974b",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1360,
        760
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3
    },
    {
      "id": "4c47133d-b67a-4f66-9001-9f27272f84ff",
      "name": "渲染视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        760
      ],
      "parameters": {
        "url": "https://api.creatomate.com/v1/renders",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"template_id\": \"62cb0638-8d36-4602-900a-0e331e45de27\",\n  \"modifications\": {\n    \"Video-1.source\": \"{{ $json.urls[0].url }}\",\n    \"Video-2.source\": \"{{ $json.urls[1].url }}\",\n    \"Video-3.source\": \"{{ $json.urls[2].url }}\",\n    \"Video-4.source\": \"{{ $json.urls[3].url }}\",\n    \"Audio-Track.source\": \"{{ $('Upload to Drive').first().json.webContentLink }}\",\n    \"Text-1.text\": \"{{ $('Grab Idea').first().json.content1 }}\",\n    \"Text-2.text\": \"{{ $('Grab Idea').first().json.content2 }}\",\n    \"Text-3.text\": \"{{ $('Grab Idea').first().json.content3 }}\",\n    \"Text-4.text\": \"{{ $('Grab Idea').first().json.content4 }}\"\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer credentials"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "15a1c892-8fcb-4ae4-b1c0-8dd9e5300301",
      "name": "25 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        1960,
        760
      ],
      "webhookId": "51238949-14f3-4d3c-aeee-561b67d269b3",
      "parameters": {
        "amount": 25
      },
      "typeVersion": 1.1
    },
    {
      "id": "03e2b2f8-b23e-471d-94f8-a5fa592ca42e",
      "name": "下载视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1360,
        980
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "2b5b4b63-7ef4-448d-862d-2189c6e8079a",
      "name": "更新表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1560,
        980
      ],
      "parameters": {
        "columns": {
          "value": {
            "videoLink": "={{ $json.url }}",
            "video status": "=Created",
            "publish status": "Processed"
          },
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content1",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content2",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content3",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content3",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content4",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content4",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "style",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "style",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "caption",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "video status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "video status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "publish status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "publish status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "videoLink",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "videoLink",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "video status"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K-Btbc1KvhIK-ShsRhFpcPpxR604vHwNACz0Ohwf7Gk/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE/edit?usp=drivesdk",
          "cachedResultName": "Tour Agent Video Prompts"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "id",
          "name": "Google Sheets account 5"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "23e538fc-9bb2-41e9-a30f-f29da1fcb06c",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        100,
        160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a7347268-0032-4b5b-a06c-8f6675d63ca4",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "disabled": true,
      "position": [
        0,
        60
      ],
      "parameters": {
        "color": 4,
        "width": 1780,
        "height": 460,
        "content": "# 生成图片提示词"
      },
      "typeVersion": 1
    },
    {
      "id": "4d726b7d-7105-4f25-a4b6-e3f5604d53c3",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        620
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 260,
        "content": "# 生成图片"
      },
      "typeVersion": 1
    },
    {
      "id": "cdb35bf1-6f0f-4834-8028-58dcaeac208d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        920
      ],
      "parameters": {
        "color": 5,
        "width": 1240,
        "height": 280,
        "content": "# 生成音频"
      },
      "typeVersion": 1
    },
    {
      "id": "8253411e-4577-4c67-be1a-54fcf7a087c6",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        620
      ],
      "parameters": {
        "width": 880,
        "height": 580,
        "content": "# 渲染与上传"
      },
      "typeVersion": 1
    },
    {
      "id": "0db3dd21-a0e7-441e-bdbb-00ffc2f95dde",
      "name": "获取视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1020,
        720
      ],
      "parameters": {
        "url": "=https://api.dev.runwayml.com/v1/tasks/{{ $json.id }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Runway-Version",
              "value": "2024-11-06"
            },
            {
              "name": "Authorization",
              "value": "Bearer credentials"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "id",
          "name": "RunwayAPINate"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5cc6008a-d5a6-4430-aafa-6b382f39f53a",
      "name": "生成视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        680,
        720
      ],
      "parameters": {
        "url": "https://api.dev.runwayml.com/v1/image_to_video",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "promptImage",
              "value": "={{ $json.data.output.image_url }}"
            },
            {
              "name": "model",
              "value": "gen3a_turbo"
            },
            {
              "name": "ratio",
              "value": "768:1280"
            },
            {
              "name": "duration",
              "value": "5"
            },
            {
              "name": "promptText",
              "value": "={{ $json.data.input.prompt }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Runway-Version",
              "value": "2024-11-06"
            },
            {
              "name": "Authorization",
              "value": "Bearer credentials"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e6cf10d5-a3bb-4353-8024-72e00084a159",
      "name": "2 分钟",
      "type": "n8n-nodes-base.wait",
      "position": [
        860,
        720
      ],
      "webhookId": "18144204-7d10-4f70-a90d-f74efbfb41f1",
      "parameters": {
        "unit": "minutes",
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "8a84452a-b9e2-43be-8bbc-6cdae73cbbd8",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        620
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 260,
        "content": "# 生成视频"
      },
      "typeVersion": 1
    },
    {
      "id": "036e9dd1-2fdf-409e-b38d-f9b88b36d019",
      "name": "拆分片段",
      "type": "n8n-nodes-base.code",
      "position": [
        1560,
        760
      ],
      "parameters": {
        "jsCode": "// N8n Code Node to extract URLs from output arrays and combine them into a single array\n\n// This code assumes your input JSON is in items[0].json or is multiple items\n// Determine data source format\nlet inputArray;\n\nif (items.length === 1 && Array.isArray(items[0].json)) {\n  // If we have a single item containing our array\n  inputArray = items[0].json;\n} else if (items.length > 1) {\n  // If we already have multiple items, each containing part of our data\n  inputArray = items.map(item => item.json || item);\n} else {\n  throw new Error('Input structure not recognized. Please check your data format.');\n}\n\n// Create a single array to hold all URLs\nconst urlArray = [];\n\n// Process each item in the input array\nfor (const item of inputArray) {\n  // Get the data object\n  const data = item;\n  \n  // Check if the item has an output array\n  if (data.output && Array.isArray(data.output)) {\n    // For each URL in the output array, add to our URL array\n    for (const url of data.output) {\n      // You can choose to add just the URL or include metadata\n      urlArray.push({\n        url: url,\n        sourceId: data.id,\n        createdAt: data.createdAt\n      });\n    }\n  }\n}\n\n// Return a single item containing the array of all URLs\nreturn [{\n  json: {\n    urls: urlArray\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "2e9e45b2-f3a0-445e-9ba6-b3debde1ed69",
      "name": "分享文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1080,
        1020
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "reader",
            "type": "anyone",
            "allowFileDiscovery": true
          }
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "id",
          "name": "id"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "2c34967a-3468-4951-961f-debe2c0ce5fd",
      "name": "设置内容",
      "type": "n8n-nodes-base.set",
      "position": [
        540,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "aefd1ab6-29fc-46a8-b817-cf86d62d5e4d",
              "name": "content",
              "type": "array",
              "value": "=[\"{{ $json['content1'] }}\",\"{{ $json['content2'] }}\",\"{{ $json['content3'] }}\",\"{{ $json['content4'] }}\"]"
            },
            {
              "id": "16c0db54-c132-4719-87e6-9253a3fc6a54",
              "name": "style",
              "type": "string",
              "value": "={{ $json.style }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "48dd86a9-579f-46c2-8aab-fe8cb3ae06a4",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        300,
        1200
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "id",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "11403315-1554-4fa2-bd15-517f5790ca28",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1780,
        960
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "content": "## 连接到社交媒体并自动发布视频"
      },
      "typeVersion": 1
    },
    {
      "id": "8f091041-34f7-42e7-9418-4d7b8f1a49bd",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -120
      ],
      "parameters": {
        "color": 3,
        "width": 680,
        "content": "## 旅游代理通过文本提示生成的社交媒体视频帖子"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Sound Agent": [
      {
        "json": {
          "output": "A bustling cityscape at dawn, alive with the echoes of distant sirens, the rumble of early buses, and the hurried footsteps of commuters, all layered beneath the playful chirping of birds welcoming the new day.\n"
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6b715ab0-fb86-48ab-9947-afd50bff594d",
  "connections": {
    "Limit": {
      "main": [
        [
          {
            "node": "Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Split Out Parts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT 4o": {
      "ai_languageModel": [
        [
          {
            "node": "Image Prompt Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "2 minutes": {
      "main": [
        [
          {
            "node": "Get Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Grab Idea": {
      "main": [
        [
          {
            "node": "Set Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove \\n": {
      "main": [
        [
          {
            "node": "Set Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Audio": {
      "main": [
        [
          {
            "node": "Generate Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Image Prompt Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "25 Seconds": {
      "main": [
        [
          {
            "node": "Download Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "90 seconds": {
      "main": [
        [
          {
            "node": "Get Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Images": {
      "main": [
        [
          {
            "node": "Generate Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Videos": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          },
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share File": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Set Content": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Prompts": {
      "main": [
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sound Agent": {
      "main": [
        [
          {
            "node": "Set Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render Video": {
      "main": [
        [
          {
            "node": "25 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Sheet": {
      "main": [
        []
      ]
    },
    "Video Status": {
      "main": [
        [
          {
            "node": "Sound Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video": {
      "main": [
        [
          {
            "node": "Update Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Audio": {
      "main": [
        [
          {
            "node": "Upload to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "90 seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Videos": {
      "main": [
        [
          {
            "node": "2 minutes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Parts": {
      "main": [
        [
          {
            "node": "Render Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Drive": {
      "main": [
        [
          {
            "node": "Share File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Grab Idea",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Prompt Agent": {
      "main": [
        [
          {
            "node": "Remove \\n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Sound Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Grab Idea",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Mohan Gopal

Mohan Gopal

@mohan

B2B and B2C Travel App Consultant. Building AI Agent for Travel Solution.

外部链接
在 n8n.io 查看

分享此工作流