AI LinkedIn Content Engine with Perplexity, OpenAI, and Replicate - n8n Workflow

Use this advanced n8n workflow to generate high-quality, persona-driven LinkedIn posts enhanced by real-time research (Perplexity) and paired with scroll-stopping images (Replicate/flux).

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

• Content marketers and solo-preneurs seeking to scale personalized LinkedIn output.
• Users needing a complex AI automation pipeline combining research, writing, and image generation.
• Developers looking for advanced n8n templates integrating multiple LLMs (OpenAI, Perplexity) and third-party APIs (Replicate).
• Anyone wanting to leverage an n8n workflow for scoring content quality before publication.

Overview

Generating high-quality, authentic social media content at scale is challenging, especially when it needs to be persona-driven and supported by fresh data. This sophisticated n8n workflow solves this by chaining specialized AI agents. It starts with a simple n8n trigger (a Webhook), fetches real-time research using the Perplexity n8n node, drafts a post centered around the user’s personal story (via an OpenAI n8n node), refines the voice, and then scores the content for quality. Crucially, it generates an abstract, scroll-stopping image via the Replicate API and saves all output to Google Sheets. This highly integrated n8n template ensures every piece of content is authentic, data-backed, visually appealing, and pre-scored for efficiency.

How it Works

The entire process is initiated by an incoming POST request to the n8n trigger (Webhook), providing parameters like Topic, Length, and AdditionalContext.


  1. Research Phase: The 🔍 Research & Trends Perplexity n8n node searches for real-time, verifiable data relevant to the input topic. This prevents the AI from hallucinating and grounds the content in facts.

  2. Drafting Phase: The ✍️ Content Creator - OpenAI n8n node receives both the input parameters and the research data. It uses a detailed prompt to create an 80/20 post—80% personal experience, 20% research support.

  3. Refinement Phase: The 🎨 Voice Refiner - OpenAI n8n node polishes the draft, adjusting the language to match the defined 'natural voice,' enforcing strict length requirements, and adding necessary formatting (emojis, short sentences). This ensures high readability and adherence to the user's brand.

  4. Scoring Phase: The 📊 Content Scorer Code n8n node evaluates the final text, checking factors like length compliance, the inclusion of engagement elements (like questions and numbers), and penalizing common AI phrases. It assigns a status (e.g., 'pendingreview').

  5. Image Prompting: The 🖼️ Image Prompt Generator OpenAI n8n node creates an abstract, conceptual image prompt based on the final text, prioritizing visual metaphors over literal representations.

  6. Image Generation: After a cleanup step using a Code n8n node, the 🎨 Image Generator HTTP Request n8n node sends the prompt to the Replicate API (using the Flux model) to generate a high-quality, custom image.

  7. Storage: Finally, the 💾 Save Results Google Sheets n8n node appends the generated post, the image URL, the score, and the status to a spreadsheet, creating a ready-to-review content backlog.

Installation Guide

To utilize this powerful n8n workflow, follow these steps:


  1. Import the Workflow: Copy the provided JSON data and paste it into a new workflow within your n8n instance.

  2. Set up Credentials: This n8n workflow requires four separate credentials:

OpenAI API: For the three OpenAI nodes (✍️ Content Creator, 🎨 Voice Refiner, 🖼️ Image Prompt Generator).
Perplexity API: For the research n8n node (🔍 Research & Trends).
Replicate API: For the image generation n8n node (HTTP Request).
Google Sheets OAuth2 API: For the final data storage (💾 Save Results).

  1. Configure the Webhook Trigger: Activate the Webhook n8n trigger node to generate its unique URL. This URL is where you will send POST requests to start the content generation.

  2. Customize Prompts: Update the detailed system prompts within the two main OpenAI n8n node steps (✍️ Content Creator and 🎨 Voice Refiner) with your specific personal achievements, context, and preferred language patterns for optimal results.

  3. Setup Google Sheets: Ensure the target Google Sheet document exists and update the Document ID and Sheet Name in the 💾 Save Results n8n node.

Node Details

Webhook (n8n trigger): Starts the n8n workflow upon receiving an external POST request. It passes key content parameters (Topic, Length, Context) down the flow.
🔍 Research & Trends (Perplexity n8n node): Gathers factual, verifiable research and trends relevant to the topic to ground the content creation process. Key configuration uses the 'sonar' model to ensure accuracy.
✍️ Content Creator - OpenAI (OpenAI n8n node): The core creation engine (using GPT-4o). It combines user persona data, research findings, and input parameters to draft a story-driven LinkedIn post (80% story, 20% research).
🎨 Voice Refiner - OpenAI (OpenAI n8n node): Refines the post's tone, ensuring it matches the defined 'natural voice' while adhering to strict length constraints (Short, Medium, or Long).
📊 Content Scorer (Code n8n node): A custom scoring function that analyzes the refined post based on character count, engagement elements (questions, numbers), and voice authenticity. It assigns a status for human review.
🖼️ Image Prompt Generator (OpenAI n8n node): Generates abstract, conceptual prompts for visual AI, focusing on metaphorical representation rather than literal subject matter to produce scroll-stopping visuals.
Code (n8n node): Cleans the image prompt by removing line breaks and escaping quotes, preparing the string for a successful JSON payload to the Replicate API.
🎨 Image Generator (HTTP Request n8n node): Communicates with the Replicate API to generate the image using the highly aesthetic flux-1.1-pro model, leveraging the n8n platform's HTTP request capabilities.


  • 💾 Save Results (Google Sheets n8n node): Stores the final generated post, the image URL, the AI score, and the status in a designated Google Sheet, creating a structured review queue for your content strategy. This completes the end-to-end n8n workflow.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by
Mariano Kostelec
Mariano Kostelec

Featured*