AutomationFlowsAI & RAG › Generate AI Video Avatars From Urls with Heygen, Gemini & Upload to Social Media

Generate AI Video Avatars From Urls with Heygen, Gemini & Upload to Social Media

ByJuan Carlos Cavero Gracia @carlosgracia on n8n.io

This workflow turns any URL (news article, blog post, or even an n8n workflow page) into a vertical short video with your AI avatar explaining it ready for TikTok, Instagram Reels, and YouTube Shorts. It fetches the page, generates a tight 30–45s script and platform-optimized…

Event trigger★★★★★ complexityAI-powered33 nodesHTTP RequestAgentGoogle Gemini ChatHTTP Request ToolOutput Parser StructuredN8N Nodes Upload Post
AI & RAG Trigger: Event Nodes: 33 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #10642 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "hMKwFuA2SpHciZPi",
  "name": "AI Video Avatar Generator: Turn URLs into Shorts (Using Free Tier APIS)",
  "tags": [],
  "nodes": [
    {
      "id": "cb527bab-157f-4d35-99b4-fbd7c5f417c2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        0
      ],
      "parameters": {
        "width": 1456,
        "height": 1312,
        "content": "# What does this workflow do?\n\n## Description\n\nThis AI Avatar Viral News system turns any URL\u2014a news article, blog post, or even an n8n workflow page\u2014into a short, vertical talking-head AI video that explains the content for you (no filming or editing required). It uses Gemini to fetch and summarize the page, writes a punchy script and captions, then generates the video with HeyGen. Finally, it sends the MP4 to **Upload-Post** to publish or schedule across your social profiles.\n\n### The 4 video types we generate\n\n**Free (zero cost, full free trial of APIs):**\n1) **Split-screen (vertical) with background video**: top half shows an auto-scroll capture of the article/blog/workflow; bottom half shows your avatar speaking and gesturing.\n2) **Split-screen (vertical) with static image**: same layout, but instead of a background video, we use a single static image (e.g., the article\u2019s hero image or a screenshot).\n\n**Paid heygen api (background removal):**\n3) **Cut-out avatar over background video**: your avatar is cleanly cut out and overlaid on top of a background video.\n4) **Cut-out avatar over static image**: your avatar is cleanly cut out and overlaid on a single static image.\n\n> Notes:\n> - Free/Trial modes use split-screen (no background removal).\n> - Paid modes use background removal for a clean overlay (depends on HeyGen plan and API availability).\n\n### HeyGen rendering modes\n- **Free / Trial (no background removal):** split-screen look (avatar on the lower half, background video or static image on the upper half).\n- **Paid API (with background removal):** clean cut-out avatar over a background video or a static image. Enable by setting `background_removal: true` in the **Set Input Vars** node (requires a paid HeyGen API plan).\n\n## Overview\n\n1. **Manual trigger**\n\n2. **AI agent: fetch webpage & generate script**  \n   - The agent grabs the target page and produces a concise, 30\u201345s script.  \n   - Generates platform-optimized captions/descriptions.\n\n3. **Create avatar video (HeyGen)**  \n   - Call the HeyGen API with your `avatar_id` and `voice_id`.  \n   - Choose layout/background:\n     - **Free / Trial:** split-screen vertical.\n       - **Background as video:** set `has_background_video: true` and provide `background_video_url`.\n       - **Background as static image:** set `has_background_image: true` and provide `background_image_url`.\n     - **Paid:** background removal overlay.\n       - **Overlay on video:** set `background_removal: true` and `background_video_url`.\n       - **Overlay on static image:** set `background_removal: true` and `background_image_url`.\n\n4. **Get video**  \n   - Poll HeyGen until the job completes, then download the final MP4.  \n   - Upload the resulting video file to **Upload-Post**.\n\n5. **Human review / approval**  \n   - A human reviews the video, title, and captions. Approve to continue, or request changes and loop back to steps 2\u20134.\n\n6. **Publish to social media via Upload-Post**  \n   - Connect your social profiles in **Upload-Post**.  \n   - Pick platforms (e.g., TikTok, Instagram, YouTube, X, Facebook, etc.).  \n   - Publish immediately or schedule for later."
      },
      "typeVersion": 1
    },
    {
      "id": "f78abf61-600b-4193-9032-9d45d7d3b341",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2592,
        1312
      ],
      "parameters": {
        "width": 320,
        "height": 976,
        "content": "# Post to All social networks\n"
      },
      "typeVersion": 1
    },
    {
      "id": "215fadb8-11a8-4b4f-b03a-e83aa95ba242",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        1312
      ],
      "parameters": {
        "color": 4,
        "width": 1424,
        "height": 980,
        "content": "# Create video\n\n- **HeyGen modes:**\n  - **Free / Trial (no background removal):** the avatar sits in the lower half of the frame while the upper half shows the background video (split-screen look).\n  - **Paid API (with background removal):** the avatar is cleanly cut out and overlaid on top of the background video. Enable it in **SETUP HEYGEN** by setting the HeyGen var `background_removal` to `true`. Pricing: https://www.heygen.com/api-pricing\n- You can use a custom **ElevenLabs** voice by connecting ElevenLabs inside the HeyGen web app.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "80162c87-a425-4c1e-afa5-8d70d6444741",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        1616
      ],
      "parameters": {
        "color": 3,
        "width": 182,
        "height": 116,
        "content": "For background removal need heygen api paid plan and set true in var background_removal"
      },
      "typeVersion": 1
    },
    {
      "id": "bc5e241b-12e0-42c6-87e0-a0cdccc5da26",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        960,
        1728
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "73001c6b-fae2-48cd-b0a6-aa453b837902",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $('Set Input Vars').item.json.background_removal }}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "3c04645d-07cd-44af-99b9-2966012f6c30",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1568,
        1728
      ],
      "parameters": {
        "unit": "minutes",
        "amount": 1
      },
      "typeVersion": 1.1,
      "alwaysOutputData": false
    },
    {
      "id": "46355a71-eb04-4d75-9481-e15326c822bb",
      "name": "Get Avatar Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1728,
        1728
      ],
      "parameters": {
        "url": "https://api.heygen.com/v1/video_status.get",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "video_id",
              "value": "={{ $('Edit Fields').item.json.video_id }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Api-Key",
              "value": "={{ $('Set Input Vars').item.json.heygen_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "88a88640-f116-4380-b1bd-075ec2ff0980",
      "name": "If Video Done",
      "type": "n8n-nodes-base.if",
      "position": [
        1888,
        1728
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e511deb8-8e4c-45db-aa35-18f43a0552b6",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Get Avatar Video').item.json.data.status }}",
              "rightValue": "completed"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "fce8f9bc-e6fd-413a-9381-29b1b5ad646d",
      "name": "Social Media Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -96,
        1744
      ],
      "parameters": {
        "text": "=# Role & Persona\nEres Creador experto de contenido short-form y Evangelista de n8n. Tono cercano, builder, pr\u00e1ctico, con un punto nerd simp\u00e1tico. Tu objetivo: contar una historia \u00fatil en ~30s basada en **cualquier p\u00e1gina web** (noticia, post de blog, documentaci\u00f3n o workflow de n8n) y animar a quienes te ven a probarlo o quedarse con la idea clave.\n\n# Contexto de Producci\u00f3n del V\u00eddeo\n- De fondo se mostrar\u00e1 **la propia web** (la URL analizada) haciendo **scroll vertical** por secciones relevantes.\n- En primer plano, **mi avatar (HeyGen)** habla el guion en una ventana inferior.\n- El guion debe ser **solo texto** (sin acotaciones, efectos ni notas, ni saltos de linea ni emotes), \u00f3ptimo para TTS de HeyGen.\n\n# Fuente de Verdad (HTTP Request + An\u00e1lisis \u00danico)\n1) **URL a analizar (cualquier contenido):** `{{ $json.workflow_url }}`\n2) **Descarga el HTML** (HTTP GET) y analiza:\n   - **Idea/Problema/Hecho principal** que comunica la p\u00e1gina.\n   - **Resultado/beneficio/impacto** para el usuario.\n   - **Detalles y datos** relevantes (fechas, cifras, comparativas, quotes).\n   - **Tecnolog\u00edas/nodos/servicios** si se trata de un workflow de n8n (por ejemplo OpenAI, Google Sheets, APIs, etc.).\n3) **imageUrl (imagen representativa de la p\u00e1gina):**\n   - Primero busca `<meta property=\"og:image\" content=\"...\">`.\n   - Si el contenido es un workflow, intenta que la imagen sea el **diagrama** (nodos y conexiones). Si el og:image no sirve:\n     - Recorre `<img>` y elige la imagen principal del contenido (pistas: `workflow`, `diagram`, `template`, `graph`, o la imagen m\u00e1s central/grande del art\u00edculo).\n   - Si no hay una imagen adecuada, usa `imageUrl: \"\"`.\n\n# Requisitos del Guion (30s, un \u00fanico guion para todas las plataformas)\n- **Idioma:** Espa\u00f1ol (Espa\u00f1a), natural y directo.\n- **Nivel de lectura:** ~6\u00ba de primaria (frases cortas, vocabulario claro).\n- **Hook inicial (2\u20133s):** crea una **curiosity gap** irresistible (\u2264 12 palabras si puedes).\n- **Estructura:** Problema/Hecho \u2192 Contexto/Soluci\u00f3n \u2192 Ejemplo/Impacto \u2192 **CTA**.\n- **Datos**: incluye **detalles y estad\u00edsticas** concretas si est\u00e1n en la p\u00e1gina; si es workflow, menciona **nodos/servicios** clave sin aburrir.\n- **CTA final del estilo (HeyGen/TTS) Solo si es un workflow de n8n :** \u201cSigueme y Comenta la palabra workflow y te lo mando por mensaje privado\u201d\n- **sin Emojis, texto plano.\n- **Sin enlaces crudos** en el guion (usa \u201clink en bio/comentarios\u201d si aplica).\n- **Sin acotaciones** de escena o efectos (texto plano para TTS).\n- Texto plano porque se lo pasamos luego a elevenlabs para que hable\n\n# Regla de Autor\n- Si el autor es Carlos Gracia o Juan Carlos Cavero Gracia , redacta en primera persona; si no, en tercera persona.\n\n# Caption SEO (acompa\u00f1a el v\u00eddeo)\n- Redacta una **caption optimizada SEO** en espa\u00f1ol que:\n  - Resuma el tema con claridad.\n  - A\u00f1ada **2\u20133 bullets** tipo FAQs/puntos clave.\n  - Use **hasta 5 hashtags** relevantes y espec\u00edficos.\n\n# T\u00edtulo Viral (muy corto)\n- Escribe **1 frase viral** (m\u00e1x. **8 palabras**), nivel 6\u00ba de primaria, **neutral**, **sin emojis** y sin puntuaci\u00f3n salvo `?` o `!`.\n\n# Descripciones por Plataforma (Short-form org\u00e1nico)\nGenera **descripciones espec\u00edficas por plataforma** para el **mismo guion**:\n- **TikTok:** 1\u20132 frases + 3\u20135 hashtags. (\u2248 200\u2013300 caracteres)\n- **Instagram Reels:** 2\u20133 frases + 5\u20137 hashtags (#n8n #Automatizaci\u00f3n #NoCode #API #Productividad + espec\u00edficas). (\u2248 400\u2013600 caracteres)\n- **YouTube Shorts:** muy corta, 1 frase + 2\u20133 hashtags. (\u2248 120\u2013160 caracteres)\n\n# Formatos de Salida (JSON ESTRICTO)\nDevuelve **4 bloques JSON** separados, sin arrays, uno por l\u00ednea, sin comas finales:\n\n1) **TikTok** (guion com\u00fan + descripci\u00f3n adaptada, usa imageUrl si procede):\n{\"platform\":\"tiktok\",\"guion\":\"GUION_COMUN_EN_ESPANOL_30S\",\"descripcion\":\"DESCRIPCION_TIKTOK\",\"imageUrl\":\"IMAGE_URL_AQUI\"}\n\n2) **Instagram**:\n{\"platform\":\"instagram\",\"guion\":\"GUION_COMUN_EN_ESPANOL_30S\",\"descripcion\":\"DESCRIPCION_INSTAGRAM\",\"imageUrl\":\"IMAGE_URL_AQUI\"}\n\n3) **YouTube Shorts**:\n{\"platform\":\"youtube_shorts\",\"guion\":\"GUION_COMUN_EN_ESPANOL_30S\",\"descripcion\":\"TITULO_YOUTUBE_SHORTS_MUY_CORTO_MAX_100_CARACTERES\",\"imageUrl\":\"IMAGE_URL_AQUI\"}\n\n4) **Bundle para Avatar (HeyGen/TTS)**:\n{\n  \"script\": \"Monologue script (solo texto, ~30s, nivel 6\u00ba primaria, curiosity gap al inicio, datos si existen, y que me sigan\",\n  \"caption\": \"Caption SEO en espa\u00f1ol (m\u00e1x. 5 hashtags)\",\n  \"title\": \"Frase viral corta (\u2264 8 palabras, sin emojis, sin puntuaci\u00f3n salvo ? o !)\"\n}\n\n# Reglas de Estilo y Contenido (recordatorio)\n- Nada de relleno (\u201cen este video te voy a\u2026\u201d): ve **al grano**.\n- Hashtags **relevantes** y **limitados**.\n- Mant\u00e9n **coherencia** con el contenido real de la p\u00e1gina analizada.\n- Si la URL no carga o es ambigua, genera un guion veros\u00edmil seg\u00fan t\u00edtulo y primeros textos; en descripciones sugiere \u201crevisar enlace en bio/comentarios\u201d (sin romper el JSON).\n\n# Checklist antes de devolver\n- [ ] Hook potente en 2\u20133s con curiosity gap.\n- [ ] Problema/Hecho \u2192 Contexto/Soluci\u00f3n \u2192 Ejemplo/Impacto \u2192 CTA en \u2264 30s.\n- [ ] Nivel 6\u00ba primaria; datos concretos si existen.\n- [ ] M\u00e1x. 2 emojis en guion com\u00fan; texto plano para TTS.\n- [ ] 3 objetos para plataformas + 1 bundle para avatar.\n- [ ] imageUrl v\u00e1lida (og:image o imagen principal); si no, \"\".\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "e4091cc4-1a5f-45bd-b375-07e2ef8aef84",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -96,
        1952
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "69564190-cffe-46d1-ab1f-5cf26a5a4358",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        32,
        2064
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', ``, 'string') }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "c0f17447-0722-42b8-90ad-c55d31317d35",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        144,
        1952
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "[\n  {\n    \"platform\": \"tiktok\",\n    \"guion\": \"GUION_COMUN_EN_ESPANOL_30S\",\n    \"descripcion\": \"DESCRIPCION_TIKTOK_CORTA_CON_3_A_5_HASHTAGS\",\n    \"imageUrl\": \"optional_image_url\"\n  },\n  {\n    \"platform\": \"instagram\",\n    \"guion\": \"GUION_COMUN_EN_ESPANOL_30S\",\n    \"descripcion\": \"DESCRIPCION_INSTAGRAM_MEDIA_CON_5_A_7_HASHTAGS\",\n    \"imageUrl\": \"optional_image_url\"\n  },\n  {\n    \"platform\": \"youtube_shorts\",\n    \"guion\": \"GUION_COMUN_EN_ESPANOL_30S\",\n    \"descripcion\": \"TITULO_YOUTUBE_SHORTS_MUY_CORTO_MAX_100_CARACTERES\",\n    \"imageUrl\": \"optional_image_url\"\n  }\n]\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "b0a5bd0b-29cf-4164-ba28-3b09bc3ea0fa",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        144,
        2080
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1494f8b9-c3c2-4bdc-b3bf-47052c5c44d6",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -512,
        1744
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0818d1ad-6f81-4610-903f-072d12c4b6ec",
      "name": "Create video avatar with background removal",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1152,
        1600
      ],
      "parameters": {
        "url": "https://api.heygen.com/v2/video/generate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"video_inputs\": [\n    {\n      \"character\": {\n        \"type\": \"avatar\",\n        \"avatar_id\": \"{{ $('Set Input Vars').item.json.avatar_id }}\",\n        \"avatar_style\": \"normal\",\n        \"scale\": 1,\n        \"offset\": { \n          \"x\": 0.15,\n          \"y\": 0.15 \n        },\n        \"matting\": true\n      },\n      \"voice\": {\n        \"type\": \"text\",\n        \"input_text\": \"{{ $('Social Media Agent').item.json.output[0].guion }}\",\n        \"voice_id\": \"{{ $('Set Input Vars').item.json.voice_id }}\",\n        \"speed\": 1.1,\n        \"pitch\": 50,\n        \"emotion\": \"Excited\"\n      },\n      \"background\": {\n        \"type\": \"video\",\n        \"url\": \"{{ $('upload to heygen').item.json.data.url }}\",\n        \"play_style\": \"loop\",\n        \"fit\": \"cover\"\n      }\n    }\n  ],\n  \"dimension\": { \"width\": 720, \"height\": 1280 },\n  \"aspect_ratio\": \"9:16\",\n  \"caption\": false,\n  \"title\": \"n8n-avatar\"\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Api-Key",
              "value": "={{ $('Set Input Vars').item.json.heygen_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "09adca22-c5b5-4961-903e-bf188c070299",
      "name": "Create video avatar with split screen (heygen free trial api)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1152,
        1760
      ],
      "parameters": {
        "url": "https://api.heygen.com/v2/video/generate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"video_inputs\": [\n    {\n      \"character\": {\n        \"type\": \"avatar\",\n        \"avatar_id\": \"{{ $('Set Input Vars').item.json.avatar_id }}\",\n        \"avatar_style\": \"normal\",\n        \"scale\": 1.8,\n        \"offset\": { \n        \"x\": 0.0,\n        \"y\": 0.32 \n        }\n      },\n      \"voice\": {\n        \"type\": \"text\",\n        \"input_text\": \"{{ $('Social Media Agent').item.json.output[0].guion }}\",\n        \"voice_id\": \"{{ $('Set Input Vars').item.json.voice_id }}\",\n        \"speed\": 1.1,\n        \"pitch\": 50,\n        \"emotion\": \"Excited\"\n      },\n      \"background\": {\n        \"type\": \"video\",\n        \"url\": \"{{ $('upload to heygen').item.json.data.url }}\",\n        \"play_style\": \"loop\",\n        \"fit\": \"cover\"\n      }\n    }\n  ],\n  \"dimension\": { \"width\": 720, \"height\": 1280 },\n  \"aspect_ratio\": \"9:16\",\n  \"caption\": false,\n  \"title\": \"n8n-avatar\"\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Api-Key",
              "value": "={{ $('Set Input Vars').item.json.heygen_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "25f41827-5c1d-404f-a991-81bad08b1f59",
      "name": "Get video url",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2048,
        1712
      ],
      "parameters": {
        "url": "https://api.heygen.com/v1/video_status.get",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "video_id",
              "value": "={{ $json.data.id }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Api-Key",
              "value": "={{ $('Set Input Vars').item.json.heygen_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "75c3909b-b2c9-43fb-982d-4d690e9ca175",
      "name": "Get background video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        528,
        1728
      ],
      "parameters": {
        "url": "=https://api.screenshotone.com/animate?access_key={{ $('Set Input Vars').item.json.screenshotone.comAPI_KEY }}&url={{ $('Set Input Vars').item.json.workflow_url }}&format=mp4&viewport_width=1080&viewport_height=1920&viewport_mobile=true&block_ads=true&storage_return_location=true&block_cookie_banners=true&block_banners_by_heuristics=false&block_trackers=true&delay=10&timeout=60&scenario=scroll&duration=30&scroll_delay=5000&scroll_duration=200&scroll_by=400&scroll_start_immediately=true&scroll_start_delay=5000&scroll_back=true&scroll_complete=true&scroll_easing=ease_in_out_quint&scroll_try_navigate=false",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "1fa8ee73-6491-4dad-b866-1e38ba3f2d64",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        1312
      ],
      "parameters": {
        "color": 6,
        "width": 1312,
        "height": 980,
        "content": "# Generate script and backgroud video\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b4836afa-e601-4433-b170-6815ea329d1b",
      "name": "Wait to approve by user1",
      "type": "n8n-nodes-base.wait",
      "position": [
        2240,
        1712
      ],
      "parameters": {
        "resume": "form",
        "options": {},
        "formTitle": "Review the posts ",
        "formFields": {
          "values": [
            {
              "fieldType": "dropdown",
              "fieldLabel": "decision",
              "fieldOptions": {
                "values": [
                  {
                    "option": "approve"
                  },
                  {
                    "option": "reject"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        },
        "formDescription": "={{ $json.data.video_url }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "73969b0e-8733-43a2-898c-f99435c17153",
      "name": "If approved publish1",
      "type": "n8n-nodes-base.if",
      "position": [
        2384,
        1712
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "394500db-496d-4c6e-9adb-59f3caead492",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Wait to approve by user1').item.json.decision }}",
              "rightValue": "=approve"
            }
          ]
        },
        "looseTypeValidation": "=true"
      },
      "typeVersion": 2.2
    },
    {
      "id": "b5cffd1b-8599-44ba-ba48-a41f9d7b8779",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2176,
        1312
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 976,
        "content": "# Approval by human for upload to social networks\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d12ee22c-486d-44c0-9d3f-d94c3ece5643",
      "name": "Upload video to all social networks",
      "type": "n8n-nodes-upload-post.uploadPost",
      "position": [
        2688,
        1696
      ],
      "parameters": {
        "user": "influencersde",
        "title": "test",
        "video": "={{ $('Get video url').item.json.data.video_url }}",
        "platform": [
          "instagram",
          "tiktok",
          "youtube"
        ],
        "operation": "uploadVideo",
        "tiktokTitle": "={{ $('Social Media Agent').item.json.output[0].descripcion }}",
        "youtubeTitle": "={{ $('Social Media Agent').item.json.output[2].descripcion }}",
        "instagramTitle": "={{ $('Social Media Agent').item.json.output[1].descripcion }}",
        "instagramMediaType": "REELS"
      },
      "credentials": {
        "uploadPostApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9acf058b-0173-4c57-b505-764e39ae38d9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        288
      ],
      "parameters": {
        "width": 912,
        "height": 1024,
        "content": "## Setup\n\n### 1) Accounts & API keys\n- **HeyGen** (Free/Trial or Paid API). Background removal requires the **paid** API plan.\n- **https://dash.screenshotone.com/** (Free trial not credit card) for generate video background of the url\n- **Upload-Post** (Free trial not credit card) for publishing.\n- **OpenAI/Gemini** for scripting.\n- *(Optional)* **ElevenLabs** (custom voice linked inside HeyGen).\n\n### Add variables :\n- In the Set Input Vars node\n\n### 2) HeyGen configuration\n- **Choose rendering mode**\n  - **Free / Trial:** no background removal \u2192 split-screen layout (avatar bottom half, background video top half).\n    - Set `background_removal: false`.\n  - **Paid API:** background removal \u2192 clean cut-out avatar overlaid on the background video.\n    - Set `background_removal: true` (requires paid plan).\n- In the **Set Input Vars** node set:\n  - `avatar_id` and `voice_id`\n  - `background_video_url: https://...` (if using a background)\n\n### 3) Upload-Post configuration\n- In **SETUP UPLOAD-POST** node:\n  - Generate api key and connect social networs: https://app.upload-post.com\n  - Select the social networks you want to upload platform\n  - The description for each social network is generated by AI agent\n  - publish now or schedule_at\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "66f4022f-bdb7-4e7c-85b5-a549887f875a",
      "name": "Get background photo",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        528,
        2112
      ],
      "parameters": {
        "url": "=https://api.screenshotone.com/take?access_key={{ $('Set Input Vars').item.json.screenshotone.comAPI_KEY }}&url={{ $('Set Input Vars').item.json.workflow_url }}&viewport_width=1080&viewport_height=1920&viewport_mobile=false&format=jpg&block_ads=true&block_cookie_banners=true&block_banners_by_heuristics=false&block_trackers=true&delay=10&timeout=60&response_type=json&image_quality=80",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "30727b8b-42b2-4d9c-8ae4-d7469071d861",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        832,
        2112
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "73001c6b-fae2-48cd-b0a6-aa453b837902",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.background_removal }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2e1f0985-7148-4f92-836c-5c3584d0595f",
      "name": "Create video avatar with background removal1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1152,
        1952
      ],
      "parameters": {
        "url": "https://api.heygen.com/v2/video/generate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"video_inputs\": [\n    {\n      \"character\": {\n        \"type\": \"avatar\",\n        \"avatar_id\": \"{{ $('Set Input Vars').item.json.avatar_id }}\",\n        \"avatar_style\": \"normal\",\n        \"scale\": 1,\n        \"offset\": { \n          \"x\": 0.15,\n          \"y\": 0.15 \n        },\n        \"matting\": true\n      },\n      \"voice\": {\n        \"type\": \"text\",\n        \"input_text\": \"{{ $('Social Media Agent').item.json.output[0].guion }}\",\n        \"voice_id\": \"{{ $('Set Input Vars').item.json.voice_id }}\",\n        \"speed\": 1.1,\n        \"pitch\": 50,\n        \"emotion\": \"Excited\"\n      },\n      \"background\": {\n        \"type\": \"image\",\n        \"url\": \"{{ $('Get background photo').item.json.screenshot_url }}\",\n        \"fit\": \"cover\"\n      }\n    }\n  ],\n  \"dimension\": { \"width\": 720, \"height\": 1280 },\n  \"aspect_ratio\": \"9:16\",\n  \"caption\": false,\n  \"title\": \"n8n-avatar\"\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Api-Key",
              "value": "={{ $('Set Input Vars').item.json.heygen_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e5966331-cc81-49dc-a783-6ecb46544cb7",
      "name": "Create video avatar with split screen (heygen free trial api)1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1152,
        2128
      ],
      "parameters": {
        "url": "https://api.heygen.com/v2/video/generate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"video_inputs\": [\n    {\n      \"character\": {\n        \"type\": \"avatar\",\n        \"avatar_id\": \"{{ $('Set Input Vars').item.json.avatar_id }}\",\n        \"avatar_style\": \"normal\",\n        \"scale\": 1.8,\n        \"offset\": { \n        \"x\": 0.0,\n        \"y\": 0.32 \n        }\n      },\n      \"voice\": {\n        \"type\": \"text\",\n        \"input_text\": \"{{ $('Social Media Agent').item.json.output[0].guion }}\",\n        \"voice_id\": \"{{ $('Set Input Vars').item.json.voice_id }}\",\n        \"speed\": 1.1,\n        \"pitch\": 50,\n        \"emotion\": \"Excited\"\n      },\n      \"background\": {\n        \"type\": \"photo\",\n        \"url\": \"{{ $('Get background photo').item.json.screenshot }}\",\n        \"play_style\": \"loop\",\n        \"fit\": \"cover\"\n      }\n    }\n  ],\n  \"dimension\": { \"width\": 720, \"height\": 1280 },\n  \"aspect_ratio\": \"9:16\",\n  \"caption\": false,\n  \"title\": \"n8n-avatar\"\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Api-Key",
              "value": "={{ $('Set Input Vars').item.json.heygen_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4708c3d1-2135-46f8-9b97-ee09d32acdac",
      "name": "Set Input Vars",
      "type": "n8n-nodes-base.set",
      "position": [
        -320,
        1744
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ab234870-d90d-4b54-8916-5084080e1ad8",
              "name": "workflow_url",
              "type": "string",
              "value": "https://www.xataka.com/empresas-y-economia/openai-acaba-mover-ficha-su-separacion-bienes-microsoft-ha-firmado-acuerdo-amazon-38-000-millones-dolares"
            },
            {
              "id": "6268ce66-0e20-4461-a2fa-cb6e53a8cd0c",
              "name": "screenshotone.comAPI_KEY",
              "type": "string",
              "value": ""
            },
            {
              "id": "d8870ebc-338f-4f0c-8c87-830eed637e8d",
              "name": "heygen_api_key",
              "type": "string",
              "value": ""
            },
            {
              "id": "ebf525fe-abd2-47cd-8d80-2e0897674dc8",
              "name": "avatar_id",
              "type": "string",
              "value": ""
            },
            {
              "id": "5ca261cc-aa2c-4f30-8ff7-0605133ca201",
              "name": "voice_id",
              "type": "string",
              "value": ""
            },
            {
              "id": "95a9fd9f-a88c-408a-a8e6-5daee5c6eb5f",
              "name": "background_removal",
              "type": "string",
              "value": "true"
            },
            {
              "id": "a6542328-c98b-4048-8f49-f4c638df472f",
              "name": "background_type",
              "type": "string",
              "value": "video"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "7c88a824-7f60-4449-a813-73cfe61aa38b",
      "name": "video or photo",
      "type": "n8n-nodes-base.if",
      "position": [
        272,
        1744
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "394500db-496d-4c6e-9adb-59f3caead492",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Set Input Vars').item.json.background_type }}",
              "rightValue": "=video"
            }
          ]
        },
        "looseTypeValidation": "=true"
      },
      "typeVersion": 2.2
    },
    {
      "id": "e6f67531-4c53-4c07-a22a-ad273b6c60b9",
      "name": "upload to heygen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        784,
        1728
      ],
      "parameters": {
        "url": "https://upload.heygen.com/v1/asset",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Api-Key",
              "value": "={{ $('Set Input Vars').item.json.heygen_api_key }}"
            },
            {
              "name": "Content-Type",
              "value": "video/mp4"
            }
          ]
        },
        "inputDataFieldName": "data"
      },
      "typeVersion": 4.3
    },
    {
      "id": "22905c42-80f2-4083-9b69-27997cdb39ae",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1392,
        1728
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ac5899dd-52f6-48bb-981e-9cb60696e461",
              "name": "video_id",
              "type": "string",
              "value": "={{ $json.data.video_id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "47fe8c3d-d35c-4345-ac71-9bd77db0077e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        576
      ],
      "parameters": {
        "width": 512,
        "height": 416,
        "content": "## Video DEMO\n\n\n@[youtube](fh3t6Kc2oRM)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8702639d-ba3a-49dd-8879-20ac330199e3",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Create video avatar with background removal",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create video avatar with split screen (heygen free trial api)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Create video avatar with background removal1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create video avatar with split screen (heygen free trial api)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Avatar Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get video url": {
      "main": [
        [
          {
            "node": "Wait to approve by user1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "ai_tool": [
        [
          {
            "node": "Social Media Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "If Video Done": {
      "main": [
        [
          {
            "node": "Get video url",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Input Vars": {
      "main": [
        [
          {
            "node": "Social Media Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "video or photo": {
      "main": [
        [
          {
            "node": "Get background video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get background photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Avatar Video": {
      "main": [
        [
          {
            "node": "If Video Done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "upload to heygen": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Social Media Agent": {
      "main": [
        [
          {
            "node": "video or photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get background photo": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get background video": {
      "main": [
        [
          {
            "node": "upload to heygen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If approved publish1": {
      "main": [
        [
          {
            "node": "Upload video to all social networks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Social Media Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Social Media Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Wait to approve by user1": {
      "main": [
        [
          {
            "node": "If approved publish1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Set Input Vars",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create video avatar with background removal": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create video avatar with background removal1": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create video avatar with split screen (heygen free trial api)": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create video avatar with split screen (heygen free trial api)1": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow turns any URL (news article, blog post, or even an n8n workflow page) into a vertical short video with your AI avatar explaining it ready for TikTok, Instagram Reels, and YouTube Shorts. It fetches the page, generates a tight 30–45s script and platform-optimized…

Source: https://n8n.io/workflows/10642/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This automated workflow template transforms a single product image into a complete professional advertisement video with dynamic motion and custom soundtrack. Perfect for e-commerce businesses, market

HTTP Request, Output Parser Structured, Tool Think +4
AI & RAG

Main. Uses httpRequest, agent, lmChatGoogleGemini, outputParserStructured. Event-driven trigger; 57 nodes.

HTTP Request, Agent, Google Gemini Chat +4
AI & RAG

This is an automated blog post generation system that: Researches topics using AI agents and web search tools Writes complete blog posts with proper SEO structure Generates custom images for each post

Output Parser Structured, Google Gemini Chat, HTTP Request Tool +11
AI & RAG

This automation workflow is designed for e-commerce businesses, digital marketers, and entrepreneurs who need to create high-quality promotional content for their products quickly and efficiently. Fro

Output Parser Structured, Tool Think, Agent +5
AI & RAG

This workflow transforms any video you drop into a Google Drive folder into a ready-to-publish YouTube upload. It analyzes the video with AI to craft 3 high-CTR title ideas, 3 long SEO-friendly descri

Agent, Google Gemini Chat, Output Parser Structured +5