Automate Twitter content with trend analysis using OpenAI GPT & MCP
Needs changesWhat this workflow does
This AI workflow has 16 nodes and runs on a schedule (every 2 hours). Along the way it connects MCP Client, Slack, OpenAI Chat Model and MySQL and 1 more.
How it runs
Trigger: On a schedule (every 2 hours).
- Execute a SQL query (MySQL): run a query
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (MCP Client)
- Format Results (Function): runs custom JavaScript (legacy Function node)
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (MCP Client)
- Send a message (Slack): uses Slack
- keyword_formatter (Code): runs custom JavaScript code
- Wait: pauses before continuing
- Wait: pauses before continuing
- Execute a SQL query (MySQL): run a query
…plus 1 more step. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- Function (legacy) in Format Results1: replace with Code node, mode 'Run Once for All Items'.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| Function (legacy) Format Results1 | Code node, mode 'Run Once for All Items' |
Nodes used (11)
- Function
n8n-nodes-base.function - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - AI Agent
@n8n/n8n-nodes-langchain.agent - MCP Client Tool
@n8n/n8n-nodes-langchain.mcpClientTool - Slack
n8n-nodes-base.slack - Wait
n8n-nodes-base.wait - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - MySQL
n8n-nodes-base.mySql - Schedule Trigger
n8n-nodes-base.scheduleTrigger - X (Formerly Twitter)
n8n-nodes-base.twitter - Code
n8n-nodes-base.code
From the author
How it works This template creates a fully automated Twitter content system that discovers trending topics, analyzes why they're trending using AI, and posts intelligent commentary about them. The workflow uses MCP (Model Context Protocol) with the twitter154…