
n8n Gmail Trigger: Watch Inbox for New Emails & Send Replies (2026 Setup Guide)
Quick Summary
- •The n8n Gmail Trigger polls your inbox and fires on new matching emails - not a webhook, so expect up to 60s delay
- •Google OAuth2 setup requires adding your email as a Test User in Google Cloud Console or the 403 error will block you
- •Use a Filter node after the trigger for sender/subject filtering - the trigger itself only supports label and read-status filters
- •Test mode requires you to send a real email after clicking Listen - it does not poll automatically
- •Synta can generate complete Gmail automation workflows from plain English descriptions
If you want n8n to react to incoming emails, the n8n Gmail Trigger is where every email automation workflow starts. Whether you are routing support tickets, processing lead notifications, or auto-replying to inquiries, getting the Gmail Trigger wired up correctly is step one. This guide covers setup from scratch, including the OAuth2 credential dance that trips up most people.
What the n8n Gmail Trigger Does (and What It Doesn't)
The Gmail Trigger node polls your Gmail inbox at a set interval and fires whenever a new email matches your criteria. It is not a webhook - it uses polling (every minute by default in production, or on-demand in test mode). That matters because:
- There is a small delay between email arrival and trigger execution (up to 60 seconds)
- You can filter by label, sender, or subject to avoid processing every single email
- It pulls full message data including body, headers, and attachment metadata
What it does not do:
- It does not send replies on its own (you need a separate Gmail node for that)
- It cannot filter by complex regex on the subject line in the node itself (handle that in a Filter node downstream)
- It will not trigger on emails you send - only received messages
Prerequisites: Google OAuth2 Setup in n8n
Before touching the Gmail Trigger node, you need a working Google OAuth2 credential. This is where 80% of setup problems originate.
Step 1 - Create a Google Cloud Project
- Go to console.cloud.google.com and create a new project (or select an existing one)
- Navigate to APIs & Services > Library
- Search for "Gmail API" and click Enable

Step 2 - Configure the OAuth Consent Screen
- Go to APIs & Services > OAuth consent screen
- Choose External (unless you are on Google Workspace)
- Fill in required fields: App name, user support email, developer contact
- Under Scopes, add: https://www.googleapis.com/auth/gmail.modify (covers read + send)
- Add your email address as a Test user - critical, without this the OAuth flow will fail with a 403
Step 3 - Create OAuth2 Credentials
- Go to APIs & Services > Credentials > Create Credentials > OAuth client ID
- Choose Web application
- Under Authorized redirect URIs, add your n8n callback: https://your-n8n-domain.com/rest/oauth2-credential/callback (or the n8n Cloud equivalent)
- Copy the Client ID and Client Secret
Step 4 - Add the Credential in n8n
- In n8n, go to Settings > Credentials > Add credential
- Search for "Google OAuth2 API" and paste your Client ID and Client Secret
- Set the scope to: https://www.googleapis.com/auth/gmail.modify
- Click Connect and complete the Google authorization flow in the popup
Setting Up the Gmail Trigger Node
Once your credential is connected, add a Gmail Trigger node to your workflow. Click + to add a node, search "Gmail Trigger", then select your Google OAuth2 credential. Configure the polling settings based on your use case: Poll Times (every 1 minute by default), Label IDs set to INBOX, Read Status to Unread, and toggle on Include Attachments only if needed.
To filter by sender, skip trying to do it inside the Gmail Trigger itself. Instead, add an IF or Filter node after the trigger with condition {{ $json.from }} contains your target domain or address.
Common Setup Errors and How to Fix Them
Most Gmail Trigger issues fall into three categories. Here is what to do:
- 403 access_denied during OAuth: Add your email under OAuth consent screen > Test Users
- invalid_client error: Wrong Client ID/Secret - re-copy credentials from Google Cloud Console
- insufficient authentication scopes: Delete credential, recreate with gmail.modify scope, and re-authorize
- Trigger fires but no data: Test mode does not poll - click Listen for event then send a real email immediately
- Trigger stops firing in production: OAuth token expired - re-authorize the credential in n8n Settings
- No emails being picked up: Ensure emails are unread OR remove the Read Status filter entirely
Test Mode vs Production Mode
This trips up everyone on first setup. In test mode (when you click "Test step"), the node does not poll - it waits for you to send a real email. Click "Test step", then immediately send a test email to your inbox. The node will capture it and show the output. Do not click it and wait five minutes wondering why nothing happened. In production mode, with the workflow active, polling runs automatically at your configured interval with no manual interaction needed.
Building a Reply Workflow: Gmail Trigger to AI to Send Reply
Here is a complete pattern for building an AI-powered auto-reply system:

Node-by-Node Setup
Step 1 - Gmail Trigger: Configure as described above (INBOX + Unread labels).
Step 2 - Filter node: Skip no-reply addresses ({{ $json.from }} does not contain noreply) and your own email address.
Step 3 - AI processing node: Use OpenAI Chat Model or Anthropic. System prompt: "You are a helpful assistant responding to emails on behalf of [Name]. Keep responses professional and concise." Pass subject, from, and body text from the trigger output.
Step 4 - Gmail node (send reply): Use Operation: Reply. Pass the original message ID from the trigger: {{ $('Gmail Trigger').item.json.id }}. n8n handles threading headers automatically when you use the Reply operation.
Step 5 - Gmail node (mark as read, optional): Use Operation: Mark as Read with the same message ID to prevent reprocessing.
Scaling and Performance Considerations
Rate limits: Gmail API allows 250 quota units per user per second. Each message read costs 5 units. For most use cases this is fine, but if you are processing hundreds of emails per minute, add a Wait node to pace execution.
Deduplication: Gmail Trigger tracks processed message IDs. In rare cases (n8n restart, database reset), it may reprocess recent emails. Add a Supabase or Postgres check if idempotency is critical.
Attachment handling: If you enable attachments, the node returns base64-encoded data. For large files, only enable attachments when your filter criteria indicate the email has one.
Generate Gmail Automation Workflows from Plain English with Synta
Setting up the Gmail Trigger manually works, but describing your email automation in plain English is faster. Synta lets you say something like "watch my inbox for emails from clients, extract action items using AI, and send a summary to Slack" - and it generates the complete n8n workflow for you.
The AI copilot handles node selection, credential wiring (it knows Gmail requires OAuth2), filter logic, and error handling. For Gmail-heavy workflows like auto-responders, email-to-task pipelines, and digest builders, this cuts setup time from an hour to under five minutes. The self-healing validation catches common wiring mistakes before you run the workflow live.
FAQ
Why is my n8n Gmail Trigger not firing in production?
The most common causes are an expired OAuth token (re-authorize in Settings > Credentials), the workflow is paused (check the active toggle), or all matching emails are already marked as read. Check Executions to see if the trigger is polling but finding zero results.
Can the n8n Gmail Trigger watch multiple email accounts?
Yes - create separate Gmail OAuth2 credentials for each account, then run parallel workflows or use multiple Gmail Trigger nodes in the same workflow with different credentials. Each credential maps to one Gmail account.
How do I filter emails by subject in the Gmail Trigger?
The trigger node does not support subject filtering natively. Poll all unread emails from INBOX, then add a Filter node after the trigger with condition {{ $json.subject }} contains your keyword.
What is the minimum polling interval for the Gmail Trigger?
One minute is the minimum in n8n. If you need near-real-time processing, consider using Gmail's push notifications via Google Cloud Pub/Sub instead - this requires an HTTP Webhook trigger and more advanced setup, but delivers emails within seconds.
Can I trigger on emails I send, not just receive?
The Gmail Trigger watches received messages only. To trigger on sent emails, poll the SENT label: set Label IDs to SENT in the trigger configuration.