@schamardak/n8n-nodes-vertex-anthropic
v0.1.0
Published
n8n community node: Anthropic Claude chat model via Google Cloud Vertex AI (Model Garden). Wraps @langchain/anthropic with @anthropic-ai/vertex-sdk so Claude models hosted on Vertex AI (e.g. claude-haiku-4-5@20251001 in europe-west1) can be used as a Chat
Maintainers
Readme
@karrierenest/n8n-nodes-vertex-anthropic
n8n community node that exposes Anthropic Claude models hosted on Google Cloud Vertex AI (Model Garden) as a Chat Model sub-node. Lets you use models like claude-haiku-4-5@20251001 in europe-west1 from within an n8n AI Agent — with full tool-calling support — instead of the direct Anthropic API.
Built for the Zoe (KCS Medical) chatbot project to satisfy EU data residency for the LLM call layer (Vertex AI EU regions) while still using Claude.
Why this exists
n8n (as of May 2026) ships two relevant nodes — neither of which can route Anthropic Claude through Vertex AI:
| Node | What it actually does |
|---|---|
| @n8n/n8n-nodes-langchain.lmChatAnthropic | Calls api.anthropic.com directly with an Anthropic API key. No Vertex routing, no Google Cloud auth. |
| @n8n/n8n-nodes-langchain.lmChatGoogleVertex | Calls Vertex AI Gemini endpoints (:generateContent with Gemini schema). Cannot call Anthropic :rawPredict. |
To call Anthropic Claude on Vertex AI from an n8n AI Agent, you need a third node. This package is that node.
Under the hood it composes two officially-supported libraries:
@anthropic-ai/vertex-sdk(Anthropic's official Vertex client) — owns the Vertex-AI HTTP transport, OAuth2 token exchange, region/project routing.@langchain/anthropic— provides the LangChainChatAnthropicclass with fullbindToolssupport. Its documentedcreateClienthook lets us swap the defaultnew Anthropic(...)for anAnthropicVertexinstance, transparently routing every chat call through Vertex.
This is exactly the pattern recommended by LangChain.js' own docs (Custom clients section).
Installation
This package is not published to public npm. Install locally on a self-hosted n8n instance via the n8n custom-nodes volume.
Prerequisites
- Self-hosted n8n (Docker) with
N8N_COMMUNITY_PACKAGES_ENABLED=true - n8n version ≥ 1.50 (for
@n8n/ai-utilities@^0.14compatibility) - Node.js 20+ on the build machine
Build locally
cd tools/n8n-nodes-vertex-anthropic
npm install
npm run build
# → produces dist/Deploy to the n8n Docker host
See DEPLOYMENT.md for the exact copy-paste commands.
Configuration
1. Google Cloud setup
- A GCP project with the Vertex AI API enabled.
- A service account with the role
roles/aiplatform.user(or finer-grained equivalent) on the project. - The Anthropic model(s) you want to use must be enabled in Vertex AI Model Garden for your chosen region.
- A non-zero per-minute quota for the Anthropic-on-Vertex model (Google sets this to 0 by default — file a quota increase request).
2. n8n credential
Use the built-in Google API credential type (already part of n8n; no new credential is shipped by this package). Fill in:
| Field | Value |
|---|---|
| Service Account Email | <sa-email>@<project>.iam.gserviceaccount.com |
| Private Key | The full -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- block from the SA JSON |
| Region | Set the same region as you select in the node (used for n8n internals; the node's own Region field is authoritative for the API call) |
| Set up for use in the HTTP Request node | Optional — but if you turn it on, also set Scopes to https://www.googleapis.com/auth/cloud-platform |
3. Node parameters
- Project ID — your GCP project (e.g.
my-project) - Region — Vertex AI region (e.g.
europe-west1for EU residency) - Model — pick from the curated list of Anthropic models on Vertex (Haiku 4.5, Sonnet 4.5, Sonnet 4, Opus 4.1, Opus 4)
- Options (optional) — Max Tokens, Temperature, Top P, Top K
Usage in an AI Agent
[Chat Trigger / Webhook]
│
▼
[AI Agent] ◀── ai_languageModel ─── [Vertex Anthropic Chat Model]
▲
└── ai_tool ──── [your tools…]Connect the Vertex Anthropic Chat Model node to the AI Agent's ai_languageModel input. Tool-calling, streaming and structured-output features are inherited from LangChain's ChatAnthropic class and work out of the box — Vertex AI is API-compatible with the direct Anthropic API at the message-and-tools layer.
Known limitations (v0.1.0)
- No
gcpProjectsListresourceLocator — the upstreamLmChatGoogleVertexshows a dropdown of GCP projects from the credential's IAM scope. We currently take Project ID as a plain string. (Add later if the n8n SDK exposesProjectsClientaccess cleanly.) - No thinking-mode controls — Vertex-Anthropic supports Claude's extended thinking, but the per-model option-collection differentiation in the upstream node is large. We expose a simple
maxTokens/temperature/topP/topKset; advanced users can patch the source. - No
searchModelslistSearch — model list is hardcoded as of May 2026. Update on each Anthropic-on-Vertex model release. - No region-availability cross-check — the node will let you pick
model: claude-opus-4-1@20250805+region: asia-southeast1even if Anthropic hasn't enabled that combo. Vertex will return a 4xx at runtime — the n8n error message will include the Vertex response. - Manual model availability per region — see https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude#regions for the canonical list.
Development
npm run lint # eslint + n8n-node lint
npm run lint:fix # auto-fix what can be fixed
npm run dev # watch-mode build (n8n-node dev)
npm run build # production build → dist/The build pipeline is the standard @n8n/node-cli (TypeScript → ESLint → produce dist/). No special flags.
License
MIT — see LICENSE.md.
Credits
- Built on the n8n-nodes-starter template.
- Wraps
@anthropic-ai/vertex-sdkand@langchain/anthropic. - Pattern matches LangChain.js' official Vertex example.
