AutomationFlowsAI & RAG › Lead Generation and Qualification with Gpt-4o, Google Workspace, and…

Lead Generation and Qualification with Gpt-4o, Google Workspace, and…

Original n8n title: Lead Generation and Qualification with Gpt-4o, Google Workspace, and Automated Follow-up

ByFranz @agents-by-franz on n8n.io

This n8n workflow template automates your lead generation and follow-up process using AI. It captures leads through a form, enriches them with company data, classifies them into different categories, and sends appropriate follow-up sequences automatically. 🤖 AI-powered lead…

Event trigger★★★★★ complexityAI-powered41 nodesGmailOutput Parser StructuredForm TriggerGoogle SheetsAgentOpenAI ChatText ClassifierGoogle Calendar
AI & RAG Trigger: Event Nodes: 41 Complexity: ★★★★★ AI nodes: yes Added:

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

This workflow follows the Agent → Form Trigger 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": "ZniFVC6XnMf5P3lG",
  "name": "AI Lead Enrichment, Qualification and Follow-Up",
  "tags": [],
  "nodes": [
    {
      "id": "aa2fa5ce-a4e2-4bb3-afd2-b66fc4bccb34",
      "name": "Send Drop Message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2320,
        1060
      ],
      "parameters": {
        "sendTo": "={{ $('Input Form').item.json.Email }}",
        "message": "=Hello {{ $('Input Form').item.json.Name }},\n\nThank you for your message and interest.\n\nRegarding your inquiry:\n\"{{ $('Input Form').item.json.Message }}\"\n\nUnfortunately, {{ $('Input Form').item.json.Company }} does not currently meet our requirements for a partnership. We focus exclusively on companies that meet our specific criteria for size, location, and service needs.\n\nShould your situation change or if you have any questions, please feel free to reach out.\n\nBest regards,\n[Your Company Team]\n\nP.S. Feel free to visit our website for more information: [Your Website URL]",
        "options": {},
        "subject": "Re: Your Inquiry",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "6bd721e9-a644-43cb-8246-be0a4162f871",
      "name": "Define ICP and Lead Criteria",
      "type": "n8n-nodes-base.set",
      "position": [
        1280,
        540
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e339805a-db3b-426b-80fe-bcb3de317e93",
              "name": "ICP",
              "type": "string",
              "value": "ICP Criteria: Define your Ideal Customer Profile here. Example criteria:\n- Company Size: Define minimum employee count (e.g., 50+ employees)\n- Industry: List target industries (e.g., Tech, Finance, Healthcare, Manufacturing)\n- Geography: Specify target regions (e.g., North America, Europe, specific countries)\n- Pain Points: List problems your solution solves (e.g., manual processes, compliance issues, high costs)\n- Other Requirements: Annual revenue, technology stack, specific needs"
            },
            {
              "id": "d46ed2e4-fb27-46c8-b02a-59be7d0a1136",
              "name": "demo-ready",
              "type": "string",
              "value": "Demo-Ready: \"High-Intent Prospects with Clear Needs\"\n\nDefine criteria for demo-ready leads. Example:\n\nRequired: [Your primary requirement, e.g., specific region or company size]\n\nQualifying Criteria (need 2+ of these):\n- Company Size: [Your threshold]\n- Industries: [Your target industries]\n- Volume/Usage: [Expected usage levels]\n- Has relevant team/department\n- Message indicates: urgent needs, specific challenges, requests demo, mentions pain points\n\nExamples:\n1. Large Enterprise (1000+ employees) - Message: \"We need to automate our processes\"\n2. Mid-Market Company (200+ employees) - Message: \"Looking for solution to reduce costs\"\n3. Growing Startup (50+ employees) - Message: \"Need to scale our operations\""
            },
            {
              "id": "4df8d682-7975-4632-847e-e51753128780",
              "name": "nurture",
              "type": "string",
              "value": "Nurture: \"Prospects with Future Potential\"\n\nDefine criteria for nurture leads. Example:\n\nRequired: [Your basic requirement]\n\nQualifying Criteria (ANY of these):\n- Company Size: [Lower threshold]\n- ANY company in target industry\n- Message indicates: general interest, exploring options, budget constraints, future planning\n\nKey Rule: If they meet basic requirements and could benefit from your solution, default to nurture\n\nExamples:\n1. Small Company (20+ employees) - Message: \"Interested in learning about your solutions\"\n2. Growing Startup (30+ employees) - Message: \"Planning to implement next year\"\n3. Mid-size Company - Message: \"What are the benefits of your solution?\""
            },
            {
              "id": "f38c081d-8390-4ee5-82ef-f5c6b6b2080b",
              "name": "drop",
              "type": "string",
              "value": "Drop: \"Only Non-Target or No Relevance\"\n\nDrop ONLY if:\n- Does NOT meet geographic requirements\n- OR meets location but:\n  - Below minimum size threshold AND no growth potential\n  - Wrong industry (B2C when you serve B2B)\n  - Individual consumers or very small businesses\n  - Already using competitor with long-term contract\n  - Government with multi-year procurement cycles\n- Message indicates: spam, unrelated request, explicitly states no need\n\nExamples:\n1. International company outside target region\n2. B2C retail shop (when you serve B2B)\n3. Individual freelancer\n4. Company using competitor - Message: \"Happy with current solution\"\n5. Test messages or spam"
            },
            {
              "id": "567620aa-5eff-4537-bc1e-bed577effe1d",
              "name": "output",
              "type": "string",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f10a7086-b328-4cf6-8cf4-6141bcaec989",
      "name": "Demo-ready Data Processing",
      "type": "n8n-nodes-base.code",
      "position": [
        2100,
        160
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst transformedItems = items.map((item) => {\n  try {\n    item.json.output = JSON.parse(item.json.output);\n    item.json[\"lead classification\"] = \"demo-ready\";\n  } catch (error) {\n    console.log(\"Error parsing JSON\", error);\n  }\n  return item;\n});\nreturn transformedItems;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "b07be6c0-1c4a-46ba-bb05-f34717a95a40",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        320
      ],
      "parameters": {
        "width": 1340,
        "height": 620,
        "content": "## \ud83c\udfaf Nurture Follow-Up Sequence\n\n### Configuration:\n1. **Wait Times**: Adjust the wait nodes between emails (currently 1 day each)\n2. **Email Content**: Customize the nurture emails with your value propositions\n3. **Calendar Integration**: Update demo invitation with your calendar details\n\n### Sequence:\n1. Initial acknowledgment email with resources\n2. Follow-up with educational content/webinar\n3. Final demo invitation after nurturing"
      },
      "typeVersion": 1
    },
    {
      "id": "2e0aeace-e31f-451f-93d5-19b107fdff2c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        -280
      ],
      "parameters": {
        "color": 4,
        "width": 1340,
        "height": 580,
        "content": "## \u2705 Demo-Ready Follow-Up\n\n### Configuration:\n1. **Calendar Event**: Configure with your Google Calendar\n2. **Meeting Duration**: Default 1 hour (adjust as needed)\n3. **Auto-scheduling**: Next business day at 12 PM\n4. **Meeting Link**: Automatically includes Google Meet"
      },
      "typeVersion": 1
    },
    {
      "id": "32fe485d-0a83-4f5b-98c6-2fa497e3dd18",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        960
      ],
      "parameters": {
        "color": 3,
        "width": 1340,
        "height": 400,
        "content": "## \u274c Drop Follow-Up\n\n### Configuration:\n1. **Drop Message**: Customize the polite rejection email\n2. **Keep Door Open**: Mention they can reach out if situation changes\n3. **Website Link**: Add your company website URL"
      },
      "typeVersion": 1
    },
    {
      "id": "fc28ef38-a202-4be4-8fec-18f35de27c0b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1220,
        160
      ],
      "parameters": {
        "color": 5,
        "width": 580,
        "height": 1200,
        "content": "## \ud83e\udd16 Lead Classification\n\n### How it Works:\n- AI analyzes leads based on your ICP criteria\n- Classifies into: demo-ready, nurture, or drop\n- Uses GPT-4o for accurate classification\n\n### Setup:\n1. Edit the \"Define ICP and Lead Criteria\" node\n2. Customize the three classification categories\n3. Add your specific requirements and examples\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### Future Improvements:\n- Train with your historical lead data\n- Add more granular scoring system\n- Integrate with your CRM for better classification"
      },
      "typeVersion": 1
    },
    {
      "id": "f1da595e-e6de-4ef2-ae5f-4d83c049db24",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        160
      ],
      "parameters": {
        "color": 5,
        "width": 380,
        "height": 1200,
        "content": "## \ud83d\udcca Lead Enrichment\n\n### How it Works:\n- AI searches for company information\n- Extracts pain points from user message\n- Enriches with company size, industry, location\n\n### Setup:\n1. Ensure OpenAI API key is configured\n2. Uses GPT-4o-mini with search capabilities\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### Future Improvements:\n- Add more data sources (LinkedIn, Clearbit, etc.)\n- Integrate with company databases\n- Add technographic data enrichment"
      },
      "typeVersion": 1
    },
    {
      "id": "4fe396e9-6828-44cb-a250-52ed1d2f3e40",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        160
      ],
      "parameters": {
        "color": 5,
        "width": 800,
        "height": 540,
        "content": "## \ud83d\udce5 Input Form & Logging\n\n### Setup Required:\n1. **Form Webhook**: Copy the form URL after saving workflow\n2. **Google Sheets**: Create a new sheet with columns:\n   - Date, Name, Email, Company, Job Title, Message\n   - Number of Employees, Industry, Geography\n   - Annual Revenue, Technology, Pain Points\n   - Lead Classification\n3. **Update Sheet ID**: Replace YOUR_GOOGLE_SHEET_ID in all Google Sheets nodes\n\n### Future Improvements:\n- Connect to your website form via webhook\n- Add form validation\n- Implement duplicate detection"
      },
      "typeVersion": 1
    },
    {
      "id": "1f22c944-7cff-4a59-861d-a2ca3449fae3",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -280
      ],
      "parameters": {
        "color": 2,
        "width": 1800,
        "height": 420,
        "content": "# \ud83d\ude80 AI Lead Generation and Follow-Up Workflow\n\n### Overview:\nThis workflow automatically processes incoming leads, enriches them with company data, classifies them using AI, and sends appropriate follow-up sequences.\n\n### Prerequisites:\n1. **OpenAI API Key**: For AI classification and enrichment\n2. **Google Workspace**: Gmail, Sheets, and Calendar access\n3. **n8n**: Self-hosted or cloud instance\n\n### Quick Start:\n1. Import this workflow\n2. Update all credential nodes with your accounts\n3. Create a Google Sheet for lead logging\n4. Customize the ICP criteria and email templates\n5. Test with sample leads before going live"
      },
      "typeVersion": 1
    },
    {
      "id": "f18af6c3-e120-4589-912e-83b758cada07",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        720
      ],
      "parameters": {
        "color": 5,
        "width": 800,
        "height": 640,
        "content": "## \ud83d\udcac AI Answer Agent\n\n\n\n\n\n\n\n### How it Works:\n- Analyzes if message needs immediate response\n- Can answer basic questions automatically\n- Escalates complex queries to your team\n\n### Setup:\n1. **Escalation Email**: Replace \"your-email@company.com\" with your sales team email\n2. **Knowledge Base**: Add your company info to the AI agent\n3. **Auto-responses**: Customize for common questions\n\n### Future Improvements:\n- Separate workflow for complex Q&A\n- Add company knowledge base\n- Enable conversation logging"
      },
      "typeVersion": 1
    },
    {
      "id": "b5fdd252-b4d6-44c0-97d0-2f8d9cc63db2",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        540,
        880
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"Sending To\": \"user@example.com\",\n  \"Subject\": \"example subject\",\n\t\"Message\": \"example message\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "0cc44527-eddf-4d3f-9fbb-e491cbcc4dad",
      "name": "Input Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        40,
        540
      ],
      "parameters": {
        "options": {},
        "formTitle": "Contact Information",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Name",
              "requiredField": true
            },
            {
              "fieldLabel": "Email",
              "requiredField": true
            },
            {
              "fieldLabel": "Company",
              "requiredField": true
            },
            {
              "fieldLabel": "Job Title",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Message",
              "placeholder": "Tell us about your needs and challenges...",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "345a698a-8c65-4499-a544-3e1abadfe904",
      "name": "Get all columns",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        460,
        540
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "e6104159-0e01-47d1-9c55-b1389bbdab8f",
      "name": "Return latest column",
      "type": "n8n-nodes-base.code",
      "position": [
        660,
        540
      ],
      "parameters": {
        "jsCode": "const rows = items;\nconst lastRow = rows[rows.length - 1];\nreturn [lastRow];"
      },
      "typeVersion": 2
    },
    {
      "id": "2aafc922-f891-464c-922d-2061befab4f2",
      "name": "AI Answer Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "onError": "continueErrorOutput",
      "position": [
        340,
        740
      ],
      "parameters": {
        "text": "=We received the message \"{{ $json.Message }}\" from \"{{ $json.Name }}\", who is \"{{ $json['Job Title'] }}\" at \"{{ $json.Company }}\". The email is \"{{ $json.Email }}\"",
        "options": {
          "systemMessage": "You are a helpful assistant for [Your Company Name]. Your job is to evaluate incoming customer questions and determine whether you can provide a confident, accurate answer directly, if the inquiry requires human expertise, or if the message requires no response at all.\n\nInput Information:\nYou will receive: We received the message \"{{ $json.Message }}\" from \"{{ $json.Name }}\", who is \"{{ $json['Job Title'] }}\" at \"{{ $json.Company }}\". The email is \"{{ $json.Email }}\"\n\nDecision Criteria:\n\u2705 You CAN answer confidently when:\n- Questions about general features and capabilities\n- Basic product information and benefits\n- General pricing structure questions\n- Technical requirements and compatibility\n- Demo scheduling requests\n- General industry questions\n\n\u274c You CANNOT answer and must escalate when:\n- Specific pricing quotes or custom deals\n- Technical implementation details\n- Legal compliance questions\n- Account-specific issues\n- Partnership requests\n- Complaints or escalations\n\n\ud83d\udeab NO RESPONSE needed when:\n- Test messages\n- Spam or irrelevant content\n- Messages with no clear question\n- Automated messages\n\nResponse Instructions:\n- Language: Respond in the same language as the customer's message\n- Personalization: Address the customer by name\n- Professional Closing: Always end with proper signature\n- CRITICAL: ALL escalations go to user@example.com\n\nResponse Format:\nWhen you CAN answer:\n{\n\t\"Sending To\": \"{{ $json.Email }}\",\n\t\"Subject\": \"Re: Your inquiry about [topic]\",\n\t\"Message\": \"Your personalized answer\"\n}\n\nWhen you CANNOT answer:\n{\n\t\"Sending To\": \"user@example.com\",\n\t\"Subject\": \"Customer Inquiry Escalation - {{ $json.Company }}\",\n\t\"Message\": \"Customer inquiry requires human expertise...\"\n}\n\nWhen NO RESPONSE:\n{}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": false,
      "typeVersion": 2
    },
    {
      "id": "7cc7c4d1-f8ca-45aa-879a-cbcdc4c32130",
      "name": "Log Lead to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        260,
        540
      ],
      "parameters": {
        "columns": {
          "value": {
            "Date": "={{ $json.submittedAt }}",
            "Name": "={{ $json.Name }}",
            "Mail ": "={{ $json.Email }}",
            "Company": "={{ $json.Company }}",
            "Message": "={{ $json.Message }}",
            "Job Title": "={{ $json['Job Title'] }}"
          },
          "mappingMode": "defineBelow"
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9364acfc-1abe-4010-84eb-136d5f524724",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        380,
        880
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "7035b23b-bfb3-4a15-b359-6a4fe59e4fc0",
      "name": "Send Answer or Escalate",
      "type": "n8n-nodes-base.gmail",
      "position": [
        640,
        740
      ],
      "parameters": {
        "sendTo": "={{ $json.output['Sending To'] }}",
        "message": "={{ $json.output.Message }}",
        "options": {},
        "subject": "={{ $json.output.Subject }}",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "19f6d411-02ee-40c8-a1f1-18b50e382db6",
      "name": "AI Lead Enrichment",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        900,
        540
      ],
      "parameters": {
        "text": "=Complete the following lead information by using your knowledge and web search. Make sure not to include uncertain information.\n\nEnrich the following input company lead:\n\"{{ $json.Company }}\"\n\nUser Message:\n\"{{ $json.Message }}\"\n\nAnalyze the message to extract pain points and specific needs. Include these in the painpoints field.\n\nFill as much of the information schema below as clearly possible. Use appropriate number formatting for your region.\n\n{\n\"Number of Employees\": \"\",\n\"Industry\": \"\",\n\"geography\": \"\",\n\"annual revenue\": \"\",\n\"technology\": \"\",\n\"painpoints\": \"[Extract from message + research]\"\n}\n\nYour output MUST adhere to the JSON format defined above. No other text is allowed. DO NOT enclose the JSON in ```json ... ```",
        "options": {
          "systemMessage": "You are a helpful assistant that enriches a lead with relevant information and extracts pain points from their message."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": false,
      "typeVersion": 2
    },
    {
      "id": "25475f66-629f-4429-a920-c28911cf291c",
      "name": "OpenAI Search Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        920,
        700
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "98596eac-6b20-481f-8bdd-d317a471e30c",
      "name": "AI Lead Classifier",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        1500,
        540
      ],
      "parameters": {
        "options": {
          "multiClass": false,
          "systemPromptTemplate": "=You are an expert B2B sales qualification agent. Analyze leads based on our Ideal Customer Profile (ICP) and their message content.\n\n{{ $json.ICP }}\n\nIMPORTANT: Pay special attention to the user's message. Strong pain points or urgent needs in the message can upgrade a lead's classification. Be inclusive - when in doubt, choose nurture over drop.\n\nMake sure to only select exactly ONE classification category!"
        },
        "inputText": "=Company: {{ $('Input Form').item.json.Company }},\nMessage: {{ $('Input Form').item.json.Message }},\nLead enriched by AI: {{ $('AI Lead Enrichment').item.json.output }}",
        "categories": {
          "categories": [
            {
              "category": "demo-ready",
              "description": "={{ $json['demo-ready'] }}"
            },
            {
              "category": "nurture",
              "description": "={{ $json.nurture }}"
            },
            {
              "category": "drop",
              "description": "={{ $json.drop }}"
            }
          ]
        }
      },
      "typeVersion": 1.1,
      "alwaysOutputData": true
    },
    {
      "id": "9a726045-4534-43eb-8d98-e9cc58d29e2a",
      "name": "OpenAI Chat",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1520,
        680
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "789d48be-3949-4dc9-8b47-a117f37dee93",
      "name": "If demo-ready not empty",
      "type": "n8n-nodes-base.if",
      "position": [
        1860,
        160
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "285ef269-e5ca-4753-8c6e-334ac57131f3",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.output }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "fecfc85e-3196-4229-9fed-248ee2caf24c",
      "name": "If nurture not empty",
      "type": "n8n-nodes-base.if",
      "position": [
        1860,
        800
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "49fb9489-7940-4a49-846b-ebd87e229e94",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.output }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "673e0d53-1c54-42dc-ab82-a123965ed0cc",
      "name": "If drop not empty",
      "type": "n8n-nodes-base.if",
      "position": [
        1880,
        1200
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "49fb9489-7940-4a49-846b-ebd87e229e94",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.output }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "493ac5fe-16bf-4b84-a0e5-e6cdeb6567d9",
      "name": "Schedule Demo - High Intent",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        2100,
        -40
      ],
      "parameters": {
        "end": "={{ \n  $now.weekday === 5 ? \n    $now.plus(3, 'day').set({ hour: 13, minute: 0, second: 0 }) : \n  $now.weekday === 6 ? \n    $now.plus(2, 'day').set({ hour: 13, minute: 0, second: 0 }) : \n    $now.plus(1, 'day').set({ hour: 13, minute: 0, second: 0 }) \n}}",
        "start": "={{ \n  $now.weekday === 5 ? \n    $now.plus(3, 'day').set({ hour: 12, minute: 0, second: 0 }) : \n  $now.weekday === 6 ? \n    $now.plus(2, 'day').set({ hour: 12, minute: 0, second: 0 }) : \n    $now.plus(1, 'day').set({ hour: 12, minute: 0, second: 0 }) \n}}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "user@example.com"
        },
        "additionalFields": {
          "summary": "[Your Company] Product Demo",
          "attendees": [
            "={{ $('Input Form').item.json.Email }}"
          ],
          "description": "=Hello {{ $('Input Form').item.json.Name }}, \n\nThank you for your interest. We're confident our solution can revolutionize operations at {{ $('Input Form').item.json.Company }}. This demo will cover:\n\n- Your specific use case\n- Product walkthrough\n- Pricing and implementation\n- Q&A\n\nLooking forward to meeting you!\n\nBest regards,\n[Your Company] Team",
          "sendUpdates": "all",
          "guestsCanModify": true,
          "conferenceDataUi": {
            "conferenceDataValues": {
              "conferenceSolution": "hangoutsMeet"
            }
          },
          "guestsCanInviteOthers": true
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "fa67db9e-4b5d-4bac-8429-dad5383864c0",
      "name": "Update Sheet - Demo Ready",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2320,
        160
      ],
      "parameters": {
        "columns": {
          "value": {
            "Industry": "={{ $json.output.Industry }}",
            "Geography": "={{ $json.output.geography }}",
            "Technology": "={{ $json.output.technology }}",
            "row_number": "={{ $('Return latest column').item.json.row_number }}",
            "Pain Points": "={{ $json.output.painpoints }}",
            "Annual Revenue": "={{ $json.output['annual revenue'] }}",
            "Lead Classification": "={{ $json['lead classification'] }}",
            "Number of Employees": "={{ $json.output['Number of Employees'] }}"
          },
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ]
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "80600f05-e3d3-4743-a622-690272855861",
      "name": "Nurture Data Processing",
      "type": "n8n-nodes-base.code",
      "position": [
        2100,
        800
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst transformedItems = items.map((item) => {\n  try {\n    item.json.output = JSON.parse(item.json.output);\n    item.json[\"lead classification\"] = \"nurture\";\n  } catch (error) {\n    console.log(\"Error parsing JSON\", error);\n  }\n  return item;\n});\nreturn transformedItems;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ba34fe48-8840-4cde-85c2-10d822871c35",
      "name": "Drop Data Processing",
      "type": "n8n-nodes-base.code",
      "position": [
        2100,
        1200
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst transformedItems = items.map((item) => {\n  try {\n    item.json.output = JSON.parse(item.json.output);\n    item.json[\"lead classification\"] = \"drop\";\n  } catch (error) {\n    console.log(\"Error parsing JSON\", error);\n  }\n  return item;\n});\nreturn transformedItems;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "4768d28d-6805-4602-8a77-11d44f6662ae",
      "name": "Update Sheet - Drop",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2320,
        1200
      ],
      "parameters": {
        "columns": {
          "value": {
            "Industry": "={{ $json.output.Industry }}",
            "Geography": "={{ $json.output.geography }}",
            "Technology": "={{ $json.output.technology }}",
            "row_number": "={{ $('Return latest column').item.json.row_number }}",
            "Pain Points": "={{ $json.output.painpoints }}",
            "Annual Revenue": "={{ $json.output['annual revenue'] }}",
            "Lead Classification": "={{ $json['lead classification'] }}",
            "Number of Employees": "={{ $json.output['Number of Employees'] }}"
          },
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ]
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "0104b0d6-93a5-4fd9-bcae-df917ba3e0d4",
      "name": "Update Sheet - Nurture",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2320,
        800
      ],
      "parameters": {
        "columns": {
          "value": {
            "Industry": "={{ $json.output.Industry }}",
            "Geography": "={{ $json.output.geography }}",
            "Technology": "={{ $json.output.technology }}",
            "row_number": "={{ $('Return latest column').item.json.row_number }}",
            "Pain Points": "={{ $json.output.painpoints }}",
            "Annual Revenue": "={{ $json.output['annual revenue'] }}",
            "Lead Classification": "={{ $json['lead classification'] }}",
            "Number of Employees": "={{ $json.output['Number of Employees'] }}"
          },
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ]
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "1f7b2806-4372-450b-9d14-9be58dbaaa9c",
      "name": "Send Nurture Email - Resources",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2200,
        620
      ],
      "parameters": {
        "sendTo": "={{ $('Input Form').item.json.Email }}",
        "message": "=Hello {{ $('Input Form').item.json.Name }},\n\nThank you for your message:\n\"{{ $('Input Form').item.json.Message }}\"\n\nWe're excited about your interest! Based on your inquiry, we see great potential for collaboration.\n\nOur solution can help you:\n\u2713 [Benefit 1 - e.g., Reduce processing time by 80%]\n\u2713 [Benefit 2 - e.g., Improve accuracy and compliance]\n\u2713 [Benefit 3 - e.g., Scale your operations efficiently]\n\nWe'd love to show you how our solution can specifically help {{ $('Input Form').item.json.Company }}. A member of our team will reach out shortly to schedule a personalized demo.\n\nIn the meantime, check out our resource: [Link to video/guide]\n\nBest regards,\n[Your Company] Team",
        "options": {},
        "subject": "=Welcome to [Your Company] - Resources for You",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "d2e53971-ece2-4ae4-a3a4-37371d79dd59",
      "name": "Send Nurture Email - Event",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2560,
        620
      ],
      "parameters": {
        "sendTo": "={{ $('Input Form').item.json.Email }}",
        "message": "=Hello {{ $('Input Form').item.json.Name }}, \n\nStill exploring how [Your Company] can transform your operations at {{ $('Input Form').item.json.Company }}?\n\nJoin our upcoming webinar where we'll showcase:\n- Latest industry trends\n- Best practices and case studies\n- Live Q&A with our experts\n\nRegister here: [Webinar Link]\n\nCan't make it? Reply to schedule a personalized demo instead.\n\nBest regards,\n[Your Company] Team",
        "options": {},
        "subject": "Join Our Upcoming Webinar - [Topic]",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "ea4c08ff-8ca2-4bf4-a4f9-3989895fa248",
      "name": "Schedule Demo - After Nurture",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        2960,
        620
      ],
      "parameters": {
        "end": "={{ \n  $now.weekday === 5 ? \n    $now.plus(3, 'day').set({ hour: 13, minute: 0, second: 0 }) : \n  $now.weekday === 6 ? \n    $now.plus(2, 'day').set({ hour: 13, minute: 0, second: 0 }) : \n    $now.plus(1, 'day').set({ hour: 13, minute: 0, second: 0 }) \n}}",
        "start": "={{ \n  $now.weekday === 5 ? \n    $now.plus(3, 'day').set({ hour: 12, minute: 0, second: 0 }) : \n  $now.weekday === 6 ? \n    $now.plus(2, 'day').set({ hour: 12, minute: 0, second: 0 }) : \n    $now.plus(1, 'day').set({ hour: 12, minute: 0, second: 0 }) \n}}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "user@example.com"
        },
        "additionalFields": {
          "summary": "[Your Company] Product Demo",
          "attendees": [
            "={{ $('Input Form').item.json.Email }}"
          ],
          "description": "=Hello {{ $('Input Form').item.json.Name }}, \n\nThank you for your continued interest. We're excited to show you how our solution can transform {{ $('Input Form').item.json.Company }}'s operations.\n\nThis demo will be tailored to your needs and cover:\n- Your specific challenges\n- Solution demonstration\n- Implementation roadmap\n- Investment options\n\nSee you soon!\n\n[Your Company] Team",
          "sendUpdates": "all",
          "guestsCanModify": true,
          "conferenceDataUi": {
            "conferenceDataValues": {
              "conferenceSolution": "hangoutsMeet"
            }
          },
          "guestsCanInviteOthers": true
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "85416656-0617-44c8-b6e6-ffe81fc86ffe",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2740,
        -280
      ],
      "parameters": {
        "color": 4,
        "width": 440,
        "height": 580,
        "content": "### \ud83d\udccb Demo-Ready Actions:\n- Update log file with enriched data\n- Send immediate calendar invitation\n\n### Future Improvements:\n- Add CRM integration\n- Send prep materials before demo\n- Automated reminders"
      },
      "typeVersion": 1
    },
    {
      "id": "45177210-0fcf-4a6d-9197-41f023d7b044",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2740,
        760
      ],
      "parameters": {
        "width": 440,
        "height": 180,
        "content": "### \ud83d\udce7 Nurture Actions:\n- Update log file\n- Send educational resources\n- Follow up with event invite\n- Final demo scheduling\n\n### Future Improvements:\n- Personalized content paths\n- Lead scoring updates\n- Multi-channel follow-up"
      },
      "typeVersion": 1
    },
    {
      "id": "41771259-60a2-4c65-9739-a75f7513348b",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2740,
        960
      ],
      "parameters": {
        "color": 3,
        "width": 440,
        "height": 380,
        "content": "### \ud83d\udeab Drop Actions:\n- Update log file\n- Send polite decline message\n- Keep door open for future\n\n### Future Improvements:\n- Reason tracking\n- Re-engagement campaigns\n- Referral opportunities"
      },
      "typeVersion": 1
    },
    {
      "id": "429f33dc-aa67-4862-bdf7-2906825532b3",
      "name": "Wait 1 Day (3)",
      "type": "n8n-nodes-base.wait",
      "position": [
        2760,
        620
      ],
      "parameters": {
        "unit": "days",
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "9a04d625-9dff-4388-943a-79184d47bfc0",
      "name": "Wait 1 Day (2)",
      "type": "n8n-nodes-base.wait",
      "position": [
        2380,
        620
      ],
      "parameters": {
        "unit": "days",
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "f2b40d76-7dd3-4397-bff2-7a6efcf93f74",
      "name": "Wait 1 Day (1)",
      "type": "n8n-nodes-base.wait",
      "position": [
        2020,
        620
      ],
      "parameters": {
        "unit": "days",
        "amount": 1
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0a7365f5-3f0c-4929-a5c0-edfceb4f487b",
  "connections": {
    "Input Form": {
      "main": [
        [
          {
            "node": "AI Answer Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Lead to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat": {
      "ai_languageModel": [
        [
          {
            "node": "AI Lead Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Wait 1 Day (1)": {
      "main": [
        [
          {
            "node": "Send Nurture Email - Resources",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 1 Day (2)": {
      "main": [
        [
          {
            "node": "Send Nurture Email - Event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 1 Day (3)": {
      "main": [
        [
          {
            "node": "Schedule Demo - After Nurture",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Answer Agent": {
      "main": [
        [
          {
            "node": "Send Answer or Escalate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all columns": {
      "main": [
        [
          {
            "node": "Return latest column",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If drop not empty": {
      "main": [
        [
          {
            "node": "Drop Data Processing",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Drop Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Lead to Sheet": {
      "main": [
        [
          {
            "node": "Get all columns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Answer Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Lead Classifier": {
      "main": [
        [
          {
            "node": "If demo-ready not empty",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If nurture not empty",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If drop not empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Lead Enrichment": {
      "main": [
        [
          {
            "node": "Define ICP and Lead Criteria",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Search Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Lead Enrichment",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Update Sheet - Drop": {
      "main": [
        []
      ]
    },
    "Drop Data Processing": {
      "main": [
        [
          {
            "node": "Update Sheet - Drop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If nurture not empty": {
      "main": [
        [
          {
            "node": "Nurture Data Processing",
            "type": "main",
            "index": 0
          },
          {
            "node": "Wait 1 Day (1)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Return latest column": {
      "main": [
        [
          {
            "node": "AI Lead Enrichment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If demo-ready not empty": {
      "main": [
        [
          {
            "node": "Demo-ready Data Processing",
            "type": "main",
            "index": 0
          },
          {
            "node": "Schedule Demo - High Intent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nurture Data Processing": {
      "main": [
        [
          {
            "node": "Update Sheet - Nurture",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Answer Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Demo-ready Data Processing": {
      "main": [
        [
          {
            "node": "Update Sheet - Demo Ready",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Nurture Email - Event": {
      "main": [
        [
          {
            "node": "Wait 1 Day (3)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define ICP and Lead Criteria": {
      "main": [
        [
          {
            "node": "AI Lead Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Nurture Email - Resources": {
      "main": [
        [
          {
            "node": "Wait 1 Day (2)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

This n8n workflow template automates your lead generation and follow-up process using AI. It captures leads through a form, enriches them with company data, classifies them into different categories, and sends appropriate follow-up sequences automatically. 🤖 AI-powered lead…

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

The workflow runs every hour with a randomized delay of 5–20 minutes to help distribute load. It records the exact date and time a lead is emailed so you can track outreach. Follow-ups are automatical

Google Sheets, Agent, OpenAI Chat +5
AI & RAG

Transform your manual hiring process into an intelligent evaluation system that saves 15-20 minutes per candidate! This workflow automates the entire candidate assessment pipeline - from CSV/XLSX uplo

Form Trigger, Google Sheets, Google Drive +8
AI & RAG

This n8n workflow is designed for e-commerce businesses, digital marketers, and content creators who want to automatically generate professional 3D product videos from product images. It's perfect for

Form Trigger, Google Drive, HTTP Request +9
AI & RAG

AI Agents Vs AI Workflow. Uses lmChatOpenAi, gmailTrigger, gmail, gmailTool. Event-driven trigger; 30 nodes.

OpenAI Chat, Gmail Trigger, Gmail +7
AI & RAG

This workflow automates the complete process of generating and sending AI-powered newsletters. It starts with a form submission where the user provides a brand name, website, and topic query. The syst

Output Parser Structured, Agent, Google Sheets +5