{
  "name": "Send bulk email campaigns with Gmail/SMTP and Postgres reputation-safe timing",
  "nodes": [
    {
      "id": "cd37d46a-f769-458d-b7f5-7019f777ea06",
      "name": "Campaign Upload Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1344,
        96
      ]
    },
    {
      "id": "9fc5e2b2-6dab-4abe-bd8c-a62462f5a72e",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -1168,
        96
      ]
    },
    {
      "id": "3952be89-1a72-4ec4-832e-af07b5116b2c",
      "name": "Extract CSV Leads",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -896,
        96
      ]
    },
    {
      "id": "5808ce88-41d3-421b-a8ca-64345c6cdcd5",
      "name": "Split Leads",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -672,
        96
      ]
    },
    {
      "id": "1ac2e8a4-ca32-4fe6-b0ae-3e31787a4d11",
      "name": "Validate Email & Extract Domain",
      "type": "n8n-nodes-base.code",
      "position": [
        -496,
        96
      ]
    },
    {
      "id": "c1868399-326e-4b25-8885-7e0361716bd3",
      "name": "Is Email Valid?",
      "type": "n8n-nodes-base.if",
      "position": [
        -224,
        96
      ]
    },
    {
      "id": "8f9fff06-c9ec-4231-b7fc-9fe49848da31",
      "name": "Check Domain MX Records",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        96,
        0
      ]
    },
    {
      "id": "0cd57923-f1a2-48ec-af11-1a9ab4bfa27c",
      "name": "Enrich Lead Data",
      "type": "n8n-nodes-base.code",
      "position": [
        448,
        0
      ]
    },
    {
      "id": "30771931-e4b9-446c-8fd4-9168fb388209",
      "name": "Store Valid Lead",
      "type": "n8n-nodes-base.postgres",
      "position": [
        672,
        0
      ]
    },
    {
      "id": "be00b299-c935-4b8a-a08d-b3d6e09eacef",
      "name": "Store Invalid Lead",
      "type": "n8n-nodes-base.postgres",
      "position": [
        96,
        208
      ]
    },
    {
      "id": "5efbf8aa-2368-452d-911c-2fc5504be140",
      "name": "Campaign Scheduler",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1344,
        688
      ]
    },
    {
      "id": "f431a43a-4712-4436-9c43-e31f6cfdd3dc",
      "name": "Get Pending Campaigns",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -1152,
        688
      ]
    },
    {
      "id": "1913e611-eae0-4555-9750-3b33b86413d6",
      "name": "Split Campaigns",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -896,
        688
      ]
    },
    {
      "id": "3b96f62b-f494-45ed-a286-f6f520bf9413",
      "name": "Get Campaign Leads",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -672,
        688
      ]
    },
    {
      "id": "bc92f362-f8a6-4372-ae89-2860bd776c9c",
      "name": "Split Campaign Leads",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -464,
        688
      ]
    },
    {
      "id": "7a980288-ec94-4bd1-8e58-4c2b0134e1a1",
      "name": "Calculate Send Time & Select Inbox",
      "type": "n8n-nodes-base.code",
      "position": [
        -288,
        688
      ]
    },
    {
      "id": "c2ed8ee4-96e1-4867-961a-31c1f22d2310",
      "name": "Wait Until Send Time",
      "type": "n8n-nodes-base.wait",
      "position": [
        0,
        688
      ]
    },
    {
      "id": "40b97f6f-7e1a-45c3-8fb7-9435014d0d76",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        224,
        688
      ]
    },
    {
      "id": "c3e86c12-f430-4149-8e8d-ed7cc09f6c08",
      "name": "Log Send Event",
      "type": "n8n-nodes-base.postgres",
      "position": [
        464,
        688
      ]
    },
    {
      "id": "6abae748-9768-426a-ad65-38dff04ffb12",
      "name": "Update Inbox Stats",
      "type": "n8n-nodes-base.postgres",
      "position": [
        688,
        688
      ]
    },
    {
      "id": "48e31d93-c6bd-4905-aa79-fac9540f1cf8",
      "name": "Email Event Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1392,
        1040
      ]
    },
    {
      "id": "1901961d-dc62-4ef3-ab2d-03b773f0bf73",
      "name": "Parse Event Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -1088,
        1040
      ]
    },
    {
      "id": "3266e902-d2ca-4edb-bc64-8cc7a985b9ba",
      "name": "Log Email Event",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -800,
        1040
      ]
    },
    {
      "id": "2854d08a-fb91-4fe8-9ab6-a1ececaadc8d",
      "name": "Update Performance Stats",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -528,
        1040
      ]
    },
    {
      "id": "fef6b1e5-9d82-4cc0-9b01-42abcc49ef88",
      "name": "Analytics Scheduler",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1408,
        1392
      ]
    },
    {
      "id": "48403e27-7aa8-4f3d-987f-8d317489d3e9",
      "name": "Get Performance Data",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -1024,
        1392
      ]
    },
    {
      "id": "25dd805e-0568-473e-b84d-2c2b3b071fa9",
      "name": "Calculate Best Send Times",
      "type": "n8n-nodes-base.code",
      "position": [
        -800,
        1392
      ]
    },
    {
      "id": "925458ce-cb95-47d4-ab87-8ba2589088a0",
      "name": "Update Send Time Rules",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -496,
        1392
      ]
    },
    {
      "id": "d362c82d-f245-403e-9f97-01fa0c52c328",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2528,
        272
      ],
      "parameters": {
        "width": 448,
        "height": 560,
        "content": "\n## How it works\nThis workflow automates end-to-end email campaigns with built-in deliverability protection and smart optimization. It ingests campaign data and CSV leads, validates emails, checks dom"
      }
    },
    {
      "id": "21b3c85d-68a7-407a-899f-309f08d14f5f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1424,
        -80
      ],
      "parameters": {
        "width": 416,
        "height": 432,
        "content": "## Campaign Setup\nReceives campaign data and CSV leads. Configures limits, delays, and validation settings."
      }
    },
    {
      "id": "eb10cf7a-9949-4308-ba8f-4f0ac24fcc5f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        -48
      ],
      "parameters": {
        "width": 384,
        "height": 352,
        "content": "## Lead Extraction\nParses uploaded CSV and splits leads into individual records for processing."
      }
    },
    {
      "id": "bcf907e7-b88a-4786-928b-130239652069",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        -48
      ],
      "parameters": {
        "width": 256,
        "height": 352,
        "content": "## Lead Extraction\nParses uploaded CSV and splits leads into individual records for processing."
      }
    },
    {
      "id": "aa32dd2f-5e13-45a6-8ed4-4c15a5658c75",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -112
      ],
      "parameters": {
        "width": 560,
        "height": 416,
        "content": "## Validation Routing\nValid leads continue to processing. Invalid ones are stored separately."
      }
    },
    {
      "id": "6d0d02fc-f7df-4675-b684-6baed29b6dde",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        -144
      ],
      "parameters": {
        "width": 480,
        "height": 352,
        "content": "## Lead Enrichment\nVerifies domain via MX records, assigns timezone, and calculates engagement score before storing."
      }
    },
    {
      "id": "92a3d87a-763c-4f05-b445-a6c5fac489e1",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        512
      ],
      "parameters": {
        "width": 480,
        "height": 352,
        "content": "## Send Tracking\nLogs sent emails and updates inbox usage statistics."
      }
    },
    {
      "id": "bd5ca422-1ff4-42d6-b015-a893e8928097",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        1280
      ],
      "parameters": {
        "width": 496,
        "height": 304,
        "content": "## Performance Analysis\nAnalyzes historical data to identify best-performing send times."
      }
    },
    {
      "id": "0ff46a9d-5be8-4a98-b27d-2c16b1e96056",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        1264
      ],
      "parameters": {
        "width": 272,
        "height": 304,
        "content": "## Continuous Optimization\nUpdates send-time rules to improve future campaign performance."
      }
    },
    {
      "id": "7cc7a2d5-c41f-461e-a27f-133e057e1f92",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        928
      ],
      "parameters": {
        "width": 480,
        "height": 304,
        "content": "## Performance Update\nUpdates campaign performance metrics based on user interactions."
      }
    },
    {
      "id": "97438aba-43b1-4203-8509-40e5a2555922",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        560
      ],
      "parameters": {
        "width": 384,
        "height": 272,
        "content": "## Email Delivery\nWaits until optimal time and sends emails using selected inbox."
      }
    },
    {
      "id": "e6618eba-0b36-4a9e-a02d-1ffe6085375d",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        544
      ],
      "parameters": {
        "width": 384,
        "height": 304,
        "content": "## Lead Selection\nPulls top leads sorted by engagement score and readiness."
      }
    },
    {
      "id": "f89bd8ae-8836-4930-9401-58515cb0569e",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        944
      ],
      "parameters": {
        "width": 304,
        "height": 272,
        "content": "## Event Processing\nParses event data and logs it for tracking and analytics."
      }
    },
    {
      "id": "825e50a6-af56-48ce-99d4-a70acadb566d",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1472,
        592
      ],
      "parameters": {
        "width": 512,
        "height": 288,
        "content": "## Campaign Execution\nFetches active campaigns and prepares them for email sending."
      }
    },
    {
      "id": "d8d560eb-e0e8-4a76-a982-0d150fda641d",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        544
      ],
      "parameters": {
        "width": 384,
        "height": 304,
        "content": "## Send Optimization\nCalculates best send time per lead and selects inbox using rotation and limits."
      }
    },
    {
      "id": "c982d118-1ec4-4b85-b2a1-bdc0a80a985c",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        944
      ],
      "parameters": {
        "width": 272,
        "height": 272,
        "content": "## Event Intake\nReceives email events like opens, clicks, replies, and bounces."
      }
    },
    {
      "id": "1f2fef7b-bb6c-45b9-b697-eb99635d4c84",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        1280
      ],
      "parameters": {
        "width": 336,
        "height": 304,
        "content": "## Analytics Trigger\nRuns periodically to analyze campaign performance."
      }
    }
  ],
  "connections": {
    "Send Email": {
      "main": [
        [
          {
            "node": "Log Send Event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Leads": {
      "main": [
        [
          {
            "node": "Validate Email & Extract Domain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Send Event": {
      "main": [
        [
          {
            "node": "Update Inbox Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Email Valid?": {
      "main": [
        [
          {
            "node": "Check Domain MX Records",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Store Invalid Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Email Event": {
      "main": [
        [
          {
            "node": "Update Performance Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Campaigns": {
      "main": [
        [
          {
            "node": "Get Campaign Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich Lead Data": {
      "main": [
        [
          {
            "node": "Store Valid Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Event Data": {
      "main": [
        [
          {
            "node": "Log Email Event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract CSV Leads": {
      "main": [
        [
          {
            "node": "Split Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Campaign Scheduler": {
      "main": [
        [
          {
            "node": "Get Pending Campaigns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Campaign Leads": {
      "main": [
        [
          {
            "node": "Split Campaign Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analytics Scheduler": {
      "main": [
        [
          {
            "node": "Get Performance Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Event Webhook": {
      "main": [
        [
          {
            "node": "Parse Event Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Performance Data": {
      "main": [
        [
          {
            "node": "Calculate Best Send Times",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Campaign Leads": {
      "main": [
        [
          {
            "node": "Calculate Send Time & Select Inbox",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Until Send Time": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Pending Campaigns": {
      "main": [
        [
          {
            "node": "Split Campaigns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Extract CSV Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Campaign Upload Webhook": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Domain MX Records": {
      "main": [
        [
          {
            "node": "Enrich Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Best Send Times": {
      "main": [
        [
          {
            "node": "Update Send Time Rules",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Email & Extract Domain": {
      "main": [
        [
          {
            "node": "Is Email Valid?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Send Time & Select Inbox": {
      "main": [
        [
          {
            "node": "Wait Until Send Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}