Generar fondos de IA con Nano Banana (imágenes Gemini)

Avanzado

Este es unautomatización que contiene 35 nodos.Utiliza principalmente nodos como If, Set, Code, Wait, Merge. Usar Gemini y VideoBGRemover para crear videos con fondos generados por IA

Requisitos previos
  • Punto final de HTTP Webhook (n8n generará automáticamente)
  • Credenciales de API de Google Drive
  • Pueden requerirse credenciales de autenticación para la API de destino

Categoría

-
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "name": "AI Background Generation with Nano Banana (Gemini Image)",
  "nodes": [
    {
      "id": "c7388890-0c23-4122-bd5d-252650bc1bcc",
      "name": "📋 Vista general",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3360,
        -144
      ],
      "parameters": {
        "width": 520,
        "height": 580,
        "content": "## 🎨 AI Background Generation\n\n**What it does:**\n- Generates custom background image from text prompt\n- Uses Gemini's Nano Banana (native image generation)\n- Removes foreground video background\n- Composites video on AI-generated background\n- Saves final result to Google Drive\n\n**Perfect for:**\n- Creating custom scenes from imagination\n- Marketing videos with branded environments\n- Product demos with tailored backgrounds\n- Social media content with unique visuals\n- AI avatars in AI-generated worlds\n\n**Processing time:** 2-4 minutes per video\n- Image generation: ~10-20 seconds\n- Background removal: ~20-60 seconds\n- Composition: ~30-60 seconds\n\n**Setup:** ~5 minutes (2 API keys)\n\n[📖 Full Documentation](https://docs.videobgremover.com/)"
      },
      "typeVersion": 1,
      "notesTextSize": "large",
      "notesBackgroundColor": 4
    },
    {
      "id": "4cea6533-3c98-4416-9590-55d59fa384c1",
      "name": "🔑 Configuración de clave API",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2784,
        -160
      ],
      "parameters": {
        "width": 380,
        "height": 380,
        "content": "## 🔑 API Keys Setup (Required)\n\n**Step 1: Gemini API Key**\n- Visit: https://aistudio.google.com/apikey\n- Create new API key\n- Add to n8n: Settings → Variables\n  - Name: `GEMINI_KEY`\n  - Value: your Gemini API key\n\n**Step 2: VideoBGRemover API Key**\n- Visit: https://videobgremover.com/api-management\n- Sign up (free tier available)\n- Copy your API key\n- Add to n8n: Settings → Variables\n  - Name: `VIDEOBGREMOVER_KEY`\n  - Value: your API key\n\n✅ This workflow uses `$vars.GEMINI_KEY` and `$vars.VIDEOBGREMOVER_KEY` (secure)\n\n**Pricing:**\n- Gemini: $0.03 per image (~1024x1024)\n- VideoBGRemover: $0.50-$2.00 per min"
      },
      "typeVersion": 1
    },
    {
      "id": "e78fbba9-30f1-4195-b186-7b0e1089592f",
      "name": "📥 Entradas",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2240,
        -144
      ],
      "parameters": {
        "width": 380,
        "height": 320,
        "content": "## 📥 Input Required\n\n**video_url** (required)\n- URL to your foreground video\n- AI actors, product demos, talking heads\n- Any resolution up to 4K\n- Must be publicly accessible\n\n**background_prompt** (required)\n- Text description of desired background\n- Be descriptive and specific\n- Example: \"A modern minimalist office with floor-to-ceiling windows overlooking a city skyline at sunset\"\n\n**aspect_ratio** (optional)\n- Default: \"1:1\" (square)\n- Landscape: \"16:9\", \"4:3\"\n- Portrait: \"9:16\", \"3:4\"\n- Full list: https://ai.google.dev/gemini-api/docs/image-generation#aspect_ratios\n\n⚠️ Video must be **publicly accessible URL**"
      },
      "typeVersion": 1
    },
    {
      "id": "0c554823-6fe3-4ab1-8ff8-ae6ea3d6e369",
      "name": "🎨 Nano Banana",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -144
      ],
      "parameters": {
        "width": 380,
        "height": 380,
        "content": "## 🎨 Nano Banana (Gemini Image)\n\n**How it works:**\n- Uses Gemini 2.5 Flash with native image generation\n- Generates high-quality backgrounds from text\n- Supports detailed, photorealistic prompts\n- Built-in SynthID watermarking\n\n**Prompt tips:**\n- Be descriptive and specific\n- Mention lighting, colors, mood\n- Use photography terms for realism\n- Describe the scene, not just keywords\n\n**Examples:**\n- \"A cozy coffee shop interior with warm lighting and vintage decor\"\n- \"Modern tech office with glass walls and city views\"\n- \"Tropical beach at golden hour with palm trees\"\n\n**Output:** Base64-encoded PNG image\n**Latency:** ~10-20 seconds per image"
      },
      "typeVersion": 1
    },
    {
      "id": "c644eeb5-59d2-4423-8ae4-78843e8c17b6",
      "name": "🔄 Procesamiento",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -144
      ],
      "parameters": {
        "width": 380,
        "height": 320,
        "content": "## 🔄 Processing Flow\n\n**1. Generate Background** (~10-20s)\n- Gemini creates image from prompt\n- Returns base64-encoded PNG\n- Supports multiple aspect ratios\n\n**2. Background Removal** (~20-60s)\n- VideoBGRemover processes video\n- AI-powered segmentation\n- Clean edge detection\n\n**3. Composition** (~30-60s)\n- Composite video on AI background\n- Centered template (maintain aspect)\n- Professional framing\n\n**4. Upload to Drive**\n- Automatic save with shareable link\n- Permanent storage\n\n⏱️ Total: 2-4 min per video"
      },
      "typeVersion": 1
    },
    {
      "id": "6cf6aa8c-213e-454b-acc4-86c8331cbb25",
      "name": "💾 Google Drive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -144
      ],
      "parameters": {
        "width": 380,
        "height": 280,
        "content": "## 💾 Google Drive Setup\n\n**Step 1:** Connect Google Drive\n- Click \"Upload to Google Drive\" node\n- Click \"Connect\"\n- Authorize n8n\n\n**Step 2:** Choose folder (optional)\n- Default: Root of \"My Drive\"\n- Or select specific folder\n\n**Output:**\n- Permanent shareable link\n- Direct download URL\n- File metadata\n\n⏱️ Setup time: ~2 minutes"
      },
      "typeVersion": 1
    },
    {
      "id": "6961e968-3b00-468d-8109-f9ce3c2ebaa4",
      "name": "🚀 Uso",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        -144
      ],
      "parameters": {
        "width": 380,
        "height": 380,
        "content": "## 🚀 How to Use\n\n**Manual testing:**\n1. Update inputs in \"Sample Inputs (manual)\"\n   - `video_url`: Your video URL\n   - `background_prompt`: Describe background\n   - `aspect_ratio`: Optional (default 1:1)\n2. Click \"Execute Workflow\"\n3. Wait 2-4 minutes for processing\n4. Check Google Drive for result\n\n**Webhook automation:**\n1. Activate workflow\n2. Copy webhook URL\n3. POST to webhook:\n```json\n{\n  \"video_url\": \"https://...\",\n  \"background_prompt\": \"A modern office...\",\n  \"aspect_ratio\": \"16:9\"\n}\n```\n\n**Batch processing:** Connect to Google Sheets or Airtable for bulk automation"
      },
      "typeVersion": 1
    },
    {
      "id": "827a2d53-0d00-492c-b2d4-095bf01a9dc2",
      "name": "Disparador Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2800,
        272
      ],
      "webhookId": "ai-background-gen",
      "parameters": {
        "path": "ai-background-gen",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 1.1
    },
    {
      "id": "d0af9917-1f4f-4357-bf89-2ab33bdc329c",
      "name": "Disparador manual",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2800,
        432
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "525d4ab1-81c3-4194-8428-8eba04186dbb",
      "name": "Sección: Gemini",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2368,
        512
      ],
      "parameters": {
        "width": 900,
        "height": 100,
        "content": "## 🎨 GEMINI AI IMAGE GENERATION SECTION\nGenerates custom background image from text prompt using Nano Banana → Returns base64 PNG"
      },
      "typeVersion": 1,
      "notesBackgroundColor": 5
    },
    {
      "id": "2619d740-a101-489c-b2a0-0b6bcd3371e5",
      "name": "📸 Entrada",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3360,
        704
      ],
      "parameters": {
        "width": 416,
        "height": 748,
        "content": "## 📸 Example: Input\n\n![AI Actor](https://videos.videobgremover.com/public-assets/template-04-assets/01-foreground-ai-actor.jpg)\n\n**1. Foreground Video**\n*AI avatar speaking*\n\n**Prompt:**\n\"Modern office with city skyline at golden hour\"\n\n**Aspect ratio:** 16:9\n\n**Full video:**\nhttps://videos.videobgremover.com/public-videos/assets/ai-actor.mp4"
      },
      "typeVersion": 1,
      "notesBackgroundColor": 4
    },
    {
      "id": "0e05ad57-00a1-48f6-8a2a-15583cd04750",
      "name": "Extraer datos Webhook",
      "type": "n8n-nodes-base.set",
      "position": [
        -2640,
        272
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "name": "video_url",
              "type": "string",
              "value": "={{ $json.body?.video_url ?? $json.video_url }}"
            },
            {
              "name": "background_prompt",
              "type": "string",
              "value": "={{ $json.body?.background_prompt ?? $json.background_prompt }}"
            },
            {
              "name": "aspect_ratio",
              "type": "string",
              "value": "={{ $json.body?.aspect_ratio ?? $json.aspect_ratio ?? '1:1' }}"
            },
            {
              "name": "source",
              "type": "string",
              "value": "webhook"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "e1149727-5f4b-4d18-93c8-2607c069b2f4",
      "name": "Entradas de ejemplo (editar aquí)",
      "type": "n8n-nodes-base.set",
      "position": [
        -2640,
        432
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "name": "video_url",
              "type": "string",
              "value": "https://videos.videobgremover.com/public-videos/assets/ai-actor.mp4"
            },
            {
              "name": "background_prompt",
              "type": "string",
              "value": "A modern minimalist office with floor-to-ceiling windows overlooking a vibrant city skyline at golden hour. Warm sunlight streams through the glass, casting soft shadows on a polished concrete floor. In the background, sleek wooden desks and green plants create a professional yet inviting atmosphere. The lighting is natural and diffused, creating a calm, productive mood. Photorealistic, architectural photography style."
            },
            {
              "name": "aspect_ratio",
              "type": "string",
              "value": "16:9"
            },
            {
              "name": "source",
              "type": "string",
              "value": "manual"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "65c2e215-a254-4514-a5bd-c36bd6d344ca",
      "name": "Fusionar disparadores",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2480,
        352
      ],
      "parameters": {
        "mode": "append"
      },
      "typeVersion": 2.1
    },
    {
      "id": "6483a5c1-fd4e-42ee-8ad8-219aded66c30",
      "name": "1. Generar imagen de fondo (Gemini)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2320,
        352
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "json"
            }
          }
        },
        "jsonBody": "={\n  \"contents\": [{\n    \"parts\": [\n      {\"text\": \"{{ $json.background_prompt }}\"}\n    ]\n  }],\n  \"generationConfig\": {\n    \"responseModalities\": [\"Image\"],\n    \"imageConfig\": {\n      \"aspectRatio\": \"{{ $json.aspect_ratio }}\"\n    }\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "x-goog-api-key",
              "value": "={{ $vars.GEMINI_KEY }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "157c8a70-af96-4353-9fe8-8104d1f2073e",
      "name": "Extraer datos de imagen",
      "type": "n8n-nodes-base.code",
      "position": [
        -2080,
        352
      ],
      "parameters": {
        "jsCode": "// Extract base64 image from Gemini response\nconst imageData = $input.item.json.candidates[0].content.parts[0].inlineData.data;\nconst mimeType = $input.item.json.candidates[0].content.parts[0].inlineData.mimeType;\n\n// Convert base64 to binary for temporary storage\nconst buffer = Buffer.from(imageData, 'base64');\n\n// Create a data URL for VideoBGRemover API\nconst dataUrl = `data:${mimeType};base64,${imageData}`;\n\nreturn {\n  json: {\n    background_image_data: imageData,\n    background_image_mime: mimeType,\n    background_image_url: dataUrl\n  },\n  binary: {\n    data: {\n      data: buffer,\n      mimeType: mimeType,\n      fileName: 'generated_background.png'\n    }\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "0ba0480a-ace4-447e-8698-1dc854205011",
      "name": "2. Guardar imagen de fondo en Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1840,
        352
      ],
      "parameters": {
        "name": "=ai_bg_{{ $('Merge Triggers').item.json.background_prompt.substring(0, 30).replace(/[^a-zA-Z0-9]/g, '_') }}_{{ new Date().getTime() }}.png",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {
          "simplifyOutput": true
        },
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "68810993-3dbf-4f53-a27c-a461653f8f7f",
      "name": "3. Hacer pública la imagen de fondo Make",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1600,
        352
      ],
      "parameters": {
        "fileId": "={{ $json.id }}",
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "reader",
            "type": "anyone"
          }
        }
      },
      "typeVersion": 3
    },
    {
      "id": "2dd106d4-9f8e-4a22-8da7-c5f245fbf0f5",
      "name": "📸 Generado",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2800,
        704
      ],
      "parameters": {
        "width": 432,
        "height": 700,
        "content": "## 📸 Example: Generated\n\n![Generated Background](https://videos.videobgremover.com/public-assets/template-04-assets/02-generated-background-nano-banana.png)\n\n**2. Nano Banana Output**\n*AI-generated office background*\n\n**Details:**\n- Model: Gemini 2.5 Flash\n- Aspect ratio: 16:9\n- Resolution: ~1536x864px\n- Time: ~10-15 seconds\n- PNG with SynthID\n\n**Saved to Drive & made public**"
      },
      "typeVersion": 1,
      "notesBackgroundColor": 6
    },
    {
      "id": "6bcc43e4-4de5-4c73-9dba-610e91d0a23f",
      "name": "Sección: VideoBGRemover",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        512
      ],
      "parameters": {
        "width": 1020,
        "height": 100,
        "content": "## 🎬 VIDEOBGREMOVER COMPOSITION SECTION\nRemoves foreground video background → Composites on AI-generated image → Centered template"
      },
      "typeVersion": 1,
      "notesBackgroundColor": 2
    },
    {
      "id": "639e12d4-7275-4353-9bbd-5a4a62138ada",
      "name": "4. Crear trabajo (subir video)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1360,
        592
      ],
      "parameters": {
        "url": "https://api.videobgremover.com/api/v1/jobs",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "json"
            }
          }
        },
        "jsonBody": "={ \"video_url\": \"{{ $('Merge Triggers').item.json.video_url }}\" }",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-Key",
              "value": "={{ $vars.VIDEOBGREMOVER_KEY }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "aef3cf73-31dc-429e-9f61-083338ca1520",
      "name": "5. Iniciar composición (fondo con IA)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1120,
        592
      ],
      "parameters": {
        "url": "=https://api.videobgremover.com/api/v1/jobs/{{ $json.id }}/start",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "json"
            }
          }
        },
        "jsonBody": "={\n  \"background\": {\n    \"type\": \"composition\",\n    \"composition\": {\n      \"template\": \"centered\",\n      \"background_type\": \"image\",\n      \"background_url\": \"https://drive.google.com/uc?id={{ $('2. Save Background Image to Drive').item.json.id }}\",\n      \"export_format\": \"h264\",\n      \"export_preset\": \"medium\"\n    }\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-Key",
              "value": "={{ $vars.VIDEOBGREMOVER_KEY }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "e3a43a09-01ad-4618-ba17-b16429bfe3b4",
      "name": "6. Verificar estado del trabajo",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -880,
        592
      ],
      "parameters": {
        "url": "=https://api.videobgremover.com/api/v1/jobs/{{ $('4. Create Job (Upload Video)').item.json.id }}/status",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "json"
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-Key",
              "value": "={{ $vars.VIDEOBGREMOVER_KEY }}"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "249577e0-7159-4945-92fd-ad3a7bfbb9a1",
      "name": "¿Está completo?",
      "type": "n8n-nodes-base.if",
      "position": [
        -640,
        592
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "is_completed_condition",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "completed"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "b0b6b36f-284c-446e-894b-1bacfae40264",
      "name": "Sección: Salida",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        512
      ],
      "parameters": {
        "width": 840,
        "height": 100,
        "content": "## 💾 OUTPUT SECTION\nDownload final video → Upload to Google Drive → Return response"
      },
      "typeVersion": 1,
      "notesBackgroundColor": 3
    },
    {
      "id": "4acc452e-2286-4db8-92b0-799fda21f6de",
      "name": "7. Descargar video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -400,
        752
      ],
      "parameters": {
        "url": "={{ $json.processed_video_url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "432d20ce-1e25-400c-86a7-789e8447c323",
      "name": "8. Subir video a Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -160,
        752
      ],
      "parameters": {
        "name": "=ai_bg_video_{{ $('4. Create Job (Upload Video)').item.json.id }}_{{ new Date().getTime() }}.mp4",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {
          "simplifyOutput": true
        },
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "ac59da0a-0526-4f25-ab9c-fe42a3a353d1",
      "name": "📸 Final",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2240,
        704
      ],
      "parameters": {
        "width": 320,
        "height": 676,
        "content": "## 📸 Example: Final\n\n![Final Result](https://videos.videobgremover.com/public-assets/template-04-assets/03-final-composed-result.jpg)\n\n**3. Composed Video**\n*AI actor on AI background*\n\n**Details:**\n- Template: Centered\n- Background removed\n- Aspect ratio preserved\n- Professional framing\n\n**Full video:**\nhttps://videos.videobgremover.com/public-assets/template-04-assets/final-result.mp4\n\n**Saved to Google Drive**"
      },
      "typeVersion": 1,
      "notesBackgroundColor": 4
    },
    {
      "id": "06d9ffa9-5ea1-4f76-b7c0-72ee3f9561a0",
      "name": "Construir respuesta de éxito",
      "type": "n8n-nodes-base.set",
      "position": [
        96,
        752
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "name": "final_result",
              "type": "object",
              "value": "={{ {\n  success: true,\n  job_id: $('4. Create Job (Upload Video)').item.json.id,\n  export_id: $('5. Start Composition (AI Background)').item.json.export_id,\n  video: {\n    google_drive_id: $('8. Upload Video to Drive').item.json.id,\n    google_drive_url: $('8. Upload Video to Drive').item.json.webViewLink,\n    download_url: $('6. Check Job Status').item.json.processed_video_url,\n    filename: $('8. Upload Video to Drive').item.json.name,\n    length_seconds: $('6. Check Job Status').item.json.length_seconds\n  },\n  background_image: {\n    google_drive_id: $('2. Save Background Image to Drive').item.json.id,\n    google_drive_url: $('2. Save Background Image to Drive').item.json.webViewLink,\n    public_url: 'https://drive.google.com/uc?id=' + $('2. Save Background Image to Drive').item.json.id,\n    filename: $('2. Save Background Image to Drive').item.json.name,\n    prompt: $('Merge Triggers').item.json.background_prompt,\n    aspect_ratio: $('Merge Triggers').item.json.aspect_ratio\n  },\n  message: 'Video composed with AI-generated background successfully. Both video and background image saved to Google Drive',\n  source: $('Merge Triggers').item.json.source\n} }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "4c13c1eb-3d12-444d-821a-9cce21a9356f",
      "name": "¿Ha fallado?",
      "type": "n8n-nodes-base.if",
      "position": [
        -640,
        832
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "is_failed_condition",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "failed"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "710a1000-eda6-4f22-be7c-618f875b2579",
      "name": "Esperar 20s",
      "type": "n8n-nodes-base.wait",
      "position": [
        -400,
        992
      ],
      "parameters": {
        "amount": 20
      },
      "typeVersion": 1.1
    },
    {
      "id": "afc2bd32-fe3a-4e16-a6ae-2d75575582c8",
      "name": "Construir respuesta de error",
      "type": "n8n-nodes-base.set",
      "position": [
        -640,
        992
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "name": "final_result",
              "type": "object",
              "value": "={{ {\n  success: false,\n  job_id: $('4. Create Job (Upload Video)').item.json.id,\n  error: $json.error || 'Video composition with AI background failed',\n  status: $json.status,\n  message: 'Failed to compose video with AI-generated background',\n  source: $('Merge Triggers').item.json.source\n} }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "006453e6-d202-4b10-9feb-544b6be77f52",
      "name": "¿Desde Webhook?",
      "type": "n8n-nodes-base.if",
      "position": [
        336,
        752
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "is_webhook_condition",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.final_result?.source ?? $json.source }}",
              "rightValue": "webhook"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "a6ba3383-2e3b-4497-8e88-a9d2e96561c1",
      "name": "Responder a Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        576,
        672
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "a30e6cda-335b-4a68-afbd-d492beb28c60",
      "name": "Prueba manual completada",
      "type": "n8n-nodes-base.set",
      "position": [
        576,
        832
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "name": "final_result",
              "type": "object",
              "value": "={{ $json.final_result ?? $json }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "710a1000-eda6-4f22-be7c-618f875b2579": {
      "main": [
        [
          {
            "node": "e3a43a09-01ad-4618-ba17-b16429bfe3b4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4c13c1eb-3d12-444d-821a-9cce21a9356f": {
      "main": [
        [
          {
            "node": "afc2bd32-fe3a-4e16-a6ae-2d75575582c8",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "710a1000-eda6-4f22-be7c-618f875b2579",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "249577e0-7159-4945-92fd-ad3a7bfbb9a1": {
      "main": [
        [
          {
            "node": "4acc452e-2286-4db8-92b0-799fda21f6de",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "4c13c1eb-3d12-444d-821a-9cce21a9356f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "006453e6-d202-4b10-9feb-544b6be77f52": {
      "main": [
        [
          {
            "node": "a6ba3383-2e3b-4497-8e88-a9d2e96561c1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "a30e6cda-335b-4a68-afbd-d492beb28c60",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d0af9917-1f4f-4357-bf89-2ab33bdc329c": {
      "main": [
        [
          {
            "node": "e1149727-5f4b-4d18-93c8-2607c069b2f4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "65c2e215-a254-4514-a5bd-c36bd6d344ca": {
      "main": [
        [
          {
            "node": "6483a5c1-fd4e-42ee-8ad8-219aded66c30",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "827a2d53-0d00-492c-b2d4-095bf01a9dc2": {
      "main": [
        [
          {
            "node": "0e05ad57-00a1-48f6-8a2a-15583cd04750",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4acc452e-2286-4db8-92b0-799fda21f6de": {
      "main": [
        [
          {
            "node": "432d20ce-1e25-400c-86a7-789e8447c323",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "157c8a70-af96-4353-9fe8-8104d1f2073e": {
      "main": [
        [
          {
            "node": "0ba0480a-ace4-447e-8698-1dc854205011",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e3a43a09-01ad-4618-ba17-b16429bfe3b4": {
      "main": [
        [
          {
            "node": "249577e0-7159-4945-92fd-ad3a7bfbb9a1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "afc2bd32-fe3a-4e16-a6ae-2d75575582c8": {
      "main": [
        [
          {
            "node": "006453e6-d202-4b10-9feb-544b6be77f52",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0e05ad57-00a1-48f6-8a2a-15583cd04750": {
      "main": [
        [
          {
            "node": "65c2e215-a254-4514-a5bd-c36bd6d344ca",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "06d9ffa9-5ea1-4f76-b7c0-72ee3f9561a0": {
      "main": [
        [
          {
            "node": "006453e6-d202-4b10-9feb-544b6be77f52",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "432d20ce-1e25-400c-86a7-789e8447c323": {
      "main": [
        [
          {
            "node": "06d9ffa9-5ea1-4f76-b7c0-72ee3f9561a0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e1149727-5f4b-4d18-93c8-2607c069b2f4": {
      "main": [
        [
          {
            "node": "65c2e215-a254-4514-a5bd-c36bd6d344ca",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "639e12d4-7275-4353-9bbd-5a4a62138ada": {
      "main": [
        [
          {
            "node": "aef3cf73-31dc-429e-9f61-083338ca1520",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "68810993-3dbf-4f53-a27c-a461653f8f7f": {
      "main": [
        [
          {
            "node": "639e12d4-7275-4353-9bbd-5a4a62138ada",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0ba0480a-ace4-447e-8698-1dc854205011": {
      "main": [
        [
          {
            "node": "68810993-3dbf-4f53-a27c-a461653f8f7f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "aef3cf73-31dc-429e-9f61-083338ca1520": {
      "main": [
        [
          {
            "node": "e3a43a09-01ad-4618-ba17-b16429bfe3b4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6483a5c1-fd4e-42ee-8ad8-219aded66c30": {
      "main": [
        [
          {
            "node": "157c8a70-af96-4353-9fe8-8104d1f2073e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos35
Categoría-
Tipos de nodos11
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34