n8n Automation for Content Creation With a Brief Pipeline
Overview & Architecture
Going from an idea to a usable outline normally means a blank page, a pile of browser tabs and a lot of rewriting. This blueprint puts that process behind one n8n form. You enter a topic, audience and goal, optionally paste source text or upload a file, and choose Approve or Hold for review.
The AI steps run on a local Ollama model, and references come from your own SearXNG search server. The finished record is saved to a Postgres table together with its approval status.
The Pipeline
- Form Trigger: Collects topic, audience, goal, optional pasted source material, an optional source file and an Approve / Hold for review dropdown.
- Normalize Inputs: A Code node cleans the fields and marks whether a file was uploaded.
- Apache Tika Extraction: If a file was uploaded, an HTTP Request sends it to Tika’s
/tikaendpoint for plain text. With no file this step is skipped. A Code node then merges pasted and extracted text (capped at 12,000 characters). - Content Brief: A Basic LLM Chain with an Ollama Chat Model (
gemma4:12b-it-qat, 8192 context) writes a structured brief. - SearXNG References: An HTTP Request calls the SearXNG JSON search endpoint and a Code node removes duplicate URLs and keeps up to six numbered references.
- Draft: A second Ollama stage writes a first draft from the brief, source text and references.
- Critique and Revision Plan: A third stage critiques the draft and produces a numbered revision checklist.
- Publish-Ready Outline: A fourth stage applies the revision plan and outputs the outline with a sources list.
- Save and Approval Gate: A Postgres node creates the
content_pipelinetable if needed and saves every stage plus the status. An If node returns the finished markdown document for approved items, or a pending message for held ones.
What You Need
- n8n with the Form Trigger, Code, HTTP Request, If, Basic LLM Chain, Ollama Chat Model and Postgres nodes (the exact n8n version was not recorded during the build)
- A local Ollama server with a text model such as
gemma4:12b-it-qat - A SearXNG instance with
jsonenabled undersearch.formats - A Postgres database and credential
- Apache Tika (optional, only for file uploads)
Key Deployment Hurdles & Solutions
- Tika Was Not Reachable: During the build n8n could not reach a Tika server, so the file-upload branch is built but was not tested. Run
apache/tikaon the same Docker network as n8n and check the URL in the Tika node. - Google Docs and Sheets Replaced: No Google credential was available, so records and the final markdown document live in Postgres instead. Everything else works without Google.
- Form Production URL: The production form URL uses the form node’s webhook ID, not the path field, and the workflow must be active.
- Slow Local Stages: The test run with
gemma4:12b-it-qattook about six minutes for four Ollama stages, and the form’s browser response may time out while the run still completes. A smaller model speeds this up. - Only the Approve Path Was Tested: The Hold for review route is built but was not run.
Download the Workflow (.json)
Import-ready n8n workflow with all 21 nodes including the four Ollama model nodes. In n8n choose Import from file, then select your own Ollama and Postgres credentials on those nodes and check the Tika and SearXNG URLs.
Download the n8n workflow (.json)
Download the Companion System Prompt (.md)
Enter your first name to personalize the content-pipeline assistant prompt so your AI helper can walk you through Ollama, SearXNG, Tika and Postgres setup step by step. Add your email optionally to get notified when new home lab blueprints drop.