AutomationFlowsAI & RAG › Automate Sales for Digital Products & SAAS with AI (gpt-4o)

Automate Sales for Digital Products & SAAS with AI (gpt-4o)

ByBadr @b4dr on n8n.io

Tired of manually finding leads, collecting emails, and sending messages that get ignored? Let AI do the heavy lifting.

Event trigger★★★★★ complexityAI-powered34 nodesHTTP RequestOpenAIGmailChain LlmOutput Parser StructuredOpenAI Chat
AI & RAG Trigger: Event Nodes: 34 Complexity: ★★★★★ AI nodes: yes Added:

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

This workflow follows the Chainllm → Gmail 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
{
  "nodes": [
    {
      "id": "f6a98207-f368-4289-813e-6ee4360a0955",
      "name": "Extract URLs from Google Search",
      "type": "n8n-nodes-base.code",
      "position": [
        1240,
        260
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "4d7629fc-eb31-4bd4-a42b-ef859114acf1",
      "name": "Remove Duplicate URLs",
      "type": "n8n-nodes-base.removeDuplicates",
      "onError": "continueErrorOutput",
      "position": [
        2120,
        180
      ],
      "parameters": {},
      "typeVersion": 1.1,
      "alwaysOutputData": true
    },
    {
      "id": "b2bf88bf-f17c-479a-bc78-2a9fd9b24995",
      "name": "Remove Duplicate Emails",
      "type": "n8n-nodes-base.removeDuplicates",
      "onError": "continueErrorOutput",
      "position": [
        2000,
        1180
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "6d39ba82-e656-4caa-82bb-fb3b30e8c882",
      "name": "Split Emails into Items",
      "type": "n8n-nodes-base.splitOut",
      "onError": "continueRegularOutput",
      "position": [
        1380,
        940
      ],
      "parameters": {},
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "1607d14f-1403-4676-ad74-02dfe15efb93",
      "name": "Aggregate Email Lists",
      "type": "n8n-nodes-base.aggregate",
      "onError": "continueErrorOutput",
      "position": [
        1000,
        940
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "02bfd700-f1c3-4e3a-8357-24ec0b6c2ccb",
      "name": "Search Google Maps",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        880,
        260
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "ab76c18c-d35c-42b6-ae69-e40fb7cef57f",
      "name": "Filter Out Google/Schema URLs",
      "type": "n8n-nodes-base.filter",
      "onError": "continueRegularOutput",
      "position": [
        1540,
        240
      ],
      "parameters": {},
      "typeVersion": 2.2,
      "alwaysOutputData": false
    },
    {
      "id": "d2896a33-3dd8-4e4d-9d6e-10abfc279e33",
      "name": "Loop Through Unique URLs",
      "type": "n8n-nodes-base.splitInBatches",
      "onError": "continueRegularOutput",
      "position": [
        2620,
        360
      ],
      "parameters": {},
      "typeVersion": 3,
      "alwaysOutputData": false
    },
    {
      "id": "b000cb31-03ed-49fb-9ab4-ff745e8044a0",
      "name": "Fetch Website Content (via URL)",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        3060,
        480
      ],
      "parameters": {},
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "b5ebd880-54d5-41c0-9435-7c24cc902462",
      "name": "Loop Through Website Content Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "onError": "continueRegularOutput",
      "position": [
        700,
        940
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 3,
      "alwaysOutputData": false
    },
    {
      "id": "6f5e1f79-89d2-4eda-b0d7-1246c1a8308d",
      "name": "Extract and Filter Emails",
      "type": "n8n-nodes-base.code",
      "onError": "continueRegularOutput",
      "position": [
        860,
        1120
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "57225174-929a-4a96-a849-8759aed631ac",
      "name": "Loop Through Search Queries",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        260,
        240
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "ef116f8c-4803-4754-81d7-379ef36ccc9a",
      "name": "Wait Before Google Search",
      "type": "n8n-nodes-base.wait",
      "position": [
        600,
        260
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "59b1bb9d-b697-4c6d-a6e9-f678a7ae4fad",
      "name": "Process AI-Generated Queries",
      "type": "n8n-nodes-base.code",
      "position": [
        -140,
        240
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "03c374ee-b7c8-4477-8c67-579b01636a7f",
      "name": "Generate Google Maps Queries (OpenAI)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -600,
        240
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 1.4,
      "alwaysOutputData": true
    },
    {
      "id": "bfbf6faf-df5d-476e-a356-3161a4a112af",
      "name": "Extract Domain from Email",
      "type": "n8n-nodes-base.code",
      "position": [
        960,
        1840
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "a90d56ab-7b87-4446-b9a0-658dc74fe3b3",
      "name": "Loop Through Unique Emails",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        540,
        1840
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "b4d069bf-6ad1-4ff8-823f-b5d8d8bda9a3",
      "name": "Scrape Website Content (Jina.ai)",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        1240,
        1840
      ],
      "parameters": {},
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "3ebd8474-5b4e-49a3-93b4-0698fbf0fa03",
      "name": "Check for Scraping Error",
      "type": "n8n-nodes-base.if",
      "position": [
        1540,
        1840
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "eedcf1b9-ab74-431b-9564-28a8342006a2",
      "name": "Truncate Website Content",
      "type": "n8n-nodes-base.code",
      "position": [
        1780,
        1860
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "8105f0e9-439a-441c-a03d-755c8059aa20",
      "name": "Check if URL Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        1780,
        300
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "aaddce95-8cd8-4c2c-85ba-e4d801b62bd3",
      "name": "Send Email via Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2600,
        2080
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "40c1888b-1ab9-4af7-9202-9787c82fdb5f",
      "name": "Wait Between Emails",
      "type": "n8n-nodes-base.wait",
      "position": [
        3460,
        2180
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "0fab3ced-eddb-477b-9636-3eab865ab097",
      "name": "Generate Random Delay",
      "type": "n8n-nodes-base.code",
      "position": [
        2920,
        2100
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "474fa8d0-9433-488c-ac2b-6da6716bf425",
      "name": "Sticky Note: Scraping Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c123db2e-7617-4ffc-89db-718d3efe1571",
      "name": "Sticky Note: Email Extraction Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        920
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "187ffe11-3b48-414f-8cd0-5539616eee9d",
      "name": "Sticky Note: Personalization & Sending Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        1600
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "24eaddb6-c9aa-408f-a312-0150d2cfd1dd",
      "name": "Generate Personalized Email (LLM Chain)",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2180,
        1880
      ],
      "parameters": {},
      "typeVersion": 1.5
    },
    {
      "id": "4042ea25-a820-4396-95f9-7f02cae68a57",
      "name": "Parse AI Email Output (JSON)",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2260,
        2120
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "20e642e4-46fc-4741-acae-0faed9dee8df",
      "name": "NoOp (If URL Invalid)",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2020,
        360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ec77840b-93ff-4da7-97cb-b6662ea3cea1",
      "name": "MANUAL TRIGGER: Start Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -900,
        240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9bd66b20-f61d-451b-92ef-d15937de4efa",
      "name": "Sticky Note: CONFIGURATION",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -980,
        40
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "80366ada-46d8-4083-b964-f5b63ba57cf9",
      "name": "Configure OpenAI Chat Model (GPT-4o-mini)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2020,
        2120
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "fb29e15d-48cf-4933-894a-e0bf60a3705c",
      "name": "Sticky Note: Workflow Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2720,
        900
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Search Google Maps": {
      "main": [
        [
          {
            "node": "Extract URLs from Google Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if URL Exists": {
      "main": [
        [
          {
            "node": "Remove Duplicate URLs",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "NoOp (If URL Invalid)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Between Emails": {
      "main": [
        [
          {
            "node": "Loop Through Unique Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email via Gmail": {
      "main": [
        [
          {
            "node": "Generate Random Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Email Lists": {
      "main": [
        [
          {
            "node": "Split Emails into Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Random Delay": {
      "main": [
        [
          {
            "node": "Wait Between Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicate URLs": {
      "main": [
        [
          {
            "node": "Loop Through Unique URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicate Emails": {
      "main": [
        [
          {
            "node": "Loop Through Unique Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Emails into Items": {
      "main": [
        [
          {
            "node": "Remove Duplicate Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Scraping Error": {
      "main": [
        [
          {
            "node": "Loop Through Unique Emails",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Truncate Website Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Unique URLs": {
      "main": [
        [
          {
            "node": "Loop Through Website Content Batches",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch Website Content (via URL)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Truncate Website Content": {
      "main": [
        [
          {
            "node": "Generate Personalized Email (LLM Chain)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Domain from Email": {
      "main": [
        [
          {
            "node": "Scrape Website Content (Jina.ai)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract and Filter Emails": {
      "main": [
        [
          {
            "node": "Loop Through Website Content Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Google Search": {
      "main": [
        [
          {
            "node": "Search Google Maps",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Unique Emails": {
      "main": [
        [
          {
            "node": "Loop Through Search Queries",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Domain from Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Search Queries": {
      "main": [
        [],
        [
          {
            "node": "Wait Before Google Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Email Output (JSON)": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Personalized Email (LLM Chain)",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Process AI-Generated Queries": {
      "main": [
        [
          {
            "node": "Loop Through Search Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Out Google/Schema URLs": {
      "main": [
        [
          {
            "node": "Check if URL Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MANUAL TRIGGER: Start Workflow": {
      "main": [
        [
          {
            "node": "Generate Google Maps Queries (OpenAI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract URLs from Google Search": {
      "main": [
        [
          {
            "node": "Filter Out Google/Schema URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Website Content (via URL)": {
      "main": [
        [
          {
            "node": "Loop Through Unique URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Website Content (Jina.ai)": {
      "main": [
        [
          {
            "node": "Check for Scraping Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Website Content Batches": {
      "main": [
        [
          {
            "node": "Aggregate Email Lists",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract and Filter Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Google Maps Queries (OpenAI)": {
      "main": [
        [
          {
            "node": "Process AI-Generated Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Personalized Email (LLM Chain)": {
      "main": [
        [
          {
            "node": "Send Email via Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure OpenAI Chat Model (GPT-4o-mini)": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Personalized Email (LLM Chain)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

Tired of manually finding leads, collecting emails, and sending messages that get ignored? Let AI do the heavy lifting.

Source: https://n8n.io/workflows/3342/ — 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

True Multi-Offer Campaigns Promote any mix of products, services or solutions in one run; no separate workflows needed. SMTP Load Balancing A Switch node rotates sends across five Gmail/SMTP accounts

HTTP Request, OpenAI, Chain Llm +3
AI & RAG

[](https://www.youtube.com/watch?v=rfu4MSvtpAw)

Lm Open Ai, Output Parser Structured, Chain Llm +7
AI & RAG

This n8n template automates targeted lead discovery, AI-driven data structuring, and personalized cold-email sending at controlled intervals. It’s ideal for sales teams, founders, and agencies that wa

Google Sheets, Form Trigger, Chain Llm +6
AI & RAG

The best content automation template in the market is now even better—with “deep research” on time-sensitive topics\! Unlike most n8n content automation templates that are mainly for “demo purposes,”

OpenAI, HTTP Request, XML +11
AI & RAG

Typeform IA - YT. Uses typeformTrigger, agent, lmChatOpenAi, toolWorkflow. Event-driven trigger; 75 nodes.

Typeform Trigger, Agent, OpenAI Chat +7