Vertex AI and n8n

Published: Jun 5, 2025 by Isaac Johnson

Last time I showed how to use OpenAI with n8n workflow agent setups to query a google shared calendar. Today, I wanted to dig into Google Vertex AI integration to see how it compares.

We’ll build a simple chat bot but then move on to using some AI tools to help build out a new flow. I’ll compare a few different systems (Copilot, Gemini, Claude, Anthropic Opus) and show how I ultimately built out a fully functional Vertex AI based Chatbot that can search my Github issues and then created new ones based on user feedback via an Agentic AI.

Let’s get started…

Getting started

Let’s start by adding a new workflow

/content/images/2025/05/n8nvertex-01.png

I’ll search for “vertex”. We could add just a Chat trigger and build out an agent that way

/content/images/2025/05/n8nvertex-02.png

But using the “Vertex chat model” set’s up a lot of the steps for us

/content/images/2025/05/n8nvertex-03.png

This brings up a settings page with a drop-down to pick our credential

/content/images/2025/05/n8nvertex-04.png

The next page will need details from a Service Account.

/content/images/2025/05/n8nvertex-05.png

Creating a Service Account

Creating a Service Account and downloading the JSON keys is a pretty easy task. Here I’ll create a new SA, grant some API access and download some fresh JSON keys

I can now add those to the n8n dialogue box

/content/images/2025/05/n8nvertex-07.png

Saving will show a green box if it works

/content/images/2025/05/n8nvertex-08.png

n8n agent setup

We continue with the flow in n8n by picking our project. In my case, it is ‘myanthosproject2’

/content/images/2025/05/n8nvertex-09.png

Lastly, I’ll pick a model. Here I’ll use the new gemini-2.5-pro-preview-05-06 model

/content/images/2025/05/n8nvertex-10.png

At this point I have a basic LLM chain flow with Vertex AI

/content/images/2025/05/n8nvertex-11.png

I can test it with a “Hello” prompt

/content/images/2025/05/n8nvertex-13.png

and see the output in the Agent Details when invoked

/content/images/2025/05/n8nvertex-12.png

n8n with Chat trigger

Let’s delete that all and start fresh. This time, we’ll just add a Chat trigger

/content/images/2025/05/n8nvertex-14.png

I click “+” and the “AI” block

/content/images/2025/05/n8nvertex-15.png

This time I pick an AI Agent

/content/images/2025/05/n8nvertex-16.png

The defaults are fine

/content/images/2025/05/n8nvertex-17.png

But let’s have a bit of fun and expand the options to give a system message. The default is “You are a helpful assistant”.

Let’s change that to

You are an excited assistant named Chuck with a dark past in the mob you often allude to but do not address directly.  You speak with a thick Chicago accent and use appropriate gangster slang. 

/content/images/2025/05/n8nvertex-22.png

Next, I need to set a Chat Model, Memory and Tool

/content/images/2025/05/n8nvertex-18.png

For the chat model, I’ll pick Vertex

/content/images/2025/05/n8nvertex-19.png

And configure the same as before with the gemini-2.5-pro-preview-05-06 model (or whatever is latest at the time you read this post)

/content/images/2025/05/n8nvertex-20.png

Next, I’ll click “+” on memory and just use the built-in “Simple Memory”

/content/images/2025/05/n8nvertex-21.png

Test

Let’s test our flow by clicking “Open Chat”

/content/images/2025/05/n8nvertex-23.png

Not all that useful without data, but kind of fun to engage with:

I asked the question a few times and in different ways but never got back the exact time, just a placeholder

/content/images/2025/05/n8nvertex-25.png

AI to make AI

I came across this YT video about building AI agents with AI agents by Nolan Harper.

There was a lot there and he used a variety of AI agents chained together to get the job done. It made me wonder if we could just get the job done with one or two prompts instead.

I first thought of making a quick straightforward flow of form to email and discord as an example

I would like an n8n workflow JSON that prompts a user for feedback, then emails that to my email (user@example.com) as well as posts to a discord channel and adds a new Github Issue in a repo. You may wish to consult https://docs.n8n.io/ for examples.

/content/images/2025/05/n8nvertex-26.png

I also handed the same prompt to Anthropic’s Claude Opus 4

/content/images/2025/05/n8nvertex-27.png

Lastly, I fed the same prompt to Gemini 2.5 Pro Preview and Claude Sonnet 4 - both in free tier - to see what I can get for free.

/content/images/2025/05/n8nvertex-28.png

Vertex timed out so i nudged it again

/content/images/2025/05/n8nvertex-29.png

Let’s see the results.

Here is the imported Anthropic Claude Opus 4

/content/images/2025/05/n8nvertex-30.png

I’m afraid Vertex with Gemini created a bit of a mess

/content/images/2025/05/n8nvertex-31.png

Claude Sonnet 4 was interesting - valid, but definitely not that of which I requested

/content/images/2025/05/n8nvertex-32.png

And lastly what I got from Gemini 2.5 Pro Preview in the free tier (which wasn’t too bad)

/content/images/2025/05/n8nvertex-33.png

Since the Opus response seemed best, I wanted to first check how hard it was hitting the pocketbook before I went any farther

/content/images/2025/05/n8nvertex-34.png

An AI Driven Flow

My next step was to ask for something a bit more complex

I would like an n8n workflow JSON that starts with a chat and uses an Agent tied to Vertex AI with Simple Memory for Memory and uses Github for a Tool. The desire is to have this agent be able to search Github Issues in a Project to see if any issue exists for a user’s request. If no issue (open or closed) exists that is related, then they may create a new Github Issue. You may wish to consult https://docs.n8n.io/ for examples.

/content/images/2025/05/n8nvertex-35.png

The JSON when imported looks a bit like trash

/content/images/2025/05/n8nvertex-36.png

Let’s try another path. Here I wrote up a basic setup, though I really just linked steps and set credentials. I want the rest to be handled for me.

/content/images/2025/05/n8nvertex-37.png

I put that into the Anthropic Console to get a result

/content/images/2025/05/n8nvertex-39.png

Throwing caution to the wind, I tried it just as it was:

/content/images/2025/05/n8nvertex-40.png

Indeed it did put in the wrong model (gemini-1.5-pro)

/content/images/2025/05/n8nvertex-41.png

I changed that back to gemini-2.5-pro-preview-05-06 and tried again

The next try went WAY better

/content/images/2025/05/n8nvertex-42.png

The error seems to be about labels.map is not a function

I tried just removing those fields and manually invoking that step

/content/images/2025/05/n8nvertex-44.png

But still got the error.

I think I need to inject the following to the Github step

        "labels": [
          {
            "label": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('labels0_Label', ``, 'string') }}"
          }
        ],
        "assignees": [
          {
            "assignee": "idjohnson"
          }
        ]

I figured that out by adding my own new step, downloading the flow and just looking at the difference

/content/images/2025/05/n8nvertex-47.png

To update my existing workflow, I just downloaded the workflow (came down as a new JSON), found the messed up block, added steps and saved.

I then deleted everything in the workflow and imported that updated file.

Now it looks pretty good:

/content/images/2025/05/n8nvertex-45.png

This flow was amazing. Here you can see it in action

I looked to see usage but the numbers seemed fine

/content/images/2025/05/n8nvertex-48.png

The costs (which can take a day to show up) looked to be about 21c for all that I did with Vertex:

/content/images/2025/05/n8nvertex-49.png

That would have included all AI usage for the app and the n8n workflow creation (twice since the first time timed out).

Since I really just want to see the AI part, I’ll do just one flow today and see how that comes out on the bill for June 1st.

And looking the next day, we see it was just US$0.01 for our AI run

/content/images/2025/06/n8nvertex-50.png

Summary

In this blog post, I explored integrating n8n with Google’s Vertex AI to create AI-powered workflows. I started by building a simple n8n based chatbot and then moved on to using AI tools to help construct a new flow. I compared different systems like Copilot, Gemini, Claude, and Anthropic Opus, ultimately creating a fully functional Vertex AI-based chatbot that could search my GitHub issues and create new ones based on user feedback.

I found that combining n8n with Vertex AI significantly simplified AI-driven automation. I prompted various AI models to generate n8n workflows, and while some attempts resulted in messy or incorrect outputs, Anthropic’s Claude Opus 4 performed the best. I was able to create a complex flow that searched GitHub issues and created new ones, though it required some manual tweaking to correct errors in the generated JSON. Despite the initial challenges, the final result worked pretty darn well, and the costs associated with using Vertex AI were negligible.

n8n vertexai ai agent github workflow automation

Have something to add? Feedback? You can use the feedback form

Isaac Johnson

Isaac Johnson

Cloud Solutions Architect

Isaac is a CSA and DevOps engineer who focuses on cloud migrations and devops processes. He also is a dad to three wonderful daughters (hence the references to Princess King sprinkled throughout the blog).

Theme built by C.S. Rhymes