Générateur de vidéo IA de vie virtuelle : convertir une URL en court métrage (en utilisant l'API de la couche gratuite)

Avancé

Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 33 nœuds.Utilise principalement des nœuds comme If, Set, Wait, HttpRequest, ManualTrigger. Générez des avatars vidéo IA à partir d'une URL avec HeyGen, Gemini et téléchargez-les sur les réseaux sociaux

Prérequis
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
  • Clé API Google Gemini
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "hMKwFuA2SpHciZPi",
  "meta": {
    "instanceId": "3378b0d68c3b7ebfc71b79896d94e1a044dec38e99a1160aed4e9c323910fbe2"
  },
  "name": "AI Video Avatar Generator: Turn URLs into Shorts (Using Free Tier APIS)",
  "tags": [],
  "nodes": [
    {
      "id": "cb527bab-157f-4d35-99b4-fbd7c5f417c2",
      "name": "Note adhésive2",
      "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—a news article, blog post, or even an n8n workflow page—into 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’s 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–45s 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–4.\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": "Note adhésive10",
      "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": "Note adhésive12",
      "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": "Note adhésive13",
      "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": "Si",
      "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": "Attendre",
      "type": "n8n-nodes-base.wait",
      "position": [
        1568,
        1728
      ],
      "webhookId": "d9404622-0a06-4a65-959e-badd4fd87465",
      "parameters": {
        "unit": "minutes",
        "amount": 1
      },
      "typeVersion": 1.1,
      "alwaysOutputData": false
    },
    {
      "id": "46355a71-eb04-4d75-9481-e15326c822bb",
      "name": "Obtenir la vidéo d'avatar",
      "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": "Si vidéo terminée",
      "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": "Agent des réseaux sociaux",
      "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áctico, con un punto nerd simpático. Tu objetivo: contar una historia útil en ~30s basada en **cualquier página web** (noticia, post de blog, documentación o workflow de n8n) y animar a quienes te ven a probarlo o quedarse con la idea clave.\n\n# Contexto de Producción del Vídeo\n- De fondo se mostrará **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), óptimo para TTS de HeyGen.\n\n# Fuente de Verdad (HTTP Request + Análisis Único)\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ágina.\n   - **Resultado/beneficio/impacto** para el usuario.\n   - **Detalles y datos** relevantes (fechas, cifras, comparativas, quotes).\n   - **Tecnologías/nodos/servicios** si se trata de un workflow de n8n (por ejemplo OpenAI, Google Sheets, APIs, etc.).\n3) **imageUrl (imagen representativa de la página):**\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ás central/grande del artículo).\n   - Si no hay una imagen adecuada, usa `imageUrl: \"\"`.\n\n# Requisitos del Guion (30s, un único guion para todas las plataformas)\n- **Idioma:** Español (España), natural y directo.\n- **Nivel de lectura:** ~6º de primaria (frases cortas, vocabulario claro).\n- **Hook inicial (2–3s):** crea una **curiosity gap** irresistible (≤ 12 palabras si puedes).\n- **Estructura:** Problema/Hecho → Contexto/Solución → Ejemplo/Impacto → **CTA**.\n- **Datos**: incluye **detalles y estadísticas** concretas si están en la página; si es workflow, menciona **nodos/servicios** clave sin aburrir.\n- **CTA final del estilo (HeyGen/TTS) Solo si es un workflow de n8n :** “Sigueme y Comenta la palabra workflow y te lo mando por mensaje privado”\n- **sin Emojis, texto plano.\n- **Sin enlaces crudos** en el guion (usa “link en bio/comentarios” 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ña el vídeo)\n- Redacta una **caption optimizada SEO** en español que:\n  - Resuma el tema con claridad.\n  - Añada **2–3 bullets** tipo FAQs/puntos clave.\n  - Use **hasta 5 hashtags** relevantes y específicos.\n\n# Título Viral (muy corto)\n- Escribe **1 frase viral** (máx. **8 palabras**), nivel 6º de primaria, **neutral**, **sin emojis** y sin puntuación salvo `?` o `!`.\n\n# Descripciones por Plataforma (Short-form orgánico)\nGenera **descripciones específicas por plataforma** para el **mismo guion**:\n- **TikTok:** 1–2 frases + 3–5 hashtags. (≈ 200–300 caracteres)\n- **Instagram Reels:** 2–3 frases + 5–7 hashtags (#n8n #Automatización #NoCode #API #Productividad + específicas). (≈ 400–600 caracteres)\n- **YouTube Shorts:** muy corta, 1 frase + 2–3 hashtags. (≈ 120–160 caracteres)\n\n# Formatos de Salida (JSON ESTRICTO)\nDevuelve **4 bloques JSON** separados, sin arrays, uno por línea, sin comas finales:\n\n1) **TikTok** (guion común + descripción 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º primaria, curiosity gap al inicio, datos si existen, y que me sigan\",\n  \"caption\": \"Caption SEO en español (máx. 5 hashtags)\",\n  \"title\": \"Frase viral corta (≤ 8 palabras, sin emojis, sin puntuación salvo ? o !)\"\n}\n\n# Reglas de Estilo y Contenido (recordatorio)\n- Nada de relleno (“en este video te voy a…”): ve **al grano**.\n- Hashtags **relevantes** y **limitados**.\n- Mantén **coherencia** con el contenido real de la página analizada.\n- Si la URL no carga o es ambigua, genera un guion verosímil según título y primeros textos; en descripciones sugiere “revisar enlace en bio/comentarios” (sin romper el JSON).\n\n# Checklist antes de devolver\n- [ ] Hook potente en 2–3s con curiosity gap.\n- [ ] Problema/Hecho → Contexto/Solución → Ejemplo/Impacto → CTA en ≤ 30s.\n- [ ] Nivel 6º primaria; datos concretos si existen.\n- [ ] Máx. 2 emojis en guion común; texto plano para TTS.\n- [ ] 3 objetos para plataformas + 1 bundle para avatar.\n- [ ] imageUrl válida (og:image o imagen principal); si no, \"\".\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "e4091cc4-1a5f-45bd-b375-07e2ef8aef84",
      "name": "Modèle de chat Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -96,
        1952
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "JQq5JRn9RAWcdBI6",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "69564190-cffe-46d1-ab1f-5cf26a5a4358",
      "name": "Requête HTTP1",
      "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": "Analyseur de sortie structurée",
      "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": "Modèle de chat Google Gemini1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        144,
        2080
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Pz5rkKL1ZRGrSYoQ",
          "name": "key studio google"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1494f8b9-c3c2-4bdc-b3bf-47052c5c44d6",
      "name": "Lors du clic sur 'Exécuter le workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -512,
        1744
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0818d1ad-6f81-4610-903f-072d12c4b6ec",
      "name": "Créer un avatar vidéo avec suppression de l'arrière-plan",
      "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": "Créer un avatar vidéo avec écran divisé (essai gratuit HeyGen 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": "Obtenir l'URL de la vidéo",
      "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": "Obtenir la vidéo d'arrière-plan",
      "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": "Note adhésive",
      "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": "Attendre l'approbation par l'utilisateur1",
      "type": "n8n-nodes-base.wait",
      "position": [
        2240,
        1712
      ],
      "webhookId": "f8e6054e-44e4-4987-9698-d5befb8b31b6",
      "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": "Si approuvé, publier1",
      "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": "Note adhésive11",
      "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": "Télécharger la vidéo sur tous les réseaux sociaux",
      "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": {
          "id": "mREXP5Q3Gj5dS52e",
          "name": "Smoker"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9acf058b-0173-4c57-b505-764e39ae38d9",
      "name": "Note adhésive3",
      "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 → split-screen layout (avatar bottom half, background video top half).\n    - Set `background_removal: false`.\n  - **Paid API:** background removal → 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": "Obtenir la photo d'arrière-plan",
      "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": "Si1",
      "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": "Créer un avatar vidéo avec suppression de l'arrière-plan1",
      "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": "Créer un avatar vidéo avec écran divisé (essai gratuit HeyGen 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": "Définir les variables d'entrée",
      "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": "vidéo ou 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": "télécharger sur 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": "Modifier les champs",
      "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": "Note adhésive1",
      "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,
  "pinData": {
    "When clicking ‘Execute workflow’": [
      {
        "json": {}
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8702639d-ba3a-49dd-8879-20ac330199e3",
  "connections": {
    "bc5e241b-12e0-42c6-87e0-a0cdccc5da26": {
      "main": [
        [
          {
            "node": "0818d1ad-6f81-4610-903f-072d12c4b6ec",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "09adca22-c5b5-4961-903e-bf188c070299",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "30727b8b-42b2-4d9c-8ae4-d7469071d861": {
      "main": [
        [
          {
            "node": "2e1f0985-7148-4f92-836c-5c3584d0595f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "e5966331-cc81-49dc-a783-6ecb46544cb7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3c04645d-07cd-44af-99b9-2966012f6c30": {
      "main": [
        [
          {
            "node": "46355a71-eb04-4d75-9481-e15326c822bb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "22905c42-80f2-4083-9b69-27997cdb39ae": {
      "main": [
        [
          {
            "node": "3c04645d-07cd-44af-99b9-2966012f6c30",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "25f41827-5c1d-404f-a991-81bad08b1f59": {
      "main": [
        [
          {
            "node": "b4836afa-e601-4433-b170-6815ea329d1b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "69564190-cffe-46d1-ab1f-5cf26a5a4358": {
      "ai_tool": [
        [
          {
            "node": "fce8f9bc-e6fd-413a-9381-29b1b5ad646d",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "88a88640-f116-4380-b1bd-075ec2ff0980": {
      "main": [
        [
          {
            "node": "25f41827-5c1d-404f-a991-81bad08b1f59",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "3c04645d-07cd-44af-99b9-2966012f6c30",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4708c3d1-2135-46f8-9b97-ee09d32acdac": {
      "main": [
        [
          {
            "node": "fce8f9bc-e6fd-413a-9381-29b1b5ad646d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7c88a824-7f60-4449-a813-73cfe61aa38b": {
      "main": [
        [
          {
            "node": "75c3909b-b2c9-43fb-982d-4d690e9ca175",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "66f4022f-bdb7-4e7c-85b5-a549887f875a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "46355a71-eb04-4d75-9481-e15326c822bb": {
      "main": [
        [
          {
            "node": "88a88640-f116-4380-b1bd-075ec2ff0980",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e6f67531-4c53-4c07-a22a-ad273b6c60b9": {
      "main": [
        [
          {
            "node": "bc5e241b-12e0-42c6-87e0-a0cdccc5da26",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fce8f9bc-e6fd-413a-9381-29b1b5ad646d": {
      "main": [
        [
          {
            "node": "7c88a824-7f60-4449-a813-73cfe61aa38b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "66f4022f-bdb7-4e7c-85b5-a549887f875a": {
      "main": [
        [
          {
            "node": "30727b8b-42b2-4d9c-8ae4-d7469071d861",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "75c3909b-b2c9-43fb-982d-4d690e9ca175": {
      "main": [
        [
          {
            "node": "e6f67531-4c53-4c07-a22a-ad273b6c60b9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "73969b0e-8733-43a2-898c-f99435c17153": {
      "main": [
        [
          {
            "node": "d12ee22c-486d-44c0-9d3f-d94c3ece5643",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e4091cc4-1a5f-45bd-b375-07e2ef8aef84": {
      "ai_languageModel": [
        [
          {
            "node": "fce8f9bc-e6fd-413a-9381-29b1b5ad646d",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "c0f17447-0722-42b8-90ad-c55d31317d35": {
      "ai_outputParser": [
        [
          {
            "node": "fce8f9bc-e6fd-413a-9381-29b1b5ad646d",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "b4836afa-e601-4433-b170-6815ea329d1b": {
      "main": [
        [
          {
            "node": "73969b0e-8733-43a2-898c-f99435c17153",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b0a5bd0b-29cf-4164-ba28-3b09bc3ea0fa": {
      "ai_languageModel": [
        [
          {
            "node": "c0f17447-0722-42b8-90ad-c55d31317d35",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "1494f8b9-c3c2-4bdc-b3bf-47052c5c44d6": {
      "main": [
        [
          {
            "node": "4708c3d1-2135-46f8-9b97-ee09d32acdac",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0818d1ad-6f81-4610-903f-072d12c4b6ec": {
      "main": [
        [
          {
            "node": "22905c42-80f2-4083-9b69-27997cdb39ae",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2e1f0985-7148-4f92-836c-5c3584d0595f": {
      "main": [
        [
          {
            "node": "22905c42-80f2-4083-9b69-27997cdb39ae",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "09adca22-c5b5-4961-903e-bf188c070299": {
      "main": [
        [
          {
            "node": "22905c42-80f2-4083-9b69-27997cdb39ae",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e5966331-cc81-49dc-a783-6ecb46544cb7": {
      "main": [
        [
          {
            "node": "22905c42-80f2-4083-9b69-27997cdb39ae",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Création de contenu, IA Multimodale

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds33
Catégorie2
Types de nœuds11
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Auteur
Juan Carlos Cavero Gracia

Juan Carlos Cavero Gracia

@carlosgracia

Follow me in linkedin: https://www.linkedin.com/in/juan-carlos-cavero-gracia/

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34