Overview
The YouTube Automation Agent runs on a comprehensive schedule that handles content generation, publishing, analytics, and optimization tasks automatically. This guide explains each scheduled task and how to customize them.All times are based on your server’s local timezone. Ensure your system time is correctly configured.
Daily Schedule Overview
Here’s what happens automatically each day:| Time | Task | Frequency | Description |
|---|---|---|---|
| 6:00 AM | Content Generation | Daily | Generate new video content |
| Every 15 min | Publish Queue | Continuous | Check and publish scheduled videos |
| 9:00 AM | Analytics Collection | Daily | Gather performance data |
| 10:00 PM | Optimization | Daily | Update SEO and keywords |
| 8:00 AM Sunday | Strategy Review | Weekly | Analyze and adjust content strategy |
| 3:00 AM Saturday | Database Maintenance | Weekly | Backup and cleanup |
Scheduled Tasks Detail
1. Daily Content Generation (6:00 AM)
Cron Expression:0 6 * * *
This is the primary automation task that creates new video content.
What Happens
Check Content Buffer
System verifies if new content is needed based on:
- Current scheduled videos (default: maintain 3-day buffer)
- Posting frequency setting (daily, every-2-days, 3-per-week, weekly)
- Last generation timestamp
Generate Content
If content is needed, runs full pipeline:
- Content Strategy Agent selects topic
- Script Writer Agent creates script
- Thumbnail Designer Agent generates thumbnail
- SEO Optimizer Agent optimizes metadata
- Production Management Agent compiles assets
- Publishing Scheduling Agent queues for upload
Smart Buffer Management
The system intelligently decides whether to generate content:2. Publish Queue Processing (Every 15 Minutes)
Cron Expression:*/15 * * * *
Continuously monitors and publishes scheduled content.
Processing Flow
- Query Database: Get all content with
status = 'scheduled'andpublishTime <= NOW() - Upload to YouTube: Use YouTube Data API v3 to upload video
- Update Status: Mark as
publishedwith YouTube video ID - Enable Monitoring: Add to analytics tracking queue
3. Daily Analytics Collection (9:00 AM)
Cron Expression:0 9 * * *
Collects performance data for recently published videos.
Collection Process
Query YouTube Analytics
For each video, collect:
- View count
- Watch time
- Average view duration
- Likes, comments, shares
- Click-through rate
- Audience retention
- Traffic sources
Calculate Performance Score
Generate composite performance score (0-100) based on:
- Engagement rate (30%)
- View velocity (25%)
- Retention rate (25%)
- CTR (20%)
4. Weekly Strategy Review (8:00 AM Sunday)
Cron Expression:0 8 * * 0
Analyzes performance and adjusts content strategy.
Review Process
-
Aggregate Weekly Data
- Collect analytics for all videos from past 7 days
- Identify top 3 performers
- Calculate average performance score
-
Extract Insights
-
Optimize Publishing Times
- Analyze when your audience is most active
- Adjust default publish time (currently 2:00 PM)
- Update scheduling algorithm
-
Update Content Focus
- Feed top-performing topics to Content Strategy Agent
- Adjust content style preferences
- Update keyword priorities
5. Daily Optimization Tasks (10:00 PM)
Cron Expression:0 22 * * *
Maintains and improves existing content.
Optimization Tasks
Re-optimize Low Performers
Identifies videos with performance score < 50 in last 30 days:
- Re-analyze SEO metadata
- Generate updated titles/descriptions
- Suggest thumbnail improvements
- Update tags and keywords
Update Keyword Performance
Track keyword effectiveness:
- Map keywords to video performance
- Calculate keyword ROI
- Build trending keyword database
- Update SEO strategy
6. Database Maintenance (3:00 AM Saturday)
Cron Expression:0 3 * * 6
Weekly maintenance ensures system health.
Maintenance Operations
-
Create Backup
-
Database Statistics
-
Cleanup Old Data
- Remove analytics older than 90 days
- Archive completed automation events
- Optimize database indexes
Customizing the Schedule
Change Content Generation Time
Editschedules/daily-automation.js:
Adjust Posting Frequency
Modify the content buffer settings in your database:Change Content Buffer Size
Adjust Analytics Collection Frequency
Monitoring Automation
View Automation Status
Check current automation state:View Recent Automation Events
Query the automation events log:daily_content_generationqueue_processinganalytics_collectionweekly_strategy_reviewdaily_optimizationdatabase_maintenance
Dashboard Monitoring
The web dashboard athttp://localhost:3456 displays:
- Next scheduled generation time
- Automation status (active/paused)
- Recent automation activity log
- System health score
Controlling Automation
While the schedule is automated, you maintain full control:Pause Automation
Pausing automation stops scheduled content generation but allows manual operations to continue.
Resume Automation
Stop All Tasks
System Health Monitoring
The automation system includes self-monitoring:Hourly Health Checks
Every hour, the system performs:Failure Notifications
When tasks fail, the system:- Logs error details to database
- Logs to console with ERROR level
- Stores failure in automation_events table
- Continues other scheduled tasks
Best Practices
Recommended Configuration
For New Channels:- Posting frequency:
daily - Content buffer:
3 days - Manual topic selection for first 5-10 videos
- Posting frequency:
every-2-daysor3-per-week - Content buffer:
5 days - Full automation with strategy agent
Monitoring Checklist
- Check dashboard daily for first week
- Review analytics after each video publishes
- Verify health endpoint returns “healthy”
- Monitor content buffer stays above 2 days
- Review weekly strategy insights
- Check database backups are being created
Troubleshooting
Content Not Generating
Check automation status:- Automation paused: Resume with
resumeAutomation() - Buffer full: Content buffer already satisfied
- API rate limits: Wait for quota reset
- Missing credentials: Run
npm run credentials:setup
Videos Not Publishing
Verify publish queue:- OAuth token expiration (reauthorize)
- Network connectivity issues
- YouTube API quota limits
- Content stuck in “processing” status
Analytics Not Updating
Common issues:- Videos too new (wait 24 hours for data)
- YouTube Analytics API not enabled
- Insufficient video history
- Rate limiting from excessive requests
Next Steps
Manual Operations
Override automation with manual control endpoints
Dashboard Guide
Master the web interface for monitoring
Agent Configuration
Customize individual agent behaviors
API Reference
Explore all available API endpoints