バッチAI動画生成 - Freepik Minimax HailuoとGoogle製品パッケージの統合

中級

これはContent Creation, Multimodal AI分野の自動化ワークフローで、13個のノードを含みます。主にCode, Wait, Switch, GoogleDrive, HttpRequestなどのノードを使用。 AI ビデオのバッチ生成 - Google スイートと統合された Freepik Minimax Hailuo

前提条件
  • Google Drive API認証情報
  • ターゲットAPIの認証情報が必要な場合あり
  • Google Sheets API認証情報
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "39cea19d-02e6-4431-9d8e-0dc76646d6cd",
      "name": "動画をBase64としてダウンロード",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        128,
        1904
      ],
      "parameters": {
        "url": "={{ $json.data.generated[0] }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "78fa05c7-f18f-4d91-a425-d3760106016e",
      "name": "Google Drive1にアップロード",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        256,
        2048
      ],
      "parameters": {
        "name": "=video - {{ $('Get prompt from google sheet').item.json.Name }} - {{ $('Duplicate Rows2').item.json.run }}",
        "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": "1TnDibwPPPUm3VbmETiqWDVhtaUTLJ6mn",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1TnDibwPPPUm3VbmETiqWDVhtaUTLJ6mn",
          "cachedResultName": "n8n workflows"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "pl7bkYVKthXr65dR",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "ed922804-f614-4dc4-be98-263c803e8382",
      "name": "動画を作成",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -720,
        1952
      ],
      "parameters": {
        "url": "https://api.freepik.com/v1/ai/image-to-video/minimax-hailuo-02-768p",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.Prompt }}   "
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "MBOXm1HI3OHfvpZ7",
          "name": "Header Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4a77b1d7-8e1f-49c0-899c-182ab2866d6f",
      "name": "動画URLを取得",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "If the previous node isn't SUCCEEDED yet, re-run \"Get Task Status\" after a short wait.",
      "position": [
        -496,
        1936
      ],
      "parameters": {
        "url": "=\nhttps://api.freepik.com/v1/ai/image-to-video/minimax-hailuo-02-768p/{{ $json.data.task_id }}\n\n",
        "options": {
          "timeout": 120000
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "MBOXm1HI3OHfvpZ7",
          "name": "Header Auth account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "1a4468a7-753e-4caf-956d-6d07121e0da5",
      "name": "スイッチ",
      "type": "n8n-nodes-base.switch",
      "position": [
        -208,
        1968
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Completed",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "43a3872d-1597-4265-92df-cb055a049d10",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.data.status }}",
                    "rightValue": "COMPLETED"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Failed",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d54580f5-e892-475d-b2eb-19dcf216e1e2",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.data.status }}",
                    "rightValue": "FAILED"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Created",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "089f70ab-b693-44c4-bca7-dfee87bd6fee",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.data.status }}",
                    "rightValue": "CREATED"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "In Progress",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d3086f63-8dd7-421d-a880-877f318c5366",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.data.status }}",
                    "rightValue": "IN_PROGRESS"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "25e5774c-ea6d-47bd-bb32-93136982ee16",
      "name": "待機",
      "type": "n8n-nodes-base.wait",
      "position": [
        32,
        2032
      ],
      "webhookId": "a042360e-97f5-49cc-9173-447db7d07ba8",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "714ea29e-4834-4da7-aab2-68e2dae8e0a1",
      "name": "行を複製2",
      "type": "n8n-nodes-base.code",
      "position": [
        -1296,
        2080
      ],
      "parameters": {
        "jsCode": "const original = items[0].json;\n\nreturn [\n  { json: { ...original, run: 1 } },\n  { json: { ...original, run: 2 } },\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "4c240d7f-5497-4165-b485-3fcb8c0a0baa",
      "name": "アイテムをループ処理",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -944,
        1952
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "34f8f236-4efb-44c8-aead-4dc19d7e2381",
      "name": "google シートからプロンプトを取得",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1504,
        2016
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1_u9IxEZINcwKQB15Rfx7C1hM71zeDST58Fz3nRHTCUY/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1_u9IxEZINcwKQB15Rfx7C1hM71zeDST58Fz3nRHTCUY",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1_u9IxEZINcwKQB15Rfx7C1hM71zeDST58Fz3nRHTCUY/edit?usp=drivesdk",
          "cachedResultName": "freepik prompts"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "3d4d077f-4988-4b70-b3a5-358ecbab19f4",
      "name": "付箋17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1616,
        1200
      ],
      "parameters": {
        "width": 2032,
        "content": "## 📬 Need Help or Want to Customize This?\n📧 [robert@ynteractive.com](mailto:robert@ynteractive.com)  \n🔗 [LinkedIn](https://www.linkedin.com/in/robert-breen-29429625/)"
      },
      "typeVersion": 1
    },
    {
      "id": "a310dde0-0eb9-4a18-8e0a-cb9519fd2b9f",
      "name": "付箋2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1616,
        1376
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 860,
        "content": "\n#### Node Configuration Details:\n\n##### Get prompt from google sheet (Google Sheets)\n- **Document ID**: Your Google Sheet ID (from Step 3)\n- **Sheet Name**: `Sheet1` (or your sheet name)\n- **Operation**: Read\n- **Credentials**: Select your \"Google Sheets account\"\n\n##### Duplicate Rows2 (Code Node)\n- **Purpose**: Creates multiple variations of each prompt\n- **JavaScript Code**:\n```javascript\nconst original = items[0].json;\n\nreturn [\n  { json: { ...original, run: 1 } },\n  { json: { ...original, run: 2 } },\n];\n```\nGoogle sheet to copy: \nhttps://docs.google.com/spreadsheets/d/1_u9IxEZINcwKQB15Rfx7C1hM71zeDST58Fz3nRHTCUY/edit?usp=sharing"
      },
      "typeVersion": 1
    },
    {
      "id": "c7610191-4c24-4701-9c3f-bce9feb9e167",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        1376
      ],
      "parameters": {
        "color": 6,
        "width": 712,
        "height": 860,
        "content": "\n##### Loop Over Items (Split in Batches)\n- Processes items in batches to manage API rate limits\n- **Options**: Keep default settings\n- **Reset**: `false`\n\n##### Create Video (HTTP Request)\n- **Method**: `POST`\n- **URL**: `https://api.freepik.com/v1/ai/image-to-video/minimax-hailuo-02-768p`\n- **Authentication**: Generic → HTTP Header Auth\n- **Credentials**: Select your \"Header Auth account\"\n- **Send Body**: `true`\n- **Body Parameters**:\n  - **Name**: `prompt`\n  - **Value**: `={{ $json.Prompt }}`\n\n##### Get Video URL (HTTP Request)\n- **Method**: `GET`\n- **URL**: `https://api.freepik.com/v1/ai/image-to-video/minimax-hailuo-02-768p/{{ $json.data.task_id }}`\n- **Authentication**: Generic → HTTP Header Auth\n- **Credentials**: Select your \"Header Auth account\"\n- **Timeout**: `120000` (2 minutes)\n- **Purpose**: Polls the API for video completion status\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6b1c2572-5143-402b-9bdd-8225b187ee4e",
      "name": "付箋4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        1376
      ],
      "parameters": {
        "color": 3,
        "width": 664,
        "height": 860,
        "content": "\n##### Switch (Switch Node)\n- **Purpose**: Routes workflow based on video generation status\n- **Conditions**:\n  - **Completed**: `{{ $json.data.status }}` equals `COMPLETED`\n  - **Failed**: `{{ $json.data.status }}` equals `FAILED`\n  - **Created**: `{{ $json.data.status }}` equals `CREATED`\n  - **In Progress**: `{{ $json.data.status }}` equals `IN_PROGRESS`\n\n##### Wait (Wait Node)\n- **Amount**: `30` seconds\n- **Purpose**: Waits before re-checking video status\n- **Webhook ID**: Auto-generated for resume functionality\n\n##### Download Video as Base64 (HTTP Request)\n- **Method**: `GET`\n- **URL**: `={{ $json.data.generated[0] }}`\n- **Purpose**: Downloads completed video file\n\n##### Upload to Google Drive1 (Google Drive)\n- **Operation**: Upload\n- **Name**: `=video - {{ $('Get prompt from google sheet').item.json.Name }} - {{ $('Duplicate Rows2').item.json.run }}`\n- **Drive ID**: `My Drive`\n- **Folder ID**: Your Google Drive folder ID (from Step 4)\n- **Credentials**: Select your \"Google Drive account\"\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "25e5774c-ea6d-47bd-bb32-93136982ee16": {
      "main": [
        [
          {
            "node": "4a77b1d7-8e1f-49c0-899c-182ab2866d6f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1a4468a7-753e-4caf-956d-6d07121e0da5": {
      "main": [
        [
          {
            "node": "39cea19d-02e6-4431-9d8e-0dc76646d6cd",
            "type": "main",
            "index": 0
          }
        ],
        [],
        [
          {
            "node": "25e5774c-ea6d-47bd-bb32-93136982ee16",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "25e5774c-ea6d-47bd-bb32-93136982ee16",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ed922804-f614-4dc4-be98-263c803e8382": {
      "main": [
        [
          {
            "node": "4a77b1d7-8e1f-49c0-899c-182ab2866d6f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4a77b1d7-8e1f-49c0-899c-182ab2866d6f": {
      "main": [
        [
          {
            "node": "1a4468a7-753e-4caf-956d-6d07121e0da5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "714ea29e-4834-4da7-aab2-68e2dae8e0a1": {
      "main": [
        [
          {
            "node": "4c240d7f-5497-4165-b485-3fcb8c0a0baa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4c240d7f-5497-4165-b485-3fcb8c0a0baa": {
      "main": [
        [],
        [
          {
            "node": "ed922804-f614-4dc4-be98-263c803e8382",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "78fa05c7-f18f-4d91-a425-d3760106016e": {
      "main": [
        [
          {
            "node": "4c240d7f-5497-4165-b485-3fcb8c0a0baa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "39cea19d-02e6-4431-9d8e-0dc76646d6cd": {
      "main": [
        [
          {
            "node": "78fa05c7-f18f-4d91-a425-d3760106016e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "34f8f236-4efb-44c8-aead-4dc19d7e2381": {
      "main": [
        [
          {
            "node": "714ea29e-4834-4da7-aab2-68e2dae8e0a1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - コンテンツ作成, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
中級
ノード数13
カテゴリー2
ノードタイプ8
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

作成者
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34