{
  "id": "Zgf81bcaaB04rjcd",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Start an outbound Vapi phone call from a new n8n form submission",
  "tags": [],
  "nodes": [
    {
      "id": "cb6ee340-933a-4699-bc0a-be7605309df7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        158,
        -284
      ],
      "parameters": {
        "width": 260,
        "height": 524,
        "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\n\n## Set country code\n- insert the phone number country code. Include the + symbol and no spaces."
      },
      "typeVersion": 1
    },
    {
      "id": "b5557910-7469-4937-9229-1d599ad5bf2d",
      "name": "Start outbound Vapi call",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        464,
        80
      ],
      "parameters": {
        "url": "https://api.vapi.ai/call",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"assistantId\": \"{{ $json.vapiAssistantId }}\",\n    \"phoneNumberId\": \"{{ $json.vapiPhoneNumberId }}\",\n    \"customer\": {\n        \"number\": \"{{ $('On form submission').item.json.Phone }}\"\n    }\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $json.vapiApi }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e4039ec8-1e6e-4d59-ab3c-14727562cdae",
      "name": "Set fields",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        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": "fe87d956-e2f6-4fbd-ac30-e09b3c48bb15",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 472,
        "content": "## Requirements \n### n8n form\n- A text field that takes a full international phone number including the + symbol and country code. Example for US: +11234567890.\n- Add more fields according to your use case\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": "5855a19a-0c94-4ca7-ac4c-330fd7b8a194",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -208,
        80
      ],
      "parameters": {
        "options": {
          "appendAttribution": false
        },
        "formTitle": "Lead form",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Name",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Email",
              "requiredField": true
            },
            {
              "fieldLabel": "Phone",
              "placeholder": "Insert + symbol and country code without spaces",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3075f3b5-12d0-465a-b1ff-0b13d928f684",
      "name": "Wait 2min",
      "type": "n8n-nodes-base.wait",
      "position": [
        16,
        80
      ],
      "parameters": {
        "unit": "minutes",
        "amount": 2
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "28254a07-4ced-4c28-b49f-9eec8cb01a3c",
  "connections": {
    "Wait 2min": {
      "main": [
        [
          {
            "node": "Set fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields": {
      "main": [
        [
          {
            "node": "Start outbound Vapi call",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Wait 2min",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}