How to Build a WhatsApp Chatbot for NGO Lead Management with n8n (Free Template)

How to Build a WhatsApp Chatbot for NGO Lead Management with n8n (Free Template)

International NGOs face a critical challenge: managing thousands of beneficiary inquiries across WhatsApp while maintaining personalized engagement. Manual responses create bottlenecks that delay critical services. This n8n workflow solves that by automating WhatsApp conversations, delivering content sequences, and tracking lead status in real-time. You'll learn how to build a complete chatbot system that handles data ingestion, conversation management, and automated follow-ups.

The Problem: Manual WhatsApp Management Doesn't Scale

NGOs receive hundreds of WhatsApp messages daily from beneficiaries seeking services, information, or support. Staff members manually respond to each inquiry, copy data into spreadsheets, and track follow-up schedules in separate systems.

Current challenges:

  • Response time averages 4-6 hours during business hours, 24+ hours after-hours
  • Lead data scattered across WhatsApp chats, paper forms, and multiple spreadsheets
  • No automated content delivery for educational sequences or program information
  • Staff spend 15-20 hours weekly on repetitive message responses

Business impact:

  • Time spent: 80+ hours monthly on manual WhatsApp management
  • Missed opportunities: 30-40% of inquiries never receive follow-up
  • Data accuracy: Manual entry creates 15-20% error rate in lead tracking

The Solution Overview

This n8n workflow creates an automated WhatsApp chatbot that handles the complete lead management cycle. The system ingests beneficiary data from Google Sheets, processes incoming WhatsApp messages through the WhatsApp Business API, delivers automated content sequences based on lead status, and updates lead information back to Google Sheets in real-time. The architecture uses webhook triggers for instant message processing, conditional logic for conversation routing, and scheduled triggers for automated follow-ups.

What You'll Build

This workflow delivers a complete WhatsApp automation system with data synchronization and intelligent conversation management.

Component Technology Purpose
Data Source Google Sheets Centralized lead database with status tracking
Message Gateway WhatsApp Business API Two-way message processing and delivery
Conversation Logic n8n Switch & IF Nodes Route messages based on content and lead status
Content Delivery Schedule Trigger + HTTP Request Automated message sequences at defined intervals
Data Sync Google Sheets Update Real-time lead status updates from conversations
Error Handling Stop and Error Node Graceful failure management with logging

Prerequisites

Before starting, ensure you have:

  • n8n instance (cloud or self-hosted version 1.0+)
  • WhatsApp Business API account with approved phone number
  • Google Sheets with API access enabled
  • Google Service Account credentials JSON file
  • Basic understanding of webhook concepts
  • WhatsApp Business API credentials (API key, phone number ID)

Step 1: Set Up Data Ingestion from Google Sheets

The workflow begins by establishing a stable connection to your lead database in Google Sheets. This foundation enables all subsequent automation.

Configure Google Sheets Connection

  1. Create a Google Sheets document with these exact column headers: Name, Phone, Status, Last_Contact, Next_Action
  2. In n8n, add a Google Sheets node configured for "Read" operation
  3. Set the spreadsheet ID from your Google Sheets URL
  4. Configure the range as Sheet1!A:E to capture all lead data
  5. Enable "RAW Data" option to preserve data types

Node configuration:

{
  "authentication": "serviceAccount",
  "operation": "read",
  "sheetName": "Sheet1",
  "range": "A:E",
  "options": {
    "rawData": true
  }
}

Why this works:

Reading the entire range ensures you capture all existing leads without manual updates when new rows are added. The RAW Data option prevents Google Sheets from converting phone numbers into scientific notation, which would break WhatsApp message delivery.

Variables to customize:

  • sheetName: Change if your data is on a different sheet tab
  • range: Adjust columns based on your lead tracking fields

Step 2: Configure WhatsApp Business API Integration

WhatsApp message processing requires two separate workflows: one for receiving messages (webhook) and one for sending messages (HTTP requests).

Set Up Incoming Message Webhook

  1. Add a Webhook node as your workflow trigger
  2. Set HTTP Method to POST
  3. Copy the production webhook URL
  4. In your WhatsApp Business API dashboard, configure this URL as your webhook endpoint
  5. Add the verification token provided by WhatsApp

Node configuration:

{
  "httpMethod": "POST",
  "path": "whatsapp-webhook",
  "responseMode": "responseNode",
  "options": {
    "rawBody": true
  }
}

Configure Outgoing Message API

  1. Add an HTTP Request node for sending messages
  2. Set method to POST
  3. URL: https://graph.facebook.com/v17.0/{phone-number-id}/messages
  4. Add Authentication header with your WhatsApp API token
  5. Configure JSON body with message template

Message sending configuration:

{
  "messaging_product": "whatsapp",
  "to": "{{$json.phone}}",
  "type": "text",
  "text": {
    "body": "{{$json.message_content}}"
  }
}

Why this approach:

Separating inbound and outbound message handling allows independent scaling. The webhook responds instantly to user messages while the HTTP Request node handles rate limiting and retry logic for outbound messages.

Common issues:

  • Webhook verification fails → Ensure your verification token matches WhatsApp dashboard exactly
  • Messages not sending → Check that phone number ID is from your WhatsApp Business API account, not your personal WhatsApp number

Step 3: Implement Conversation Logic and Routing

The chatbot needs to understand message context and route conversations appropriately based on lead status and message content.

Add Message Classification

  1. Insert a Switch node after the webhook trigger
  2. Configure routing rules based on message content keywords
  3. Add routes for: "info", "register", "help", "status"
  4. Include a default route for unrecognized messages

Switch node configuration:

{
  "mode": "rules",
  "rules": [
    {
      "conditions": {
        "string": [
          {
            "value1": "={{$json.body.entry[0].changes[0].value.messages[0].text.body.toLowerCase()}}",
            "operation": "contains",
            "value2": "info"
          }
        ]
      },
      "renameOutput": "info_request"
    }
  ]
}

Add Lead Status Checking

  1. After message classification, add an IF node
  2. Connect to Google Sheets to lookup lead by phone number
  3. Check if lead exists and retrieve current status
  4. Route to appropriate response based on status: "new", "contacted", "enrolled", "inactive"

Why this works:

The Switch node handles immediate message classification without database queries, reducing response time. The subsequent IF node performs status checks only for messages that require personalized responses, optimizing API calls to Google Sheets.

Variables to customize:

  • keywords: Add industry-specific terms your beneficiaries use
  • status_values: Adjust based on your lead lifecycle stages

Step 4: Build Automated Content Sequence

Content sequences deliver educational materials, program information, or follow-up messages at scheduled intervals based on lead status.

Configure Schedule Trigger

  1. Add a separate workflow with a Schedule Trigger node
  2. Set to run daily at 9:00 AM local time
  3. Connect to Google Sheets to fetch leads where Next_Action date equals today
  4. Filter for leads with status "enrolled" or "contacted"

Schedule configuration:

{
  "rule": {
    "interval": [
      {
        "field": "cronExpression",
        "expression": "0 9 * * *"
      }
    ]
  }
}

Build Content Delivery Logic

  1. Add a Function node to determine which message to send based on lead status and enrollment date
  2. Calculate days since enrollment: Math.floor((Date.now() - new Date($json.enrollment_date)) / 86400000)
  3. Map day count to content sequence: Day 1 = Welcome, Day 3 = Resources, Day 7 = Check-in
  4. Connect to HTTP Request node to send WhatsApp message

Function node logic:

const daysSinceEnrollment = Math.floor((Date.now() - new Date($json.enrollment_date)) / 86400000);

const contentMap = {
  1: "Welcome to our program! Here's what to expect...",
  3: "Access your resources here: [link]",
  7: "How are you progressing? Reply with any questions.",
  14: "Reminder: Complete your first milestone by [date]"
};

return {
  json: {
    phone: $json.phone,
    message_content: contentMap[daysSinceEnrollment] || "Thank you for being part of our program!",
    lead_id: $json.id
  }
};

Why this approach:

Calculating content delivery based on enrollment date rather than fixed schedules ensures each beneficiary receives personalized timing. The Function node centralizes content logic, making it easy to modify message sequences without changing multiple nodes.

Step 5: Automate Lead Status Updates

Every conversation interaction should update the lead's status and timestamp in Google Sheets to maintain accurate tracking.

Configure Status Update Node

  1. Add a Google Sheets node set to "Update" operation
  2. Place after each conversation path that requires status change
  3. Map the lead's row number from the lookup operation
  4. Update columns: Status, Last_Contact, Next_Action

Update configuration:

{
  "operation": "update",
  "sheetName": "Sheet1",
  "range": "Sheet1!A{{$json.row_number}}:E{{$json.row_number}}",
  "options": {
    "valueInputMode": "USER_ENTERED"
  },
  "dataMode": "defineBelow",
  "fieldsUi": {
    "values": [
      {
        "column": "Status",
        "fieldValue": "={{$json.new_status}}"
      },
      {
        "column": "Last_Contact",
        "fieldValue": "={{$now.toFormat('yyyy-MM-dd HH:mm')}}"
      }
    ]
  }
}

Add Error Handling

  1. Insert a Stop and Error node after the update operation
  2. Configure to continue on error and log to a separate error tracking sheet
  3. Add a Function node to format error details: timestamp, lead ID, error message

Why this works:

Updating immediately after each interaction ensures data consistency even if subsequent workflow steps fail. The error handling prevents a single failed update from blocking the entire conversation flow.

Variables to customize:

  • status_values: Match your organization's lead lifecycle terminology
  • next_action_calculation: Adjust follow-up intervals based on program requirements

Workflow Architecture Overview

This workflow consists of 18-22 nodes organized into 4 main sections:

  1. Data ingestion (Nodes 1-4): Google Sheets connection, lead data retrieval, initial data validation
  2. Message processing (Nodes 5-12): Webhook trigger, message parsing, conversation routing via Switch node, lead status lookup
  3. Response generation (Nodes 13-18): Content selection based on status, WhatsApp API message sending, delivery confirmation
  4. Data synchronization (Nodes 19-22): Lead status updates, timestamp recording, error logging

Execution flow:

  • Trigger: Incoming WhatsApp message via webhook OR scheduled daily run at 9:00 AM
  • Average run time: 2-4 seconds for message processing, 8-12 seconds for batch content delivery
  • Key dependencies: Google Sheets API, WhatsApp Business API, stable webhook endpoint

Critical nodes:

  • Switch Node: Routes messages based on keyword detection and intent classification
  • IF Node: Checks lead existence and current status to determine appropriate response path
  • Function Node: Calculates content sequence timing and formats message templates
  • HTTP Request Node: Handles all WhatsApp message sending with retry logic

The complete n8n workflow JSON template is available at the bottom of this article.

Key Configuration Details

WhatsApp Business API Integration

Required fields:

  • API Token: Your WhatsApp Business API access token (starts with "EAAG...")
  • Phone Number ID: The ID of your WhatsApp Business phone number (not the phone number itself)
  • Webhook Verify Token: Custom string you create for webhook verification
  • API Version: v17.0 or higher (update URL if using newer version)

Common issues:

  • Using personal WhatsApp number instead of Business API number → Messages fail to send
  • Incorrect phone number format → Use international format without + symbol: "1234567890"
  • Webhook verification fails → Token in n8n must exactly match token in WhatsApp dashboard

Google Sheets Configuration

Critical settings:

  • Service Account JSON: Must have "Editor" permissions on the target spreadsheet
  • Sheet ID: Extract from URL between /d/ and /edit: docs.google.com/spreadsheets/d/[THIS_IS_THE_ID]/edit
  • Range notation: Always use Sheet1!A:Z format, not A:Z alone

Why this approach:

Service Account authentication is more stable than OAuth for automated workflows because tokens don't expire every hour. Using column letter ranges (A:Z) instead of named ranges prevents errors when columns are added or reordered.

Variables to customize:

  • message_templates: Modify response text for your organization's voice and language
  • status_transition_rules: Define which message types trigger which status changes
  • content_sequence_days: Adjust timing between automated messages (currently 1, 3, 7, 14 days)

Testing & Validation

Test Each Component Independently

  1. Data ingestion: Execute the Google Sheets read node manually and verify all lead data appears in the output panel
  2. Webhook reception: Use WhatsApp Business API test tools to send a test message and confirm the webhook receives it
  3. Message classification: Send messages with different keywords ("info", "help", "register") and verify the Switch node routes correctly
  4. Status updates: Manually trigger a status change and confirm the Google Sheets row updates within 5 seconds

Run End-to-End Validation

  1. Create a test lead in Google Sheets with status "new"
  2. Send a WhatsApp message from that lead's phone number with keyword "register"
  3. Verify the chatbot responds within 10 seconds
  4. Check Google Sheets to confirm status changed to "contacted" and Last_Contact timestamp updated
  5. Wait for scheduled trigger (or manually execute) and verify content sequence message delivers

Common troubleshooting:

Issue Cause Solution
Webhook not receiving messages Incorrect webhook URL in WhatsApp dashboard Copy production URL from n8n, not test URL
Messages send but don't update status Row lookup failing Add logging to Function node to verify row_number variable
Content sequence sends to wrong leads Date calculation error Test Function node with various enrollment_date values
Rate limiting errors Too many API calls Add Wait node between batch message sends (500ms delay)

Production Deployment Checklist

Area Requirement Why It Matters
Error Handling Retry logic with 3 attempts, 5-second delays WhatsApp API occasionally returns 500 errors that resolve on retry
Monitoring Webhook health check every 15 minutes Detect webhook failures within 15 minutes vs discovering when users complain
Rate Limiting Maximum 80 messages per second WhatsApp Business API enforces rate limits; exceeding causes temporary blocks
Data Backup Daily Google Sheets export to separate backup sheet Prevents data loss if sheet is accidentally deleted or corrupted
Logging Store all message exchanges in separate log sheet Required for audit trails and troubleshooting conversation issues
Credentials Store API keys in n8n environment variables Prevents exposure in workflow exports and version control

Real-World Use Cases

Use Case 1: Beneficiary Onboarding for Education Programs

  • Industry: International education NGO
  • Scale: 2,000 new beneficiaries monthly
  • Modifications needed: Add language detection node to route to appropriate message templates, integrate with learning management system API for enrollment

Use Case 2: Health Service Appointment Reminders

  • Industry: Healthcare NGO
  • Scale: 500 appointments weekly
  • Modifications needed: Add date/time parsing for appointment scheduling, connect to calendar API, implement 24-hour and 2-hour reminder sequence

Use Case 3: Emergency Response Communication

  • Industry: Disaster relief organization
  • Scale: 10,000+ contacts during active response
  • Modifications needed: Add priority routing for urgent keywords, implement broadcast messaging for mass notifications, integrate with geolocation services

Use Case 4: Donor Engagement and Updates

  • Industry: Fundraising organization
  • Scale: 5,000 active donors
  • Modifications needed: Segment by donation tier, add payment processing integration, create custom content sequences based on donor history

Customizing This Workflow

Alternative Integrations

Instead of Google Sheets:

  • Airtable: Better for complex relational data - requires changing Google Sheets nodes to Airtable nodes (4 node swaps)
  • PostgreSQL: Best for high-volume operations (>10,000 leads) - requires SQL query nodes instead of Sheets nodes (6 node changes)
  • HubSpot CRM: Use when you need full CRM features - swap Sheets nodes with HubSpot API nodes (5 node changes)

Workflow Extensions

Add multilingual support:

  • Insert a language detection node after webhook trigger
  • Create separate message template sets for each language
  • Route to appropriate template based on detected language
  • Nodes needed: +3 (Language Detection, Switch for routing, additional Function nodes)

Implement AI-powered responses:

  • Add OpenAI API node after message classification
  • Use GPT-4 to generate contextual responses for complex queries
  • Fall back to template responses if AI confidence is low
  • Performance impact: +2-3 seconds response time, requires OpenAI API credits

Scale to handle multiple programs:

  • Add program identifier field to Google Sheets
  • Modify Switch node to route based on program type
  • Create separate content sequences per program
  • Nodes needed: +8 per additional program (routing, content, status tracking)

Integration possibilities:

Add This To Get This Complexity
Twilio SMS Fallback communication for WhatsApp failures Easy (3 nodes)
Slack notifications Real-time alerts for urgent messages Easy (2 nodes)
Salesforce sync Enterprise CRM integration Medium (7 nodes)
Payment processing (Stripe) Donation collection via chat Medium (6 nodes)
AI sentiment analysis Automatically flag negative interactions Medium (4 nodes)
Zapier webhook Connect to 5,000+ other apps Easy (2 nodes)

Get Started Today

Ready to automate your NGO's WhatsApp communication?

  1. Download the template: Scroll to the bottom of this article to copy the complete n8n workflow JSON
  2. Import to n8n: Navigate to Workflows → Import from URL or File, paste the JSON
  3. Configure your services: Add credentials for WhatsApp Business API and Google Sheets service account
  4. Customize message templates: Edit the Function nodes to match your organization's voice and program requirements
  5. Test with sample data: Create 3-5 test leads in Google Sheets and send test messages before going live
  6. Deploy to production: Configure your webhook URL in WhatsApp Business dashboard and activate the workflow

Need help customizing this workflow for your specific NGO programs or scaling to handle higher message volumes? Schedule an intro call with Atherial.

Complete N8N Workflow Template

Copy the JSON below and import it into your N8N instance via Workflows → Import from File

{
  "name": "NGO WhatsApp Chatbot & Lead Automation",
  "nodes": [
    {
      "id": "whatsapp-trigger",
      "name": "WhatsApp Incoming Message",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        100,
        300
      ],
      "parameters": {
        "updates": [
          "messages"
        ]
      },
      "typeVersion": 1
    },
    {
      "id": "extract-message-data",
      "name": "Extract Message Data",
      "type": "n8n-nodes-base.set",
      "position": [
        300,
        300
      ],
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "name": "senderPhone",
              "value": "{{ $json.messages[0].from }}"
            },
            {
              "name": "messageBody",
              "value": "{{ $json.messages[0].text.body }}"
            },
            {
              "name": "messageId",
              "value": "{{ $json.messages[0].id }}"
            },
            {
              "name": "timestamp",
              "value": "{{ $json.messages[0].timestamp }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "determine-chatbot-response",
      "name": "Determine Chatbot Response",
      "type": "n8n-nodes-base.set",
      "position": [
        500,
        300
      ],
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "name": "botResponse",
              "value": "{{ $json.messageBody.toLowerCase().includes('help') ? 'Welcome to our NGO! 👋 How can we help you today? You can ask about: donations, volunteering, or events.' : $json.messageBody.toLowerCase().includes('donate') ? 'Thank you for your interest in supporting us! 💚 Visit our donation page: [donation-link]' : $json.messageBody.toLowerCase().includes('volunteer') ? 'Great! We would love your support. Learn more about volunteering opportunities here: [link]' : 'Thank you for reaching out! A team member will respond shortly.' }}"
            },
            {
              "name": "leadCategory",
              "value": "{{ $json.messageBody.toLowerCase().includes('interested') ? 'Interested' : $json.messageBody.toLowerCase().includes('donate') ? 'Potential Donor' : 'Inquiry' }}"
            },
            {
              "name": "leadStatus",
              "value": "Active"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "send-whatsapp-response",
      "name": "Send WhatsApp Response",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        700,
        300
      ],
      "parameters": {
        "resource": "message",
        "textBody": "{{ $json.botResponse }}",
        "operation": "send",
        "phoneNumberId": "{{ $credentials.whatsAppPhoneNumberId }}",
        "recipientPhoneNumber": "{{ $json.senderPhone }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "save-lead-to-sheets",
      "name": "Save/Update Lead in Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        900,
        300
      ],
      "parameters": {
        "range": "A:H",
        "operation": "appendOrUpdate",
        "sheetName": "Leads",
        "documentId": "{{ $credentials.googleSheetId }}"
      },
      "typeVersion": 4.7
    },
    {
      "id": "respond-to-trigger",
      "name": "Respond to Webhook Trigger",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1100,
        300
      ],
      "parameters": {
        "respondWith": "noData"
      },
      "typeVersion": 1.4
    },
    {
      "id": "schedule-daily-sequence",
      "name": "Schedule Daily Sequence (9 AM)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        100,
        700
      ],
      "parameters": {
        "unit": "days",
        "interval": [
          1
        ],
        "triggerAtHour": 9,
        "triggerAtMinute": 0
      },
      "typeVersion": 1.2
    },
    {
      "id": "retrieve-pending-leads",
      "name": "Retrieve Pending Leads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        300,
        700
      ],
      "parameters": {
        "range": "A:H",
        "operation": "read",
        "sheetName": "Leads",
        "documentId": "{{ $credentials.googleSheetId }}"
      },
      "typeVersion": 4.7
    },
    {
      "id": "filter-leads-for-sequence",
      "name": "Filter Leads for Sequence",
      "type": "n8n-nodes-base.filter",
      "position": [
        500,
        700
      ],
      "parameters": {
        "conditions": {
          "conditions": [
            {
              "id": "condition_1",
              "value": "{{ $json.D }}",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string"
              },
              "resourceLocator": {
                "value": "New"
              }
            }
          ]
        },
        "looseTypeValidation": false
      },
      "typeVersion": 2.2
    },
    {
      "id": "batch-process-leads",
      "name": "Process Leads in Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        700,
        700
      ],
      "parameters": {
        "batchSize": 10
      },
      "typeVersion": 3
    },
    {
      "id": "send-sequence-message",
      "name": "Send Daily Sequence Content",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        900,
        700
      ],
      "parameters": {
        "resource": "message",
        "textBody": "{{ 'Hi ' + ($json.B || 'there') + '! 👋\\n\\nToday we\\'d like to share an update about our latest initiative. Would you like to hear more? Reply YES or NO' }}",
        "operation": "send",
        "phoneNumberId": "{{ $credentials.whatsAppPhoneNumberId }}",
        "recipientPhoneNumber": "{{ $json.A }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "mark-sequence-complete",
      "name": "Update Sequence Status",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1100,
        700
      ],
      "parameters": {
        "range": "A:H",
        "operation": "appendOrUpdate",
        "sheetName": "Leads",
        "documentId": "{{ $credentials.googleSheetId }}"
      },
      "typeVersion": 4.7
    },
    {
      "id": "webhook-trigger-data-intake",
      "name": "Webhook for External Data Intake",
      "type": "n8n-nodes-base.webhook",
      "position": [
        100,
        500
      ],
      "parameters": {
        "httpMethod": "POST"
      },
      "typeVersion": 1.1
    },
    {
      "id": "process-external-leads",
      "name": "Process External Lead Data",
      "type": "n8n-nodes-base.set",
      "position": [
        300,
        500
      ],
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "name": "externalPhone",
              "value": "{{ $json.phone_number }}"
            },
            {
              "name": "externalName",
              "value": "{{ $json.name }}"
            },
            {
              "name": "externalSource",
              "value": "{{ $json.source || 'External Form' }}"
            },
            {
              "name": "leadStatus",
              "value": "New"
            },
            {
              "name": "dateAdded",
              "value": "{{ new Date().toISOString() }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "append-external-leads",
      "name": "Append External Leads to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        500,
        500
      ],
      "parameters": {
        "range": "A:H",
        "operation": "append",
        "sheetName": "Leads",
        "documentId": "{{ $credentials.googleSheetId }}"
      },
      "typeVersion": 4.7
    },
    {
      "id": "respond-external-webhook",
      "name": "Confirm External Data Received",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        700,
        500
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "{ \"status\": \"success\", \"message\": \"Lead data received and queued for processing\" }"
      },
      "typeVersion": 1.4
    }
  ],
  "connections": {
    "Extract Message Data": {
      "main": [
        [
          {
            "node": "Determine Chatbot Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Pending Leads": {
      "main": [
        [
          {
            "node": "Filter Leads for Sequence",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send WhatsApp Response": {
      "main": [
        [
          {
            "node": "Save/Update Lead in Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Sequence Status": {
      "main": [
        []
      ]
    },
    "Process Leads in Batches": {
      "main": [
        [
          {
            "node": "Send Daily Sequence Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Leads for Sequence": {
      "main": [
        [
          {
            "node": "Process Leads in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Incoming Message": {
      "main": [
        [
          {
            "node": "Extract Message Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Determine Chatbot Response": {
      "main": [
        [
          {
            "node": "Send WhatsApp Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process External Lead Data": {
      "main": [
        [
          {
            "node": "Append External Leads to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Webhook Trigger": {
      "main": [
        []
      ]
    },
    "Send Daily Sequence Content": {
      "main": [
        [
          {
            "node": "Update Sequence Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append External Leads to Sheet": {
      "main": [
        [
          {
            "node": "Confirm External Data Received",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confirm External Data Received": {
      "main": [
        []
      ]
    },
    "Schedule Daily Sequence (9 AM)": {
      "main": [
        [
          {
            "node": "Retrieve Pending Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook for External Data Intake": {
      "main": [
        [
          {
            "node": "Process External Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save/Update Lead in Google Sheets": {
      "main": [
        [
          {
            "node": "Respond to Webhook Trigger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}