8
n8n 中文网amn8n.com

使用GPT-4o和Flux-pro发送每日AI生成名言和图片到Telegram

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 Telegram, AimlApi, HttpRequest, ScheduleTrigger, TelegramTrigger 等节点。 使用GPT-4o和Flux-pro发送每日AI生成名言和图片到Telegram

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "58e06bfa452afe2836b2ce0aa089999394af0b93c2a455035675d99d83112fa1",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "260f5434-583e-4d83-b8db-f21822617d45",
      "name": "便签 - Telegram 设置",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        1584
      ],
      "parameters": {
        "color": 4,
        "width": 248,
        "height": 344,
        "content": "## 传入消息"
      },
      "typeVersion": 1
    },
    {
      "id": "2e5506ca-1137-47fb-aeaf-8789a927b0b8",
      "name": "📩 接收 Telegram 消息1",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        448,
        1760
      ],
      "webhookId": "3ceea664-fd53-4141-8bc6-4fdaca0a661d",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "bb70IQruLtlUfyRb",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8b1ba5c2-533b-4300-bd81-c37d0d8a79ae",
      "name": "⏰ 计划触发器(每日)1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        448,
        2112
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7,
              "triggerAtMinute": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ebe338f1-fb23-407e-9e05-e374f13758e0",
      "name": "✍️ 生成引用 (AI/ML API)1",
      "type": "n8n-nodes-aimlapi.aimlApi",
      "position": [
        752,
        1936
      ],
      "parameters": {
        "model": "openai/gpt-4o",
        "prompt": "You are a generator of short, original, uplifting quotes.\n\nRequirements:\n- Output ONLY the quote text, no author, no quotes, no markdown.\n- Max 180 characters.\n- Avoid clichés.\n- Language: the same as this instruction.\n\nGenerate 1 quote.",
        "options": {},
        "requestOptions": {}
      },
      "credentials": {
        "aimlApi": {
          "id": "6Z9fP7Dy0ZkIBXXw",
          "name": "AI/ML account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "00d23e37-ac8e-4345-8e36-b22e31c2dcea",
      "name": "🎨 生成图像 (AI/ML API | flux-pro)2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1072,
        1936
      ],
      "parameters": {
        "url": "https://api.aimlapi.com/v1/images/generations",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "flux-pro"
            },
            {
              "name": "prompt",
              "value": "={{ \"Create a cinematic, aesthetically pleasing illustration that captures the spirit of this quote. No text in the image. Emphasize mood, lighting, composition. Quote: \" + $('✍️ Generate Quote (AI/ML API)1').item.json.content }}"
            },
            {
              "name": "n",
              "value": "1"
            },
            {
              "name": "size",
              "value": "1024x1024"
            },
            {
              "name": "response_formats",
              "value": "=1"
            }
          ]
        },
        "nodeCredentialType": "aimlApi"
      },
      "credentials": {
        "aimlApi": {
          "id": "6Z9fP7Dy0ZkIBXXw",
          "name": "AI/ML account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1e589308-1a74-4d1d-892e-e3010cce2392",
      "name": "📤 发送到 Telegram1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1392,
        1936
      ],
      "webhookId": "4a46da0a-9a91-4f31-802a-f0ce89516aa7",
      "parameters": {
        "file": "={{ $('🎨 Generate Image (AI/ML API | flux-pro)2').item.json.images[0].url }}",
        "chatId": "={{ $('📩 Receive Telegram Message1').item.json.message.chat.id }}",
        "operation": "sendPhoto",
        "additionalFields": {
          "caption": "={{ \"🌅 \" + $('✍️ Generate Quote (AI/ML API)1').item.json.content }}"
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "bb70IQruLtlUfyRb",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cb3c6fef-2d1d-45bf-8908-b352b2eef2ac",
      "name": "便签 - 生成引用",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        1744
      ],
      "parameters": {
        "color": 6,
        "width": 300,
        "height": 428,
        "content": "## 2️⃣ 生成引用"
      },
      "typeVersion": 1
    },
    {
      "id": "a331b89b-f8cb-452e-a88c-e8c301eab1dd",
      "name": "便签 - 创建图像",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        1744
      ],
      "parameters": {
        "color": 6,
        "width": 300,
        "height": 428,
        "content": "## 3️⃣ 创建图像"
      },
      "typeVersion": 1
    },
    {
      "id": "a184f1fb-11df-4b53-bd5a-37d9f8a64be7",
      "name": "便签 - 发送到 Telegram",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        1744
      ],
      "parameters": {
        "color": 4,
        "width": 300,
        "height": 428,
        "content": "## 4️⃣ 发送到 Telegram"
      },
      "typeVersion": 1
    },
    {
      "id": "67085e4e-0d9c-4c29-baac-da1779c05d66",
      "name": "便签 - Telegram 设置1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        1936
      ],
      "parameters": {
        "color": 4,
        "width": 248,
        "height": 344,
        "content": "## 1️⃣ 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "b57ae9fa-8690-4544-9ee6-86214b26b87c",
      "name": "便签 - 介绍",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        1552
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 236,
        "content": "# 🌅 每日 AI 灵感 — Telegram + AI/ML API"
      },
      "typeVersion": 1
    },
    {
      "id": "9e4edede-c992-4abc-99cd-15eac550ee71",
      "name": "便签 - 步骤 1 触发器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        1616
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 284,
        "content": "## 1️⃣ 触发器设置 (Telegram / 计划)"
      },
      "typeVersion": 1
    },
    {
      "id": "e113c728-9408-4014-b6a0-1979110a39d5",
      "name": "便签 - 步骤 2 引用",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        1792
      ],
      "parameters": {
        "color": 6,
        "width": 460,
        "height": 296,
        "content": "## 2️⃣ 生成引用 (AI/ML API)"
      },
      "typeVersion": 1
    },
    {
      "id": "987f164a-f000-4538-ad4f-7cc1764c2ec7",
      "name": "便签 - 步骤 3 图像",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        1904
      ],
      "parameters": {
        "color": 6,
        "width": 460,
        "height": 296,
        "content": "## 3️⃣ 创建图像 (AI/ML API — flux-pro)"
      },
      "typeVersion": 1
    },
    {
      "id": "a21f5e8c-6dec-412d-a12f-e6833d4885af",
      "name": "便签 - 步骤 4 发送",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        2096
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 172,
        "content": "## 4️⃣ 发送到 Telegram"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "⏰ Schedule Trigger (Daily)1": {
      "main": [
        [
          {
            "node": "✍️ Generate Quote (AI/ML API)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📩 Receive Telegram Message1": {
      "main": [
        [
          {
            "node": "✍️ Generate Quote (AI/ML API)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "✍️ Generate Quote (AI/ML API)1": {
      "main": [
        [
          {
            "node": "🎨 Generate Image (AI/ML API | flux-pro)2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🎨 Generate Image (AI/ML API | flux-pro)2": {
      "main": [
        [
          {
            "node": "📤 Send to Telegram1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
外部链接
在 n8n.io 查看

分享此工作流