AutomationFlowsAI & RAG › Automate Personalized Cold Email Sequences with Gpt-4, Mailgun and Supabase

Automate Personalized Cold Email Sequences with Gpt-4, Mailgun and Supabase

ByPaul @diagopl on n8n.io

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Cron / scheduled trigger★★★★★ complexityAI-powered100 nodesMailgunOpenAIOpenAI ChatSupabaseOutput Parser StructuredAgentTelegramMemory Buffer Window
AI & RAG Trigger: Cron / scheduled Nodes: 100 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #6402 — we link there as the canonical source.

This workflow follows the Agent → OpenAI Chat recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "71rsSS872JvzpgRw",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "GPT-4 Powered Cold Mail Workflow with Fully Tailored 3-Email Follow-Ups",
  "tags": [
    {
      "id": "1hRHEiy7UZK0rzHP",
      "name": "Building...",
      "createdAt": "2025-06-18T21:57:50.272Z",
      "updatedAt": "2025-06-18T21:57:50.272Z"
    },
    {
      "id": "Pk2fJStrBv0ahTzF",
      "name": "Marketplace",
      "createdAt": "2025-06-18T21:56:48.947Z",
      "updatedAt": "2025-06-18T21:56:48.947Z"
    }
  ],
  "nodes": [
    {
      "id": "d422e373-6961-4c5d-a472-a41927e872c4",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        944,
        528
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6c3c2362-e4fc-443a-852d-45f0ab6de389",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2752,
        512
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "3624a1bf-6bbd-42ca-b129-e13e77af0434",
      "name": "Time Zone",
      "type": "n8n-nodes-base.code",
      "position": [
        2880,
        512
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "3b9975dc-2b14-4659-8ceb-aa2fc09c333f",
      "name": "Sender Email",
      "type": "n8n-nodes-base.code",
      "position": [
        3024,
        512
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "b8785fb8-5653-48b7-8e25-bf8e1b5dd8cf",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        896,
        1456
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "7a58437d-149f-4590-a86c-25c503f34670",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1104,
        1184
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "12dee400-48b7-4118-9d15-2c2f28687d12",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1552,
        1248
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "313500f9-2001-40f5-92a2-92da7e136656",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1104,
        1680
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "02bee7f9-ac9f-4180-9529-5c4c39141b53",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        1552,
        1744
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "8b55e93a-093f-4540-a824-43174871893c",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        16,
        1568
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "667f78f4-a393-473b-be2d-4cee7461ee14",
      "name": "If3",
      "type": "n8n-nodes-base.if",
      "position": [
        576,
        560
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "75d3fbce-241d-4df8-9303-2366e8618585",
      "name": "Mailgun",
      "type": "n8n-nodes-base.mailgun",
      "onError": "continueRegularOutput",
      "position": [
        1328,
        1728
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7740d4c1-f0f2-4b03-a2f8-b016d583ab06",
      "name": "Mailgun1",
      "type": "n8n-nodes-base.mailgun",
      "onError": "continueRegularOutput",
      "position": [
        1328,
        1216
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ce786ec9-3979-4f2b-88bb-a8729b6deb1e",
      "name": "General anlysis",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1520,
        352
      ],
      "parameters": {},
      "typeVersion": 1.8
    },
    {
      "id": "1b9ca49d-b99c-432a-a308-d3f6261d1877",
      "name": "Limit1",
      "type": "n8n-nodes-base.limit",
      "position": [
        672,
        1456
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9c0c0f3c-6005-479f-9b89-566468651e37",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2048,
        256
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "39dd4a5a-448b-4979-b2cf-a08aea68a22f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        1008
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d411fc4b-e101-4646-bae0-b86103f9b8a8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "04d4f716-9f18-49d7-8a49-844226e029d3",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1024,
        736
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "481e2246-a571-43b2-b42e-57f5611ca512",
      "name": "Supabase2",
      "type": "n8n-nodes-base.supabase",
      "position": [
        192,
        1568
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f6b2a8dc-f5e4-40b2-9bbe-25780c3f4ea2",
      "name": "If2",
      "type": "n8n-nodes-base.if",
      "position": [
        464,
        1568
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "958c9c6b-51a0-4bfa-b52e-3f754351147d",
      "name": "No Operation, do nothing2",
      "type": "n8n-nodes-base.noOp",
      "position": [
        672,
        1664
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "555d36bb-3892-406b-9058-a20f9f85b4b8",
      "name": "Supabase3",
      "type": "n8n-nodes-base.supabase",
      "position": [
        1328,
        1024
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d03d5fb3-be12-4a72-a97d-517332798d91",
      "name": "Supabase4",
      "type": "n8n-nodes-base.supabase",
      "position": [
        1328,
        1568
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9ad9bb78-480b-4fb6-acdd-8147c1cafd8f",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "disabled": true,
      "position": [
        2272,
        368
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "edcd7c06-e16f-44dd-a43c-a5ceb56b91e1",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        2464,
        96
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "dd33db02-6c2f-4a9a-9a92-dd743bf01172",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        1008
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "93c1baf3-50ad-45d3-ab3c-0c6acb4c002c",
      "name": "Schedule Trigger3",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        112,
        560
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "4381f6c5-36c7-4d45-8259-efd78c30eb08",
      "name": "Supabase11",
      "type": "n8n-nodes-base.supabase",
      "position": [
        2032,
        1632
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "13ee1f55-85df-4411-9788-c247257adbf7",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        2320,
        1632
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "48bf81ab-9da7-4d6d-88ff-a7a8a4e4135c",
      "name": "Evualute when the mail was sent",
      "type": "n8n-nodes-base.code",
      "position": [
        2176,
        1632
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "687ca9b0-098c-4ab4-87cb-e1201c2b149e",
      "name": "Sort",
      "type": "n8n-nodes-base.sort",
      "position": [
        2512,
        1536
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0e66bb20-4986-42d5-9cfc-efd7075313dd",
      "name": "Sort1",
      "type": "n8n-nodes-base.sort",
      "position": [
        768,
        528
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "96c3cec7-404f-466f-87a0-f94878902404",
      "name": "Sort2",
      "type": "n8n-nodes-base.sort",
      "position": [
        336,
        1568
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4b6ed200-976d-4f09-b813-9ac7584b3c09",
      "name": "Limit2",
      "type": "n8n-nodes-base.limit",
      "position": [
        2672,
        1536
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "170b8687-6f69-44d6-93a0-163e5657f353",
      "name": "Switch5",
      "type": "n8n-nodes-base.switch",
      "position": [
        2800,
        1536
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "6f273340-b5b3-49a4-aabe-08106daf139b",
      "name": "Loop Over Items7",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3024,
        1264
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "742ed340-2408-4d14-ac94-15bbbafdde4f",
      "name": "Wait7",
      "type": "n8n-nodes-base.wait",
      "position": [
        3456,
        1312
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "d77224d7-d041-46dc-9b0f-105815811436",
      "name": "Loop Over Items10",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3024,
        1760
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "9a08e206-511a-4201-8f20-47fa5db52f82",
      "name": "Wait10",
      "type": "n8n-nodes-base.wait",
      "position": [
        3456,
        1824
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "096f95af-9dfc-4a29-b9b5-34f1c96ff396",
      "name": "Mailgun6",
      "type": "n8n-nodes-base.mailgun",
      "onError": "continueRegularOutput",
      "position": [
        3248,
        1776
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6787aeb3-b0a4-416f-914e-76fab96db404",
      "name": "Mailgun7",
      "type": "n8n-nodes-base.mailgun",
      "onError": "continueRegularOutput",
      "position": [
        3248,
        1280
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d2ec8788-4587-43e5-9284-0d34a58f5e50",
      "name": "Supabase12",
      "type": "n8n-nodes-base.supabase",
      "position": [
        3248,
        1072
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "50d5c74f-4cfe-49c9-9a54-9698aa9da425",
      "name": "Supabase14",
      "type": "n8n-nodes-base.supabase",
      "position": [
        3248,
        1584
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fef61ad9-1293-4b33-842c-55f00a34b1cf",
      "name": "Schedule Trigger4",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1904,
        1632
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "1be06c32-5eb9-4a61-bdc2-9569012af00f",
      "name": "No Operation, do nothing1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2560,
        1728
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "cdfad724-b494-477e-ad2b-5755c3694053",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        2112
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "69af83e0-3c30-4dff-b73c-33cb13d675ae",
      "name": "Supabase13",
      "type": "n8n-nodes-base.supabase",
      "position": [
        960,
        2720
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a665e803-5023-405c-823a-77f27a111075",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        1392,
        2720
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "3bc0d82b-1c6a-435c-a91f-d51cdeb85d92",
      "name": "Evualute when the mail was sent1",
      "type": "n8n-nodes-base.code",
      "position": [
        1168,
        2720
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "db07613e-110c-4c84-a83b-a6ddd9973f12",
      "name": "Sort3",
      "type": "n8n-nodes-base.sort",
      "position": [
        1616,
        2608
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "765f50c6-5a78-4a29-b618-fb09603a9744",
      "name": "Limit4",
      "type": "n8n-nodes-base.limit",
      "position": [
        1840,
        2608
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9f7cf2b9-b4c9-40cc-9f19-77b63a84d00b",
      "name": "Switch6",
      "type": "n8n-nodes-base.switch",
      "position": [
        2048,
        2608
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "ec529746-0a16-4153-9b33-56f92599c995",
      "name": "Loop Over Items8",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2272,
        2336
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "9b1e4556-9046-4371-889b-36f613cf1c82",
      "name": "Wait8",
      "type": "n8n-nodes-base.wait",
      "position": [
        2720,
        2400
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "de11fc44-569a-455f-991b-9df9de84ccbf",
      "name": "Loop Over Items11",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2272,
        2832
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "f2fa0e48-fd1b-4521-aa5a-70cc8649b9e6",
      "name": "Wait11",
      "type": "n8n-nodes-base.wait",
      "position": [
        2720,
        2896
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "0ddbd9ce-3657-4633-b697-e371763c8839",
      "name": "Mailgun8",
      "type": "n8n-nodes-base.mailgun",
      "onError": "continueRegularOutput",
      "position": [
        2496,
        2848
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7dc1cdd0-c52f-4e27-affa-6aee5c7c1620",
      "name": "Mailgun9",
      "type": "n8n-nodes-base.mailgun",
      "onError": "continueRegularOutput",
      "position": [
        2496,
        2352
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f4f87b57-8fd5-4d67-a0b4-d631877357cb",
      "name": "Supabase15",
      "type": "n8n-nodes-base.supabase",
      "position": [
        2496,
        2160
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c1471b04-a8a0-4347-a460-b5f8a5121179",
      "name": "Supabase16",
      "type": "n8n-nodes-base.supabase",
      "position": [
        2496,
        2656
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "33f54e10-d1d0-48d5-93ac-79261abeb016",
      "name": "Schedule Trigger6",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        736,
        2720
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "318c64af-3fe2-4c0d-9a86-54fbdbab9dba",
      "name": "No Operation, do nothing4",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1616,
        2816
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "48575304-b138-413f-bcc5-8fd273c19688",
      "name": "research about company",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1168,
        352
      ],
      "parameters": {},
      "typeVersion": 1.8
    },
    {
      "id": "b36e8212-6d04-41c5-b7b7-0c5a5584b5fc",
      "name": "create email sequence",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2080,
        96
      ],
      "parameters": {},
      "typeVersion": 1.9
    },
    {
      "id": "a1c93bea-7cc5-4b74-8568-0975e4fbe0f4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        496
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a48ecb77-57f4-451a-bbc2-33893fa558b3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        480
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f7ead7ef-89e9-4e90-ad10-47ab408c5227",
      "name": "Get many rows",
      "type": "n8n-nodes-base.supabase",
      "position": [
        368,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c67a7a2b-5e93-4543-9e84-7ca7b48c174d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        0
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "2e5cfc4c-1d61-42eb-b9f9-7175ce038ae2",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        32
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "adf3d3c9-57c5-466a-8de8-b5db27fe623c",
      "name": "Your leads table",
      "type": "n8n-nodes-base.supabase",
      "position": [
        3184,
        512
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "093a447e-9636-4dca-ab6d-89e7f80cb968",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        1232
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "af4f384c-61fe-4f55-96ed-8ad07310d50f",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        1392
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "afa0b3ec-4882-4334-a5ad-1939718467e8",
      "name": "Create URL",
      "type": "n8n-nodes-base.code",
      "position": [
        496,
        -1200
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "464b0c0c-c290-489e-a0d0-1eaae937fa02",
      "name": "Extract Info",
      "type": "n8n-nodes-base.set",
      "position": [
        928,
        -1200
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "8a6e25e3-7e7a-41a9-9b26-858452873810",
      "name": "Only Keep Verified Emails ",
      "type": "n8n-nodes-base.filter",
      "position": [
        1152,
        -1200
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "059aaf5d-d798-4749-889f-02ac83dbb43e",
      "name": "Download File1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -592,
        -1376
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "c775974b-8112-4f7c-af3c-33f83e574bb8",
      "name": "Transcribe1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -368,
        -1376
      ],
      "parameters": {},
      "typeVersion": 1.6
    },
    {
      "id": "7b42eeff-f1df-433e-85b8-947724b7fcc7",
      "name": "Text1",
      "type": "n8n-nodes-base.set",
      "position": [
        -464,
        -1120
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "69e148b6-0371-4390-b6f8-bbd26bdda3db",
      "name": "Voice or Text1",
      "type": "n8n-nodes-base.switch",
      "position": [
        -816,
        -1280
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "0132b284-c763-43c5-aafa-f25e6c0f013f",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -144,
        -1056
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "12dcaf59-cc03-487a-b909-cb30f488b0c0",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -32,
        -1056
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "91397452-14c7-468b-82f5-cedf8b588120",
      "name": "Select already scraped mails",
      "type": "n8n-nodes-base.postgres",
      "position": [
        688,
        -1472
      ],
      "parameters": {},
      "typeVersion": 2.6
    },
    {
      "id": "639f8660-ea8d-4b3c-8627-3c71e42d7d9f",
      "name": "Keep only the new leads",
      "type": "n8n-nodes-base.compareDatasets",
      "position": [
        1392,
        -1232
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "48db196a-33f8-4c21-a4b1-acd8d7f3ee88",
      "name": "Already scraped",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1728,
        -1328
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "073fe5e1-36b0-41d5-be43-c468b4ad9d28",
      "name": "Create rows with new leads",
      "type": "n8n-nodes-base.supabase",
      "position": [
        1664,
        -1120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d82625ee-8937-4bfd-b367-35afbb9091cf",
      "name": "Set Telegram message",
      "type": "n8n-nodes-base.set",
      "position": [
        1872,
        -1120
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "4f056dcf-f321-40c9-a8ed-dd96fb887654",
      "name": "Confirmation message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2288,
        -1120
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "24d884c6-b4e5-4ad2-a254-c554d0139238",
      "name": "User message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1024,
        -1280
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "67707945-ee00-4f21-90ee-1073a392db5a",
      "name": "Generate query payload",
      "type": "n8n-nodes-base.set",
      "position": [
        288,
        -1168
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "45180735-a044-4bef-a737-7228f6275c93",
      "name": "Scraper agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -112,
        -1280
      ],
      "parameters": {},
      "typeVersion": 1.9
    },
    {
      "id": "9ced89ec-f095-43ac-be01-c44e9cdc87e4",
      "name": "Run an Actor",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        704,
        -1200
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ce63a8f1-92a5-423a-b83d-4a14673a1a10",
      "name": "Limit3",
      "type": "n8n-nodes-base.limit",
      "position": [
        2064,
        -1120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "da02cf3c-21d5-4781-b839-902cbccf1047",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        96,
        -1056
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "9ebc529e-c8a8-416e-8f2c-264421c3c553",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1056,
        -1520
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d7df1f97-ad55-44ef-be70-aa8017357414",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        -1520
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "faf7c863-61c1-4ba7-89c3-250be8087bd9",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1056,
        -896
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3066ba73-7948-4c8a-906a-4ec215017bf4",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -1280
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "9303636c-00fd-45a6-9d1f-c1ee4f8ee68a",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        -960
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "39b68e8d-8106-4913-bfa6-0d22750642be",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1056,
        -1760
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bd3d62ff-95c6-4df5-b416-6d0ab84faa58",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Sort3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Sort",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "Limit1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If3": {
      "main": [
        [
          {
            "node": "Sort1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort": {
      "main": [
        [
          {
            "node": "Limit2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          },
          {
            "node": "research about company",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Time Zone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort1": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort2": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort3": {
      "main": [
        [
          {
            "node": "Limit4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text1": {
      "main": [
        [
          {
            "node": "Scraper agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait7": {
      "main": [
        [
          {
            "node": "Loop Over Items7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait8": {
      "main": [
        [
          {
            "node": "Loop Over Items8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit1": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit2": {
      "main": [
        [
          {
            "node": "Switch5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit3": {
      "main": [
        [
          {
            "node": "Confirmation message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit4": {
      "main": [
        [
          {
            "node": "Switch6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait10": {
      "main": [
        [
          {
            "node": "Loop Over Items10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait11": {
      "main": [
        [
          {
            "node": "Loop Over Items11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mailgun": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch5": {
      "main": [
        [
          {
            "node": "Loop Over Items7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch6": {
      "main": [
        [
          {
            "node": "Loop Over Items8",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mailgun1": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mailgun6": {
      "main": [
        [
          {
            "node": "Wait10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mailgun7": {
      "main": [
        [
          {
            "node": "Wait7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mailgun8": {
      "main": [
        [
          {
            "node": "Wait11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mailgun9": {
      "main": [
        [
          {
            "node": "Wait8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase2": {
      "main": [
        [
          {
            "node": "Sort2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Time Zone": {
      "main": [
        [
          {
            "node": "Sender Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create URL": {
      "main": [
        [
          {
            "node": "Run an Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase11": {
      "main": [
        [
          {
            "node": "Evualute when the mail was sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase13": {
      "main": [
        [
          {
            "node": "Evualute when the mail was sent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe1": {
      "main": [
        [
          {
            "node": "Scraper agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Info": {
      "main": [
        [
          {
            "node": "Only Keep Verified Emails ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run an Actor": {
      "main": [
        [
          {
            "node": "Extract Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sender Email": {
      "main": [
        [
          {
            "node": "Your leads table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "User message": {
      "main": [
        [
          {
            "node": "Voice or Text1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many rows": {
      "main": [
        [
          {
            "node": "If3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scraper agent": {
      "main": [
        [
          {
            "node": "Generate query payload",
            "type": "main",
            "index": 0
          },
          {
            "node": "Select already scraped mails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Scraper agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Download File1": {
      "main": [
        [
          {
            "node": "Transcribe1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Voice or Text1": {
      "main": [
        [
          {
            "node": "Download File1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Text1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "General anlysis": {
      "main": [
        [
          {
            "node": "create email sequence",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Supabase3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mailgun1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Supabase4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mailgun",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items7": {
      "main": [
        [
          {
            "node": "Supabase12",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mailgun7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items8": {
      "main": [
        [
          {
            "node": "Supabase15",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mailgun9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items10": {
      "main": [
        [
          {
            "node": "Supabase14",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mailgun6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items11": {
      "main": [
        [
          {
            "node": "Supabase16",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mailgun8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "create email sequence",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Supabase2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger3": {
      "main": [
        [
          {
            "node": "Get many rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger4": {
      "main": [
        [
          {
            "node": "Supabase11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger6": {
      "main": [
        [
          {
            "node": "Supabase13",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Scraper agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set Telegram message": {
      "main": [
        [
          {
            "node": "Limit3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create email sequence": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate query payload": {
      "main": [
        [
          {
            "node": "Create URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "research about company": {
      "main": [
        [
          {
            "node": "General anlysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep only the new leads": {
      "main": [
        [
          {
            "node": "Already scraped",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Already scraped",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Already scraped",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create rows with new leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        []
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Scraper agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Create rows with new leads": {
      "main": [
        [
          {
            "node": "Set Telegram message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only Keep Verified Emails ": {
      "main": [
        [
          {
            "node": "Keep only the new leads",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Select already scraped mails": {
      "main": [
        [
          {
            "node": "Keep only the new leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Evualute when the mail was sent": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Evualute when the mail was sent1": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

How this works

This workflow generates and sends personalised cold email sequences by pulling contact data from Supabase, crafting context-aware messages with GPT-4, and delivering them through Mailgun. It suits sales teams and founders who need to run regular outreach without manual drafting each time. The core step is the AI agent that analyses recipient details and previous replies before deciding the next message tone and content.

Use it for steady lead-nurture campaigns where contacts are already stored in Supabase and replies can be tracked; avoid it for one-off blasts or when strict compliance rules require human approval on every email. A common variation swaps the cron trigger for a webhook so sequences start immediately on new sign-ups.

About this workflow

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Source: https://n8n.io/workflows/6402/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

System Architecture Two integrated N8N workflows providing automated US stock portfolio management through Telegram:

Output Parser Autofixing, OpenAI Chat, Perplexity +10
AI & RAG

staying consistent with personal brand content is hard when you're running everything yourself. you know what you want to say — but turning raw thoughts into polished posts takes hours.

Output Parser Structured, Telegram, OpenAI +4
AI & RAG

Template Name: AI Personal Assistant - Task & Email Management Price: $27 Category: Productivity & Automation Difficulty: Intermediate Use Case: Personal productivity automation for busy professionals

Telegram, HTTP Request, OpenAI +8
AI & RAG

Title: Create daily AI news digest and send to Telegram

HTTP Request, Agent, OpenAI Chat +5
AI & RAG

This workflow manages subscription billing reminders and data updates via Telegram. It runs daily at 8:00 AM to check for upcoming due subscriptions, formats relevant information, and sends reminders

OpenAI Chat, Memory Buffer Window, Telegram +7