{
  "id": "mP0xzDliHhlMDrkO",
  "name": "ElevenLabs AI Voice Cloning from YouTube",
  "tags": [],
  "nodes": [
    {
      "id": "d2b59ce9-6f9d-4d0b-bd61-b1d3327c2070",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -112,
        224
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "de8c6deb-da4b-4696-a197-555c4b0e274a",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        416,
        224
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "a7c5f85d-5cec-4a1b-91d9-cf6e8251008c",
      "name": "Update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1360,
        576
      ],
      "parameters": {
        "columns": {
          "value": {
            "row_number": "={{ $('Loop Over Items').item.json.row_number }}",
            "ELEVENLABS VOICE ID": "={{ $json.voice_id }}"
          },
          "schema": [
            {
              "id": "YOUTUBE VIDEO",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "YOUTUBE VIDEO",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "VOICE NAME",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "VOICE NAME",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ELEVENLABS VOICE ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ELEVENLABS VOICE ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "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/1pZt5RZy6JkcnnxoSG1MFuIrNTLa0P4pVCptuk8uFJdI/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1pZt5RZy6JkcnnxoSG1MFuIrNTLa0P4pVCptuk8uFJdI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pZt5RZy6JkcnnxoSG1MFuIrNTLa0P4pVCptuk8uFJdI/edit?usp=drivesdk",
          "cachedResultName": "ElevenLabs Clone voice from Yotubue"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "76248407-d030-4c0a-8faf-683f406e7bfa",
      "name": "Get videos",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        128,
        224
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "ELEVENLABS VOICE ID"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pZt5RZy6JkcnnxoSG1MFuIrNTLa0P4pVCptuk8uFJdI/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1pZt5RZy6JkcnnxoSG1MFuIrNTLa0P4pVCptuk8uFJdI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pZt5RZy6JkcnnxoSG1MFuIrNTLa0P4pVCptuk8uFJdI/edit?usp=drivesdk",
          "cachedResultName": "ElevenLabs Clone voice from Yotubue"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "558cfb31-463b-45fb-a163-4626a3ae18c9",
      "name": "Get Video ID",
      "type": "n8n-nodes-base.code",
      "position": [
        736,
        240
      ],
      "parameters": {
        "jsCode": "const url = $json['YOUTUBE VIDEO'];\n\nconst regex = /(?:youtube\\.com\\/(?:watch\\?v=|embed\\/|v\\/)|youtu\\.be\\/)([^&?/]+)/;\n\nlet match = url.match(regex);\nlet video_id = match ? match[1] : null;\n\nreturn [\n  {\n    json: {\n      video_id\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "e439f81e-a101-49bf-a41a-47f183c67364",
      "name": "From video to audio",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1008,
        240
      ],
      "parameters": {
        "url": "=https://youtube-mp3-2025.p.rapidapi.com/v1/social/youtube/audio",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "id",
              "value": "={{ $json.video_id }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "youtube-mp3-2025.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "XXX"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "4feb1779-a909-415e-8b0e-91f7ec4deb95",
      "name": "Download audio",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1360,
        240
      ],
      "parameters": {
        "url": "={{ $json.linkDownload }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "74ad0d93-086e-4406-9d23-78e69341d919",
      "name": "Create voice",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        736,
        576
      ],
      "parameters": {
        "url": "https://api.elevenlabs.io/v1/voices/add",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "Teresa Mannino"
            },
            {
              "name": "files",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "2d72fa0b-a99f-408a-94be-f02a26ccefc6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        128
      ],
      "parameters": {
        "color": 7,
        "width": 560,
        "height": 272,
        "content": "## STEP 1\n[Clone this Sheet](https://docs.google.com/spreadsheets/d/1pZt5RZy6JkcnnxoSG1MFuIrNTLa0P4pVCptuk8uFJdI/edit?usp=sharing) and fill the columns \"Youtube Video\" and \"Voice Name\""
      },
      "typeVersion": 1
    },
    {
      "id": "e84c80e5-2f22-46d6-a9a6-700b27f06bda",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        128
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 272,
        "content": "## STEP  2\nSet your [Rapid API Key with FREE Trial](https://rapidapi.com/nguyenmanhict-MuTUtGWD7K/api/youtube-mp3-2025) and enter it in the \"x-rapidapi-key\" field."
      },
      "typeVersion": 1
    },
    {
      "id": "32175dd4-8a33-4478-ad60-78bc55a49993",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        448
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 288,
        "content": "## STEP 3\nGo to Developers, create your [ElevenLabs API Key](https://try.elevenlabs.io/ahkbf00hocnu). Set Header Auth (Name: xi-api-key, Value: YOUR_API_KEY)"
      },
      "typeVersion": 1
    },
    {
      "id": "54138ce2-c081-40b6-82a6-ded6879f4958",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -368
      ],
      "parameters": {
        "width": 1200,
        "height": 448,
        "content": "## Automated AI Voice Cloning from YouTube videos to ElevenLabs & Google Sheets\nThis workflow automates the process of **creating cloned voices** in **ElevenLabs** using audio extracted from **YouTube** videos. It processes a list of video URLs from Google Sheets, converts them to audio, submits them to [ElevenLabs for voice cloning](https://try.elevenlabs.io/ahkbf00hocnu)*, and records the generated voice IDs back to the spreadsheet.\n\n*ONLY FOR STARTER, CREATOR, PRO PLAN\n\n\n### **How it works:**\n\nThis workflow automates the end-to-end process of cloning voices in ElevenLabs using YouTube videos listed in a Google Sheet. It first retrieves rows without an \u201cELEVENLABS VOICE ID,\u201d extracts the YouTube video ID, and converts the video to audio via RapidAPI. The resulting M4A file is downloaded and uploaded to the ElevenLabs `/v1/voices/add` endpoint to generate a new cloned voice. Finally, the generated `voice_id` is written back to the corresponding row in the Google Sheet, completing the automation loop.\n\n### **Setup steps:**\n\nStart by duplicating the Google Sheets template and filling in the \"YOUTUBE VIDEO\" and \"VOICE NAME\" columns. Obtain and configure API keys: use a RapidAPI key for the YouTube-to-audio conversion node and an ElevenLabs key in the \"Create voice\" node under `xi-api-key`. Optionally, replace the hardcoded voice name with a dynamic reference from your sheet. Once configured, execute the workflow to automatically create voices and update the sheet with their generated IDs.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cce395ea-f2f4-49f7-8813-adda1d14fc4f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -656
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 736,
        "content": "## MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new **YouTube channel**](https://youtube.com/@n3witalia). Here I\u2019ll share videos and Shorts with practical tutorials and **FREE templates for n8n**.\n\n[![image](https://n3wstorage.b-cdn.net/n3witalia/youtube-n8n-cover.jpg)](https://youtube.com/@n3witalia)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "c0847de5-a6a8-4ce3-a0a2-4a4a42a89560",
  "connections": {
    "Get videos": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create voice": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video ID": {
      "main": [
        [
          {
            "node": "From video to audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download audio": {
      "main": [
        [
          {
            "node": "Create voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Get Video ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "From video to audio": {
      "main": [
        [
          {
            "node": "Download audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}