{
  "id": "3TgB8gjUez1uQjJw",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automate B2B Lead Qualification with Voice Calls (VAPI) and Google Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "b99be5b1-f4a6-4d0f-af0d-4d2464be11c1",
      "name": "New Lead Captured",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -320,
        -580
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1562885128,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DCq5a_I2KyD0Tt5Z_TqluZOM1sq6KI05PaxmVVI7J4o/edit#gid=1562885128",
          "cachedResultName": "phone_number"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1DCq5a_I2KyD0Tt5Z_TqluZOM1sq6KI05PaxmVVI7J4o",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DCq5a_I2KyD0Tt5Z_TqluZOM1sq6KI05PaxmVVI7J4o/edit?usp=drivesdk",
          "cachedResultName": "Outter calls list"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e6efc842-fbb5-4d0d-949f-0b08a2612255",
      "name": "Initiate Voice Call (VAPI)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        120,
        -580
      ],
      "parameters": {
        "url": "https://api.vapi.ai/call",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"assistantId\": \"add_id_here\",\n  \"phoneNumberId\": \"add_phone_number_id_here\",\n  \"customers\": [\n    {\n      \"number\": \"add_vapi_agent_phonenumber_here\"\n    }\n  ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "add_authorization_token_here"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d8e5a345-a452-41ca-a7d1-e0d05a1fe565",
      "name": "Save Qualified Lead to CRM Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -100,
        -320
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name ": "={{ $json.body.message.toolCallList[0].function.arguments.name }}",
            "Company name": "={{ $json.body.message.toolCallList[0].function.arguments.company_name }}",
            "Company size": "={{ $json.body.message.toolCallList[0].function.arguments.company_size }}"
          },
          "schema": [
            {
              "id": "Name ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Company name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company size",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Company size",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Name "
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DCq5a_I2KyD0Tt5Z_TqluZOM1sq6KI05PaxmVVI7J4o/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1DCq5a_I2KyD0Tt5Z_TqluZOM1sq6KI05PaxmVVI7J4o",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DCq5a_I2KyD0Tt5Z_TqluZOM1sq6KI05PaxmVVI7J4o/edit?usp=drivesdk",
          "cachedResultName": "Outter calls list"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "1b365b16-e3d3-41ee-99fd-e92d26de2b1e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        -680
      ],
      "parameters": {
        "color": 3,
        "height": 260,
        "content": "Triggers on new phone number entry."
      },
      "typeVersion": 1
    },
    {
      "id": "7843c35f-7957-4285-9726-8bd518065be6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        -680
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 260,
        "content": "Captures name, company, challenges via POST."
      },
      "typeVersion": 1
    },
    {
      "id": "e32182b9-c2b4-4021-b618-cdf961062ce2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -400
      ],
      "parameters": {
        "color": 5,
        "width": 250,
        "height": 280,
        "content": "Qualifies lead with outbound call.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "00540380-6c9c-47a5-a322-5d823482f3e7",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -400
      ],
      "parameters": {
        "height": 300,
        "content": "Stores data in Google Sheet.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "beea0df6-d706-4b65-ae44-b78e11adb49a",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        -400
      ],
      "parameters": {
        "color": 6,
        "width": 230,
        "height": 300,
        "content": "Confirms success to VAPI.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0e5b636d-c8c4-4102-9c09-6a7373887e58",
      "name": "Send Call Data Acknowledgement",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        320,
        -320
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "3fc02fbd-935c-4c24-aeb8-aac8b3f14efa",
      "name": "Receive Lead Details from VAPI",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -460,
        -320
      ],
      "parameters": {
        "path": "60d5fdeb-b5d8-4e71-90d0-182acc695404",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    }
  ],
  "active": false,
  "settings": {
    "timezone": "Asia/Kolkata",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "efedae37-b126-49fe-a641-1ca005bd26a8",
  "connections": {
    "New Lead Captured": {
      "main": [
        [
          {
            "node": "Initiate Voice Call (VAPI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Lead Details from VAPI": {
      "main": [
        [
          {
            "node": "Save Qualified Lead to CRM Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Qualified Lead to CRM Sheet": {
      "main": [
        [
          {
            "node": "Send Call Data Acknowledgement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}