📱 Generate article-based posts for LinkedIn, Twitter (X), and Reddit with OpenAI

98 views · 📱 Social Media & Email Marketing

💡 Pro Tip — If you’re pulling LinkedIn data through HTTP requests or dealing with API restrictions, there’s a community node called ScraperNode that handles this natively. It has dedicated scrapers for profiles, companies, jobs, and people search — you just pass a URL and get structured data back.

View All Scrapers

Description

Overview

AI-powered workflow that transforms any article URL into platform-optimized social media posts for LinkedIn, Twitter (X), and Reddit. Uses Mozilla Readability for content extraction, multi-agent AI with RAG from viral LinkedIn post database, and interactive review forms for content refinement before auto-publishing.

Key Capabilities:

How It Works

Stage 1: Article Content Extraction

  1. Form Submission: User enters article URL (with basic auth protection)
  2. URL Validation: Checks if valid URL format
  3. Article Scraping: HTTP request fetches HTML content
  4. Readability Parsing: Mozilla Readability extracts:
    • Clean article text (removes ads, navigation, etc.)
    • Title, author, excerpt
    • Word count, site name
    • Featured image (from og:image, twitter:image, or first img tag)
  5. Error Handling: Returns user-friendly error if scraping fails

Stage 2: LinkedIn Post Generation (3-Agent System)

Agent 1: LinkedIn Post Strategist

Agent 2: LinkedIn Post Generator

Agent 3: LinkedIn Post Formatter

Review Loop:

  1. User sees formatted post in web form
  2. Options: “Regenerate” or “Continue”
  3. If regenerate: Provide feedback → Agent creates new version
  4. Second review form with same options
  5. After 2 iterations or approval, proceeds to image selection

Stage 3: Image Handling for LinkedIn

  1. Image Preview: Shows extracted article image
  2. User Choice:
    • “Yes” → Downloads image, posts with text + image
    • “Continue without Image” → Posts with text + article link preview
  3. Auto-Publish: Posts to LinkedIn with selected format

Stage 4: Twitter (X) Post Generation

Parallel process (runs alongside LinkedIn):

  1. Twitter Agent:
    • Creates tweet under 280 characters (including spaces)
    • Must include article URL
    • Uses GPT-4.1 or GPT-5 models
  2. Tweet Review Form: User reviews generated tweet
  3. Regeneration Loop (if requested):
    • User provides feedback
    • Re-generate Tweet Agent creates new version
    • Second review form
  4. Auto-Tweet: Posts with article image attachment

Stage 5: Reddit Post Automation

Parallel process (runs alongside LinkedIn/Twitter):

  1. Subreddit Selection: User picks from dropdown (r/n8n, r/mcp, r/technews)
  2. Flair Retrieval: Fetches available flairs for selected subreddit via Reddit API
  3. AI Flair Selection:
    • GPT-4o-mini analyzes article title + available flairs
    • Selects most appropriate flair
  4. Auto-Post: Submits link post to Reddit with title and selected flair

How To Use

Prerequisites

API Credentials Required

  1. OpenAI API: GPT-4.1, GPT-5, GPT-5-mini, GPT-4o-mini access
  2. Supabase: Vector database with linkedin_post table (from previous workflow)
  3. LinkedIn OAuth2: Developer app with posting permissions
  4. Twitter OAuth2: Developer account with tweet permissions
  5. Reddit OAuth2: App credentials with submit permissions
  6. Basic Auth: For form password protection

Setup Steps

1. Configure Form Access

3. Set Up Social Media APIs

LinkedIn:

Twitter:

Reddit:

4. Configure AI Models

🔗 Nodes Used

HTTP Request, X (Formerly Twitter), LinkedIn, AI Agent, Embeddings OpenAI, OpenAI Chat Model

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup