AI Content Creation Agent with Self-Correction and LinkedIn Publishing - n8n Workflow

Build a powerful n8n workflow to generate daily LinkedIn posts using OpenAI agents, self-correction based on a brand brief stored in Notion, and automatic publishing.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content Creators and Marketers needing high-volume, brand-consistent output.

  • n8n users looking for advanced examples of LangChain AI Agents and custom tools.

  • Digital personal brands seeking automated social media presence.

  • Anyone requiring robust, iterative content creation driven by AI and data stored in Notion.

Overview

This advanced n8n workflow solves the crucial problem of maintaining brand consistency and high quality when automating social media content creation. It utilizes a sophisticated LangChain AI Agent within n8n that doesn't just generate a post; it uses custom tools to retrieve a detailed brand brief from Notion and then submits the drafted content to a secondary AI model for critique and scoring. If the score is below 0.8, the agent automatically enters a feedback loop, refining the post until it meets the predefined quality threshold. This powerful n8n setup ensures every published piece, finalized by the LinkedIn n8n node, adheres strictly to brand guidelines, maximizing engagement and relevance. This n8n workflow demonstrates complex integration between multiple services and AI models, making it one of the most valuable n8n templates for advanced content operations.

How it Works

The content creation pipeline is meticulously structured within this n8n workflow:


  1. Daily Trigger: The process starts daily via the core n8n trigger, Daily Scheduler, set to run at 9 PM.

  2. Idea Generation: The primary n8n workflow first executes a sub-workflow (Get Content Ideas) to retrieve the brand brief and subsequently generates 10 fresh content suggestions using a dedicated OpenAI n8n node (GPT-4o-mini).

  3. Iteration Prep: The main n8n workflow splits the list of ideas using the Split Ideas n8n node and enters a loop (Loop through content Ideas) to process them one by one.

  4. AI Agent Execution: The Generate LinkedIn Post with AI LangChain Agent n8n node receives the current content idea. This powerful n8n node is configured with two critical LangChain Tool Workflows:

Get Brand Brief: Pulls guidelines from Notion via a sub-workflow.
GetContentFeedback: Sends the draft to a critique AI model for grading.

  1. Self-Correction Loop: The AI Agent's system prompt mandates that it must use the feedback tool to score the post. If the alignment score is below 0.8, the agent iteratively edits and resubmits the draft for a new score, ensuring brand consistency.

  2. Publishing: Once the AI Agent successfully generates an approved post, the final output is seamlessly passed to the Publish to Linkedin n8n node, which automatically posts the content to the designated personal profile.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import Workflow: Copy the provided n8n workflow JSON code and import it directly into your n8n instance.

  2. Credential Setup: You must configure credentials for the following services used by the various n8n node components:

OpenAI API: Required for the LangChain Agent, content idea generation, and feedback model. Ensure the corresponding OpenAi account credential is set up.
Notion API: Required for the Get Brand Brief sub-workflow to access the brand guidelines database.
* LinkedIn OAuth2 API: Required for the final Publish to Linkedin n8n node.

  1. Sub-Workflows: This master n8n workflow relies on three linked sub-workflows (Get Content Ideas, Get Brand Brief, and Get Content Feedback). Ensure these n8n templates or flows are also imported and active, or update the workflowId parameters in the Execute Workflow and Tool Workflow n8n nodes if they have different IDs in your system.

  2. Notion Setup: Update the Get Brand Brief n8n node block URL parameter within the relevant sub-workflow to point accurately to your specific Notion page containing the brand guidelines.

  3. Activation: Set the main n8n workflow to 'Active' to enable the daily trigger.

Node Details

Daily Scheduler (n8n trigger)
Function: Initiates the entire automated content generation process daily.
Key Configuration: Set to trigger daily at 21:00 (9 PM).
Get Content Ideas (Execute Workflow n8n node)
Function: Calls a dedicated sub-workflow to retrieve the brand brief and generate 10 relevant content topics using an OpenAI n8n node.
Key Configuration: Links to the N5PyYK0EClSQRWNK workflow.
OpenAI Chat Model (LangChain n8n node)
Function: Serves as the primary Large Language Model (LLM) component within the AI Agent for drafting content.
Key Configuration: Uses gpt-4.1-mini and requires the OpenAI credential.
Generate LinkedIn Post with AI (LangChain Agent n8n node)
Function: The orchestrator of the n8n workflow. This advanced n8n node manages content creation, memory, tool usage (brief retrieval and feedback), and the crucial self-correction loop.
Key Configuration: System Message defines the iterative process: use Get Brand Brief, create post, use GetContentFeedback, refine if score < 0.8.
Get Content Feedback (LangChain Tool Workflow n8n node)
Function: Allows the AI Agent to access the external critique mechanism defined in a separate n8n workflow, which grades the draft against brand guidelines.
Key Configuration: Calls the 3Bnlfdq60OZoXcba sub-workflow, which returns a structured score and description.
Publish to Linkedin (LinkedIn n8n node)
Function: Posts the final, high-scoring, approved content (extracted from the AI Agent's final output) to the designated LinkedIn profile.
Key Configuration: Text input is dynamically mapped to {{ $json.output }} from the preceding Agent node.

Related n8n Workflows

Free

Nodes: 15 Nodes
Updated: December 26 2025
View all
Created by
Nabin Bhandari
Nabin Bhandari