Templates / Automate Twitter content with trend analysis using OpenAI GPT & MCP

Automate Twitter content with trend analysis using OpenAI GPT & MCP

Needs changes

by Dayong Huang · 786 views · created 2025-09-04 · Social Media, AI RAG

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: Function (legacy). 1 breaking item(s) found. Static check, last run 2026-10-19.

What 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).

  1. Execute a SQL query (MySQL): run a query
  2. AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (MCP Client)
  3. Format Results (Function): runs custom JavaScript (legacy Function node)
  4. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  5. AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (MCP Client)
  6. Send a message (Slack): uses Slack
  7. keyword_formatter (Code): runs custom JavaScript code
  8. Wait: pauses before continuing
  9. Wait: pauses before continuing
  10. Execute a SQL query (MySQL): run a query

…plus 1 more step. See the full node list below.

Services it uses

MCP ClientSlackOpenAI Chat ModelMySQLX (Formerly Twitter)

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.0Replace with
Function (legacy)
Format Results1
Code node, mode 'Run Once for All Items'

Nodes used (11)

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…

Excerpt from Dayong Huang's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.