{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "a3f37784-e3d9-4083-a640-ddaee2f08172",
      "name": "Google Sheets Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -380,
        -120
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bj_wgQyqusAX_ar4kyHX0Ws0Gd5NP50Sf-1ukNawZT8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1bj_wgQyqusAX_ar4kyHX0Ws0Gd5NP50Sf-1ukNawZT8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bj_wgQyqusAX_ar4kyHX0Ws0Gd5NP50Sf-1ukNawZT8/edit?usp=drivesdk",
          "cachedResultName": "HR Calling Data"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ea1c8b54-b2b3-4e21-b313-cfa4a11b9c28",
      "name": "Make a Call",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        280,
        -120
      ],
      "parameters": {
        "url": "https://api.vapi.ai/call",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n  \"assistantId\": \"394aa072-2678-4ac3-a5da-2843b6173984\",\n  \"phoneNumberId\": \"79c489ec-e4e2-46a5-bba8-33d245b37cc6\",\n  \"customer\": {\n    \"numberE164CheckEnabled\": true,\n    \"number\": \"+1234567890\"\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <Token>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d490f11c-5b27-4fc7-82d2-8da607d5961c",
      "name": "Get Call Transcript",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        500,
        -120
      ],
      "parameters": {
        "url": "https://api.vapi.ai/call/<ID>",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <Token>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "58288895-75e0-428a-adf4-8d1284f1774e",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        740,
        60
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-flash-preview-05-20"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3605cb5b-17de-4c21-99fd-50cb10c981cc",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        880,
        60
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"Total Work Experience\": {\n      \"type\": \"string\",\n      \"description\": \"Total years/months of professional experience\",\n      \"default\": \"Not mentioned\"\n    },\n    \"Current CTC\": {\n      \"type\": \"string\",\n      \"description\": \"Current annual cost to company\",\n      \"default\": \"Not mentioned\"\n    },\n    \"Expected CTC\": {\n      \"type\": \"string\",\n      \"description\": \"Expected annual cost to company\",\n      \"default\": \"Not mentioned\"\n    },\n    \"Current Notice Period\": {\n      \"type\": \"string\",\n      \"description\": \"Notice period duration\",\n      \"default\": \"Not mentioned\"\n    },\n    \"Is Notice Period Negotiable\": {\n      \"type\": \"string\",\n      \"enum\": [\"Yes\", \"No\", \"Not mentioned\"],\n      \"default\": \"Not mentioned\"\n    },\n    \"Current Place of Residence\": {\n      \"type\": \"string\",\n      \"default\": \"Not mentioned\"\n    },\n    \"Open for Work from Office\": {\n      \"type\": \"string\",\n      \"enum\": [\"Yes\", \"No\", \"Not mentioned\"],\n      \"default\": \"Not mentioned\"\n    },\n    \"Any Questions to Get Back\": {\n      \"type\": \"string\",\n      \"enum\": [\"Yes\", \"No\"],\n      \"default\": \"No\"\n    },\n    \"All Information Collected\": {\n      \"type\": \"string\",\n      \"enum\": [\"Yes\", \"No\"],\n      \"default\": \"No\"\n    },\n    \"Need a Call Back\": {\n      \"type\": \"string\",\n      \"enum\": [\"Yes\", \"No\"],\n      \"default\": \"Yes\"\n    },\n    \"Callback Time\": {\n      \"type\": \"string\",\n      \"description\": \"When the user prefers a callback\",\n      \"default\": \"Not specified by the user\"\n    },\n    \"Reason for Not able to collect Info\": {\n      \"type\": \"string\",\n      \"description\": \"Why information is not collected\",\n      \"default\": \"Not able to identify\"\n    }\n  },\n  \"required\": [\n    \"Total Work Experience\",\n    \"Current CTC\",\n    \"Expected CTC\",\n    \"Current Notice Period\",\n    \"Is Notice Period Negotiable\",\n    \"Current Place of Residence\",\n    \"Open for Work from Office\",\n    \"Any Questions to Get Back\",\n    \"All Information Collected\",\n    \"Need a Call Back\",\n    \"Callback Time\",\n    \"Reason for not able to collect Info\"\n  ]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "13b8c74b-9032-4db8-a383-2badbd69f702",
      "name": "Update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1300,
        -120
      ],
      "parameters": {
        "columns": {
          "value": {
            "Current CTC": "={{ $json.output['Current CTC'] }}",
            "Expected CTC": "={{ $json.output['Expected CTC'] }}",
            "Calling Status": "={{ $json.output['Reason for Not able to collect Info'] }}",
            "Current Notice Period": "={{ $json.output['Current Notice Period'] }}",
            "Total Work Experience": "={{ $json.output['Total Work Experience'] }}",
            "Open for Work from Office ?": "={{ $json.output['Open for Work from Office'] }}",
            "Current place of residence ?": "={{ $json.output['Current Place of Residence'] }}",
            "Is that Notice Period Negotiable ?": "={{ $json.output['Is Notice Period Negotiable'] }}"
          },
          "schema": [
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone No.",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Phone No.",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Current Company",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Current Company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Total Work Experience",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Total Work Experience",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Current CTC",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Current CTC",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Expected CTC",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Expected CTC",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Current Notice Period",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Current Notice Period",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Is that Notice Period Negotiable ?",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Is that Notice Period Negotiable ?",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Current place of residence ?",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Current place of residence ?",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Open for Work from Office ?",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Open for Work from Office ?",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Any Questions to get back ?",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Any Questions to get back ?",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Calling Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Calling Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Phone No."
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bj_wgQyqusAX_ar4kyHX0Ws0Gd5NP50Sf-1ukNawZT8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1bj_wgQyqusAX_ar4kyHX0Ws0Gd5NP50Sf-1ukNawZT8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bj_wgQyqusAX_ar4kyHX0Ws0Gd5NP50Sf-1ukNawZT8/edit?usp=drivesdk",
          "cachedResultName": "HR Calling Data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "1941ad75-ac6e-4d5b-934c-89b30fd487ba",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        -220
      ],
      "parameters": {
        "width": 440,
        "height": 280,
        "content": "## Set up Trigger ##\nto to get candidate information for calling"
      },
      "typeVersion": 1
    },
    {
      "id": "5b0e13eb-bb7d-43cd-8983-2cc8f8bc93a8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -260
      ],
      "parameters": {
        "width": 680,
        "height": 320,
        "content": "## VAPI Trigger to call and Transcription ##\n"
      },
      "typeVersion": 1
    },
    {
      "id": "67ace40a-09f1-4ae2-a270-c5858b8e54cf",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1220,
        -200
      ],
      "parameters": {
        "height": 260,
        "content": "## Update back to Google Sheets\n"
      },
      "typeVersion": 1
    },
    {
      "id": "460b07aa-76c1-4cae-8996-e8e6d4a680ab",
      "name": "Call Data Analyser",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        720,
        -120
      ],
      "parameters": {
        "text": "=Parse the incoming call trascipt to extract the details such as \n- Total Work Experience\t\n- Current CTC\t\n- Expected CTC\t\n- Current Notice Period\t\n- Is that Notice Period Negotiable ?\t\n- Current place of residence ?\t\n- Open for Work from Office ?\t\n- Any Questions to get back ?  \n- All Information Collected\n- Do user need a call back ?\n- Yes then when should you call back ?\n- Reason for Not able to collec Information ?\n\nfrom the following input data:{{ $json.transcript }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are a Call Data entry operator, whose job is to go through call transcript and do\n1. Understand the transcript and get the required information\n2. Understand if users as asked to call back or not.\n3. Understand if complete information is collected or not."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "e680b886-be4f-4e41-a8c8-d1a454473545",
      "name": "Rename Required Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -160,
        -120
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d1ac5433-077f-4512-ab3c-8b4f929c460f",
              "name": "First name",
              "type": "string",
              "value": "={{ $json['First Name'] }}"
            },
            {
              "id": "520e04d7-f16d-40dd-8bf4-4fabe3b8b2c1",
              "name": "Last name",
              "type": "string",
              "value": "={{ $json['Last Name'] }}"
            },
            {
              "id": "b55a39ac-5d1e-407c-9def-db719a99b308",
              "name": "Phone No",
              "type": "number",
              "value": "={{ $json['Phone No.'] }}"
            },
            {
              "id": "7822500e-9b0b-4f79-9beb-4f3ea46c7552",
              "name": "Current Company",
              "type": "string",
              "value": "={{ $json['Current Company'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6e09f0a7-89aa-492b-a9cc-e1d5fb194d8f",
      "name": "Get VAPI Assistant",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        60,
        -120
      ],
      "parameters": {
        "url": "https://api.vapi.ai/assistant/<ID>",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <Token>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4bc45f01-05a9-43a4-a23b-74ccba6b007e",
      "name": "Map Field Names",
      "type": "n8n-nodes-base.set",
      "position": [
        1080,
        -120
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bfcc409c-b209-48ab-ba54-d615ade6885e",
              "name": "output",
              "type": "object",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "connections": {
    "Make a Call": {
      "main": [
        [
          {
            "node": "Get Call Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Field Names": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Data Analyser": {
      "main": [
        [
          {
            "node": "Map Field Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get VAPI Assistant": {
      "main": [
        [
          {
            "node": "Make a Call",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Call Transcript": {
      "main": [
        [
          {
            "node": "Call Data Analyser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Rename Required Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rename Required Fields": {
      "main": [
        [
          {
            "node": "Get VAPI Assistant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Call Data Analyser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Call Data Analyser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}