Basic Automatic Gmail Email Labelling with OpenAI and Gmail API

Gmail trigger Poll Gmail every x minutes, trigger when a new email is received. - Gmail API

Workflow Structure (9 nodes)
100%
Gmail Trigger
Gmail Trigger
Wait
Wait
Langchain.agent
Gmail labelling agent
Langchain.lm Chat Open Ai
OpenAI Chat Model1
Langchain.memory Buffer Window
Window Buffer Memory
Gmail Tool
Gmail - read labels
Gmail Tool
Gmail - get message
Gmail Tool
Gmail - add label to message
Gmail Tool
Gmail - create label
Node Types:
trigger
default
Requires credentials

Prerequisites

Required Credentials (2)

Gmail

Used by: Gmail Trigger, Gmail - read labels +3 more

Docs

OpenAI

Used by: OpenAI Chat Model1

Docs

Complexity

Moderate

Some experience helpful. Multiple integrations or logic.

Setup time: ~25 min
Score: 29/100

When to Use This Workflow

Streamline Team Communication

Automatically route notifications and updates to the right channels and people.

Reduce information overload while keeping everyone informed.

Email Automation

Automate email responses, forwarding, or organization based on rules.

Handle routine email tasks automatically and focus on what matters.

Real-time Response

React instantly when events happen - new orders, form submissions, or API calls.

Zero delay between trigger and action for time-sensitive workflows.

workflow.json
{
  "nodes": [
    {
      "id": "2a41e2da-19f7-4c31-ab93-3a534db3179e",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -360,
        -260
      ],
      "parameters": {
        "filters": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyX",
              "unit": "minutes",
              "value": 5
            }
          ]
...

Workflow Details

Nodes
13
Trigger
Event
Source
awesome
Added
Dec 4, 2025

Need Help?

Check out the official n8n documentation for detailed guides.

Related Workflows

Angie, Personal AI Assistant with Telegram Voice and Text

Process Telegram Request

Googlecalendartool
Memorybufferwindow
Gmailtool
Lmchatopenai
15 nodesEvent
Curated

Agentic Telegram AI bot with LangChain nodes and new tools

Generate an image with Dall-E-3 and send it via Telegram

Lmchatopenai
Memorybufferwindow
Telegram
Telegramtool
8 nodesEvent
Curated

Telegram AI Langchain bot

Generate an image with Dall-E 3 and send it via Telegram

Lmchatopenai
Memorybufferwindow
Telegram
Executeworkflow
12 nodesEvent
Curated

Telegram AI multi-format chatbot

Receive and pre-process messages

Lmchatopenai
Memorybufferwindow
Telegram
Openai
15 nodesEvent
Curated

🤖🧠 AI Agent Chatbot + LONG TERM Memory + Note Storage + Telegram

Retrieve Long Term Memories Google Docs

Chat
Lmchatopenai
Memorybufferwindow
Googledocstool
21 nodesEvent
Curated

Building Your First WhatsApp Chatbot

1. Download Product Brochure PDF [Read more about the HTTP Request Tool](https://docs.n8n.io/integrations/builtin/core-n...

Whatsapp
Lmchatopenai
Memorybufferwindow
Toolvectorstore
28 nodesEvent
Curated