{
  "id": "trapQl1iwBEIRE6q",
  "name": "\ud83d\udca5 Automate YouTube Video Creation and Publishing with Blotato - vide",
  "tags": [],
  "nodes": [
    {
      "id": "819f532a-b957-4689-9ecd-c6c6388ead1f",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        560,
        96
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2b3df5ca-3907-49f5-82da-9f8f89b1843a",
      "name": "Parse Telegram Message",
      "type": "n8n-nodes-base.code",
      "position": [
        784,
        96
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Parse Telegram message\nconst messageText = $input.item.json.message.text;\nconst lines = messageText.split('\\n');\n\n// Extract first line as yt_url and second line as user_desc\nconst yt_url = lines[0] || '';\nconst user_desc = lines[1] || '';\n\n// Return the parsed data\nreturn {\n  json: {\n    yt_url: yt_url.trim(),\n    user_desc: user_desc.trim()\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "b571f99b-01e2-45c7-980b-e262a6f1cabb",
      "name": "Append to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1232,
        96
      ],
      "parameters": {
        "columns": {
          "value": {
            "Url": "={{ $('Parse Telegram Message').item.json.yt_url }}",
            "Date": "={{ $now.toISO() }}",
            "Description": "={{ $('Parse Telegram Message').item.json.user_desc }}"
          },
          "schema": [
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Date"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Workflow Configuration').item.json.sheet_tab }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').item.json.sheet_id }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "a3e3d97e-1d97-4474-a126-0a5380cfc107",
      "name": "Get Video ID",
      "type": "n8n-nodes-base.code",
      "position": [
        1456,
        96
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Extract video ID from YouTube URL\nconst url = $input.item.json.Url;\n\nlet videoId = null;\n\nif (url) {\n  // youtu.be format\n  const youtuBeMatch = url.match(/youtu\\.be\\/([^?&]+)/);\n  if (youtuBeMatch) {\n    videoId = youtuBeMatch[1];\n  } else {\n    // youtube.com/watch?v=\n    const youtubeMatch = url.match(/[?&]v=([^?&]+)/);\n    if (youtubeMatch) {\n      videoId = youtubeMatch[1];\n    }\n  }\n}\n\nreturn {\n  json: {\n    videoId\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "779f43ba-36ee-4fab-b32e-e22d2f8b4237",
      "name": "RapidAPI Summarizer",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1680,
        96
      ],
      "parameters": {
        "url": "https://youtube-video-summarizer-gpt-ai.p.rapidapi.com/api/v1/get-transcript-v2",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "video_id",
              "value": "={{ $json.videoId }}"
            },
            {
              "name": "platform",
              "value": "youtube"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-RapidAPI-Key",
              "value": "={{ $('Workflow Configuration').item.json.rapidapi_key }}"
            },
            {
              "name": "X-RapidAPI-Host",
              "value": "youtube-video-summarizer-gpt-ai.p.rapidapi.com"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "24abb009-5ff1-47b5-bfca-09d0726e8461",
      "name": "Clean Text",
      "type": "n8n-nodes-base.code",
      "position": [
        1904,
        96
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// \u2705 n8n Code node (Run Once for Each Item)\n// Input attendu: $input.item.json.data.transcripts...\n\nconst data = $input.item.json.data;\nif (!data) throw new Error(\"Champ 'data' introuvable dans l'input.\");\n\nconst transcripts = data.transcripts;\nif (!transcripts || typeof transcripts !== \"object\") {\n  throw new Error(\"Champ 'data.transcripts' introuvable.\");\n}\n\n// 1) D\u00e9terminer la langue (ex: fr_auto) si fournie\nconst preferredLang =\n  (Array.isArray(data.language_code) && data.language_code[0]?.code) || null;\n\n// 2) Chercher le meilleur objet de transcription\nconst langObj =\n  (preferredLang && transcripts[preferredLang]) ||\n  transcripts.fr_auto ||\n  transcripts.en_auto ||\n  transcripts[Object.keys(transcripts)[0]];\n\nif (!langObj) throw new Error(\"Aucune langue de transcription trouv\u00e9e.\");\n\n// 3) Choisir le meilleur tableau (priorit\u00e9: custom > auto > default)\nconst segs =\n  langObj.custom ||\n  langObj.auto ||\n  langObj.default;\n\nif (!Array.isArray(segs)) {\n  throw new Error(\"Aucun tableau de segments trouv\u00e9 (custom/auto/default).\");\n}\n\n// 4) Joindre tous les segments texte\nlet text = segs\n  .map(s => (s?.text ?? \"\").toString().trim())\n  .filter(Boolean)\n  .join(\" \");\n\n// 5) Nettoyage l\u00e9ger + d\u00e9codage des entit\u00e9s HTML fr\u00e9quentes\ntext = text\n  .replace(/&amp;#39;|&#39;/g, \"'\")\n  .replace(/&quot;|&#34;/g, '\"')\n  .replace(/&amp;/g, \"&\")\n  .replace(/\\s+/g, \" \")\n  .trim();\n\nreturn {\n  json: {\n    videoId: data.videoId,\n    language: preferredLang || null,\n    clean_transcript: text\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "69de9692-72b4-48bc-bf1d-e4b799308d22",
      "name": "Generate Script",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        560,
        352
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "options": {},
        "responses": {
          "values": [
            {
              "role": "system",
              "content": "=You are a professional video script writer. Based on the provided transcript and user requirements, write a NEW original video script in {{ $('Workflow Configuration').item.json.output_lang }} language. Include: compelling hook, clear outline, well-structured sections, and strong call-to-action."
            },
            {
              "content": "={{ $json.clean_transcript }}\n\nUser requirements and Adapt the original transcript to the new topic: {{ $('Parse Telegram Message').item.json.user_desc }}\n\n### CRITICAL REWRITE RULES\n1. Keep the **exact same structure and flow** \u2014 same order of ideas, same pacing, same emotional progression with use differnt\nword choices so it doesn't look like a copy of the original transcript.\n2. Match the **original length within \u00b110%** of word count.\n3. Maintain the **same emotional tone and rhythm** \u2014 if the original sounds reflective, passionate, or urgent, match that.\n4. Preserve **the hook style** in the first 30 seconds \u2014 same energy, different context.\n5. Maintain **pauses, repetitions, or filler words** (\"I... I mean...\", \"you know\") naturally \u2014 not copy-pasted.\n6. Replace **specific details, names, and examples** with context-relevant equivalents from the Q&A.\n7. Keep **CTAs and closing structure** but adapt them to the new niche or audience.\n8. Write in a **natural, conversational style** \u2014 as if it\u2019s spoken narration.\n9. Do **not** make it longer or add explanations. \nNote: I want the script to be no longer than 5 minutes.\n\n### LANGUAGE AND STYLE STANDARDS\n10. Rephrase the **opening line** completely while keeping the same emotional impact.\n11. Do **not reuse more than 3\u20134 consecutive words** from the original (except common filler words).\n12. **Vary sentence structure** \u2014 if the original says \u201cI\u2019m 40 and I wasted my life,\u201d write something like \u201cI\u2019m 40 now, and I feel like I threw my best years away.\u201d\n13. Replace all **nouns, analogies, and examples** with niche-appropriate ones.\n14. Keep the **filler rhythm** (e.g. \u201cI, I, I\u2026\u201d or \u201cand, and, and\u2026\u201d) but write them freshly.\n15. The goal: **same emotion, same journey, same rhythm \u2014 but different story and context.**\n\nOUTPUT:\nReturn **only** the rewritten script.\nNo meta commentary, no explanations \u2014 just the new script, ready to paste into HeyGen.\nNote: I want the script to be no longer than 5 minutes."
            }
          ]
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "2bc9719f-a068-4581-99eb-505e73897c17",
      "name": "Generate SEO",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        896,
        352
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "options": {
          "textFormat": {
            "textOptions": {
              "type": "json_schema",
              "schema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"title\": {\n      \"type\": \"string\",\n      \"description\": \"SEO title, maximum 70 characters\"\n    },\n    \"description\": {\n      \"type\": \"string\",\n      \"description\": \"SEO description, compelling and keyword-rich\"\n    },\n    \"tags\": {\n      \"type\": \"array\",\n      \"description\": \"Exactly 15 SEO tags\",\n      \"items\": {\n        \"type\": \"string\"\n      },\n      \"minItems\": 15,\n      \"maxItems\": 15\n    }\n  },\n  \"required\": [\"title\", \"description\", \"tags\"],\n  \"additionalProperties\": false\n}\n"
            }
          },
          "instructions": "=You are an SEO expert.\n\nBased ONLY on the provided video script, generate SEO metadata.\n\nCRITICAL RULES:\n- Output MUST be valid JSON\n- NO text outside JSON\n- NO markdown\n- NO explanations\n\nSchema:\n{\n  \"title\": \"string (max 70 characters)\",\n  \"description\": \"string\",\n  \"tags\": [\"string\", \"...\"] // exactly 15 items\n}\n\nGenerate the JSON now.\n"
        },
        "responses": {
          "values": [
            {
              "content": "={{ $json.output[0].content[0].text }}"
            }
          ]
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "e7c32990-dccf-47b4-9810-68be4a9a68ad",
      "name": "Send to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1904,
        352
      ],
      "parameters": {
        "text": "=Transcript : done",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c5213952-cfff-4eef-9e28-31b7a298f72b",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        1008,
        96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "output_lang",
              "type": "string",
              "value": "english"
            },
            {
              "id": "id-2",
              "name": "sheet_id",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Google Sheets Document ID__>"
            },
            {
              "id": "id-3",
              "name": "sheet_tab",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Sheet Tab Name__>"
            },
            {
              "id": "id-4",
              "name": "rapidapi_key",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__RapidAPI Key__>"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "aac04d00-1c36-45bf-9ebb-fc786c5659a1",
      "name": "update Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1680,
        352
      ],
      "parameters": {
        "columns": {
          "value": {
            "Url": "={{ $('Parse Telegram Message').item.json.yt_url }}",
            "Date": "={{ $now.toISO() }}",
            "Tags": "={{ $json.output[0].content[0].text.tags }}",
            "Title New": "={{ $json.output[0].content[0].text.title }}",
            "row_number": 0,
            "Transcript New": "={{ $('Generate Script').item.json.output[0].content[0].text }}",
            "Description New": "={{ $json.output[0].content[0].text.description }}"
          },
          "schema": [
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Title New",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Title New",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Transcript New",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Transcript New",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description New",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Description New",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Tags",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Tags",
              "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": [
            "Url"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Workflow Configuration').item.json.sheet_tab }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').item.json.sheet_id }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7,
      "alwaysOutputData": true
    },
    {
      "id": "a226989b-7e49-41fa-9f70-4ae90da42ef6",
      "name": "Upload Video to BLOTATO",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        1456,
        576
      ],
      "parameters": {
        "mediaUrl": "=https://drive.google.com/uc?export=download&id={{ $json.final_google_drive_url }}",
        "resource": "media"
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "f7577bf3-db6a-46cb-8886-ac3ad16d349a",
      "name": "Youtube",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        1680,
        576
      ],
      "parameters": {
        "options": {},
        "platform": "youtube",
        "accountId": {
          "__rl": true,
          "mode": "list",
          "value": "8047",
          "cachedResultUrl": "https://backend.blotato.com/v2/accounts/8047",
          "cachedResultName": "DR FIRASS (Dr. Firas)"
        },
        "postContentText": "={{ $('Check Google Sheets').item.json['Description New'] }}",
        "postContentMediaUrls": "={{ $json.url }}",
        "postCreateYoutubeOptionTitle": "={{ $('Check Google Sheets').item.json['Title New'] }}",
        "postCreateYoutubeOptionPrivacyStatus": "private",
        "postCreateYoutubeOptionShouldNotifySubscribers": false
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "2b231b15-61c4-472b-a3fd-93f9d5e9225e",
      "name": "Get Google Drive ID",
      "type": "n8n-nodes-base.set",
      "position": [
        1008,
        576
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a1750d20-2f6e-4826-80b8-654d0985120d",
              "name": "final_google_drive_url",
              "type": "string",
              "value": "={{ $json['url Heygen'].match(/https:\\/\\/drive\\.google\\.com\\/file\\/d\\/([A-Za-z0-9_-]+)/i)[1] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0bbcd16d-0c7b-4614-b630-000142f27ce4",
      "name": "Workflow Configuration II",
      "type": "n8n-nodes-base.set",
      "position": [
        560,
        576
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-2",
              "name": "sheet_id",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Google Sheets Document ID__>"
            },
            {
              "id": "id-3",
              "name": "sheet_tab",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Sheet Tab Name__>"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "457bff7d-2ba2-40bb-aed2-34b32f1bb7a6",
      "name": "Check Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        784,
        576
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "ready",
              "lookupColumn": "status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $json.sheet_tab }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.sheet_id }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7,
      "alwaysOutputData": true
    },
    {
      "id": "a1773b3f-3a7e-4527-ae42-994feb96e7ea",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1232,
        576
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.final_google_drive_url }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "784911d5-6c25-47ad-a84c-b499b448f81d",
      "name": "Update Google Sheets II",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1904,
        576
      ],
      "parameters": {
        "columns": {
          "value": {
            "Url": "={{ $('Check Google Sheets').item.json.Url }}",
            "status": "publish"
          },
          "schema": [
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Title New",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Title New",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Transcript New",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Transcript New",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description New",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Description New",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Tags",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Tags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "url Heygen",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "url Heygen",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "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": [
            "Url"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Workflow Configuration II').item.json.sheet_tab }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration II').item.json.sheet_id }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7,
      "alwaysOutputData": true
    },
    {
      "id": "34b198bf-fe14-4229-9d36-6a2823456c7f",
      "name": "Setup & Configuration Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        0
      ],
      "parameters": {
        "width": 600,
        "height": 1144,
        "content": "# Setup & Configuration Guide\n\n@[youtube](szKueQ7Aen8)\n\n\n## Required Services & Credentials\n\n### 1. Telegram Bot Setup\n- Create a bot via [@BotFather](https://t.me/botfather)\n- Get your bot token\n- Add credentials in n8n: **Telegram API**\n- Credential name: `Telegram - youtube`\n\n### 2. Google Services\n\n#### Google Sheets API\n- Enable Google Sheets API in Google Cloud Console\n- Create OAuth2 credentials\n- Add credentials in n8n: **Google Sheets OAuth2 API**\n- Credential name: `Google Sheets account`\n- **[My Google Sheets : copy](https://docs.google.com/spreadsheets/d/1A-LpZ8OGn8FP692Hx50j3sEuPgIhlyMOrJ1jUNGwHr8/copy)** \n\n#### Google Drive API\n- Enable Google Drive API in Google Cloud Console\n- Use same OAuth2 credentials or create new ones\n- Add credentials in n8n: **Google Drive OAuth2 API**\n- Credential name: `Google Drive account`\n\n### 3. RapidAPI (YouTube Transcript)\n- Sign up at [RapidAPI](https://rapidapi.com)\n- Subscribe to \"YouTube Video Summarizer GPT AI\"\n- Get your API key\n- Update in **Workflow Configuration** node\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "49f8d0ab-073f-4c56-a9d8-43ccc5ebbf8a",
      "name": "Transcript Extraction",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        784
      ],
      "parameters": {
        "color": 5,
        "width": 1552,
        "height": 356,
        "content": "## Video Publishing Pipeline\n\nThis section handles the automated video publishing workflow:\n1. **Check Google Sheets** - Monitors the sheet for rows with status=\"ready\"\n2. **Get Google Drive ID** - Extracts the file ID from the HeyGen Google Drive URL\n3. **Download file** - Downloads the video file from Google Drive\n4. **Upload Video to BLOTATO** - Uploads the video to BLOTATO media library\n5. **Youtube** - Creates a private YouTube post with title, description, and video\n6. **Update Google Sheets II** - Updates the status to \"publish\" after successful upload\n\n##  \ud83d\udcd8 Documentation  \nAccess detailed setup instructions, API config, platform connection guides, and workflow customization tips:\n\ud83d\udcce [Open the full documentation on Notion](https://automatisation.notion.site/YOUTUBE-2d53d6550fd980d0ba16fa054ecb1f95?source=copy_link)"
      },
      "typeVersion": 1
    },
    {
      "id": "1f16ff65-8e81-427f-bf28-c11bd18cdaf8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        784
      ],
      "parameters": {
        "color": 5,
        "width": 736,
        "height": 352,
        "content": "### OpenAI API\n- Sign up at [OpenAI Platform](https://platform.openai.com)\n- Generate API key\n- Add credentials in n8n: **OpenAI API**\n- Credential name: `n8n free OpenAI API credits`\n- Model used: **GPT-4.1-MINI**\n\n### BLOTATO (Video Publishing)\n- Sign up at [BLOTATO](https://blotato.com/?ref=firas)\n- Get API credentials\n- Add credentials in n8n: **Blotato API**\n- Credential name: `Blotato account`\n- Connect your YouTube account via BLOTATO"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "da38a3c1-9820-4aa0-a133-9d48c34c1420",
  "connections": {
    "Youtube": {
      "main": [
        [
          {
            "node": "Update Google Sheets II",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Text": {
      "main": [
        [
          {
            "node": "Generate Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate SEO": {
      "main": [
        [
          {
            "node": "update Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video ID": {
      "main": [
        [
          {
            "node": "RapidAPI Summarizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Upload Video to BLOTATO",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Script": {
      "main": [
        [
          {
            "node": "Generate SEO",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Parse Telegram Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Google Sheets": {
      "main": [
        [
          {
            "node": "Get Google Drive ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Google Drive ID": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RapidAPI Summarizer": {
      "main": [
        [
          {
            "node": "Clean Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update Google Sheets": {
      "main": [
        [
          {
            "node": "Send to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Telegram Message": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Append to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append to Google Sheets": {
      "main": [
        [
          {
            "node": "Get Video ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video to BLOTATO": {
      "main": [
        [
          {
            "node": "Youtube",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration II": {
      "main": [
        [
          {
            "node": "Check Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}