{
  "nodes": [
    {
      "id": "f4127c9c-ac82-435c-b9ab-919b767680fa",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "notes": "\ud83d\udcac REAL-TIME RESPONSE DELIVERY - INSTANT GRATIFICATION\n\nDelivers the AI's response back to your chat interface in milliseconds. Creates the illusion of instant human interaction that keeps prospects engaged.\n\n\u2705 RESPONSE OPTIMIZATION:\n\u2022 Sub-2-second response time (faster than human typing)\n\u2022 Formats responses for your specific chat platform\n\u2022 Maintains conversation state across multiple exchanges\n\u2022 Handles error states gracefully (AI failures, rate limits)\n\u2022 Supports rich media responses (links, images, documents)\n\u2022 Mobile-optimized formatting for all screen sizes\n\n\ud83d\udce4 RESPONSE STRUCTURE:\n{\n  \"message\": \"Thanks for your interest! What type of project are you working on?\",\n  \"action\": \"continue\", // or \"complete\" when qualified\n  \"metadata\": {\n    \"leadScore\": 85,\n    \"nextSteps\": \"schedule-demo\",\n    \"priority\": \"high\"\n  }\n}\n\n\ud83c\udfaf CONVERSION OPTIMIZATION:\n\u2022 Fast responses prevent prospect abandonment\n\u2022 Consistent messaging reduces confusion\n\u2022 Smart routing based on conversation stage\n\u2022 Automatic escalation triggers for high-value leads\n\u2022 Integration with calendar booking for demos\n\n\u2699\ufe0f ADVANCED FEATURES:\n\u2022 Typing indicators for human-like experience\n\u2022 Message read receipts and delivery confirmation\n\u2022 Fallback responses for API failures\n\u2022 Rate limiting protection and queue management\n\u2022 Multi-language support based on prospect location\n\n\ud83d\udd27 CUSTOMIZATION OPTIONS:\n\u2022 Adjust response format for your chat platform\n\u2022 Add custom metadata for your CRM integration\n\u2022 Configure error handling and retry logic\n\u2022 Set up A/B testing for different response styles\n\n\ud83d\udca1 PRO TIP: Monitor response times in your analytics. Any delay over 3 seconds significantly reduces conversion rates.",
      "position": [
        240,
        -120
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "8bec2419-1971-47f1-8959-4e71a51f8799",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "notes": "\ud83c\udf10 UNIVERSAL CHAT CONNECTOR - YOUR WEBSITE'S FRONT DOOR\n\nThe entry point that connects ANY chat platform to your AI agent. This webhook makes your lead capture system platform-agnostic and future-proof.\n\n\u2705 UNIVERSAL INTEGRATION:\n\u2022 Works with ANY chat widget (Intercom, Crisp, Tidio, custom)\n\u2022 Connects to WhatsApp Business API for messaging\n\u2022 Integrates with Facebook Messenger and Instagram DM\n\u2022 Handles contact forms, popup modals, and embedded chat\n\u2022 Processes email inquiries and social media messages\n\u2022 Mobile app integration ready\n\n\ud83d\udcdd EXPECTED DATA FORMAT:\n{\n  \"message\": \"Hi, I need help with AI automation\",\n  \"sessionId\": \"visitor-12345-timestamp\",\n  \"source\": \"website-chat\" // optional for tracking\n}\n\n\ud83d\udd27 INTEGRATION EXAMPLES:\n\u2022 WordPress: Simple JavaScript fetch() call\n\u2022 Shopify: Webhook to this endpoint from chat apps\n\u2022 React/Vue: Axios POST with conversation state\n\u2022 Zapier: Connect 2000+ platforms instantly\n\u2022 Make.com: Visual integration builder\n\n\ud83c\udfaf BUSINESS SCALING:\n\u2022 One workflow handles all customer touchpoints\n\u2022 Consistent lead qualification across all channels\n\u2022 Centralized conversation analytics and reporting\n\u2022 A/B test different conversation flows easily\n\u2022 Scale from 10 to 10,000 conversations seamlessly\n\n\u26a1 QUICK SETUP:\n1. Copy this webhook URL\n2. Add to your chat widget's webhook settings\n3. Send test message with proper JSON format\n4. Verify response appears in your chat interface\n\n\ud83d\udca1 PRO TIP: Include 'source' field in requests to track which channels generate the highest-quality leads.",
      "position": [
        -280,
        -120
      ],
      "parameters": {
        "path": "4777b330-6bf9-460e-aaf0-52d6263d17d7",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "69a763e3-0d4d-4c86-90d6-498c65e1fcb8",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheetsTool",
      "notes": "\ud83d\udcca INTELLIGENT LEAD DATA STORAGE - STRUCTURED DATA FROM CHAOS\n\nAutomatically extracts and organizes lead information from natural conversation into your CRM. No more manual data entry or missed details!\n\n\u2705 AI-POWERED DATA EXTRACTION:\n\u2022 $fromAI() functions intelligently parse conversation text\n\u2022 Extracts contact info, project details, budget, timeline\n\u2022 Handles partial data (fills in gaps as conversation progresses)\n\u2022 Validates and formats data automatically (emails, phone numbers)\n\u2022 Appends new leads as rows in real-time\n\u2022 Never loses a lead due to human error\n\n\ud83c\udfaf BUSINESS VALUE:\n\u2022 Saves 15-20 minutes per lead on manual data entry\n\u2022 100% accurate lead capture (no typos or missed fields)\n\u2022 Instant CRM integration for your sales team\n\u2022 Real-time lead notifications and follow-up triggers\n\u2022 Complete conversation history stored for context\n\u2022 Lead scoring based on budget, timeline, and project scope\n\n\ud83d\udd27 SETUP CHECKLIST:\n1. Create Google Sheet with headers matching schema\n2. Connect Google Sheets OAuth in n8n credentials\n3. Update documentId to your sheet URL\n4. Test with sample conversation data\n5. Set up conditional formatting for lead prioritization\n\n\ud83d\udcc8 ADVANCED FEATURES TO ADD:\n\u2022 Timestamp for lead velocity tracking\n\u2022 Lead source attribution for marketing ROI\n\u2022 Automatic lead scoring (A/B/C priority)\n\u2022 Integration with Zapier for multi-platform sync\n\u2022 Duplicate detection and merge functionality\n\n\ud83d\udca1 PRO TIP: Add conditional formatting in Google Sheets to highlight high-value leads (budget >$10k, timeline <30 days) for immediate follow-up.",
      "position": [
        220,
        160
      ],
      "parameters": {
        "columns": {
          "value": {
            "Full Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Full_Name', ``, 'string') }}",
            "Budget Range": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Budget_Range', ``, 'string') }}",
            "Company Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Company_Name', ``, 'string') }}",
            "Phone Number": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Phone_Number', ``, 'string') }}",
            "Email Address": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Email_Address', ``, 'string') }}",
            "Project Timeline": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Project_Timeline', ``, 'string') }}",
            "Project Intent/Needs": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Project_Intent_Needs', ``, 'string') }}",
            "How they heard about DAEX AI": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('How_they_heard_about_DAEX_AI', ``, 'string') }}",
            "Preferred Communication Channel": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Preferred_Communication_Channel', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Full Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Full Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Project Intent/Needs",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Project Intent/Needs",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Project Timeline",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Project Timeline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Budget Range",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Budget Range",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Preferred Communication Channel",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Preferred Communication Channel",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "How they heard about DAEX AI",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "How they heard about DAEX AI",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OBxt6TX3edgxiSYnsULCuSM5OL7GYlA6W3DjNYBEpfo/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OBxt6TX3edgxiSYnsULCuSM5OL7GYlA6W3DjNYBEpfo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OBxt6TX3edgxiSYnsULCuSM5OL7GYlA6W3DjNYBEpfo/edit?usp=drivesdk",
          "cachedResultName": "client intake form"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "d2679c41-cd73-480c-8066-6c14c388a528",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "notes": "\ud83d\udcad CONVERSATION MEMORY - NO MORE \"WHAT'S YOUR NAME AGAIN?\"\n\nKeeps track of conversation history so your AI doesn't ask the same questions twice or lose context mid-conversation. Essential for natural, human-like interactions.\n\n\u2705 WHAT IT REMEMBERS:\n\u2022 Customer's name and company details\n\u2022 Previously discussed project requirements\n\u2022 Budget range and timeline preferences\n\u2022 Questions already asked and answered\n\u2022 Context from earlier in the conversation\n\u2022 Emotional tone and customer preferences\n\n\ud83d\udd27 MEMORY CONFIGURATION:\n\u2022 sessionId: Separates different website visitors (never mix conversations!)\n\u2022 9 messages = ~4-5 back-and-forth exchanges\n\u2022 Includes both customer messages AND AI responses\n\u2022 Automatically expires after session ends\n\n\ud83c\udfaf BUSINESS VALUE:\n\u2022 Creates seamless conversation experience\n\u2022 Reduces customer frustration from repeated questions\n\u2022 Enables complex, multi-topic discussions\n\u2022 Allows for intelligent follow-up questions\n\u2022 Maintains context even if customer refreshes page\n\n\u2699\ufe0f TUNING OPTIONS:\n\u2022 Increase contextWindowLength (10-20) for longer sales conversations\n\u2022 Decrease (5-7) for simple lead capture to save memory/costs\n\u2022 Use persistent memory for returning customers (requires database)\n\n\ud83d\udca1 PRO TIP: Monitor memory usage in logs to optimize for your conversation patterns. Longer memory = better context but higher costs.",
      "position": [
        -40,
        80
      ],
      "parameters": {
        "sessionKey": "={{ $json.body.sessionId }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 9
      },
      "typeVersion": 1.3
    },
    {
      "id": "22983be8-6b3f-47bb-a9ab-85cc4bc24172",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "notes": "\ud83e\udde0 AI LANGUAGE MODEL - THE BRAIN BEHIND THE CONVERSATION\n\nPowers the conversational intelligence with Google's latest multimodal AI. This is what makes your chatbot sound human and handle complex customer inquiries.\n\n\u2705 WHY GEMINI 2.0 FLASH:\n\u2022 Lightning-fast responses (under 2 seconds) = no awkward waiting\n\u2022 Excellent at maintaining natural conversation flow\n\u2022 Cost-effective for high-volume lead capture ($0.000075 per 1K tokens)\n\u2022 Strong reasoning for complex customer questions and objections\n\u2022 Multimodal capabilities (can handle text, images, and more)\n\u2022 Built-in safety filters and brand-appropriate responses\n\n\ud83d\udcb0 COST BREAKDOWN:\n\u2022 ~1,000 conversations per month = $15-25 in API costs\n\u2022 Compare to: One sales rep salary = $4,000-8,000/month\n\u2022 ROI is immediate and scales infinitely\n\n\ud83d\udd27 SETUP OPTIONS:\n\u2022 Get Google AI Studio API key (free tier: 15 requests/minute)\n\u2022 Alternative models: GPT-4, Claude, or local Ollama models\n\u2022 Adjust temperature for more/less creative responses\n\u2022 Set max tokens to control response length and costs\n\n\ud83c\udfaf BUSINESS IMPACT:\n\u2022 Handles multiple conversations simultaneously\n\u2022 Never gets tired, frustrated, or has bad days\n\u2022 Consistent quality regardless of volume\n\u2022 Can be trained on your specific industry knowledge",
      "position": [
        -220,
        180
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f1e4f258-7527-4c6d-84c4-c5b1da74df9a",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "notes": "\ud83e\udd16 CONVERSATIONAL AI BRAIN - THE SALES REP THAT NEVER SLEEPS\n\nThis is your automated sales assistant that handles lead qualification 24/7. Think of it as your best sales rep working around the clock.\n\n\u2705 WHAT IT DOES:\n\u2022 Welcomes visitors with human-like warmth and personality\n\u2022 Asks qualifying questions naturally (no robotic forms!)\n\u2022 Remembers context throughout the entire conversation\n\u2022 Handles objections and answers FAQs about your services\n\u2022 Extracts and saves complete lead data automatically\n\u2022 Maintains conversation flow even with complex customer questions\n\n\ud83c\udfaf BUSINESS VALUE:\n\u2022 Captures leads while you sleep (24/7 availability)\n\u2022 Qualifies prospects before they hit your calendar\n\u2022 Saves 2-3 hours daily on manual lead intake\n\u2022 Converts 30-40% more website visitors into qualified leads\n\u2022 Consistent messaging that matches your brand voice\n\n\ud83d\udd27 CUSTOMIZATION POINTS:\n\u2022 Update company name/description in system message\n\u2022 Modify qualifying questions for your specific business\n\u2022 Adjust conversation tone for your brand personality\n\u2022 Add your unique service offerings and FAQs\n\u2022 Set lead scoring criteria based on responses\n\n\ud83d\udca1 PRO TIP: The more specific you make the system message about your services and ideal customers, the better it qualifies leads and handles objections.",
      "position": [
        -100,
        -120
      ],
      "parameters": {
        "text": "={{ $json.body.message }} ",
        "options": {
          "systemMessage": "=You are a Welcome Agent for a company specializing in building custom AI assistants to suit client needs, including sales bots, data extraction tools, and automated customer service systems. Your role is to collect client information through a natural, conversational approach, answer FAQs, and save information to Google Sheets.\n\nCRITICAL INSTRUCTIONS:\n1. Begin with ONE friendly, warm welcome message introducing yourself and the company as a custom AI assistant developer.\n2. LISTEN CAREFULLY to what clients say and respond conversationally:\n  - Use natural language with occasional filler words like \"actually\" or \"you know\"\n  - Vary your sentence structure and length to sound more human\n  - Ask follow-up questions about interesting points they mention\n  - If they ask questions about services, answer them as a knowledgeable team member would\n  - Acknowledge their emotions and respond empathetically\n\n3. Collect all required information naturally, weaving questions into conversation:\n  a. Full Name\n  b. Company Name\n  c. Email Address\n  d. Phone Number (mention this is optional)\n  e. Project Intent/Needs\n  f. Project Timeline\n  g. Budget Range\n  h. Preferred Communication Channel\n  i. How they heard about the company\n\n4. Remember what they've told you and reference it later in conversation\n5. Be conversational when acknowledging responses: \"That's great to hear\" instead of \"Information acknowledged\"\n6. Use their name occasionally and mirror their communication style\n7. After collecting ALL information, provide a friendly summary of the conversation\n8. Then use the saveToGoogleSheets function to save the data\n\nCONVERSATION APPROACH:\n- Welcome them like a real person would: \"Hi there! I'm [Name] from [Company]. What brings you to our site today?\"\n- Have genuine-sounding reactions: \"That's exactly the kind of challenge we help with!\"\n- If they ask questions, answer conversationally, not like a knowledge base\n- Transition naturally: \"By the way, I didn't catch your name?\" rather than \"Please provide your full name\"\n- Add occasional personal touches: \"I worked with a similar project last month, actually\"\n- Express enthusiasm about their project specifically\n\nKEY FAQ KNOWLEDGE:\n- Explain all company services conversationally, like you're excited about them\n- Emphasize specialty in customizing AI assistants with real examples\n- Give approximate timelines based on past projects, not generic ranges\n- Discuss pricing honestly but tactfully\n- Talk about integration capabilities from personal experience\n- Discuss AI capabilities with nuance, not marketing speak\n\nAfter collecting all information, CALL THE SAVE FUNCTION:\nsaveToGoogleSheets([\n new Date().toISOString(),\n fullName,\n companyName,\n emailAddress,\n phoneNumber,\n projectIntent,\n projectTimeline,\n budgetRange,\n preferredCommunicationChannel,\n referralSource\n]);\n\nThen say something friendly and specific to their situation: \"Thanks so much, [Name]! I've passed your information to our team. Given your interest in [specific need they mentioned], I think you'll really enjoy talking with our specialists. Someone will reach out to you [timeframe based on their urgency].\"\n\nHUMAN-LIKE BEHAVIORS:\n- Occasionally start sentences with conjunctions (And, But, So)\n- Use contractions (I'm, we're, you'll) consistently\n- React to surprising or interesting information they share\n- Admit when you don't know something instead of giving generic answers\n- Use humor appropriately when the conversation allows for it\n- Show genuine interest in their business challenges\n- Don't sound overly scripted or perfectly structured in responses"
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "4371b7e4-4635-434e-b206-29d56f673eef",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -160
      ],
      "parameters": {
        "height": 240,
        "content": "## Webhook Entry Point\n\n**Receives requests from:**\n- Website chat widgets\n- Mobile apps\n- Third-party platforms\n- Custom integrations"
      },
      "typeVersion": 1
    },
    {
      "id": "9714adba-d2ab-4633-9a30-4a65e8a0fac8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -160
      ],
      "parameters": {
        "height": 340,
        "content": "## Response Output\n\n**Returns structured response:**\n- AI-generated answer\n- Consistent formatting\n- Ready for frontend display\n- JSON format compatible"
      },
      "typeVersion": 1
    },
    {
      "id": "58365a2a-41df-49ea-9872-9a355deef92e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        160
      ],
      "parameters": {
        "width": 400,
        "height": 220,
        "content": "## AI Processing Core\n\n**Powered by Google Gemini 2.0 Flash**\n- Fast response times\n- Context-aware conversations\n- Natural language understanding\n- Maintains conversation history per session"
      },
      "typeVersion": 1
    },
    {
      "id": "9cb625cd-a34a-4195-9828-550642f70659",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        200
      ],
      "parameters": {
        "width": 360,
        "height": 280,
        "content": "## Data storage to spreadsheet\n a. Full Name\n  b. Company Name\n  c. Email Address\n  d. Phone Number (mention this is optional)\n  e. Project Intent/Needs\n  f. Project Timeline\n  g. Budget Range\n  h. Preferred Communication Channel\n  i. How they heard about the company\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}