{
  "id": "OWRoYJvsNHDiKD4b",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Start an outbound Vapi phone call from a new row in Google Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "38d459ef-2c0b-4180-ab17-439a45536576",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        174,
        -156
      ],
      "parameters": {
        "width": 260,
        "height": 396,
        "content": "## Set Vapi fields\nYou must set the following fields that you can obtain inside your Vapi account \n- phone number id which will make the call\n- assistant id which will be enabled in the call\n- your Vapi api key"
      },
      "typeVersion": 1
    },
    {
      "id": "30c31eb2-56ee-466b-a8f9-2eb2ebb86a33",
      "name": "Start outbound Vapi call",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        80
      ],
      "parameters": {
        "url": "https://api.vapi.ai/call",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"assistantId\": \"{{ $json.vapiAssistantId }}\",\n    \"phoneNumberId\": \"{{ $json.vapiPhoneNumberId }}\",\n    \"customer\": {\n        \"number\": \"{{ $('Google Sheets Trigger').item.json.phone }}\"\n    }\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $json.vapiApi }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1f96b13b-8de3-4c7a-be26-1d140637bd52",
      "name": "Set fields",
      "type": "n8n-nodes-base.set",
      "position": [
        256,
        80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f38947e1-c75a-44cc-88f9-c44fc80bada8",
              "name": "vapiPhoneNumberId",
              "type": "string",
              "value": "insert-id"
            },
            {
              "id": "463ed66e-e072-48dc-a75d-a3815fd07de0",
              "name": "vapiAssistantId",
              "type": "string",
              "value": "insert-id"
            },
            {
              "id": "93f058cd-e015-4b83-a16f-efceddafb128",
              "name": "vapiApi",
              "type": "string",
              "value": "insert-api"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c64dd4b1-8985-4b42-bf81-81749d4fcf6a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 456,
        "content": "## Requirements \n### Google Sheets\n- Google Sheets credentials enabled in n8n\n- A table with a phone number column that takes the full number including the plus (+) symbol, without spaces. Example for US: +11234567890\n\n### Vapi\n- A [Vapi](https://vapi.ai/?aff=onenode) account with credit\n- A connected phone number which will make the calls\n- An assistant created and ready to make calls\n- Vapi api key \n\n### Useful links\n- [Vapi docs](https://docs.vapi.ai/api-reference/calls/create)"
      },
      "typeVersion": 1
    },
    {
      "id": "93e0b53f-094d-49c8-b9f1-354b06fae9ff",
      "name": "Google Sheets Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -192,
        80
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WhWaaamXiXOs6YvJaFt3Ahy7MIbJpqExgZPUcepjfSk/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1WhWaaamXiXOs6YvJaFt3Ahy7MIbJpqExgZPUcepjfSk",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WhWaaamXiXOs6YvJaFt3Ahy7MIbJpqExgZPUcepjfSk/edit?usp=drivesdk",
          "cachedResultName": "n8n vapi"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c777d7f8-90c6-44fc-b296-083292b767ab",
      "name": "Wait 4min",
      "type": "n8n-nodes-base.wait",
      "position": [
        32,
        80
      ],
      "parameters": {
        "unit": "minutes",
        "amount": 4
      },
      "typeVersion": 1.1
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1ad709fb-5e8a-43ad-9263-a0d2545cea51",
  "connections": {
    "Wait 4min": {
      "main": [
        [
          {
            "node": "Set fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields": {
      "main": [
        [
          {
            "node": "Start outbound Vapi call",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Wait 4min",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}