8
n8n 中文网amn8n.com

基于Gemini和随机单词API的Telegram英语词汇机器人

中级

这是一个Miscellaneous, Multimodal AI领域的自动化工作流,包含 6 个节点。主要使用 Set, Telegram, Aggregate, HttpRequest, ScheduleTrigger 等节点。 使用Gemini和随机单词API为Telegram创建英语词汇机器人

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "783d2046f405cc6ecb20ef185376ed1023323a3da628b9d8156b1fb75c75e037",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "4e12712b-5541-41e4-9cf5-181aed2682ed",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 3
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8a025bc9-489d-4448-944d-652bfc2baf77",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        208,
        0
      ],
      "parameters": {
        "url": "https://random-word-api.vercel.app/api?words=3",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "fb88b57f-7c18-431e-8d4b-429253803433",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        624,
        0
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "word"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e7b00fe8-0a71-4e00-af8f-703887170dde",
      "name": "编辑字段",
      "type": "n8n-nodes-base.set",
      "position": [
        416,
        0
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"word\": \"{{ $json }}\"\n}\n"
      },
      "typeVersion": 3.4
    },
    {
      "id": "eae51ae4-cfd4-4d5a-b522-1c55bcce4863",
      "name": "消息模型",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        832,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-1.5-flash",
          "cachedResultName": "models/gemini-1.5-flash"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=You are a vocabulary-summarizing AI. Please write a vocabulary digest message using the provided English words, including: the English word, the Vietnamese meaning, and one example sentence that contains that English word.\nToday's vocabulary list:\n{{ $json.word }}"
            }
          ]
        }
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Atcc45Iqep6u15qs",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "97be971a-7304-4f6d-9b68-f2c1c8b90363",
      "name": "发送文本消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1184,
        0
      ],
      "webhookId": "947f3fe3-d410-41f5-8340-247dbfeee897",
      "parameters": {
        "text": "={{ $json.content.parts[0].text }}",
        "chatId": "xxxxx",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "Pq1cc0nSnbtjpiPv",
          "name": "learn_english_bot"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "pinData": {},
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 杂项, 多模态 AI

需要付费吗?

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

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

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

作者
Cong Nguyen

Cong Nguyen

@cong-nguyen

I’m a developer specialized in building web and mobile applications with AI integration and intelligent automation. With a solid background in data science, I help businesses build smarter digital solutions using cutting-edge technologies.

外部链接
在 n8n.io 查看

分享此工作流