Using gemini as chat model to read gmail but not getting results

Instead, the output from the chat model is “I AM SORRY, I DO NOT HAVE THE CAPABILITY TO ACCESS YOUR EMAILS. I NEED MORE INFORMATION TO COMPLETE YOUR REQUEST.” or something similar. Gmail node appears to be connected (although I was only given the “Sign in With Google” option, so no Client ID or Client Secret windows were made available for credentials) and I’m using Gemini 1.5 flash latest. Thanks in advance for your help. I’m very new at this.

@frednitwo
Gemini (or any chat model) does not automatically gain access to your Gmail data, even if you’ve authenticated the Gmail API. Here’s what’s going on:

  1. “Sign in with Google” only authorizes the Gmail node, not the chat model.
  2. Gemini needs to be provided with the actual email content as input — it doesn’t pull it by itself.
  3. The response “I’m sorry, I don’t have the capability…” is Gemini telling you it wasn’t given enough context.
1 Like

You need to manually feed email content from Gmail into the Gemini model.

1- Use Gmail Node to fetch unread emails or list messages (e.g., Get Messages).
2- Format the Email Content, convert it to string.
3- Pass the formatted string as a prompt to Gemini 1.5 Flash, asking for the desired action (e.g., summarize, extract dates, reply).

Thanks for taking the time to consider my question and respond. I’ve attached some screenshots of my workflow (if there’s an easier way to communicate, please let me know).




I was following along this instructional video with the difference being I’m using Gemini as the model instead of anthropic.

The video doesn’t mention anything about formatting the email content, converting to string, etc. So I’m missing some major steps in my workflow?

1 Like

@frednitwo
When you test the workflow, does the Gmail Get All messages node return your emails?

It says “Workflow executed successfully.”

I’ve substituted the Gemini Chat model with the OpenAI Chat model (as suggested in the video) and now it works. Not sure why one works and the other does not, I guess Gemini just doesn’t have the same capabilities as OpenAI wrt email reading. Anyway, thanks again for you feedback.

1 Like
  1. Use a Gmail node to fetch email content first
    Make sure you’re using a Gmail > Read Email (or similar) node before the Gemini node, and set it to retrieve the message body you want to analyze.

  2. Pass the email data into Gemini’s prompt
    In the Gemini node, reference the content from the Gmail node like this in your prompt:
    Here’s an email I received: {{$json[“body”]}}
    Can you summarize it?

Sorry, I don’t understand your instructions. There is no prompt window in the Gemini node in n8n as far as I can tell.

Hi, think I can help.

Can you share your workflow? Here is a guide.

n8n attach workflow

Hi Grot, this is the workflow which does not work:

When I replace the Gemini Chat with OpenAI Chat, it works fine when I ask the agent to output information on unread emails (for example).

Oh I see. I think the reason is just that geminI 1,5 is a bad model. The tool usage is called by the LLM.

So you can add to the system prompt ore user message to always call the tool. Which I recommend you to do.

Also switch the model to this one. It’s much better. “models/gemini-2.5-flash-preview-04-17”

Thanks! Changing to Gemini-2.5 worked. Not as well as OpenAI but can at least retrieve emails now.

Glad to hear it.

Also I recommend looking over this function calling benchmark. Currently the Open AI models top the list.

Regards