Skip to main content

Send bulk email campaigns with Gmail/SMTP and Postgres reputation-safe timing

Workflow preview

Workflow preview
100%
Send bulk email campaigns with Gmail/SMTP and Postgres reputation-safe timing preview
Open on n8n.io

1. Workflow Overview

Overview This workflow automates bulk email campaigns with built in validation, deliverability protection, and smart send time optimization. It processes CSV leads, validates emails, enriches data,...

Best for

  • Social Media automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.extractfromfile, n8n-nodes-base.splitout, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.httprequest, n8n-nodes-base.postgres

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by ResilNext.

Original n8n.io source

1.1 Workflow description

Title
Send bulk email campaigns with Gmail/SMTP and Postgres reputation-safe timing
Workflow name
Send bulk email campaigns with Gmail/SMTP and Postgres reputation-safe timing

Overview

This workflow automates bulk email campaigns with built-in validation, deliverability protection, and smart send-time optimization.

It processes CSV leads, validates emails, enriches data, and schedules campaigns intelligently. Emails are sent using controlled inbox rotation, while engagement tracking and analytics continuously improve performance.


How It Works

  1. Campaign Input Receives campaign data and CSV leads via webhook.

  2. Lead Processing Extracts CSV data, splits leads, and validates email format.

  3. Domain & Quality Checks Verifies domains using MX records and filters invalid leads.

  4. Lead Enrichment Adds timezone, domain type, and engagement score for better targeting.

  5. Lead Storage Stores valid leads and separates invalid ones for tracking.

  6. Campaign Execution Scheduler fetches active campaigns and selects top leads.

  7. Send Optimization Calculates best send time per lead based on timezone and historical performance, while selecting inboxes within sending limits.

  8. Email Delivery Waits until optimal time and sends emails using selected inbox.

  9. Tracking & Logging Logs sent emails and updates inbox usage statistics.

  10. Event Tracking Captures opens, clicks, replies, and bounces via webhook.

  11. Performance Analytics Updates campaign stats and analyzes engagement trends.

  12. Continuous Optimization Updates send-time rules to improve future campaign performance.


Setup Instructions

  • Connect webhook for campaign and CSV upload
  • Configure send limits, delays, and MX API
  • Set up Postgres with required tables
  • Connect Gmail or SMTP for sending
  • Configure event webhook for tracking
  • Enable campaign and analytics schedulers
  • Test with sample campaign before activating

Use Cases

  • Running cold email campaigns at scale
  • Improving email deliverability and sender reputation
  • Automating lead validation and enrichment
  • Optimizing send times based on engagement data
  • Managing multi-inbox outbound systems

Requirements

  • n8n instance with webhook support
  • Postgres database
  • Gmail or SMTP email account(s)
  • MX record lookup API (e.g., Google DNS)
  • Email tracking system or webhook integration

Notes

  • Inbox rotation and throttling help prevent spam and protect reputation.
  • Engagement-based lead scoring improves campaign performance.
  • Send-time optimization is continuously refined using real data.
  • You can extend this workflow with personalization or AI-generated emails.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Campaign Upload Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 2 - Workflow Configuration

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Extract CSV Leads

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1.1

Block 4 - Split Leads

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 5 - Validate Email & Extract Domain

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Is Email Valid?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 7 - Check Domain MX Records

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 8 - Enrich Lead Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Store Valid Lead

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 10 - Store Invalid Lead

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 11 - Campaign Scheduler

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 12 - Get Pending Campaigns

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 13 - Split Campaigns

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 14 - Get Campaign Leads

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 15 - Split Campaign Leads

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 16 - Calculate Send Time & Select Inbox

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Wait Until Send Time

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 18 - Send Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 19 - Log Send Event

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 20 - Update Inbox Stats

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 21 - Email Event Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 22 - Parse Event Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 23 - Log Email Event

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 24 - Update Performance Stats

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Showing the first 24 of 45 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Send bulk email campaigns with Gmail/SMTP and Postgres reputation-safe timing
Complexity advanced
Nodes 45
Categories Social Media
Author ResilNext
Published 23 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14275/14275.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Send bulk email campaigns with Gmail/SMTP and Postgres reputation-safe timing do?

Overview This workflow automates bulk email campaigns with built in validation, deliverability protection, and smart send time optimization. It processes CSV leads, validates emails, enriches data,...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media use case.