快来看,n8n更新了!使用Gemini 4 Argon构建n8n工作流:MCP、助手与代理

qimuai 发布于 阅读:36 一手编译

快来看,n8n更新了!使用Gemini 4 Argon构建n8n工作流:MCP、助手与代理

内容来源:https://blog.n8n.io/build-n8n-workflows-with-gemini-4-argon-mcp-the-assistant-and-agents/

内容总结:

谷歌近日发布Gemini 4 Argon模型,n8n成为首批集成该模型的公司之一。用户可在现有n8n工作流中使用该模型,也可借此构建新工作流。谷歌同步公布了相关基准测试结果。

n8n提供了三种在平台内使用Gemini 4 Argon的方式。

第一,通过模型上下文协议(MCP)在常用AI工具中构建工作流。MCP是由智能体AI基金会(AAIF)管理的开放标准,允许AI工具连接外部应用和数据源。n8n内置MCP服务器,兼容任何MCP客户端。用户只需在n8n实例中开启实例级MCP,再将服务器URL添加到兼容工具中即可,支持一键设置和OAuth登录或API密钥认证。例如,用户可在IDE中直接让AI代理构建一个捕获新注册用户、写入CRM并发送Slack欢迎消息的n8n工作流,全程由AI完成搭建和测试,发布前会请求人工确认。

第二,在n8n Assistant中使用自带密钥(BYOK)。n8n Assistant是一款基于聊天的智能体,可用自然语言构建、编辑、测试和调试工作流。自托管用户需自行提供密钥并决定数据和模型调用路径,将密钥填入实例设置即可。目前Assistant尚无原生Gemini选项,可通过OpenRouter或谷歌的OpenAI兼容端点接入。n8n Cloud用户无需设置,Assistant使用n8n Assistant积分运行,其构建的工作流可通过Gateway积分使用Gemini 4 Argon。

第三,使用n8n Agent让AI承担工作流中的复杂判断。在n8n中设置Agent并选用Gemini 4 Argon作为推理模型,接入允许使用的工具(任意节点、API或子工作流),可选添加记忆以保持上下文。Agent会自行决定调用哪个工具、循环执行并在任务完成后停止。Gemini 4 Argon从发布起即可作为Agent模型使用,也可在独立的Google Gemini节点中使用。n8n Cloud用户还可通过Gateway积分使用,无需单独提供商账户或额外计费。

n8n表示,这三种方式分别适用于不同场景:通过MCP在AI工具内构建工作流、通过BYOK让Assistant配合最新模型工作、或通过Agent让工作流自行处理判断性任务。

中文翻译:

Gemini 4 Argon 刚刚发布,n8n 是最早使用并集成该模型的公司之一。来看看如何在你现有的 n8n 工作流中使用它,以及如何构建新的工作流。以下是 Google 公布的基准测试数据:
基准测试数据由 Google 提供。来源:Gemini 4 Argon 发布公告。
模型上下文协议(MCP)——用你最喜欢的 AI 工具,借助 Gemini 来构建工作流
MCP 是一项由智能体 AI 基金会(AAIF)管理的开放标准,允许你的 AI 工具连接外部应用和数据源。n8n 内置了 MCP 服务器,兼容任何 MCP 客户端,你可以利用它在你最喜欢的 AI 工具中构建自己的工作流。你只需要在你的开发工具中能访问 Gemini 4 Argon,再加上一个你想构建什么的点子就够了!
设置只需几分钟。在你的 n8n 实例中开启实例级 MCP,然后将你的服务器 URL 添加到任何兼容 MCP 的工具中——无论是聊天应用、编码智能体还是 IDE。许多工具支持一键设置,并通过 OAuth 登录或使用 API 密钥。
使用示例:你正在 IDE 中开发一个新的注册表单,Webhook 已经就绪。你在智能体中输入一个问题:“帮我构建一个 n8n 工作流,从这个 Webhook 接收新注册用户,把他们写入我们的 CRM,并在 Slack 中发送欢迎消息。”一分钟后,工作流就出现在你的 n8n 工作区中,构建并测试完毕。它不会直接发布,而是先征求你的确认,让你始终保持在回环中。
为 n8n Assistant 自带密钥(BYOK)
n8n Assistant 是一个基于聊天的智能体,可以用自然语言构建、编辑、测试和调试工作流。BYOK 意味着它运行在你已有的 AI 提供商账户上,而不是系统为你选择的模型。如何启用取决于你的 n8n 实例部署在哪里。
在自托管环境中,你自己提供密钥,并决定数据和模型调用发往何处。你只需将密钥填入实例设置一次,Assistant 就会在该模型上运行。一个账户、一个模型、一个上下文。Assistant 目前还没有原生的 Gemini 选项,所以你需要通过 OpenRouter 或 Google 的 OpenAI 兼容端点(基础 URL:https://generativelanguage.googleapis.com/v1beta/openai/)来接入 Gemini。
在 n8n Cloud 上,无需任何设置。Assistant 使用 n8n Assistant 积分运行,它构建的工作流可以通过 Gateway 积分使用 Gemini 4 Argon。
n8n Assistant 如何为你所用
Assistant 是一个基于聊天的智能体,可以用自然语言构建、编辑、测试和调试工作流。启用方式同样遵循上述两种路径。
在自托管环境中,你只需将密钥填入实例设置一次,Assistant 就会在该模型上运行。一个账户、一个模型、一个上下文。
在 n8n Cloud 上,无需任何设置。Assistant 使用 n8n Assistant 积分运行,它构建的工作流可以通过 Gateway 积分使用 Gemini 4 Argon。
n8n Agent——让 AI 在你的工作流中挑大梁
智能体本质上就是给模型一个目标和一套工具,它自己会想出达到目标的步骤。
在 n8n 中,你可以设置一个智能体,并使用 Gemini 4 Argon 这样的模型来进行思考。接入它被允许使用的工具(任何节点、API 或子工作流),还可以选择性地添加记忆来保持上下文。之后,智能体会自行决定下一步调用哪个工具、循环执行,直到任务完成。Gemini 4 Argon 从发布起就作为模型可用于你的 Agent,也可在独立的 Google Gemini 节点中使用。在 n8n Cloud 上,你还可以通过 Gateway 积分使用它,无需单独的提供商账户或额外计费。了解 AI 智能体在 n8n 中的工作原理:https://n8n.io/ai-agents/
为什么要费这个劲?僵化的、一步一步的工作流一旦遇到杂乱输入就会崩溃。智能体可以吸收那些需要判断的环节,周围的工作流保持可预测,同时你仍然可以严格限定它能触及哪些工具。
使用示例:假设你收到一封支持邮件。智能体读取邮件,从 CRM 中调取客户记录,再交叉参考你的帮助文档。它起草回复、设置工单优先级,或者在 Slack 中标记提醒让人来处理。
总结
以上只是你在 n8n 中使用 Google Gemini 4 Argon 模型构建工作流的三种方式。无论你是通过 n8n MCP 在你最喜欢的 AI 工具中构建工作流,还是使用自己的 API 密钥配合 n8n Assistant 让最新模型与你并肩工作,抑或是使用 Agent 让工作流来处理那些需要判断的环节,从而让你不必亲力亲为。
选最适合你的方式就好!祝你构建愉快。
想看看实际效果?观看 Gemini 4 Argon 在 n8n Assistant 中的演示:https://go.n8n.io/Hn2UxP

英文来源:

Gemini 4 Argon just dropped, and n8n is one of the first companies to use and integrate the model. Check out how you can use it with your existing n8n workflows and how to build new ones. Here are the benchmarks Google published:
Benchmarks reported by Google. Source: Gemini 4 Argon announcement.
Model Context Protocol (MCP) - Use Gemini to build workflows from your favourite AI tool
MCP is an open standard governed by the Agentic AI Foundation (AAIF) that allows your AI tools to connect to external applications and data sources. n8n has a built in MCP server that works with any MCP client that you can utilize to build your own workflows from your favourite AI tool. All you need for this is access to Gemini 4 Argon in your developer tool and an idea of what you want to build!
Setup only takes a couple of minutes. Turn on instance-level MCP in your n8n instance, then add your server URL to any MCP-compatible tool, whether that’s a chat app, a coding agent or an IDE. Many tools support one-click setup and sign in with OAuth or use an API key.
Example use case: You're in your IDE building out a new signup form and the web hook is ready. You pop a question into your agent: "Build me an n8n workflow that catches new signups from this webhook, drops them into our CRM, and fires off a welcome message in Slack." A minute later it's there in your n8n workspace, built and tested. It stops short of publishing and asks first, keeping you as the human, in the loop.
Bring Your Own Key (BYOK) to the n8n Assistant
The n8n Assistant is a chat-based agent that builds, edits, tests, and debugs workflows from plain language. BYOK means it runs on an AI provider account you already hold, rather than a model picked for you. How you get it running depends on where your n8n instance lives.
On self-hosted, you supply the key yourself and decide where your data and model calls go. You drop your key into the instance's settings once, and the Assistant runs on that model. One account, one model, one context. The Assistant doesn't have a native Gemini option yet, so you reach Gemini through OpenRouter or through Google's OpenAI-compatible endpoint (base URL: https://generativelanguage.googleapis.com/v1beta/openai/).
On n8n Cloud, there's nothing to set up. The Assistant runs on n8n Assistant credits, and the workflows it builds can use Gemini 4 Argon through Gateway credits.
Where the n8n Assistant fits in for you
The Assistant is a chat-based agent that builds, edits, tests, and debugs workflows from plain language. How you get it running follows the same split.
On self-hosted, you drop your key into the instance's settings once, and the Assistant runs on that model. One account, one model, one context.
On n8n Cloud, there's nothing to set up. The Assistant runs on n8n Assistant credits, and the workflows it builds can use Gemini 4 Argon through Gateway credits.
n8n Agent - let AI do the heavy lifting in your workflow
An agent is just a model handed a goal and a toolkit. It figures out the steps to get there on its own.
In n8n, you set up an agent and use a model such as Gemini 4 Argon for the thinking. Plug in the tools it's allowed to use (any node, API, or sub-workflow), and optionally add memory so it keeps context. From there, the agent decides which tool to call next, loops, and stops when the task is done. Gemini 4 Argon is available as a model for your Agents and in the standalone Google Gemini node from launch. On n8n Cloud you can also use it through Gateway credits, so you don't need a separate provider account or extra billing. Check out how AI agents work in n8n: https://n8n.io/ai-agents/
Why bother? Rigid, step-by-step workflows fall apart the moment input gets messy. An agent absorbs the judgment calls, the surrounding workflow stays predictable, and you still draw a hard line around which tools it can reach.
Example use case: Let’s say you have an incoming support email. The agent reads it, pulls the customer record from your CRM and then cross-references your help docs. It drafts a reply, sets the ticket priority, or drops a flag into Slack for a human to handle.
Wrap up
This is just three ways you can use the Google Gemini 4 Argon model in n8n to build your workflows. Whether you're using it via the n8n MCP to build workflows from inside your favourite AI tool, using your own API key with the n8n Assistant to get the latest model working alongside you, or using an Agent to have the workflow handle judgement calls so you don’t have to.
Pick the one that works best for you! Happy building.
Want to see it in action? Watch Gemini 4 Argon in the n8n Assistant: https://go.n8n.io/Hn2UxP

n8n

文章目录


    扫描二维码,在手机上阅读