Icon
Back to home page

A Modular Viral Content Engine for LinkedIn & X with Human Approval

A 156-node n8n engine that discovers viral ideas, generates on-brand LinkedIn and X posts with AI images, gates them through Telegram approval, and auto-publishes to both platforms.

Case Study Image

The brief: automate 90% of the content lifecycle without losing the final say.

The client wanted an end-to-end engine that handles nearly everything between "what should I post?" and "it's live on LinkedIn and X" — discovering viral ideas in their niche, writing posts in their voice, generating matching imagery, repurposing across platforms, and publishing on a schedule — while keeping a human gate before anything goes public. We delivered this as a 156-node n8n workflow organised into six modular sub-systems, deliberately built so each piece can run as its own workflow and be triggered independently, by schedule or on demand via a Telegram bot.

System 1 — Initialization (optional). A setup routine scrapes LinkedIn competitor and inspiration profiles via Apify, filters to accounts whose posts clear a popularity bar (over 100 likes), and saves them to a "Competitors" Google Sheet — building the seed list the discovery engine learns from.

System 2 — Content Discovery. Weekly (a Saturday-night schedule trigger, or on demand), the engine reads those competitor URLs, scrapes their recent posts via Apify, filters for high engagement, and removes duplicates. A text classifier then sorts each post into "evergreen" niche content versus "personal/other," so only timeless, on-topic ideas are saved as "viral ideas" to a sheet. The user is notified on Telegram when the run completes.

System 3 — Post Generation. For each idea marked "Ready," an LLM agent acts as an expert LinkedIn writer working strictly within the brand's defined voice, audience, and "content buckets" (Automation Basics, Real Implementations, Case Studies, Future & Trends). It can call a web-research sub-workflow (Perplexity, with a lower-cost research provider as an alternative) to ground the post in current, verifiable information, then outputs a structured 200–300-word post plus a hook and an image description. That description drives image generation via Gemini's image model (or OpenAI image editing), styled against a reference image pulled from Google Drive for visual consistency. The finished post and image are sent to Telegram for human review before anything proceeds.

System 4 — Repurposing for X. Approved LinkedIn posts are automatically adapted for X — condensed to instant-value, sub-280-character posts or short threads — reusing the same generated image so branding stays consistent across platforms. Generated X content is appended to the sheet.

System 5 — Auto-Publishing. Separate schedule triggers publish validated content to each platform: LinkedIn in the early evening and X shortly after (using X's OAuth1 credential, with images uploaded via the dedicated media endpoint). The system only posts rows marked valid, updates each record's status in Google Sheets after publishing, and notifies the user on Telegram. Running X a beat behind LinkedIn is a built-in best practice.

System 6 — On-demand Telegram helper (SMS). A Telegram bot lets the user drive the engine manually using a structured command format — generating a post from their own idea, kicking off scraping, or running research on demand. It includes a user-ID guard (rejecting unauthorised senders) and input validation that politely flags malformed commands.

Why this design works. The six-system split is the key decision: by separating discovery, generation, repurposing, and publishing into independent workflows wired together with Execute Workflow calls, each stage can be tested, scheduled, and reused in isolation — and the same generation logic serves both automated ideas and the user's own. Google Sheets acts as the shared spine and status ledger across every system (competitors, ideas, posts, publishing status), Google Drive stores generated imagery, and Telegram provides both the approval gate and the manual control surface. The result automates roughly 90% of the content lifecycle while preserving a human checkpoint before any post represents the brand publicly — and it runs on self-hosted infrastructure, keeping credentials and content under the owner's control.

Six modular sub-systems
Brand-voiced, research-grounded generation
Human-in-the-loop via Telegram
Call Icon
+1-888-669-1935