Local AI Video Generator in n8n That Turns a Topic Into a Shot List
Overview & Architecture
Prepping a video means researching, scripting, planning shots and briefing a thumbnail. None of it needs a paid tool.
This blueprint starts with an n8n form where you enter a topic, an audience and a video length. A local SearXNG instance gathers current references, a local Ollama model (gemma4 12b) writes the script, Code nodes turn it into a shot list with timing markers, and a second Ollama call writes the thumbnail brief. The result goes into a Google Doc and a Telegram message. Only the Doc and the message leave your machine.
In the test run, a 60 second video went from form submit to Telegram message in about 65 seconds, mostly the two Ollama calls. That was one run on the creator’s home server, so expect different times on your hardware.
The Pipeline
- Form Trigger: Topic, audience, a length dropdown (30, 60 or 180 seconds) and your Telegram chat ID.
- Clean Input: A Code node tidies the answers, picks how many beats to ask for and builds the search query.
- Search SearXNG: An HTTP Request node queries your local SearXNG instance for JSON results.
- Trim References: A Code node keeps the top five results as a compact reference block so the prompt stays small.
- Write Script: A Basic LLM Chain with an Ollama Chat Model writes a hook, numbered beats and a call to action.
- Shot List: A Code node parses the script, assigns whole-second durations that add up to the target length, and writes
-ssand-toffmpeg timing markers as an aligned text table. - Thumbnail Brief: A second Ollama chain writes a short thumbnail brief from the script.
- Google Doc: One Google Docs node creates the document and another inserts the script, shot list and brief.
- Telegram: You get the doc link, the shot count and the total runtime.
What You Need
- n8n running in Docker with the Form Trigger reachable (the version was not recorded for this build)
- Ollama with a gemma4 12b model pulled (the build used the tag
gemma4:12b-it-qat) - A SearXNG instance with JSON output enabled, reachable from n8n
- A Google account connected to n8n with Google Docs access
- A Telegram bot token and your chat ID
Key Deployment Hurdles & Solutions
- Telegram Markdown Errors: The first run failed at the Telegram node with “can’t parse entities”. The fix was HTML parse mode with the topic escaped.
- Model Tag: There was no tag called
gemma4:12b; the installed equivalent wasgemma4:12b-it-qat. - Model Output Structure: The shot list parser is tolerant and falls back to splitting sentences if the model ignores the hook, beat and call to action format.
- Docs Tables: The Google Docs node only inserts text, so the shot list is a plain-text table rather than a native table.
- Duration Heuristic: Durations come from word counts, so the markers are planning aids and not real footage timing.
- Form Needs an Active Workflow: The production form URL only works while the workflow is published.
Download the Workflow (.json)
Import-ready n8n workflow with all 12 nodes. In n8n choose Import from file, then attach your own Ollama, Google Docs and Telegram credentials and check the SearXNG address.
Download the n8n workflow (.json)
Download the Companion System Prompt (.md)
Enter your first name to personalize the assistant prompt so your AI helper can walk you through the n8n, Ollama, SearXNG, Google Docs and Telegram setup step by step. Add your email optionally to get notified when new home lab blueprints drop.