Chatbot Content Agent for Research-Backed Social Posts - n8n Workflow

Use this advanced n8n workflow to automate content generation. It combines LangChain agents, AI research tools, and structured parsing to draft and publish high-quality, localized social media posts to Facebook.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing professionals and content agencies who need rapid, research-driven content generation.
Users looking for advanced examples of integrating LangChain AI agents within an n8n workflow.
Teams requiring automated content localization (specifically Vietnamese in this template).
Social Media Managers seeking to automate publication via the Facebook Graph API.

Overview

This powerful n8n workflow template acts as a fully automated content assistant. It solves the pain point of moving from a raw idea to a polished, published social media post by leveraging large language models (LLMs) and structured data parsing. The core value of this n8n automation is its ability to integrate external research (via the Perplexity tool placeholder) to ground the generated content in up-to-date facts, ensuring high quality. The process uses a chain of specialized AI agents within n8n nodes, first structuring the research output, and then specifically optimizing it for social media consumption in a target language (Vietnamese, as configured in the CONFIG n8n node). This advanced n8n setup significantly reduces manual drafting and posting time.

How it Works

This highly sophisticated n8n workflow begins when a user submits a request through the Chat Trigger n8n node.


  1. Trigger and Research Initialization: The Chat Trigger n8n node receives the user's topic. This input is passed to the Agent: Topic + Research n8n node, which utilizes GPT-4o-mini and determines if external information is required. If so, it calls the Tool: Call Perplexity Researcher n8n node (note: this is a placeholder sub-workflow ID that must be linked).

  2. Structured Data Extraction: The combined output of the research and initial drafting is then fed into the Agent: Extract JSON n8n node. This agent, backed by GPT-4o, extracts and validates the content against the rigid structure defined in the Parser: Article JSON n8n node (ensuring fields like title, content sections, and hashtags are present).

  3. Localized Post Creation: The resulting structured JSON article is passed to the Agent: Create Post Content n8n node. This agent is specifically prompted to convert the content into a concise, engaging social media post in Vietnamese, applying emojis, CTAs, and specific stylistic guidelines defined in the n8n templates.

  4. Publication: The final, polished social media copy is retrieved from the agent's output and is published directly to the configured Facebook Page using the Publish: Facebook Graph API n8n node. This end-to-end automation showcases the versatility of an n8n workflow.

Installation Guide

To deploy and utilize this n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON code and import it into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Credentials Setup:

Set up an OpenAI credential within n8n, as multiple n8n nodes (LM Chat OpenAI) rely on GPT models for agent functionality.
Set up a Facebook Graph API credential with permissions to publish to your target Facebook Page.

  1. Configuration Node: Edit the ⚙️ CONFIG (Set fields) n8n node to define:

FACEBOOKPAGEID: Your target Facebook Page ID.
RESEARCHWORKFLOWID: The ID of your separate n8n workflow that handles the Perplexity research tool functionality.

  1. Testing: Execute the workflow manually or via the chat interface to ensure all LangChain agents and the Facebook n8n node are functioning correctly. Always test with a safe topic before enabling active posting.

Node Details

This advanced n8n workflow relies on a mixture of proprietary LangChain nodes and standard n8n nodes:

Chat Trigger n8n node: The initiation point for the n8n workflow. It provides an interface for the user to input the content topic, starting the automation.
Agent: Topic + Research n8n node: A LangChain agent responsible for analyzing the input and using the linked research tool to gather data.
Tool: Call Perplexity Researcher n8n node: A placeholder n8n node for calling a linked research sub-workflow. Essential for ensuring the content is research-backed.
LM: For JSON Extraction n8n node (OpenAI GPT-4o): Provides the high-quality language model used for accurate content structuring, critical for reliability in this n8n workflow.
Parser: Article JSON n8n node: Defines the strict JSON schema (title, content, hashtags) that the AI agent must adhere to, guaranteeing structured output for subsequent steps in the n8n workflow.
Agent: Create Post Content n8n node: The final creation stage. This agent specializes in converting the structured data into engaging, localized social media copy (Vietnamese).


  • Publish: Facebook Graph API n8n node: Uses the POST method to push the final content string directly to the designated Facebook Page feed, completing the n8n workflow automation.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
HoangSP
HoangSP

HoangSP is an automation expert with deep experience in using n8n, the open-source workflow automation platform. He regularly creates and shares practical automation templates with the n8n community, helping individuals and businesses save time, boost efficiency, and seamlessly integrate their tools and systems. With a strong systems-thinking approach and a talent for process optimization, HoangSP is a leading figure in Vietnam’s growing automation space.

Featured*