Build a Free Local n8n LinkedIn Post Generator
Overview & Architecture
Staring at a blank LinkedIn page is slow, and a post written from memory is easy to get wrong. This workflow takes a topic from a simple form, researches it on the web through your own search engine, and has a local language model draft the post from what it found.
An n8n Form Trigger collects the topic plus audience, tone, length and any required points. A private SearXNG instance returns search results, a Code node boils them down to a short research brief, and Ollama writes the post using only that brief. Every finished post is saved with its source links in a database table you can review and reuse.
The Pipeline
- Topic Form: An n8n Form Trigger asks for a topic (required), audience, tone, length and required points.
- Search SearXNG: An HTTP Request node calls your SearXNG instance’s JSON search interface with the topic.
- Build Research Brief: A Code node removes duplicate URLs and keeps the top five results as numbered titles, short snippets and links.
- Draft Post with Ollama: An HTTP Request node sends the form answers and brief to Ollama’s chat endpoint with the model
qwen2.5:14b-instruct-q5_K_M. The prompt allows only facts from the notes and asks for plain text with no sources in the post. - Clean Draft: A Code node strips think tags, preambles, markdown and any trailing sources block, and keeps the raw model response for reference.
- Create Posts Table / Save Post to Postgres: Two Postgres nodes create a
linkedin_poststable if needed and insert the topic, post text, source links, raw response and timestamp. - Confirmation: A final node returns the saved post to the form.
In the test run, a form submission about local AI models for small businesses produced a short post and saved it as the first row of the table.
What You Need
- n8n (the exact n8n version was not recorded during this build)
- Ollama with the text model you choose already pulled
- A SearXNG instance reachable from n8n with
jsonenabled undersearch.formatsin its settings - A Postgres database and an n8n Postgres credential
Key Deployment Hurdles & Solutions
- SearXNG Must Allow JSON: The search node needs the JSON format enabled in SearXNG’s
settings.yml, and n8n must be able to resolve the SearXNG hostname. The workflow useshttp://searxng:8080, so change it to match your setup. - Cold Model Loads Are Slow: The first run took about four minutes, mostly because the model was loading into memory. The HTTP Request timeout is set to ten minutes so it does not fail.
- Google Sheets Swapped for Postgres: The original plan saved to Google Sheets, but that node and credential were not available on this server, so the workflow saves to a Postgres table instead.
- Keeping the Post Honest: Local models can still drift. The prompt restricts the model to the research notes, but the test post was fairly generic and kept an emoji and hashtags, so review every draft before posting.
Download the Workflow (.json)
Import-ready n8n workflow with all 8 working nodes, grouped and labeled. In n8n choose Import from file, select your own Postgres credential on the two Postgres nodes, and adjust the SearXNG address and Ollama model if yours differ.
Download the n8n workflow (.json)
Download the Companion System Prompt (.md)
Enter your first name to personalize the LinkedIn post generator assistant prompt so your AI helper can walk you through the SearXNG, Ollama, Postgres and n8n setup step by step. Add your email optionally to get notified when new home lab blueprints drop.