AutomationFlowsSocial Media › Generate Veed AI Videos From Google Sheets

Generate Veed AI Videos From Google Sheets

Original n8n title: Generate Veed AI Talking Head Videos From Sheet Rows with Openai or Elevenlabs

ByVEED @veed on n8n.io

A production-ready n8n workflow that generates AI avatar videos from images and text using VEED Fabric 1.0, with flexible multi-platform publishing capabilities. Process any number of videos: Sequential processing ensures each video is fully generated and published before moving…

Event trigger★★★★★ complexityAI-powered54 nodesGoogle SheetsHTTP RequestOpenAIGoogle DriveN8N Nodes VeedGmailYouTubeFacebook Graph Api
Social Media Trigger: Event Nodes: 54 Complexity: ★★★★★ AI nodes: yes Added:
Generate Veed AI Videos From Google Sheets — n8n workflow card showing Google Sheets, HTTP Request, OpenAI integration

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

This workflow follows the Facebookgraphapi → Google Sheets 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": "d8xObT9y4P4B2CupEqkVT",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "VEED AI Talking Head Video Generator with Multi-Platform Publishing",
  "tags": [
    {
      "id": "1t2Nq7FmQvuRUBNK",
      "name": "AI Video",
      "createdAt": "2025-12-18T10:21:22.017Z",
      "updatedAt": "2025-12-18T10:21:22.017Z"
    },
    {
      "id": "Jj9b6mUfqfIPRtXY",
      "name": "VEED",
      "createdAt": "2025-12-18T10:21:22.028Z",
      "updatedAt": "2025-12-18T10:21:22.028Z"
    },
    {
      "id": "hCeqO49Q10y7GHDW",
      "name": "Social Media",
      "createdAt": "2025-12-18T10:21:22.027Z",
      "updatedAt": "2025-12-18T10:21:22.027Z"
    }
  ],
  "nodes": [
    {
      "id": "edf08cb5-6faa-4d85-987a-5095390741df",
      "name": "Sticky Note - Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4560,
        944
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 1824,
        "content": "# VEED AI Talking Head Video Generator\n\nA production-ready n8n workflow that generates AI avatar videos from images and text using **VEED Fabric 1.0**, with flexible multi-platform publishing capabilities.\n\n## Key Capabilities\n\n### Unlimited Scale\n- **Process any number of videos**: Sequential processing ensures each video is fully generated and published before moving to the next\n- **Batch processing**: Add multiple video requests to Google Sheet and let the workflow process them automatically\n- **No context mixing**: Each video maintains its own configuration throughout the entire pipeline\n\n### Flexible Publishing\n- **Per-video platform selection**: Each video can target different platforms (e.g., Video 1 \u2192 Instagram+YouTube, Video 2 \u2192 Telegram only)\n- **Optional publishing**: Leave PLATFORMS column empty to generate videos without publishing (videos saved to Drive)\n- **Supported platforms**: Instagram Reels, YouTube/Shorts, Facebook, Telegram, Threads\n- **Platform-specific formatting**: Automatic optimization for each platform's requirements\n\n### Smart Processing\n- **Two TTS providers**: Choose OpenAI or ElevenLabs per video\n- **Configurable quality**: Select resolution (480p/720p) and aspect ratio (9:16, 16:9, 1:1) per video\n- **Approval workflow**: Review videos before publishing with email approve/reject buttons\n- **Error handling**: Automatic error detection with detailed email notifications\n\n### Status Tracking\n- **Real-time status updates**: Google Sheet updates as workflow progresses (new \u2192 processing \u2192 published)\n- **Detailed results**: Per-platform success/failure tracking with post URLs\n- **Email reports**: Comprehensive publishing reports with links to all posted content\n\n## How It Works\n1. **Input**: Add rows to Google Sheet with video details\n2. **TTS**: Generate speech using OpenAI or ElevenLabs\n3. **Video**: VEED Fabric 1.0 creates talking head video\n4. **Approval**: Email with video preview and approve/reject buttons\n5. **Publish**: Sequential publishing to selected platforms\n6. **Report**: Status update in sheet + email with results\n\n## Requirements\n- Fal.ai API Key (for VEED)\n- Google OAuth (Sheets, Drive, Gmail)\n- TTS: OpenAI or ElevenLabs API Key\n- Social Media credentials (optional, only for platforms you use)\n- Telegram Bot Token (optional, only for Telegram)\n\n**Node:** n8n-nodes-veed\n**Author:** VEED.io"
      },
      "typeVersion": 1
    },
    {
      "id": "159b7d17-15d4-4212-bd24-059876349849",
      "name": "Sticky Note - Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4976,
        944
      ],
      "parameters": {
        "color": 4,
        "width": 440,
        "height": 1824,
        "content": "## Setup Instructions\n\n### Step 1: Create Google Sheet\nCreate a new Google Sheet with these columns:\n- `AVATAR_IMAGE_URL` - Public URL to portrait image\n- `NARRATION_TEXT` - Text for the avatar to speak\n- `TTS_PROVIDER` - \"openai\" or \"elevenlabs\"\n- `VOICE_ID` - Voice ID (e.g., \"alloy\" for OpenAI)\n- `VIDEO_TITLE` - Title for the video\n- `VIDEO_DESCRIPTION` - Description text\n- `PLATFORMS` - Comma-separated: instagram,youtube,facebook,telegram,threads\n- `ASPECT_RATIO` - \"9:16\", \"16:9\", or \"1:1\"\n- `RESOLUTION` - \"480p\" or \"720p\"\n- `STATUS` - Set to \"new\"\n\n### Step 2: Configure Credentials\n1. **Fal.ai** - Get key at fal.ai/dashboard/keys\n2. **Google OAuth** - For Gmail, Drive, Sheets\n3. **OpenAI** - platform.openai.com/api-keys\n4. **ElevenLabs** - elevenlabs.io/app/settings/api-keys\n5. **Telegram Bot** - Create bot via @BotFather and get token\n\n### Step 3: Update Node Placeholders\nOpen each node and replace:\n- **Google Sheets nodes**: Set your Google Document and Sheet IDs (from URL: docs.google.com/spreadsheets/d/YOUR_ID/edit)\n- **Upload to Drive**: Set your Google Drive folder ID for audio files\n- **Send Approval Email**: Set your approval email address\n- **Send Report Email**: Set notification email address\n\n### Step 4: Social Media Setup (Optional)\nFor each platform you want to publish to:\n- **Instagram**: Set YOUR_INSTAGRAM_BUSINESS_ACCOUNT_ID, configure Facebook Graph API credentials\n- **YouTube**: Configure Google OAuth2 credentials for YouTube API\n- **Facebook**: Set YOUR_FACEBOOK_PAGE_ID, configure Facebook Graph API credentials\n- **Telegram**: Set YOUR_TELEGRAM_CHAT_ID (for public group/channel), configure Telegram Bot credentials\n- **Threads**: Set YOUR_THREADS_USER_ID, configure HTTP Query Auth credentials (Name: access_token, Value: your Threads API token)"
      },
      "typeVersion": 1
    },
    {
      "id": "9305fe8a-27af-4c69-96d4-f799b6d4885c",
      "name": "Sticky Note - Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5424,
        944
      ],
      "parameters": {
        "color": 7,
        "width": 1176,
        "height": 1832,
        "content": "## 1. Trigger & Input\n\nWorkflow triggers either:\n- **Manual**: Click \"Test workflow\"\n- **Scheduled**: Every 15 minutes\n\nFetches rows from Google Sheets where `STATUS = new`, then processes them **one at a time** using a loop:\n\n1. Read all rows with STATUS = new\n2. Loop Over Rows (processes one row per iteration)\n3. Mark current row as `processing`\n4. Process the video\n5. Update the sheet\n6. Loop back to process next row\n\nThis ensures each video is fully processed before starting the next one, preventing context mixing and ensuring correct row updates."
      },
      "typeVersion": 1
    },
    {
      "id": "a193bcdf-7ad4-4c91-a0ce-ef9f2260bc62",
      "name": "Sticky Note - TTS",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6608,
        944
      ],
      "parameters": {
        "color": 3,
        "width": 1432,
        "height": 1824,
        "content": "## 2. Text-to-Speech Generation\n\nChoose TTS provider in your Google Sheet:\n\n**OpenAI TTS** (default)\n- Model: tts-1-hd\n- Voices: alloy, echo, fable, nova, onyx, shimmer\n\n\n**ElevenLabs**\n- Model: eleven_multilingual_v2\n- Use voice ID from your ElevenLabs dashboard\n\nAudio is uploaded to Google Drive and made publicly accessible for VEED."
      },
      "typeVersion": 1
    },
    {
      "id": "12488180-66a3-4273-9edf-673c8184e629",
      "name": "Sticky Note - VEED",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8048,
        944
      ],
      "parameters": {
        "color": 6,
        "width": 712,
        "height": 1820,
        "content": "## 3. VEED Video Generation\n\nUsing **VEED Fabric 1.0** model via Fal.ai\n\n**Requirements:**\n- Front-facing portrait photo (URL)\n- Audio file (MP3 from Google Drive)\n\n\n**Options:**\n- Resolution: 480p (faster) or 720p (better)\n- Aspect Ratio: 9:16 (TikTok/Reels), 16:9 (YouTube), 1:1 (Feed)\n\n\n**Processing Time:** 1-10 minutes depending on video length\n\n\n**Error Handling:**\nIf VEED generation fails:\n- Status updated to \"error\" in Google Sheet\n- Error notification email sent with details"
      },
      "typeVersion": 1
    },
    {
      "id": "7a8c4d46-768d-4003-96f6-ee2c7d9681a4",
      "name": "Sticky Note - Approval",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8768,
        944
      ],
      "parameters": {
        "color": 2,
        "width": 744,
        "height": 1816,
        "content": "## 4. Approval Workflow\n\nAfter video generation, an email is sent with:\n- Video preview link\n- Video metadata (title, description, platforms)\n- **Approve** / **Reject** buttons\n\n\n**Timeout:** 24 hours\n**If no response:** Video remains pending\n**If rejected:** Status updated to \"rejected\" in Google Sheet"
      },
      "typeVersion": 1
    },
    {
      "id": "60b17788-d14d-4aeb-86c9-0a3ad8aa6738",
      "name": "Sticky Note - Publishing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        9520,
        944
      ],
      "parameters": {
        "width": 1520,
        "height": 1828,
        "content": "## 5. Multi-Platform Publishing\n\nSupported platforms (configure in PLATFORMS column):\n\n**Instagram** - Reels API (requires Business Account, uses Facebook Graph API)\n**YouTube** - Auto-detects Shorts for <60s videos with 9:16\n**Facebook** - Posts to Page (not personal profile, uses Facebook Graph API)\n**Telegram** - Posts video to public groups/channels (uses Telegram Bot API)\n**Threads** - Posts to Threads (requires separate Threads API token via HTTP Query Auth)\n\n**Sequential publishing:** Platforms are published to one at a time to ensure proper error handling.\n\n**Flow:**\n1. Split Out Platforms (creates one item per platform)\n2. Loop Over Platforms (processes one platform at a time, with reset:true)\n3. Platform Router (routes to correct publishing node)\n4. Publish (Instagram/YouTube/Facebook/Telegram/Threads)\n5. Format Result (standardize response)\n6. Loop back to step 2 until all platforms done\n7. Aggregate (collect all platform results)\n8. Update Sheet with all results\n\n\n**Credentials Note:** Instagram and Facebook share the same Facebook Graph API credentials. Threads requires a separate Threads API token configured as HTTP Query Auth. Telegram uses Telegram Bot credentials."
      },
      "typeVersion": 1
    },
    {
      "id": "e943d97f-6289-485a-b074-e23f628cb6b1",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        5472,
        1408
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "220f9f1c-556e-4d9c-bafe-d77a8983e581",
      "name": "Check for New Videos",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        5472,
        1600
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 15
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "123fe60b-731d-46e3-b6b4-012ab69b5323",
      "name": "Get New Video Requests",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueRegularOutput",
      "position": [
        5728,
        1504
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "56b98ab9-7af2-4f8d-9e21-42a1ceed5fb4",
      "name": "Filter Status New",
      "type": "n8n-nodes-base.filter",
      "position": [
        5952,
        1504
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "filter-status-new",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.STATUS }}",
              "rightValue": "new"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "0dc800b2-3e1a-4782-9437-fafdf1936396",
      "name": "Loop Over Rows",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        6192,
        1504
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "99fedab8-f52d-4004-a5ad-a7fc9d6084b5",
      "name": "Mark as Processing",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueRegularOutput",
      "position": [
        6432,
        1520
      ],
      "parameters": {
        "columns": {
          "value": {
            "STATUS": "processing",
            "row_number": "={{ $('Loop Over Rows').item.json.row_number }}"
          },
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ]
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "d6231826-898a-4618-9eb5-aa1a8cf20d41",
      "name": "Prepare Video Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        6672,
        1520
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "param-image",
              "name": "imageUrl",
              "type": "string",
              "value": "={{ $('Loop Over Rows').item.json.AVATAR_IMAGE_URL }}"
            },
            {
              "id": "param-text",
              "name": "narrationText",
              "type": "string",
              "value": "={{ $('Loop Over Rows').item.json.NARRATION_TEXT }}"
            },
            {
              "id": "param-tts",
              "name": "ttsProvider",
              "type": "string",
              "value": "={{ $('Loop Over Rows').item.json.TTS_PROVIDER || 'openai' }}"
            },
            {
              "id": "param-voice",
              "name": "voiceId",
              "type": "string",
              "value": "={{ $('Loop Over Rows').item.json.VOICE_ID || 'alloy' }}"
            },
            {
              "id": "param-title",
              "name": "videoTitle",
              "type": "string",
              "value": "={{ $('Loop Over Rows').item.json.VIDEO_TITLE }}"
            },
            {
              "id": "param-desc",
              "name": "videoDescription",
              "type": "string",
              "value": "={{ $('Loop Over Rows').item.json.VIDEO_DESCRIPTION }}"
            },
            {
              "id": "param-platforms",
              "name": "platforms",
              "type": "string",
              "value": "={{ $('Loop Over Rows').item.json.PLATFORMS || '' }}"
            },
            {
              "id": "param-aspect",
              "name": "aspectRatio",
              "type": "string",
              "value": "={{ $('Loop Over Rows').item.json.ASPECT_RATIO || '9:16' }}"
            },
            {
              "id": "param-res",
              "name": "resolution",
              "type": "string",
              "value": "={{ $('Loop Over Rows').item.json.RESOLUTION || '720p' }}"
            },
            {
              "id": "param-row",
              "name": "rowNumber",
              "type": "number",
              "value": "={{ $('Loop Over Rows').item.json.row_number }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "23f614af-32ee-4a53-b0f9-89bd98761550",
      "name": "TTS Provider?",
      "type": "n8n-nodes-base.if",
      "position": [
        6912,
        1520
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "if-tts-elevenlabs-cond",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.ttsProvider === 'elevenlabs' }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "721cdc03-ad6b-4420-9198-9922831fed82",
      "name": "ElevenLabs TTS",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        7152,
        1424
      ],
      "parameters": {
        "url": "=https://api.elevenlabs.io/v1/text-to-speech/{{ $json.voiceId }}",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "jsonBody": "={\n  \"text\": {{ JSON.stringify($json.narrationText) }},\n  \"model_id\": \"eleven_multilingual_v2\",\n  \"voice_settings\": {\n    \"stability\": 0.5,\n    \"similarity_boost\": 0.75\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "c1d12676-b8f4-4b5a-ae41-c735cfc274c4",
      "name": "OpenAI TTS",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "onError": "continueRegularOutput",
      "position": [
        7152,
        1616
      ],
      "parameters": {
        "input": "={{ $json.narrationText }}",
        "voice": "={{ $json.voiceId }}",
        "options": {},
        "resource": "audio"
      },
      "typeVersion": 1.8
    },
    {
      "id": "99db6991-e1d0-4773-a1a3-0d6fac5db15b",
      "name": "Merge TTS",
      "type": "n8n-nodes-base.merge",
      "position": [
        7392,
        1520
      ],
      "parameters": {
        "mode": "combine",
        "options": {
          "includeUnpaired": true
        },
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3
    },
    {
      "id": "b1204e5b-86b8-4fa9-a7be-a6a7426e2c1c",
      "name": "Upload to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "onError": "continueRegularOutput",
      "position": [
        7632,
        1520
      ],
      "parameters": {
        "name": "={{ $now.format('yyyyMMdd-HHmmss') }}-audio.mp3",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_AUDIO_FOLDER_ID"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "827f377e-fb11-49bc-878e-d6a3dd3cbefe",
      "name": "Make Public",
      "type": "n8n-nodes-base.googleDrive",
      "onError": "continueRegularOutput",
      "position": [
        7872,
        1520
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "reader",
            "type": "anyone"
          }
        }
      },
      "typeVersion": 3
    },
    {
      "id": "b7dfce0b-1910-4a4c-9c76-06b7cb79d60b",
      "name": "Set Audio URL",
      "type": "n8n-nodes-base.set",
      "position": [
        8112,
        1520
      ],
      "parameters": {
        "options": {
          "dotNotation": false
        },
        "assignments": {
          "assignments": [
            {
              "id": "audio-url",
              "name": "audioUrl",
              "type": "string",
              "value": "=https://drive.google.com/uc?export=download&id={{ $('Upload to Drive').item.json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8882b177-edfb-49ec-bd0a-fa9210015742",
      "name": "VEED Generate Video",
      "type": "n8n-nodes-veed.veed",
      "onError": "continueRegularOutput",
      "position": [
        8352,
        1520
      ],
      "parameters": {
        "options": {
          "timeout": 15
        },
        "audioUrl": "={{ $json.audioUrl }}",
        "imageUrl": "={{ $('Prepare Video Parameters').item.json.imageUrl }}",
        "resolution": "={{ $('Prepare Video Parameters').item.json.resolution }}",
        "aspectRatio": "={{ $('Prepare Video Parameters').item.json.aspectRatio }}"
      },
      "typeVersion": 1
    },
    {
      "id": "b5fcc71d-ab9c-4748-b23a-ecbffaf8cf7b",
      "name": "VEED Error?",
      "type": "n8n-nodes-base.if",
      "position": [
        8592,
        1520
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "check-veed-error",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            },
            {
              "id": "check-video-missing",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.video?.url }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ad5d384b-f655-48fd-a2cb-6bed0b843cb4",
      "name": "Update Sheet - Error",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueRegularOutput",
      "position": [
        8256,
        1792
      ],
      "parameters": {
        "columns": {
          "value": {
            "STATUS": "error",
            "row_number": "={{ $('Prepare Video Parameters').item.json.rowNumber }}"
          },
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ]
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "0f3bba73-368e-4f2c-b867-42fa97e00207",
      "name": "Send Error Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        8480,
        1792
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "=<html>\n<body style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px;\">\n  <h2 style=\"color: #dc3545;\">Video Generation Failed</h2>\n  \n  <div style=\"background: #f8d7da; padding: 20px; border-radius: 8px; margin: 20px 0; border: 1px solid #f5c6cb;\">\n    <p><strong>Error:</strong></p>\n    <pre style=\"white-space: pre-wrap; font-family: monospace; font-size: 13px; color: #721c24;\">{{ $('VEED Generate Video').item.json.error || 'Video generation failed - no video URL returned' }}</pre>\n  </div>\n  \n  <div style=\"background: #f5f5f5; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n    <p><strong>Video Details:</strong></p>\n    <p><strong>Title:</strong> {{ $('Prepare Video Parameters').item.json.videoTitle }}</p>\n    <p><strong>Description:</strong> {{ $('Prepare Video Parameters').item.json.videoDescription }}</p>\n    <p><strong>Image URL:</strong> {{ $('Prepare Video Parameters').item.json.imageUrl }}</p>\n    <p><strong>Aspect Ratio:</strong> {{ $('Prepare Video Parameters').item.json.aspectRatio }}</p>\n    <p><strong>Resolution:</strong> {{ $('Prepare Video Parameters').item.json.resolution }}</p>\n    <p><strong>Row Number:</strong> {{ $('Prepare Video Parameters').item.json.rowNumber }}</p>\n  </div>\n  \n  <div style=\"background: #fff3cd; padding: 15px; border-radius: 8px; margin: 20px 0; border: 1px solid #ffeeba;\">\n    <p style=\"margin: 0; color: #856404;\"><strong>Action Required:</strong> Please check the input data and try again. The row status has been updated to \"error\" in the Google Sheet.</p>\n  </div>\n  \n  <p style=\"color: #666; font-size: 12px;\">Timestamp: {{ $now.toISO() }}</p>\n</body>\n</html>",
        "options": {},
        "subject": "=[ERROR] Video Generation Failed: {{ $('Prepare Video Parameters').item.json.videoTitle }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "9997d32f-0898-4709-af13-a6e1a734ba9c",
      "name": "Format Email",
      "type": "n8n-nodes-base.set",
      "position": [
        8832,
        1536
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "email-body",
              "name": "emailBody",
              "type": "string",
              "value": "=<html>\n<body style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px;\">\n  <h2 style=\"color: #333;\">New Video Ready for Approval</h2>\n  \n  <div style=\"background: #f5f5f5; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n    <p><strong>Title:</strong> {{ $('Prepare Video Parameters').item.json.videoTitle }}</p>\n    <p><strong>Description:</strong> {{ $('Prepare Video Parameters').item.json.videoDescription }}</p>\n    <p><strong>Target Platforms:</strong> {{ $('Prepare Video Parameters').item.json.platforms }}</p>\n    <p><strong>Aspect Ratio:</strong> {{ $('Prepare Video Parameters').item.json.aspectRatio }}</p>\n    <p><strong>Resolution:</strong> {{ $('Prepare Video Parameters').item.json.resolution }}</p>\n  </div>\n  \n  <div style=\"margin: 20px 0; padding: 15px; background: #e8f4e8; border-radius: 8px;\">\n    <p><strong>Video Preview:</strong></p>\n    <a href=\"{{ $('VEED Generate Video').item.json.video.url }}\" style=\"color: #007bff; font-size: 16px;\">Click here to preview video</a>\n  </div>\n  \n  <p style=\"color: #666; font-size: 12px;\">Generation took {{ Math.round($('VEED Generate Video').item.json.duration / 1000) }} seconds</p>\n  <p style=\"color: #666; font-size: 12px;\">Request ID: {{ $('VEED Generate Video').item.json.requestId }}</p>\n</body>\n</html>"
            },
            {
              "id": "video-url",
              "name": "generatedVideoUrl",
              "type": "string",
              "value": "={{ $('VEED Generate Video').item.json.video.url }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "037d4152-af28-4725-ba02-2290479e5f29",
      "name": "Send Approval Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        9072,
        1536
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ $json.emailBody }}",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeAmount": 24
            }
          }
        },
        "subject": "=Approve Video: {{ $('Prepare Video Parameters').item.json.videoTitle }}",
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "db445d37-813d-4ad9-887f-bb898bcde7fe",
      "name": "Approved?",
      "type": "n8n-nodes-base.if",
      "position": [
        9312,
        1536
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "check-approved",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "33a5d4a4-1801-4d85-a5bb-8fc48e658fa0",
      "name": "Log Rejection",
      "type": "n8n-nodes-base.set",
      "position": [
        8960,
        1792
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "status-rejected",
              "name": "status",
              "type": "string",
              "value": "rejected"
            },
            {
              "id": "rejected-at",
              "name": "rejectedAt",
              "type": "string",
              "value": "={{ $now.toISO() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "30246a95-064e-4a78-955a-5395462cf81b",
      "name": "Update Sheet - Rejected",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueRegularOutput",
      "position": [
        9200,
        1792
      ],
      "parameters": {
        "columns": {
          "value": {
            "STATUS": "rejected",
            "row_number": "={{ $('Prepare Video Parameters').item.json.rowNumber }}"
          },
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ]
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "3614c749-4dd7-435c-be06-fcc50105775e",
      "name": "Prepare Publish Data",
      "type": "n8n-nodes-base.set",
      "position": [
        9600,
        1520
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "prep-video-url",
              "name": "videoUrl",
              "type": "string",
              "value": "={{ $('Format Email').item.json.generatedVideoUrl }}"
            },
            {
              "id": "prep-title",
              "name": "title",
              "type": "string",
              "value": "={{ $('Prepare Video Parameters').item.json.videoTitle }}"
            },
            {
              "id": "prep-desc",
              "name": "description",
              "type": "string",
              "value": "={{ $('Prepare Video Parameters').item.json.videoDescription }}"
            },
            {
              "id": "prep-platforms",
              "name": "platformList",
              "type": "array",
              "value": "={{ ($('Prepare Video Parameters').item.json.platforms || '').toLowerCase().split(',').map(p => p.trim()) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ece6ce5f-3eac-4565-8380-1edc68ecee3e",
      "name": "Download Video",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        9808,
        1520
      ],
      "parameters": {
        "url": "={{ $json.videoUrl }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d3620f4e-b6ff-499f-a9ff-778009480935",
      "name": "Split Out Platforms",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        10016,
        1520
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {
          "includeBinary": true
        },
        "fieldToSplitOut": "platformList"
      },
      "typeVersion": 1
    },
    {
      "id": "loop-over-platforms-id",
      "name": "Loop Over Platforms",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        10224,
        1520
      ],
      "parameters": {
        "options": {
          "reset": "={{ $('Loop Over Platforms').context['done'] }}"
        },
        "batchSize": 1
      },
      "typeVersion": 3
    },
    {
      "id": "609bc2d8-31c9-41b6-98ca-3ea9ee504318",
      "name": "Platform Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        9616,
        1808
      ],
      "parameters": {
        "rules": {
          "rules": [
            {
              "value2": "instagram"
            },
            {
              "value2": "youtube"
            },
            {
              "value2": "facebook"
            },
            {
              "value2": "telegram"
            },
            {
              "value2": "threads"
            }
          ]
        },
        "value1": "={{ $json.platformList }}",
        "dataType": "string"
      },
      "typeVersion": 2
    },
    {
      "id": "976269d4-2ac5-4095-aab2-14c41adcd1f4",
      "name": "Instagram Create",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        9824,
        1792
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/YOUR_INSTAGRAM_BUSINESS_ACCOUNT_ID/media",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "media_type",
              "value": "REELS"
            },
            {
              "name": "video_url",
              "value": "={{ $json.videoUrl }}"
            },
            {
              "name": "caption",
              "value": "={{ $json.title + \"\\n\\n\" + $json.description }}"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "typeVersion": 4.2
    },
    {
      "id": "e97bde38-3c51-4f51-9396-3961623d96f7",
      "name": "Wait 90s",
      "type": "n8n-nodes-base.wait",
      "position": [
        10064,
        1792
      ],
      "parameters": {
        "amount": 90
      },
      "typeVersion": 1.1
    },
    {
      "id": "1f5dca32-a32c-41e2-bd1d-4fe16c0a68bb",
      "name": "Instagram Publish",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        10288,
        1792
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/YOUR_INSTAGRAM_BUSINESS_ACCOUNT_ID/media_publish",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "creation_id",
              "value": "={{ $('Instagram Create').item.json.id }}"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "typeVersion": 4.2
    },
    {
      "id": "86d03128-22a6-4f63-a92c-93cd8d72fa00",
      "name": "YouTube Upload",
      "type": "n8n-nodes-base.youTube",
      "onError": "continueRegularOutput",
      "position": [
        9824,
        1984
      ],
      "parameters": {
        "title": "={{ $json.title }}",
        "options": {
          "description": "={{ $json.description }}",
          "privacyStatus": "public"
        },
        "resource": "video",
        "operation": "upload",
        "categoryId": "22"
      },
      "typeVersion": 1
    },
    {
      "id": "7ca0bc27-4d81-4728-8da4-10da035d4c81",
      "name": "Facebook Post",
      "type": "n8n-nodes-base.facebookGraphApi",
      "onError": "continueRegularOutput",
      "position": [
        9824,
        2176
      ],
      "parameters": {
        "edge": "videos",
        "node": "YOUR_FACEBOOK_PAGE_ID",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "description",
                "value": "={{ $json.title + \"\\n\\n\" + $json.description }}"
              },
              {
                "name": "title",
                "value": "={{ $json.title }}"
              }
            ]
          }
        },
        "sendBinaryData": true,
        "graphApiVersion": "v23.0",
        "httpRequestMethod": "POST",
        "binaryPropertyName": "data"
      },
      "typeVersion": 1
    },
    {
      "id": "b4ec7774-49d0-4ef1-b6ab-8cf38c3c0a1f",
      "name": "Telegram Post",
      "type": "n8n-nodes-base.telegram",
      "onError": "continueRegularOutput",
      "position": [
        9824,
        2352
      ],
      "parameters": {
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "operation": "sendVideo",
        "binaryData": true,
        "additionalFields": {
          "caption": "={{ $json.title + \"\\n\\n\" + $json.description }}"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ad86ac83-94b7-476c-94e1-6c97e5e6d62c",
      "name": "Threads Create Container",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        9824,
        2528
      ],
      "parameters": {
        "url": "=https://graph.threads.net/v1.0/YOUR_THREADS_USER_ID/threads",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "media_type",
              "value": "VIDEO"
            },
            {
              "name": "video_url",
              "value": "={{ $json.videoUrl }}"
            },
            {
              "name": "text",
              "value": "={{ $json.title + \"\\n\\n\" + $json.description }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c185d2cc-5393-427a-84be-3a081b6ccf3d",
      "name": "Wait 30s Threads",
      "type": "n8n-nodes-base.wait",
      "position": [
        10064,
        2528
      ],
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "a5e10434-2288-426d-bfdc-ad7f77fe7974",
      "name": "Threads Publish",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        10288,
        2528
      ],
      "parameters": {
        "url": "=https://graph.threads.net/v1.0/YOUR_THREADS_USER_ID/threads_publish",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "creation_id",
              "value": "={{ $('Threads Create Container').item.json.id }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dae25d64-0a74-42af-98a8-3d4e7a422f4a",
      "name": "Format Threads Result",
      "type": "n8n-nodes-base.set",
      "position": [
        10528,
        2528
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "format-threads-platform",
              "name": "platform",
              "type": "string",
              "value": "threads"
            },
            {
              "id": "format-threads-success",
              "name": "success",
              "type": "boolean",
              "value": "={{ !!$json.id && !$json.error }}"
            },
            {
              "id": "format-threads-postid",
              "name": "postId",
              "type": "string",
              "value": "={{ $json.id || null }}"
            },
            {
              "id": "format-threads-posturl",
              "name": "postUrl",
              "type": "string",
              "value": ""
            },
            {
              "id": "format-threads-error",
              "name": "error",
              "type": "string",
              "value": "={{ $json.error?.message || ($json.id ? '' : 'Upload failed') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "74e678cd-96cd-4a76-8fc8-467bd7d86121",
      "name": "Format Telegram Result",
      "type": "n8n-nodes-base.set",
      "position": [
        10528,
        2352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "format-telegram-platform",
              "name": "platform",
              "type": "string",
              "value": "telegram"
            },
            {
              "id": "format-telegram-success",
              "name": "success",
              "type": "boolean",
              "value": "={{ $json.ok === true && !!$json.result?.video }}"
            },
            {
              "id": "format-telegram-postid",
              "name": "postId",
              "type": "string",
              "value": "={{ $json.result?.message_id ? String($json.result.message_id) : null }}"
            },
            {
              "id": "format-telegram-posturl",
              "name": "postUrl",
              "type": "string",
              "value": "={{ $json.result?.chat?.username ? 'https://t.me/' + $json.result.chat.username + '/' + $json.result.message_id : '' }}"
            },
            {
              "id": "format-telegram-error",
              "name": "error",
              "type": "string",
              "value": "={{ $json.ok === false ? ($json.description || 'Upload failed') : '' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f9e01933-34a0-4543-9ada-ed0965e01fd5",
      "name": "Format Instagram Result",
      "type": "n8n-nodes-base.set",
      "position": [
        10528,
        1792
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "format-instagram-platform",
              "name": "platform",
              "type": "string",
              "value": "instagram"
            },
            {
              "id": "format-instagram-success",
              "name": "success",
              "type": "boolean",
              "value": "={{ !!$json.id && !$json.error }}"
            },
            {
              "id": "format-instagram-postid",
              "name": "postId",
              "type": "string",
              "value": "={{ $json.id || null }}"
            },
            {
              "id": "format-instagram-posturl",
              "name": "postUrl",
              "type": "string",
              "value": "={{ $json.id ? 'https://www.instagram.com/reel/' + $json.id + '/' : '' }}"
            },
            {
              "id": "format-instagram-error",
              "name": "error",
              "type": "string",
              "value": "={{ $json.error?.message || ($json.id ? '' : 'Upload failed') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2d35f92b-a2de-4a8f-8c4f-52ff87752d32",
      "name": "Format YouTube Result",
      "type": "n8n-nodes-base.set",
      "position": [
        10528,
        1984
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "format-youtube-platform",
              "name": "platform",
              "type": "string",
              "value": "youtube"
            },
            {
              "id": "format-youtube-success",
              "name": "success",
              "type": "boolean",
              "value": "={{ !!$json.uploadId }}"
            },
            {
              "id": "format-youtube-postid",
              "name": "postId",
              "type": "string",
              "value": "={{ $json.uploadId || null }}"
            },
            {
              "id": "format-youtube-posturl",
              "name": "postUrl",
              "type": "string",
              "value": "={{ $json.uploadId ? 'https://youtube.com/watch?v=' + $json.uploadId : '' }}"
            },
            {
              "id": "format-youtube-error",
              "name": "error",
              "type": "string",
              "value": "={{ $json.error?.message || ($json.uploadId ? '' : 'Upload failed') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "63a54253-e51e-42f0-bd45-650bec919900",
      "name": "Format Facebook Result",
      "type": "n8n-nodes-base.set",
      "position": [
        10528,
        2176
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "format-facebook-platform",
              "name": "platform",
              "type": "string",
              "value": "facebook"
            },
            {
              "id": "format-facebook-success",
              "name": "success",
              "type": "boolean",
              "value": "={{ !!$json.id && !$json.error }}"
            },
            {
              "id": "format-facebook-postid",
              "name": "postId",
              "type": "string",
              "value": "={{ $json.id || null }}"
            },
            {
              "id": "format-facebook-posturl",
              "name": "postUrl",
              "type": "string",
              "value": "={{ $json.id ? 'https://www.facebook.com/' + $json.id : '' }}"
            },
            {
              "id": "format-facebook-error",
              "name": "error",
              "type": "string",
              "value": "={{ $json.error?.message || ($json.id ? '' : 'Upload failed') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "7938b794-97b8-43be-8eae-cfdb41bfb770",
      "name": "Aggregate Platform Results",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        11136,
        1504
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "97dfdcde-2aed-439e-adeb-c5f64e9d2916",
      "name": "Format Results",
      "type": "n8n-nodes-base.set",
      "position": [
        11344,
        1504
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "result-status",
              "name": "status",
              "type": "string",
              "value": "={{ $json.data.length === 0 ? 'approved-no-platforms' : ($json.data.filter(r => r.success).length === $json.data.length ? 'published' : ($json.data.filter(r => r.success).length === 0 ? 'failed' : 'partial')) }}"
            },
            {
              "id": "result-successful",
              "name": "successful",
              "type": "number",
              "value": "={{ $json.data.filter(r => r.success).length }}"
            },
            {
              "id": "result-total",
              "name": "total",
              "type": "number",
              "value": "={{ $json.data.length }}"
            },
            {
              "id": "result-summary",
              "name": "summary",
              "type": "string",
              "value": "={{ $json.data.length === 0 ? 'No platforms selected' : 'Published to ' + $json.data.filter(r => r.success).length + ' of ' + $json.data.length + ' platform(s)' }}"
            },
            {
              "id": "result-detailed",
              "name": "detailedResults",
              "type": "string",
              "value": "={{ $json.data.map(r => (r.success ? '\u2705' : '\u274c') + ' ' + r.platform.toUpperCase() + ': ' + (r.success ? (r.postUrl || 'Published successfully') : (r.error || 'Failed'))).join(\"\\n\") }}"
            },
            {
              "id": "result-rownum",
              "name": "rowNumber",
              "type": "number",
              "value": "={{ $('Prepare Video Parameters').item.json.rowNumber }}"
            },
            {
              "id": "result-videotitle",
              "name": "videoTitle",
              "type": "string",
              "value": "={{ $('Prepare Video Parameters').item.json.videoTitle }}"
            },
            {
              "id": "result-platforms",
              "name": "platforms",
              "type": "string",
              "value": "={{ $('Prepare Video Parameters').item.json.platforms }}"
            },
            {
              "id": "result-videourl",
              "name": "videoUrl",
              "type": "string",
              "value": "={{ $('Prepare Publish Data').item.json.videoUrl }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c507eb7e-38e7-4f99-8aa5-da0f3d284203",
      "name": "Update Sheet - Published",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueRegularOutput",
      "position": [
        11584,
        1504
      ],
      "parameters": {
        "columns": {
          "value": {
            "STATUS": "={{ $json.status }}",
            "VIDEO_URL": "={{ $json.videoUrl }}",
            "row_number": "={{ $json.rowNumber }}",
            "PUBLISHED_AT": "={{ $json.total === 0 ? '' : $now.toISO() }}",
            "PUBLISHING_RESULTS": "={{ $json.summary }}"
          },
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ]
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "7e8f6fad-e944-4ae3-8d30-7e593b4c1795",
      "name": "Send Report Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        11824,
        2528
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "=<html>\n<body style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px;\">\n  <h2 style=\"color: {{ $('Format Results').item.json.total === 0 ? '#ffc107' : ($('Format Results').item.json.successful > 0 ? '#28a745' : '#dc3545') }};\">{{ $('Format Results').item.json.summary }}</h2>\n  \n  <div style=\"background: #f5f5f5; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n    <p><strong>Title:</strong> {{ $('Format Results').item.json.videoTitle }}</p>\n    <p><strong>Requested Platforms:</strong> {{ $('Format Results').item.json.platforms || 'None specified' }}</p>\n    <p><strong>Status:</strong> {{ $('Format Results').item.json.status }}</p>\n  </div>\n  \n  <div style=\"background: #fff; padding: 20px; border: 1px solid #ddd; border-radius: 8px; margin: 20px 0;\">\n    <p><strong>Publishing Details:</strong></p>\n    <pre style=\"white-space: pre-wrap; font-family: monospace; font-size: 13px;\">{{ $('Format Results').item.json.detailedResults || 'No publishing attempts' }}</pre>\n  </div>\n  \n  <div style=\"margin: 20px 0;\">\n    <p><a href=\"{{ $('Format Results').item.json.videoUrl }}\" style=\"color: #007bff;\">View Generated Video</a></p>\n  </div>\n  \n  <p style=\"color: #666; font-size: 12px;\">{{ $('Format Results').item.json.total === 0 ? 'Video approved but no platforms were selected for publishing.' : ('Published at: ' + $now.toISO()) }}</p>\n</body>\n</html>",
        "options": {},
        "subject": "={{ $('Format Results').item.json.total === 0 ? '[No Platforms]' : ($('Format Results').item.json.successful === $('Format Results').item.json.total ? '[Published]' : '[Partial]') }} Video: {{ $('Format Results').item.json.videoTitle }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "55782029-e7d6-4aa4-85ba-02599f235bcc",
      "name": "Sticky Note - Report",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        11056,
        944
      ],
      "parameters": {
        "color": 5,
        "width": 976,
        "height": 1828,
        "content": "## 6. Status Update & Report\n\nAfter publishing, the workflow:\n1. Aggregates results from all selected platforms\n2. Updates Google Sheet with video URL and status\n3. Sends detailed email report with per-platform results\n\n\n**Status Values:**\n- `new` - Ready to be picked up by n8n\n- `processing` - n8n is working on it\n- `error` - VEED video generation failed (details in email notification)\n- `published` - Successfully published to all platforms\n- `partial` - Some platforms succeeded, some failed\n- `failed` - All platforms failed\n- `approved-no-platforms` - Video approved but no platforms selected\n- `rejected` - User rejected the video"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "05ff0342-f282-4a3c-8e4c-36e3966acf6d",
  "connections": {
    "Wait 90s": {
      "main": [
        [
          {
            "node": "Instagram Publish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approved?": {
      "main": [
        [
          {
            "node": "Prepare Publish Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Rejection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge TTS": {
      "main": [
        [
          {
            "node": "Upload to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI TTS": {
      "main": [
        [
          {
            "node": "Merge TTS",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Make Public": {
      "main": [
        [
          {
            "node": "Set Audio URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "VEED Error?": {
      "main": [
        [
          {
            "node": "Update Sheet - Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Email": {
      "main": [
        [
          {
            "node": "Send Approval Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Facebook Post": {
      "main": [
        [
          {
            "node": "Format Facebook Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Rejection": {
      "main": [
        [
          {
            "node": "Update Sheet - Rejected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Audio URL": {
      "main": [
        [
          {
            "node": "VEED Generate Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "TTS Provider?": {
      "main": [
        [
          {
            "node": "ElevenLabs TTS",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "OpenAI TTS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Post": {
      "main": [
        [
          {
            "node": "Format Telegram Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video": {
      "main": [
        [
          {
            "node": "Split Out Platforms",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ElevenLabs TTS": {
      "main": [
        [
          {
            "node": "Merge TTS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Results": {
      "main": [
        [
          {
            "node": "Update Sheet - Published",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Rows": {
      "main": [
        [],
        [
          {
            "node": "Mark as Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YouTube Upload": {
      "main": [
        [
          {
            "node": "Format YouTube Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Platform Router": {
      "main": [
        [
          {
            "node": "Instagram Create",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "YouTube Upload",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Facebook Post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram Post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Threads Create Container",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Threads Publish": {
      "main": [
        [
          {
            "node": "Format Threads Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Drive": {
      "main": [
        [
          {
            "node": "Make Public",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram Create": {
      "main": [
        [
          {
            "node": "Wait 90s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Error Email": {
      "main": [
        [
          {
            "node": "Loop Over Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 30s Threads": {
      "main": [
        [
          {
            "node": "Threads Publish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Status New": {
      "main": [
        [
          {
            "node": "Loop Over Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram Publish": {
      "main": [
        [
          {
            "node": "Format Instagram Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Report Email": {
      "main": [
        [
          {
            "node": "Loop Over Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark as Processing": {
      "main": [
        [
          {
            "node": "Prepare Video Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Platforms": {
      "main": [
        [
          {
            "node": "Aggreg
Pro

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

About this workflow

A production-ready n8n workflow that generates AI avatar videos from images and text using VEED Fabric 1.0, with flexible multi-platform publishing capabilities. Process any number of videos: Sequential processing ensures each video is fully generated and published before moving…

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

More Social Media workflows → · Browse all categories →

Related workflows

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

Social Media

This workflow is designed for content creators, social media managers, digital marketers, and business owners who want to automate their content creation and distribution process across multiple platf

Google Drive, Google Drive Trigger, WordPress +13
Social Media

This workflow is ideal for individuals, marketers, agencies, and brands who want to effortlessly automate the entire blogging and social media process—from idea generation to promotion. Its primary go

Execute Workflow Trigger, Notion, OpenAI Chat +13
Social Media

This workflow is built for creators, solopreneurs, SaaS founders, and agencies looking to automate their social media content process from idea to publication. It combines the power of OpenAI, Google

OpenAI Chat, Tool Workflow, Agent +15
Social Media

✨🤖Automated AI Powered Social Media Content Factory for X + Facebook + Instagram + LinkedIn. Uses outputParserStructured, lmChatGoogleGemini, lmChatOpenAi, httpRequest. Event-driven trigger; 57 nodes

Output Parser Structured, Google Gemini Chat, OpenAI Chat +11
Social Media

Social Media Managers and Digital Marketers seeking to streamline content production across 7+ platforms (X/Twitter, Instagram, LinkedIn, Facebook, TikTok, Threads, YouTube Shorts) using AI-powered au

Output Parser Structured, Google Gemini Chat, OpenAI Chat +11