Poll Multiple Gmail Accounts with Unified Data Table Storage & Discord Notifications

This template lets you poll multiple Gmail accounts from a single workflow using n8n’s credential-aware execution. Instead of creating separate workflows for every inbox, this setup loops through all accounts stored in your data table and runs Gmail operations dynamically using the correct OAuth2 credential.

It’s built for cases like cold-email systems, multi-client mail monitoring, or anything that needs centralized polling and logging.

What It Does

Pulls all email account records from the cold_email_accounts table.

For every account, the workflow:

Runs the Gmail “Get Many Messages” node for that account using "Run Node With Credentials X" community node.

Messages are reformatted into a clean JSON object (from, subject, preview text, body, labels, attachments, etc.).

Saved into the All Emails table using an upsert (avoids duplicates).

Sends a Discord notification like “15 new emails arrived”.

How to Set It Up

Create Gmail OAuth2 credentials in n8n, one for each email account you want to poll.

Add those credentials into a Data Table named cold_email_accounts with columns: cred_id credentials_name email last_polled (datetime)

Import this workflow template into n8n.

Update: DataTable references (if your names/IDs differ) Discord channel/server IDs Any domain filters inside the Gmail search query

Activate the workflow and it will automatically: Poll each Gmail inbox every hour Save all new emails Notify you on Discord Keep everything synced via last_polled.

0
Downloads
0
Views
7.32
Quality Score
beginner
Complexity
Author:Jatin Khatri(View Original →)
Created:12/19/2025
Updated:1/20/2026

🔒 Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments