What This Agent Does
This AI-powered video generation workflow automates the creation and delivery of professional video content on a scheduled basis. The agent generates creative video prompts using Google Gemini, submits them to Kie AI's Sora 2 text-to-video model, monitors processing progress, and automatically delivers the finished videos directly to your Telegram channel or chat.
Key benefits and time savings:
-
Eliminates manual video creation – Generate videos automatically without touching video editing software
-
Saves 2-4 hours per video – From concept to delivery in minutes instead of days
-
Ensures consistency – Scheduled execution means regular content delivery without human intervention
-
Reduces creative bottlenecks – AI handles prompt generation, freeing your team for strategy and refinement
-
Direct distribution – Videos arrive in Telegram instantly upon completion, ready to share
Target use cases:
- Social media content creators needing consistent video output
- Marketing teams automating promotional video production
- Educational platforms generating instructional videos on schedule
- Content agencies scaling video production for multiple clients
- Product demonstration and tutorial automation
Who Is It For
This workflow is ideal for content creators, marketing professionals, and automation enthusiasts who want to scale video production without proportionally increasing workload. You'll benefit most if you:
- Regularly need video content but lack in-house production resources
- Want to maintain consistent posting schedules across social platforms
- Prefer automation over manual, repetitive creative tasks
- Use Telegram for team communication or content distribution
- Have basic familiarity with API integrations and workflow automation
No video editing experience required – the AI handles all creative heavy lifting.
Required Integrations
Google Gemini
Why it's needed:
Google Gemini powers the creative intelligence of your workflow. It analyzes your content requirements and generates detailed, optimized video prompts that guide the Sora 2 model toward your desired output. This ensures your videos align with your brand voice and content strategy.
Setup steps:
-
Access Google AI Studio – Navigate to Google AI Studio and sign in with your Google account
-
Create a new API key – Click "Get API Key" in the left sidebar, then select "Create API Key in new project"
-
Copy your API key – Store this securely; you'll need it immediately
-
Enable the Gemini API – Go to Google Cloud Console, select your project, and enable the "Generative Language API"
-
Set up billing (if needed) – Google offers free tier credits; configure billing preferences in your Google Cloud project
How to obtain API keys/credentials:
Your API key appears in Google AI Studio after creation. It's a long alphanumeric string starting with AIza. Keep this confidential – treat it like a password.
Configuration in TaskAGI:
- In TaskAGI, navigate to Integrations → Google Gemini
- Click Add New Integration
- Paste your API key in the
API Key field
- Name this integration (e.g., "Video Prompt Generator")
- Click Test Connection to verify
- Save and return to your workflow
Telegram
Why it's needed:
Telegram serves as your video delivery channel. Once videos complete processing, this integration automatically sends them to your specified chat, channel, or user, ensuring instant distribution without manual uploads.
Setup steps:
-
Create a Telegram Bot – Open Telegram and search for
@BotFather
-
Start the bot – Send
/start and follow prompts
-
Create new bot – Send
/newbot and provide a name (e.g., "VideoAGI Bot") and username
-
Copy your bot token – BotFather provides a token like
123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
-
Get your Chat ID – Send a message to your bot, then visit
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates in your browser to find your chat ID (a numeric value)
-
Add bot to your channel (if using a channel) – Open your Telegram channel, click the menu, select "Add Members," and add your bot with admin permissions
How to obtain API keys/credentials:
-
Bot Token: Provided by BotFather after bot creation
-
Chat ID: Found via the getUpdates API call above, or use
@userinfobot in Telegram to discover your personal ID
Configuration in TaskAGI:
- Navigate to Integrations → Telegram
- Click Add New Integration
- Enter your Bot Token in the designated field
- Enter your Chat ID in the chat identifier field
- Click Test Connection – send a test message to verify
- Save the integration
Configuration Steps
Node 1-3: Agent Name Options, Category & Industry, Overview
These documentation nodes establish your workflow's purpose and context. They don't execute actions but provide clarity for future reference.
Configuration:
-
Agent Name Options: Enter descriptive names like "Weekly Product Demo Video Generator" or "Social Media Content Bot"
-
Category & Industry: Specify your domain (e.g., "Marketing," "Education," "E-commerce")
-
Overview: Write a brief description of what this agent produces and why (e.g., "Generates and delivers weekly tutorial videos to our Telegram community")
These notes help you and your team understand the workflow's intent at a glance.
Node 4: Schedule Trigger
This node determines when your workflow runs.
Configuration:
- Click the Schedule Trigger node
- Select your trigger type: Interval (recommended for regular cadence)
- Set frequency:
-
Daily: Generates one video every 24 hours
-
Weekly: Generates one video every 7 days (specify day and time)
-
Custom: Define intervals like "every 6 hours" or "every Monday at 9 AM"
- Set your timezone to match your team's location
- Save and test the schedule
Example: For a daily social media video, set to "Every day at 8:00 AM EST"
Node 5: Generate Video Prompt
This node uses Google Gemini to create your video prompt.
Configuration:
- Click the Generate Video Prompt node
- In the Prompt field, customize the instruction. Default prompt specializes in generating precise video descriptions. Modify it to reflect your content style:
You are a specialized AI agent that generates precise, creative video prompts
for text-to-video AI models. Create a detailed prompt for a [YOUR_CONTENT_TYPE]
video about [YOUR_TOPIC]. Include visual style, pacing, and key elements.
- Set Model to
gemini-2.5-flash (already configured)
- Configure Temperature (0.7-0.9 recommended for creative variation)
- Set Max Tokens to 500-800 for detailed prompts
- Save the node
Data flow: This node outputs a generated prompt string → feeds into Node 6
Node 6: Submit to Kie AI
This node sends your prompt to Sora 2 for video generation.
Configuration:
- Click the Submit to Kie AI node
- Verify the Model is set to
sora-2-text-to-video
- In the Body section, map the prompt from Node 5:
- Set
input.prompt to {{node_5.output.text}}
- Configure optional parameters:
-
duration: Set to 10 for 10-second videos (adjust as needed)
-
quality: Set to high for best results
- Save the node
Expected output: A job ID for tracking video processing
Node 7: Wait for Processing
This node pauses execution to allow Sora 2 time to generate your video.
Configuration:
- Click the Wait node
- Set duration to 120 seconds (2 minutes) – adjust based on typical processing time
- Save
This prevents premature status checks and ensures the video has time to process.
Node 8: Poll Video Status
This node checks if your video is ready.
Configuration:
- Click the Poll Video Status node
- Set the Endpoint to Kie AI's status API
- Map the job ID from Node 6:
{{node_6.output.job_id}}
- Set Polling Interval to 10 seconds
- Set Max Attempts to 30 (5-minute timeout)
- Configure success condition:
status == "completed"
- Save
This node loops until your video completes or times out.
Node 9: Extract Video URL
This node parses the video URL from the completed job response.
Configuration:
- Click the Extract Video URL node
- Set the Function to extract from JSON:
- Input:
{{node_8.output.result}}
- Path:
output.video_url
- Assign output to variable:
video_url
- Save
Data flow: Extracted URL → feeds into Node 10
Node 10: Send Video to Telegram
This node delivers your finished video to Telegram.
Configuration:
- Click the Send Video to Telegram node
- Select your Telegram Integration (created earlier)
- Set Chat ID to your target chat or channel ID
- Map the video URL:
{{node_9.output.video_url}}
- Add optional Caption (e.g., "New video generated by TaskAGI! 🎬")
- Set Parse Mode to
HTML or Markdown for formatted captions
- Save
Testing Your Agent
Step 1: Execute a Test Run
- Open your workflow in TaskAGI
- Click Test Execution (or Run Now if scheduling is disabled)
- Monitor the execution panel as each node processes
Step 2: Verify Each Node
Node 4 (Schedule Trigger): ✓ Confirms trigger fired at correct time
Node 5 (Generate Prompt): ✓ Check output contains a detailed video description (100+ words)
Node 6 (Submit to Kie AI): ✓ Verify job ID is returned (format: alphanumeric string)
Node 7 (Wait): ✓ Execution pauses for specified duration
Node 8 (Poll Status): ✓ Status changes from "processing" to "completed"
Node 9 (Extract URL): ✓ Video URL is extracted (format: https://...)
Node 10 (Send to Telegram): ✓ Video appears in your Telegram chat within 30 seconds
Step 3: Expected Results and Success Indicators
Success looks like:
- ✅ All nodes complete without errors (green checkmarks)
- ✅ Video file appears in your Telegram chat
- ✅ Video plays without buffering issues
- ✅ Execution time: 3-5 minutes total
- ✅ No authentication or timeout errors in logs
Troubleshooting:
-
Node 5 fails: Verify Google Gemini API key is valid and billing is enabled
-
Node 6 fails: Check Kie AI credentials and ensure your account has video generation quota
-
Node 8 times out: Video processing took longer than expected; increase polling timeout
-
Node 10 fails: Verify Telegram bot token and chat ID are correct; ensure bot has message permissions
Congratulations! Your video generation agent is live and ready to scale your content production. 🚀