LinkedIn Content Automation Pipeline

Problem:
LinkedIn content creation is time-intensive, repetitive, and often lacks real-time relevance, reducing posting consistency.
Solution:
Built an AI-driven n8n automation pipeline with live research, LLM-based generation, and Discord-triggered workflows with Supabase state management.
Impact:
Automated end-to-end ideation to publishing, reducing effort from hours to seconds and enabling consistent, high-quality output.
Overview
End-to-end automation from research and ideation to drafted posts and one-click publish, with human-in-the-loop via Discord and durable state for deduplication.
Results & metrics
- Hours to seconds per content cycle
- Zero duplicate topics via Supabase state tracking
- 5-API orchestration (Discord, Drive, LinkedIn, Supabase, LLM)
- Consistent posting cadence with minimal manual effort
Before / after
Publishing flow
Before: Manual context-switching across tools
Ideation
Before: Ad hoc notes and repetition
Content Consistency
Before: Irregular posting schedule subject to manual context switching
What I built
n8n content pipeline
Discord triggers n8n on EC2; an LLM drafts, Supabase dedups, LinkedIn publishes.
Discord control plane
Ideas, drafts and approve/reject buttons live in Discord; approval posts to LinkedIn.
Stack
- AWS EC2 + Docker
- n8n workflows
- Supabase
- LLM + web research
- LinkedIn & Google APIs
Decisions
Key trade-offs and design calls that shaped the final delivery.
n8n over custom code
Why
- Context
- Needed rapid workflow iteration without deployments for a content automation tool
- Decision
- Chose n8n visual workflow builder for AI-powered pipelines—allowed iterating on LLM prompts and API integrations without code changes
Discord as control plane
Why
- Context
- Team already used Discord for daily communication
- Decision
- Made Discord the single interface for triggering, reviewing, and publishing—no separate dashboard needed, minimal context switching
Architecture
The primary system boundaries, runtime pieces, and how the project was structured in production.
- Discord → n8n on EC2
- n8n on EC2 → LLM + research
- n8n on EC2 → Supabase
- n8n on EC2 → Google Drive
- n8n on EC2 → LinkedIn API
- Supabase → n8n on EC2
- n8n workflows with Gemini LLM
AI Content Engine
How
Three interconnected workflows: daily AI-powered idea pitcher with live web research and deduplication, content creator triggered by Discord that drafts posts and generates images, and one-click publisher that posts to LinkedIn.
- Supabase
State Management
How
Stores idea deduplication state, user preferences, and tracks which ideas have been pitched—prevents topic repetition across campaigns.
- Discord Bot
Control Interface
How
Sole control interface for the entire pipeline interactive buttons for approve/reject/publish, no manual LinkedIn interaction required.
Mermaid source
Paste into mermaid.live to edit the diagram.
flowchart LR
subgraph ingest [Trigger & control]
D[Discord]
end
subgraph compute [Automation]
N[n8n on EC2]
L[LLM + research]
end
subgraph data [State & assets]
S[(Supabase)]
G[Google Drive]
end
subgraph publish [Outbound]
LI[LinkedIn API]
end
D --> N
N --> L
N --> S
N --> G
N --> LI
S --> NPipeline
How changes moved from development through validation and deployment.
Interactive buttons for /generate-ideas action
Live web research and idea generation with deduplication
AI-powered post drafting with image generation
Interactive buttons for select ideas with dropdown action
Interactive buttons for approve/reject actions
3 interconnected workflows handle ideation → drafting → publishing with LLM reasoning
State management and deduplication in Supabase, AI-generated images stored in Drive
One-click automated posting after Discord approval
Select a step for its detail
Incidents
Operational failures, rehearsals, or recovery moments that changed how the system was run.
- P2
Free tier API limits causing workflow failures
Resolution
Implemented multi-AI fallback mechanism and concise prompt engineering to reduce token usage
Lesson: Free tiers have hard limits—design fallback chains and optimize prompts for cost efficiency
- P3
Discord bot webhook connectivity issues
Resolution
Configured n8n webhook node with retry logic and proper Discord bot token management
Lesson: Webhook integrations need retry logic and proper authentication handling
- P3
Web search API rate limiting
Resolution
Cached research results and batched searches to minimize API calls
Lesson: Research APIs are expensive—cache aggressively and batch requests