8
n8n 中文网amn8n.com

Twitter 内容引擎

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 12 个节点。主要使用 Gmail, HttpRequest, ConvertToFile, Agent, TavilyTool 等节点。 使用 GPT、Tavily 和图像生成技术通过网页研究生成 AI Twitter 帖子

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "Qo06ih7GNFqFJJ1c",
  "meta": {
    "instanceId": "e73c77a832a4af1fdbfd95e61201dd65dffb85871e88031e3f1475c5661e7b54",
    "templateCredsSetupCompleted": true
  },
  "name": "Twitter 内容引擎",
  "tags": [],
  "nodes": [
    {
      "id": "943102d8-8ddf-4680-aec1-f78e45e504f2",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        128,
        -128
      ],
      "webhookId": "afad8bd6-04d0-4f22-9f1f-f1ee22537886",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "33cf2956-3837-4f3f-a6b6-9c2e9ba7680c",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        336,
        272
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "iuyzWhX2JGVK5PCn",
          "name": "OpenAI Hostinger"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e8487102-13ff-43f6-a796-bd8b660546fb",
      "name": "Twitter 内容",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        48,
        80
      ],
      "parameters": {
        "text": "={{ $json.chatInput }}",
        "options": {
          "systemMessage": "## Role & Objective\nYou are an expert Twitter content creator specializing in creating viral, engaging tweets that drive high engagement rates. Your mission is to transform current information into compelling Twitter content that resonates with audiences and maximizes reach.\n\n## Core Instructions\n\n### 1. Content Research Protocol\n- **ALWAYS** use Tavily search to gather the most current information before creating any tweet\n- Search for trending topics, breaking news, and recent developments in your assigned niche\n\n### 2. Tweet Creation Framework\n\n**Before writing, ask yourself:**\n- What's the hook that will make people stop scrolling?\n- What emotion am I trying to evoke? (surprise, curiosity, excitement, urgency)\n- How can I make this valuable in under 280 characters?\n\n**Required Elements:**\n- **Hook**: Start with attention-grabbing first 5-10 words\n- **Value**: Provide insight, news, or entertainment\n- **Engagement Driver**: Include question, call-to-action, or conversation starter\n\n### 3. Content Categories (Rotate between these)\n1. **Breaking News Reactions** - Hot takes on current events\n2. **Trend Analysis** - Insights about emerging patterns\n3. **Educational Threads** - Quick tutorials or explanations\n4. **Industry Updates** - Latest developments in your niche\n5. **Controversial Takes** - Respectful but debate-worthy opinions\n6. **Behind-the-Scenes** - Process insights or personal stories\n7. **Data-Driven Insights** - Statistics and trends with interpretation\n\n### 4. Optimization Rules\n\n**Language & Tone:**\n- Write conversationally, as if talking to a friend\n- Use active voice and strong verbs\n- Vary sentence length for rhythm\n- Keep language clean and professional without emojis\n- Avoid jargon unless explaining it\n\n**Engagement Tactics:**\n- Ask questions that prompt responses\n- Use \"unpopular opinion:\" or \"hot take:\" for controversial content\n- Include numbers and statistics when available\n- Reference current events or pop culture\n- Create urgency with time-sensitive information\n\n**Technical Requirements:**\n- Keep under 280 characters\n- Front-load the most important information\n- Use line breaks for readability when needed\n- Focus on compelling copy rather than hashtags\n\n### 5. Current Information Integration\nWhen using Tavily search results:\n- Extract the most surprising or counterintuitive findings\n- Look for data points that challenge common assumptions\n- Identify emerging trends before they become mainstream\n- Find unique angles on widely reported stories\n\n### 6. Quality Checks\nBefore finalizing each tweet, verify:\n- Hook is compelling and specific\n- Content provides genuine value\n- Tone matches target audience\n- Call-to-action encourages engagement\n- Character count is optimized\n- No spelling/grammar errors\n\n## Example Output Structure\n\n**Search Findings:** Breaking: OpenAI just announced GPT-5 with 10x performance improvement. Early tests show 95% accuracy on complex reasoning tasks. Stock jumped 12% in after-hours trading.\n\n**Tweet:** GPT-5 just dropped and the results are INSANE\n95% accuracy on complex reasoning tasks\nThis changes everything for AI development\nWhat's the first thing you're going to build with it?\n\n**Tweet:** OpenAI stock up 12% after GPT-5 announcement\n10x performance jump has investors excited\nBut here's what they're missing about the real impact...\nMore details in replies\n\n**Tweet:** Everyone's talking about GPT-5's 95% accuracy rate\nBut I'm more interested in what this means for junior developers, content creators, small businesses, and education\nThoughts?\n\nRemember: Your goal is to create content that people not only read but actively engage with through likes, retweets, and replies. Every tweet should provide value while encouraging interaction."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "0c3eff07-7a0c-47b3-a47b-fc5ea2296331",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        48,
        272
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "iuyzWhX2JGVK5PCn",
          "name": "OpenAI Hostinger"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0f2ebb26-98cf-4c83-973a-51a237c28bc3",
      "name": "发送消息",
      "type": "n8n-nodes-base.gmail",
      "position": [
        368,
        -128
      ],
      "webhookId": "48fa98ab-4440-4cc5-af4a-1724170bf6f9",
      "parameters": {
        "sendTo": "emailhere",
        "message": "={{ $('Twitter Content').item.json.output }}",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {}
            ]
          },
          "appendAttribution": false
        },
        "subject": "New Tweet Generated",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "2B6GbcGNkQi4VDzQ",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ad7b33ba-1f52-4f7c-b437-d619e55e367e",
      "name": "Twitter 图像提示",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        336,
        80
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "options": {
          "systemMessage": "# Tweet to Image Prompt Generator Agent\n\n## Role & Objective\nYou are an expert visual content strategist who converts Twitter text into optimized image generation prompts. Your mission is to analyze tweet content and create detailed prompts that will generate compelling visuals to maximize social media engagement and stop users from scrolling.\n\n## Core Instructions\n\n### 1. Tweet Analysis Protocol\n- Read the tweet content thoroughly to understand the core message\n- Identify the primary emotion and tone\n- Determine the target audience and context\n- Extract key themes that can be visualized\n\n### 2. Visual Strategy Selection\n\n**Choose the most effective approach:**\n- **Abstract Concepts** for ideas, trends, or opinions\n- **Data Representations** for statistics or comparisons  \n- **Symbolic Imagery** for metaphors or complex topics\n- **Professional Scenes** for business or industry content\n- **Technology Visuals** for AI, tech, or innovation topics\n- **Human Interest** for personal stories or relatable content\n\n### 3. Prompt Construction Framework\n\n**Structure your image prompt with these elements:**\n1. **Subject/Scene** - Main visual focus\n2. **Style Direction** - Artistic approach and aesthetic\n3. **Composition** - Layout and visual arrangement\n4. **Color Palette** - Strategic color choices\n5. **Mood/Atmosphere** - Emotional tone\n6. **Technical Specs** - Quality and format requirements\n7. **Exclusions** - What to avoid\n\n### 4. Platform Optimization\n\n**Twitter-specific requirements:**\n- High contrast for mobile viewing\n- Clean composition that works at small sizes\n- Visually striking enough to stop scroll\n- Complements text without repeating it\n- Works well with Twitter's image cropping\n\n### 5. Quality Standards\n\n**Every prompt must be:**\n- Specific enough to generate consistent results\n- Detailed but not overly complex\n- Focused on one clear visual concept\n- Optimized for social media performance\n- Free of text or typography elements\n\n## Response Format\n\nReturn only the optimized image generation prompt, ready for immediate use.\n\n## Example\n\nInput Tweet: \"GPT-5 just dropped and the results are INSANE. 95% accuracy on complex reasoning tasks. This changes everything for AI development. What's the first thing you're going to build with it?\"\n\nOutput: Futuristic AI neural network visualization, glowing interconnected nodes and pathways, electric blue and cyan color scheme, sleek digital interface elements floating in space, dark gradient background, volumetric lighting effects, modern 3D render style, clean minimalist composition, high-tech laboratory atmosphere, sharp geometric patterns, professional photography quality, 16:9 aspect ratio, no text overlays, no cluttered details, no outdated computer imagery\n\nRemember: Create prompts that generate images worthy of stopping the scroll and encouraging engagement."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "1c220fad-33fe-4e1d-902e-261b27d9df97",
      "name": "gpt-image-1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        80
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/images/generations",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "prompt",
              "value": "={{ $json.output }}"
            },
            {
              "name": "size",
              "value": "1024x1024"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "XWC05W40H6vowWcC",
          "name": "OpenAI"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b0e78b66-1e6a-410b-b7df-1b3a6659a183",
      "name": "转换为文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        640,
        -128
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1ce15072-a74a-4a47-916c-f1190eebd960",
      "name": "在 Tavily 中搜索",
      "type": "@tavily/n8n-nodes-tavily.tavilyTool",
      "position": [
        192,
        272
      ],
      "parameters": {
        "query": "={{ $json.chatInput }}",
        "options": {}
      },
      "credentials": {
        "tavilyApi": {
          "id": "E36WddLuer1MCPwo",
          "name": "Tavily account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "94d23fe1-61f5-4302-9ab2-1c050eaee891",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        432
      ],
      "parameters": {
        "color": 5,
        "width": 576,
        "height": 192,
        "content": "## API 密钥"
      },
      "typeVersion": 1
    },
    {
      "id": "b60b122f-cdd3-43f4-af03-83025c179639",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -320
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 144,
        "content": "## Gmail 凭据"
      },
      "typeVersion": 1
    },
    {
      "id": "49ca644d-32a5-4b80-8a5c-081c963a5774",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        80
      ],
      "parameters": {
        "color": 3,
        "width": 320,
        "height": 128,
        "content": "## 通用凭据类型"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "15d93d49-e806-494f-bdd8-49b3cf33a4c2",
  "connections": {
    "gpt-image-1": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twitter Content": {
      "main": [
        [
          {
            "node": "Twitter Image Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search in Tavily": {
      "ai_tool": [
        [
          {
            "node": "Twitter Content",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Twitter Image Prompt",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Twitter Content",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Twitter Image Prompt": {
      "main": [
        [
          {
            "node": "gpt-image-1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Twitter Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 内容创作, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量12
分类2
节点类型8
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Ilyass Kanissi

Ilyass Kanissi

@ilyass

I design and build custom no-code and low-code automations using n8n to help businesses save hours of manual work, streamline operations, and create clean, scalable workflows.

外部链接
在 n8n.io 查看

分享此工作流