Human in the Loop: AI-Powered X (Twitter) Post Creation with Human Oversight
Overview
This workflow streamlines your social media content creation by integrating AI-powered post generation with a crucial human review step. It automatically drafts factual, engaging X (Twitter) posts based on your requests, then sends them to you for feedback via Telegram. Depending on your response (approval or revision request), the AI either publishes the post or revises it, creating a seamless and controlled content pipeline.
Use Case
This workflow is ideal for:
- Social Media Managers: Automate the drafting of daily tweets while maintaining quality control and brand voice.
- Content Creators: Quickly generate informative posts on trending topics with accurate, sourced information.
- Agencies: Efficiently manage content approval processes for clients, ensuring all posts meet their standards before going live.
- Anyone needing controlled AI output: Implement a human-in-the-loop system for any text-based content creation where final approval or iterative refinement is necessary.
How It Works
- Request a Post: You initiate the workflow by sending a message (e.g., via Telegram) describing the X (Twitter) post you want.
- AI Drafts the Post:
- The "X Post Agent" uses Tavily Search to find up-to-date and accurate information about your requested topic.
- It then drafts an informative and engaging tweet (up to 280 characters), including a brief reference to the source.
- Human Review (Telegram):
- The drafted post is sent to you on Telegram via the "Request Feedback" node.
- You'll see the proposed post and be prompted with "Good to go?". You can respond with approval (e.g., "Looks good," "Approved") or a revision request (e.g., "Make it shorter," "Add more emojis," "Change the source").
- Decision Point:
- A "Text Classifier" analyzes your Telegram response to determine if the post is
approved
or declined
(meaning it needs revisions).
- Publish or Revise:
- If Approved: The workflow directly publishes the post to X (Twitter) using the "X Post" node.
- If Declined: The "Revision Agent" takes your specific feedback and the original post, then revises the tweet. The revised post is then sent back to you via Telegram for another round of feedback, ensuring the final output meets your exact requirements. This loop continues until you approve the post.
How to Set It Up
To set up your Human in the Loop 2.0 workflow, follow these steps:
- Connect Your Telegram Account:
- Configure your Telegram credentials in n8n.
- Ensure the "Telegram_Trigger" node is connected to your Telegram bot.
- Connect Your Tavily API Key:
- Obtain an API key from Tavily.com.
- Add this API key as an HTTP Header Authentication credential and link it to the "Tavily Search" node. This enables the AI to perform real-time web searches for content.
- Connect Your OpenRouter Credentials (Optional but Recommended):
- If you plan to use models like "google/gemini-2.0-flash-001" or "openai/gpt-4.1" via OpenRouter, set up your OpenRouter credentials in n8n and connect them to the "2.0 Flash" and "GPT 4.1" nodes respectively. OpenRouter can offer diverse AI model options.
- Connect Your X (Twitter) Account:
- Set up your Twitter (X) credentials in n8n.
- Connect these credentials to the "X Post" node.
- Import the Workflow: Import the provided workflow JSON into your n8n instance.
- Activate and Test: Once all credentials are configured, activate the workflow. You can then test it by sending a message to your Telegram bot or by manually executing the workflow.
With this setup, you'll have an intelligent content creation system that keeps you in control!