Automated daily Kannada Instagram story-video pipeline. This repo is the
implementation of the architecture confirmed in
Kannada-Reels-Pipeline-Architecture-Assessment.md — read that first if
you haven't; this README assumes its decisions as given:
- Path B: full 5-minute masters, published as regular video posts (not the Reels tab — see the assessment doc §0 for why).
- Zero budget, no GPU, no reliable local machine. Every provider in this repo is a genuinely free tier. Full breakdown in the assessment doc §14.
- GitHub Actions is the entire compute layer. Nothing runs on your machine or any persistent server — see assessment doc §15.
- Human Approval Mode is on, via Telegram.
There is no always-on server. Four scheduled GitHub Actions workflows
(.github/workflows/) each spin up a fresh container, run a Python script,
and shut down. All state lives in Supabase between runs.
| Workflow file | Runs | What it does |
|---|---|---|
01-plan-and-script.yml |
Daily, 03:00 UTC | Picks today's category, generates a concept + Kannada script, scores retention, saves to Supabase with status pending_review, notifies you on Telegram |
02-check-approval-and-produce.yml |
Every 30 min | Looks for a story with status approved (you set this after reviewing the Telegram message — see below). Runs scene breakdown, image generation, voice generation, FFmpeg assembly, QC. Exits cleanly if nothing's approved yet |
03-publish.yml |
Every 30 min | Looks for a story with status produced. Generates caption/hashtags, publishes to Instagram, notifies you on Telegram |
04-analytics.yml |
Daily, evening | Pulls Instagram Insights for recently published stories, writes to performance_snapshots |
- You get a Telegram message with the day's story concept, hook, and script preview.
- Open Supabase's Table Editor, find the story row (the message includes its
story_id), changestatusfrompending_reviewtoapproved. - Within 30 minutes,
02-check-approval-and-produce.ymlpicks it up automatically.
This is intentionally simple for the MVP — a Telegram bot with a reply handler that flips the status automatically is a reasonable Phase 2 upgrade, not required to ship.
- Supabase project — create one, then run
database/schema.sqlin the SQL editor. Create a public Storage bucket namedcontent-engine-media(Storage tab → New bucket → toggle Public). - Telegram bot — message @BotFather, create a
bot, get the token. Message your new bot once, then visit
https://api.telegram.org/bot<TOKEN>/getUpdatesto find yourchat_id. - Gemini API key — from Google AI Studio, free tier, no card required.
- Sarvam API key — sign up at sarvam.ai for the
₹1,000 signup credit. See the assessment doc's risk list for the
estimated runway (~75–200 days at daily 5-min scripts) — plan the
indic_ttsfallback inscripts/lib/tts.pybefore it runs out. - Meta App Review — this is the long-lead-time item. Follow
docs/meta-app-review-checklist.mdand start it in parallel with everything else, not after. - Add every secret from
.env.exampleto GitHub → Settings → Secrets and variables → Actions.
The scripts in scripts/ run directly as plain Python inside each Actions
job — that's what makes the "no persistent server" hosting model work (see
assessment doc §15). If you'd rather design/edit the logic visually in n8n
before it becomes a script, run n8n temporarily (locally for a session, or
via a free cloud IDE like GitHub Codespaces) — it doesn't need to run
permanently. Exported workflow JSON can live in n8n/workflows/ for
reference; it's not what actually executes in production.
- Subtitle timing uses simple per-scene audio sync, not word-level ASR alignment yet. The assessment doc (§7 / §9) flags this as the correct eventual approach (Sarvam STT or Whisper on the final audio) — not wired up in this first pass so the end-to-end pipeline can be validated before adding that complexity.
indic_ttsfallback is stubbed (NotImplementedError) inscripts/lib/tts.py— implement before the Sarvam credit is projected to run out.- Duplicate-plot detection in
plan_and_script.pyavoids repeating exact hooks but doesn't do embedding-based similarity yet — fine at low volume, worth upgrading once you have enough stories for it to matter. - Token refresh workflow for the Instagram long-lived access token isn't
included yet — add a scheduled Actions workflow for this before the token
(~60 day lifetime) expires. See
docs/meta-app-review-checklist.md.
kannada-content-engine/
├── .github/workflows/ # the actual production scheduler + compute
├── database/schema.sql # run once in Supabase
├── scripts/ # plain Python, run by the Actions workflows
│ └── lib/ # provider adapters (Gemini, Sarvam, Pollinations, Supabase, Telegram)
├── characters/ # Character Bible templates — populate before production
├── prompts/ # prompt templates by category, for iterating outside code
├── docs/ # Meta App Review checklist, etc.
└── n8n/workflows/ # exported n8n JSON, for visual editing reference only