{
  "updatedAt": "2025-06-30T13:03:42.947Z",
  "createdAt": "2025-06-30T13:03:42.947Z",
  "id": "7oHkdB3fmK9oyzL2",
  "name": "AI SDR_for transcription",
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "71a6b9d4-5b02-4554-9464-ec387d777ea1",
              "leftValue": "={{ $('Webhook').item.json.body.event }}",
              "rightValue": "ended",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": true
        }
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        -1580,
        1140
      ],
      "id": "349fb0e5-8d89-40f5-8d74-ba78c5f9d25f",
      "name": "call status: ended",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=\"{{ $('Edit Fields').item.json.body.call_analysis.custom_analysis_data.summary }}\" \n\nGiven above in inverted commas is a summary of a cold call which you have to Analyze and find out if the prospect has 1. booked an appointment or a call (MENTIONED A DATE AND TIME FOR THE CALL BACK) OR \n2. Interested but wants to be called in the future OR \n3. None out of those 2 situations OR\n4. They ended the call or basically rejected the offer due to some reason\n\nYou have to give 1 out of these 3 responses according to the situation. for 1. \"BOOKED\", for 2. \"FUTURE\", for 3. \"UNKNOWN\", for 4.\"REJECTED\"\n\nNO OTHER RESPONSES THAN THESE 4"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.7,
      "position": [
        460,
        1140
      ],
      "id": "32541d0f-14a5-4d32-85ad-1391b1b8e16d",
      "name": "find interest",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "251a78c5-07d9-4d80-863f-ffce235e023e",
              "leftValue": "={{ $json.message.content }}",
              "rightValue": "booked",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": true
        }
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        860,
        940
      ],
      "id": "d6d69d6c-6dde-46b3-85dc-24c9ca7cd2cf",
      "name": "booked app"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "3fec2538-dc0c-4d8c-b31b-ad9b1b3f8ec0",
              "name": "body",
              "value": "={{ $('Get call details').item.json.body }}",
              "type": "object"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        140,
        1140
      ],
      "id": "a2b81727-ad65-45bf-8a90-a8c920ae28a6",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "251a78c5-07d9-4d80-863f-ffce235e023e",
              "leftValue": "={{ $json.message.content }}",
              "rightValue": "REJECT",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": true
        }
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        780,
        1380
      ],
      "id": "d69356fd-9f8e-4394-8434-64552d49c76f",
      "name": "rejected"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "name": "={{ $('Edit Fields').item.json.body.metadata.company_name }}",
            "phone_number": "={{ $('Edit Fields').item.json.body.to_number }}",
            "summary": "={{ $('summary1').item.json.message.content }}",
            "recording url": "={{ $('Edit Fields').item.json.body.recording_url }}",
            "their email": "={{ $('Edit Fields').item.json.body.metadata['email in list'] }}",
            "when was the call sent to them": "={{ $('Get call details').item.json.headers.date }}",
            "why did they reject the offer?": "={{ $json.message.content }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "phone_number",
              "displayName": "phone_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "displayName": "summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "recording url",
              "displayName": "recording url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "when was the call sent to them",
              "displayName": "when was the call sent to them",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "their email",
              "displayName": "their email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "why did they reject the offer?",
              "displayName": "why did they reject the offer?",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1800,
        1440
      ],
      "id": "e70872d5-79ac-4880-b2a1-65755cf15eb2",
      "name": "rejected offer",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "name": "={{ $('Edit Fields').item.json.body.metadata.company_name }}",
            "phone_number": "={{ $('Edit Fields').item.json.body.to_number }}",
            "summary": "={{ $json.message.content }}",
            "recording url": "={{ $('Edit Fields').item.json.body.recording_url }}",
            "their email": "={{ $('Edit Fields').item.json.body.metadata['email in list'] }}",
            "what time and date did they book a call for": "=Refer to summary",
            "when was the call sent to them": "={{ $('Get call details').item.json.headers.date }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "phone_number",
              "displayName": "phone_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "displayName": "summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "recording url",
              "displayName": "recording url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "when was the call sent to them",
              "displayName": "when was the call sent to them",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "their email",
              "displayName": "their email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "what time and date did they book a call for",
              "displayName": "what time and date did they book a call for",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1460,
        660
      ],
      "id": "c84e4973-961c-4701-872f-c10bb9c60dd9",
      "name": "booked",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "name": "={{ $('Edit Fields').item.json.body.metadata.company_name }}",
            "phone_number": "={{ $('Edit Fields').item.json.body.to_number }}",
            "summary": "={{ $json.message.content }}",
            "recording url": "={{ $('Edit Fields').item.json.body.recording_url }}",
            "their email": "={{ $('Edit Fields').item.json.body.metadata['email in list'] }}",
            "what time and date did they book a call for": "=FUTURE - refer to summary",
            "when was the call sent to them": "={{ $('Get call details').item.json.headers.date }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "phone_number",
              "displayName": "phone_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "displayName": "summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "recording url",
              "displayName": "recording url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "when was the call sent to them",
              "displayName": "when was the call sent to them",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "their email",
              "displayName": "their email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "what time and date did they book a call for",
              "displayName": "what time and date did they book a call for",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1680,
        1080
      ],
      "id": "19a465b8-7e9f-49e7-a26e-7455d42605c4",
      "name": "future",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=\"{{ $('Edit Fields').item.json.body.transcript }}\" \n\nGiven above in inverted commas is the transcript of a cold call between a user and an AI Agent which you have to Analyze and find out that why did the user end the call exactly. the reason may or may not be shown to you in the transcript, but you have to understand the exact tone of the user talking with the agent, and then give me just that reason in the final output, nothing else!!!\n\nAnalyze each and every single word said by the user for the responses to the AI's questions, and tell me the reason due to which the call was ended in not more than 1 line.\n\nGive me only the reason to end the call as the output, nothing else!!!"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.7,
      "position": [
        1340,
        1400
      ],
      "id": "1a9470ea-535c-477d-a788-f1fd36db7c0a",
      "name": "reason for rejection",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "95854a96-33c6-4b9c-b7eb-afabfb33aa3d",
              "leftValue": "={{ $('human or voicemail').item.json.message.content }}",
              "rightValue": "human",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": true
        }
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        -280,
        840
      ],
      "id": "976dd2da-dc46-423f-ad83-bbf4ac227158",
      "name": "human"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "95854a96-33c6-4b9c-b7eb-afabfb33aa3d",
              "leftValue": "={{ $('human or voicemail').item.json.message.content }}",
              "rightValue": "voice",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": true
        }
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        -820,
        1560
      ],
      "id": "e82ce150-5538-4e4f-9dc9-a7dc75299177",
      "name": "voicemail"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "date",
              "lookupValue": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -800,
        1140
      ],
      "id": "6fe16423-1774-45dd-abed-99981b008409",
      "name": "get row number",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "date",
              "lookupValue": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -60,
        840
      ],
      "id": "1aab0dc1-1c6a-4af7-be0c-998df3bafa7e",
      "name": "get row number1",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n  if (item?.json.hasOwnProperty(\"human calls picked\")) {\n    item.json[\"human calls picked\"] += 1;\n  }\n  return item;\n});\nreturn updatedItems;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        160,
        840
      ],
      "id": "388e3e82-82e0-4f87-a36f-53e1c97cdda3",
      "name": "Code1"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "date",
              "lookupValue": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -400,
        1780
      ],
      "id": "2f3a5e6b-65d1-4a3e-96d7-41502488f8c1",
      "name": "get row number2",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n  item.json.voicemails = item.json.voicemails + 1;\n  return item;\n});\nreturn updatedItems;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -260,
        1580
      ],
      "id": "9ba3f1bc-a4b0-4f7f-af18-04897f983cd7",
      "name": "Code2"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}",
            "human calls picked": "={{ $json['human calls picked'] }}"
          },
          "matchingColumns": [
            "date"
          ],
          "schema": [
            {
              "id": "date",
              "displayName": "date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "calls sent",
              "displayName": "calls sent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "human calls picked",
              "displayName": "human calls picked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "voicemails",
              "displayName": "voicemails",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "appointments booked",
              "displayName": "appointments booked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "offer rejected",
              "displayName": "offer rejected",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "cost incurred",
              "displayName": "cost incurred",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        420,
        840
      ],
      "id": "b66f937e-a386-4f9a-8c7f-4ece9f5e36d7",
      "name": "add humans calls picked value",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}",
            "voicemails": "={{ $json.voicemails }}"
          },
          "matchingColumns": [
            "date"
          ],
          "schema": [
            {
              "id": "date",
              "displayName": "date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "calls sent",
              "displayName": "calls sent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "human calls picked",
              "displayName": "human calls picked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "voicemails",
              "displayName": "voicemails",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "appointments booked",
              "displayName": "appointments booked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "offer rejected",
              "displayName": "offer rejected",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "cost incurred",
              "displayName": "cost incurred",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        100,
        1580
      ],
      "id": "dd3283dd-4688-4442-990e-a2fc3a2ed57e",
      "name": "add voicemails value",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}",
            "appointments booked": "={{ $json.updatedAppointmentsBooked }}"
          },
          "matchingColumns": [
            "date"
          ],
          "schema": [
            {
              "id": "date",
              "displayName": "date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "calls sent",
              "displayName": "calls sent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "human calls picked",
              "displayName": "human calls picked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "voicemails",
              "displayName": "voicemails",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "appointments booked",
              "displayName": "appointments booked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "offer rejected",
              "displayName": "offer rejected",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "cost incurred",
              "displayName": "cost incurred",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        2360,
        740
      ],
      "id": "7bdb61b7-c4d5-44cd-a277-1f2b1de91cda",
      "name": "update appointments booked value",
      "alwaysOutputData": true,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "documentId": {
          "__rl": true,
          "value": "1ch5bMLWe8SqTgy--16Ujxfa0E1waOu5_pPBxmJ8gBKg",
          "mode": "list",
          "cachedResultName": "chandramohan analysis  results",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ch5bMLWe8SqTgy--16Ujxfa0E1waOu5_pPBxmJ8gBKg/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 183516615,
          "mode": "list",
          "cachedResultName": "overall campaign details",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ch5bMLWe8SqTgy--16Ujxfa0E1waOu5_pPBxmJ8gBKg/edit#gid=183516615"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "date",
              "lookupValue": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1840,
        740
      ],
      "id": "2a88331d-4192-4f6f-b814-760efbaec186",
      "name": "get row number3",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "const rowData = $input.all().map((item) => item.json)[0];\nconst appointmentsBooked = rowData[\"appointments booked\"];\nconst updatedAppointmentsBooked = appointmentsBooked + 1;\n\nreturn { updatedAppointmentsBooked };\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2120,
        760
      ],
      "id": "1cd85b0d-28a9-463a-8967-f17cefa9e5d0",
      "name": "Code3"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "date",
              "lookupValue": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        2180,
        1460
      ],
      "id": "8e50b63a-60c2-4476-91a3-2be8a559c815",
      "name": "get row number4",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "const rows = $input.all();\nconst rejectedOffersRow = rows.find((row) => row?.json?.[\"offer rejected\"]);\nlet rejectedOffersCount =\n  parseInt(rejectedOffersRow?.json?.[\"offer rejected\"]) || 0;\nrejectedOffersCount += 1;\nreturn { \"offer rejected\": rejectedOffersCount.toString() };\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2400,
        1460
      ],
      "id": "dc069df2-52d3-42a4-b2b3-21c0aaf3b65d",
      "name": "Code4"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}",
            "offer rejected": "={{ $json['offer rejected'] }}"
          },
          "matchingColumns": [
            "date"
          ],
          "schema": [
            {
              "id": "date",
              "displayName": "date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "calls sent",
              "displayName": "calls sent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "human calls picked",
              "displayName": "human calls picked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "voicemails",
              "displayName": "voicemails",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "appointments booked",
              "displayName": "appointments booked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "offer rejected",
              "displayName": "offer rejected",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "cost incurred",
              "displayName": "cost incurred",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        2660,
        1460
      ],
      "id": "5264702a-b4e6-4ce6-aedc-6fff04227fda",
      "name": "add rejected offer value",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $('Webhook').item.json.body.call.metadata['current formatted date'] }}",
            "calls sent": "={{ $('add calls sent').item.json.result }}",
            "cost incurred": "={{ $json.result }}"
          },
          "matchingColumns": [
            "date"
          ],
          "schema": [
            {
              "id": "date",
              "displayName": "date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "calls sent",
              "displayName": "calls sent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "human calls picked",
              "displayName": "human calls picked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "voicemails",
              "displayName": "voicemails",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "appointments booked",
              "displayName": "appointments booked",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "offer rejected",
              "displayName": "offer rejected",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "cost incurred",
              "displayName": "cost incurred",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -40,
        1140
      ],
      "id": "c12b72d8-0651-4b1f-83b4-36b06a8d9a50",
      "name": "add calls sent and cost incurred value",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const result = $json['calls sent'] + 1;\nreturn { result };\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -600,
        1140
      ],
      "id": "515fc9ee-6e65-4b74-b13e-0aed237ff1ac",
      "name": "add calls sent"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const result = $('get row number').item.json['cost incurred'] + $json.body.call_cost.combined_cost;\nreturn { result };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -240,
        1140
      ],
      "id": "ae7f43d2-c968-43e6-aa91-7202f91fedc3",
      "name": "add cost incurred"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "251a78c5-07d9-4d80-863f-ffce235e023e",
              "leftValue": "={{ $json.message.content }}",
              "rightValue": "future",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": true
        }
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        900,
        1140
      ],
      "id": "5a96c533-380d-49f9-99ed-62ad079c2811",
      "name": "future1"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "428be8ff-1470-4c61-81be-c8743af0fb84",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -1800,
        1140
      ],
      "id": "52bbe123-9547-4ced-999b-7073cbc74319",
      "name": "Webhook"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -800,
        860
      ],
      "id": "076a682e-2d01-490a-b739-02d8ba45e5ab",
      "name": "Wait"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -640,
        1620
      ],
      "id": "68fa07ff-2c03-4c53-817d-49cd0d1916d7",
      "name": "Wait1"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        360,
        1820
      ],
      "id": "38a0587a-5eb3-46af-9e6d-66da6ed1059e",
      "name": "Wait2"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -100,
        460
      ],
      "id": "5a0087d9-7237-443a-89aa-6f25c7e5d837",
      "name": "Wait3"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        380,
        480
      ],
      "id": "29c1a510-64f8-495a-bcfa-f6a0d12a2461",
      "name": "Wait4"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        480,
        1580
      ],
      "id": "ff7de817-c6a5-4c94-b845-79f2f6b7d862",
      "name": "Wait5"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1420,
        320
      ],
      "id": "c461935f-fe75-4ec9-9894-f68770395a2b",
      "name": "Wait6"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1800,
        380
      ],
      "id": "bf25423b-2ea8-4005-a8a6-d033d14a4717",
      "name": "Wait7"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2640,
        760
      ],
      "id": "9347b6e6-82dc-4158-b8d3-e42f8ec37db0",
      "name": "Wait8"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2100,
        1100
      ],
      "id": "a946675e-74a5-476e-840d-28fcc66fc124",
      "name": "Wait9"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1840,
        1720
      ],
      "id": "0509138b-7db6-40e9-9436-7cc6229cb277",
      "name": "Wait10"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2240,
        1720
      ],
      "id": "86a1154e-a3b2-4d86-b399-3e59565c9323",
      "name": "Wait11"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2700,
        1720
      ],
      "id": "ebe4baeb-23af-4db9-8999-1ad828f237e4",
      "name": "Wait12"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "95854a96-33c6-4b9c-b7eb-afabfb33aa3d",
              "leftValue": "={{ $('human or voicemail').item.json.message.content }}",
              "rightValue": "human",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": true
        }
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        300,
        1140
      ],
      "id": "58f9eb1a-75d4-4a01-b287-f48ad0d386c0",
      "name": "human1"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=Given below is the transcript, of a cold call done by our AI voice agent to a cold lead referred to as the User. \n\nThe transcrit is right below:\n\n\"{{ $('Webhook').item.json.body.call.transcript }}\"\n\n\nYou have to just analyze the transcript completely, and then find out whether the one who picked up the call andd answered was a voicemail, or a human.\n\n##*NOTES:*\n- There are HUGE possibilities that the transcript or summary doesn't mention the word voicemail by mouth, and it is not there in either of them, but if the transcript is just very very short like basically of one line, or one or two words, or there are lots of lines inside the transcript, which are commonly said by the voicemails systems, or IVR systems specially, then you have to surely consider them as voicemails.\n\n- If the transcript is very short of like 1 or 2 lines overall, and the only lines inside it go similar to this: \"Thanks  for reaching out to {any company name}. Please leave a message.\", or similar common lines said by an IVR or a voicemail, then it MUST BE CONSIDERED AS A VOICEMAIL ONLY!!!\n\n\nBe very very smart, and if the final answer is that a human picked up the call, then return the word \"human\" as the answer only as it is.\n\nOtherwise, if a voicemail has picked up the call, then return only the word \"voicemail\" as the answer.\n\nNO OTHER TEXT OR ANSWER SHOULD BE GIVEN BY YOU, JUST THE WORDS \"human\" or \"voicemail\" accoring to the conditions mentioned above.\n\n"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        -1340,
        1120
      ],
      "id": "5fff1509-c801-4e03-a614-bf71c195d42f",
      "name": "human or voicemail",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=Here is the transcript  of a call, in which an appointment has been  booked:\n\n\"{{ $('Webhook').item.json.body.call.transcript }}\"\n\nYou have to analyze this transcript very perfectly, and in the end give me a 3 liner summary for what happened on the call, and for what time has the user booked an appointment with the further officials with the AI Agent on the call.\n\nDO NOT FORGET TO MANDATORILY MENTION THE DATE AND TIME EXACTLY FOR WHICH THE APAPOINTMENT HAS BEEN BOOKED!\n\nNO OTHER TEXT!! JUST THE SUMMARY."
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        1060,
        860
      ],
      "id": "139b157d-afdb-46e0-b498-43f7dc50f4d3",
      "name": "summary & date,time",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=Here is the transcript  of a call, in which an appointment has been  booked:\n\n\"{{ $('Webhook').item.json.body.call.transcript }}\"\n\nYou have to analyze this transcript very perfectly, and in the end give me a 3 liner summary for what happened on the call between the user and the AI Agent. What type of talks did they do and how did the user react.\n\nNO OTHER TEXT!! JUST THE SUMMARY."
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        1160,
        1140
      ],
      "id": "951f7094-cb1e-405a-83be-bda7cb0ddb97",
      "name": "summary",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=Here is the transcript  of a call, in which an appointment has been  booked:\n\n\"{{ $('Webhook').item.json.body.call.transcript }}\"\n\nYou have to analyze this transcript very perfectly, and in the end give me a 3 liner summary for what happened on the call between the user and the AI Agent. What type of talks did they do and how did the user react.\n\nNO OTHER TEXT!! JUST THE SUMMARY."
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        980,
        1400
      ],
      "id": "9219eb22-815b-4b94-a58c-0eefb9663e12",
      "name": "summary1",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "batchSize": 10000,
        "options": {}
      },
      "id": "d972a762-a592-4266-84fb-c175a0661a01",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        160,
        0
      ],
      "retryOnFail": false,
      "executeOnce": true,
      "alwaysOutputData": true,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "00 23 10 02 MON"
            }
          ]
        }
      },
      "id": "51950b3c-5d1a-4405-939f-481b07a97478",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        360,
        0
      ],
      "id": "1736dd56-20d6-47a2-9ef7-8ddda48f6bcd",
      "name": "get details",
      "alwaysOutputData": true,
      "executeOnce": true,
      "retryOnFail": true,
      "maxTries": 5,
      "waitBetweenTries": 5000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "delete",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        800,
        0
      ],
      "id": "38611d38-49dc-4b27-931d-14c6fb7bac39",
      "name": "delete row",
      "alwaysOutputData": true,
      "executeOnce": true,
      "retryOnFail": true,
      "maxTries": 5,
      "waitBetweenTries": 5000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "operation": "delete",
        "documentId": {
          "__rl": true,
          "value": "1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ",
          "mode": "list",
          "cachedResultName": "demo ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KI309MV6ruOf5ICOSNm1YYIW2OvUtxrarqSzbaspuUQ/edit#gid=0"
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        840,
        320
      ],
      "id": "e741c4c6-1f67-4f88-b7f7-cee5252155e0",
      "name": "delete row2",
      "alwaysOutputData": true,
      "executeOnce": true,
      "retryOnFail": true,
      "maxTries": 5,
      "waitBetweenTries": 5000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "amount": 15
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1080,
        0
      ],
      "id": "cdcfcd01-769b-40d7-b63b-3fcc3a472210",
      "name": "Wait13",
      "alwaysOutputData": true,
      "executeOnce": true,
      "retryOnFail": true,
      "maxTries": 5,
      "waitBetweenTries": 5000,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "url": "=https://api.retellai.com/v2/get-call/{{ $('Webhook').item.json.body.call.call_id }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer key_f3c8d7297ada90b3c432938463dc"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "fullResponse": true,
              "responseFormat": "json"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -420,
        1140
      ],
      "id": "977c93a3-9834-4a4b-a8b1-f79ba7a13857",
      "name": "Get call details"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://dev.sendora.ai/webhook/real-time-leads",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <Your API Token>"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"from_number\": \"<from_number>\",\n  \"to_number\": \"<to_number>\",\n  \"override_agent_id\": \"oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD\",\n  \"override_agent_version\": 1,\n  \"metadata\": {},\n  \"retell_llm_dynamic_variables\": {\n    \"Company Name\": \"<company_name>\"\n  }\n}",
        "options": {}
      },
      "id": "c6124e89-1b4f-40fb-bfd5-62aac348e026",
      "name": "Send the call (http request)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        580,
        0
      ],
      "alwaysOutputData": true,
      "executeOnce": true,
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "maxTries": 5,
      "onError": "continueErrorOutput"
    }
  ],
  "connections": {
    "call status: ended": {
      "main": [
        [
          {
            "node": "human or voicemail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "find interest": {
      "main": [
        [
          {
            "node": "booked app",
            "type": "main",
            "index": 0
          },
          {
            "node": "future1",
            "type": "main",
            "index": 0
          },
          {
            "node": "rejected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "booked app": {
      "main": [
        [
          {
            "node": "summary & date,time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "human",
            "type": "main",
            "index": 0
          },
          {
            "node": "voicemail",
            "type": "main",
            "index": 0
          },
          {
            "node": "human1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rejected": {
      "main": [
        [
          {
            "node": "summary1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "booked": {
      "main": [
        [
          {
            "node": "get row number3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "reason for rejection": {
      "main": [
        [
          {
            "node": "rejected offer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get row number": {
      "main": [
        [
          {
            "node": "add calls sent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get row number1": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "add humans calls picked value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "human": {
      "main": [
        [
          {
            "node": "get row number1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get row number2": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "add voicemails value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "voicemail": {
      "main": [
        [
          {
            "node": "get row number2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get row number3": {
      "main": [
        [
          {
            "node": "Code3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code3": {
      "main": [
        [
          {
            "node": "update appointments booked value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get row number4": {
      "main": [
        [
          {
            "node": "Code4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code4": {
      "main": [
        [
          {
            "node": "add rejected offer value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rejected offer": {
      "main": [
        [
          {
            "node": "get row number4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add calls sent and cost incurred value": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add calls sent": {
      "main": [
        [
          {
            "node": "Get call details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add cost incurred": {
      "main": [
        [
          {
            "node": "add calls sent and cost incurred value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "future1": {
      "main": [
        [
          {
            "node": "summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "future": {
      "main": [
        [
          {
            "node": "get row number3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add voicemails value": {
      "main": [
        [],
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "call status: ended",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "get row number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "get row number2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait2": {
      "main": [
        [
          {
            "node": "add voicemails value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait3": {
      "main": [
        [
          {
            "node": "get row number1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add humans calls picked value": {
      "main": [
        [],
        [
          {
            "node": "Wait4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait4": {
      "main": [
        [
          {
            "node": "add humans calls picked value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait5": {
      "main": [
        [
          {
            "node": "add calls sent and cost incurred value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait6": {
      "main": [
        [
          {
            "node": "booked",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait7": {
      "main": [
        [
          {
            "node": "get row number3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update appointments booked value": {
      "main": [
        [],
        [
          {
            "node": "Wait8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait8": {
      "main": [
        [
          {
            "node": "update appointments booked value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait9": {
      "main": [
        [
          {
            "node": "future",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait10": {
      "main": [
        [
          {
            "node": "rejected offer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait11": {
      "main": [
        [
          {
            "node": "get row number4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add rejected offer value": {
      "main": [
        [],
        [
          {
            "node": "Wait12",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait12": {
      "main": [
        [
          {
            "node": "add rejected offer value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "human1": {
      "main": [
        [
          {
            "node": "find interest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "human or voicemail": {
      "main": [
        [
          {
            "node": "get row number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "summary & date,time": {
      "main": [
        [
          {
            "node": "booked",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "summary": {
      "main": [
        [
          {
            "node": "future",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "summary1": {
      "main": [
        [
          {
            "node": "reason for rejection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "get details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get details": {
      "main": [
        [
          {
            "node": "Send the call (http request)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "delete row2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "delete row": {
      "main": [
        [
          {
            "node": "Wait13",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "delete row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "delete row2": {
      "main": [
        [
          {
            "node": "Wait13",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "delete row2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait13": {
      "main": [
        [
          {
            "node": "get details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get call details": {
      "main": [
        [
          {
            "node": "add cost incurred",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send the call (http request)": {
      "main": [
        [
          {
            "node": "delete row",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "delete row2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": null,
  "versionId": "1b3a5ed8-8b98-415d-a7ed-59cbffc985a8",
  "activeVersionId": null,
  "triggerCount": 0,
  "shared": [
    {
      "updatedAt": "2025-06-30T13:03:42.947Z",
      "createdAt": "2025-06-30T13:03:42.947Z",
      "role": "workflow:owner",
      "workflowId": "7oHkdB3fmK9oyzL2",
      "projectId": "Fm4IyGowkpuhQseY"
    }
  ],
  "activeVersion": null,
  "tags": []
}