π Async Video Polling Engine - Background Job Handler for AI Video Generation
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (10)
- Webhook
n8n-nodes-base.webhook - Code
n8n-nodes-base.code - Respond to Webhook
n8n-nodes-base.respondToWebhook - Wait
n8n-nodes-base.wait - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Redis
n8n-nodes-base.redis - S3
n8n-nodes-base.s3 - Telegram
n8n-nodes-base.telegram - Merge
n8n-nodes-base.merge
What it does
π AI Video Polling Engine - Long-Running Job Handler for Veo, Sora & Seedance The async backbone that makes AI video generation production-ready β‘π¬ !LinkedIn!Telegram --- π₯ See It In Action !Watch the Demo π Full Demo: youtu.be/OIoJ2F1O0 --- β οΈ Must Read First This is a companion workflow for the main AI Shorts Generator: π Main Workflow: AI Shorts Reactor This workflow handles the "waiting game" so your main bot stays fast and responsive. Think of it as the backstage crew that handles the heavy lifting while your main workflow performs on stage. --- π€ The Problem This Solves Without This Workflow: User sends message β Bot calls AI API β β³ Bot waits 2-5 minutes... (BLOCKED) β β Timeout errors β Execution limits exceeded β Users think bot is broken β Can't handle multiple requests With This Workflow: User sends message β Bot calls AI API β β
Bot responds instantly: "Video generating..." β π This webhook polls in background β β‘ Main bot handles other users β β
Video ready β Auto-sends to user Result: Your bot feels instant, scales infinitely, and never times out π --- π What This Workflow Does This is a dedicated polling webhook that acts as the async job handler for AI video generation. It's the invisible worker that: 1οΈβ£ Receives the Job json POST /webhook/poll-video { "sessionId": "user123", "taskId": "veoabc456", "model": "veo3", "attempt": 1 } 2οΈβ£ Responds Instantly 200 OK - "Polling started" (Main workflow never waits!) 3οΈβ£ Polls in Background Wait 60s β Check status β Repeat - β±οΈ Waits 1 minute between checks (API-friendly) - π Polls up to 15 times (~15 minutes max) - π― Supports Veo, Sora, and Seedance APIs 4οΈβ£ Detects Completion Handles multiple API response formats: javascript // Veo format { status: "completed", videoUrl: "https://..." } // Market format (Sora/Seedance) { job: { status: "success", result: { url: "..." } } } // Legacy format { data: { videourl: "..." } } (No matter how the API responds, this workflow figures it out) 5οΈβ£ Delivers the Video Once ready: - π₯ Downloads video from AI provider - βοΈ Uploads to your S3 storage - πΎ Restores user session from Redis - π± Sends Telegram preview with buttons - π Enables video extension (Veo only) - π Logs metadata for analytics --- βοΈ Technical Architecture The Flow: Main Workflow Polling Webhook β β βββTrigger AI Jobβββββββββββ€ β "Task ID: abc123" β β β βββReturn Instantly β β "Generating..." β β β βββHandle New User β β βββWait 60s β β β βββCheck Status β β "Processing..." β β β βββWait 60s β β β βββCheck Status β β "Completed!" β β β βββDownload Video β β β βββUpload to S3 β β β βββSend to User β β ββββββββββββββββββββββββββββββββββββ "Your video is ready!" --- π Key Features β‘ Non-Blocking Architecture - Main workflow never waits - Handle unlimited concurrent jobs - Each user gets instant responses π Intelligent Polling - Respects API rate limits (60s intervals) - Auto-retries on transient failures - Graceful timeout handling (15 attempts max) π― Multi-Provider Support Handles different API formats: - Veo - record-info endpoint - Sora - Market job status - Seedance - Market job status π‘οΈ Robust Error Handling javascript β
Missing video URL β Retry with fallback parsers β
API timeout β Continue polling β
Invalid response β Parse alternative formats β
Max attempts reached β Notify user gracefully πΎ Session Management - Stores state in Redis - Restores full context when video is ready - Supports video extension workflows - Maintains user preferences π Production Features - Detailed logging at each step - Metadata tracking (generation time, model used, etc.) - S3 storage integration - Telegram notifications - Analytics-ready data structure --- π§© Integration Points Works Seamlessly With: | Use Case | How It Helps | |----------|--------------| | π€ Telegram Bots | Keeps bot responsive during 2-5 min video generation | | πΊ YouTube Automation | Polls video, then triggers auto-publish | | π¬ Multi-Video Pipelines | Handles 10+ videos simultaneously |