Overview
Genie Helperβs post scheduler polls thescheduled_posts collection every 60 seconds and automatically publishes posts to X, Reddit, Instagram, TikTok, and other platforms using Stagehand browser automation.
Collection: scheduled_postsWorker: Media worker (BullMQ)
Poll interval: 60 seconds (configurable via
POST_SCHEDULER_MS)
Architecture
Scheduling Flow
Collections
scheduled_posts
| Field | Type | Description |
|---|---|---|
id | UUID | Primary key |
platform | String | Target platform (x, reddit, instagram, tiktok) |
content_text | Text | Post caption/body |
scheduled_time | DateTime | When to publish (null = draft) |
status | String | draft | scheduled | publishing | posted | failed |
media_id | FK | Directus file ID (optional) |
clip_job_id | FK | Media job ID for platform-specific clip (optional) |
platform_meta | JSON | Platform-specific params (see below) |
posted_at | DateTime | Actual publish timestamp |
error_message | Text | Failure reason (if status=failed) |
creator_id | FK | Directus user ID |
platform_meta Examples
Post Scheduler
Implementation:media-worker/index.js:1186-1241
Polling Logic
Publishing Operation
Operation:publish_post (media-worker)Browser: Local Playwright (headless Chrome)
Vision LLM:
ollama/qwen-2.5
Supported Platforms
| Platform | Status | Compose URL | Notes |
|---|---|---|---|
| X (Twitter) | β Full | https://x.com/compose/tweet | 280 char limit |
| β Full | https://reddit.com/r/{subreddit}/submit | Requires subreddit + title | |
| π§ Partial | Web posting disabled by Meta | API required | |
| TikTok | π§ Partial | Desktop upload limited | Mobile flow needed |
| OnlyFans | π Planned | Cookie auth required | |
| Fansly | π Planned | Cookie auth required |
X (Twitter) Publishing
Implementation:media-worker/index.js:879-890
Reddit Publishing
Implementation:media-worker/index.js:893-920
Cookie Injection
The worker automatically loads cookies fromplatform_sessions to bypass login:
Content Calendar UI
Page:dashboard/src/pages/ContentCalendar/index.jsx
Features
-
AI Caption Generator (Modal 3A)
- Platform selector (TikTok, Instagram, X, Reddit, OnlyFans)
- Tone selector (flirty, playful, intimate, professional, casual, teasing)
- Topic input (optional)
- Length picker (short, medium, long)
- Try Again feedback loop with adjustment notes
-
Post Draft Editor (Modal 3B)
- Platform specs validation (text limits, video dimensions)
- Media attachment from scraped_media
- Platform-specific clip generator (9:16 for TikTok/Snapchat)
- Schedule time picker
- Usage pill (plan limits)
-
Media Picker (Modal 3C)
- Grid view of scraped_media
- Search filter
- Video duration + codec display
Plan Limits
Tracked in:usage API (/api/usage/increment)
| Tier | Posts/Month | Queue Size |
|---|---|---|
| Starter | 3 | 3 |
| Creator | 30 | Unlimited |
| Pro | 150 | Unlimited |
| Studio | Unlimited | Unlimited |
dashboard/src/pages/ContentCalendar/index.jsx:220-227
AI Caption Generation
Endpoint:/api/captions/generateModel:
dolphin-mistral:7b (uncensored content writer)
Request
Feedback Loop
After first generation, user can click βTry Againβ β Enters feedback note β Re-generates with adjustment:Status Flow
scheduled_posts.error_message
Common failures:
HITL_REQUIREDβ No cookies availableStagehand timeoutβ Page load failedAuto-posting to {platform} not yet implementedβ Platform stub
Logs & Debugging
Related
- Media Processing β Clip generation for platform specs
- Platform Scraping β Cookie capture flow
- Dashboard β Content Calendar UI
