@boazlai/n8n-nodes-vertex-ai
v0.1.0
Published
n8n community nodes for Google Vertex AI: Gemini context caching, batch prediction, GCS, and a chat model sub-node with cached-content support.
Maintainers
Readme
n8n-nodes-vertex-ai
Community n8n nodes for Google Vertex AI:
- Vertex AI (regular node): three resources
- Cache — Create / Get / List / Update TTL / Delete Gemini Context Caches
- Batch — Create / Get / List / Cancel Batch Prediction Jobs (with optional internal polling)
- GCS — Upload / Download / List objects (Vertex-oriented; not a full GCS client)
- Vertex AI Chat Model (sub-node, AI Agent compatible): Gemini chat model with a Cached Content dropdown that lists your existing context caches.
Single credential: Google Vertex Service Account API.
Install
In n8n: Settings → Community Nodes → Install → n8n-nodes-vertex-ai.
Or self-hosted manual install:
cd ~/.n8n/custom
npm install n8n-nodes-vertex-aiCredential setup
Create a service account in your GCP project with:
roles/aiplatform.userroles/storage.objectAdmin(only if you use the GCS resource)
Download the JSON key. In n8n, create a Google Vertex Service Account API credential and fill:
- Service Account Email —
client_emailfrom the JSON. - Private Key —
private_keyfrom the JSON (literal\nis accepted). - Project ID — your GCP project id.
- Location — Vertex region (e.g.
us-central1).
The credential test calls the Vertex publishers endpoint to verify auth.
Cache resource example
Reproduces the standard "cache a PDF for grounding" payload:
- Resource: Cache, Operation: Create.
- Model:
Gemini 2.5 Flash. - Display Name:
Cache_Public_URL_Test. - TTL:
3Hours (or10800Seconds). - System Instruction:
Analyze the provided document to provide context for upcoming chunks. - Contents → Add Content Block (
role: user):- Add Part — Type:
Text, Text:Here is the full document context to be used for grounding subsequent chunks:\n - Add Part — Type:
File (GCS URI), MIME:application/pdf, GCS URI:gs://your-bucket/DFA2025z.pdf
- Add Part — Type:
- Tools → Add Tool → Mode:
Structured→ Function Declaration:- Name:
format_final_json_response - Description: …
- Parameters Schema: paste your OBJECT schema.
- Name:
Batch resource example
- Resource: Batch, Operation: Create.
- Display Name:
Contextual-Chunking. - Model:
Gemini 2.5 Flash. - GCS Source URIs:
gs://your-bucket/vertex-batch-input-1.jsonl. - Output URI Prefix:
gs://your-bucket/batchResults/. - Wait For Completion: ON to block until terminal state (Poll Interval and Timeout reveal).
To poll separately, run Get with the job name returned from Create.
Chat Model with Cached Content
Add the Vertex AI Chat Model node, wire it into an AI Agent's Model port. The Cached Content dropdown is populated from cachedContents.list for the credential's project + location.
Local development
npm install
npm run build
npm run dev # embedded n8n at http://localhost:5678Or copy dist/ into a Docker n8n container:
docker cp dist/ n8n:/home/node/.n8n/custom/node_modules/n8n-nodes-vertex-ai/dist/
docker compose restart n8nLicense
MIT
