{
  "name": "AI Outbound Calling with Call Analysis",
  "nodes": [
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "sheet 1"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        220,
        0
      ],
      "id": "b9442954-0574-4cfe-b0af-9536b36473f4",
      "name": "Google Sheets1"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "f7165baf-0280-4347-bcbd-7ad08782ad37",
      "name": "When clicking ‘Test workflow’"
    },
    {
      "parameters": {
        "unit": "minutes"
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        660,
        0
      ],
      "id": "e5a49fad-d89e-404c-a9d1-ac288bf0fd27",
      "name": "Wait",
      "webhookId": "486cb21e-d27f-4eb2-9605-736515225b14"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://api.bland.ai/v1/calls/{{ $json.call_id }}/analyze",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "authorization",
              "value": "YOUR_BLAND_API_KEY"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"goal\": \"Identify if the appointment was rescheduled, and if so, what time it was rescheduled for. Write the time in military (24hr) format, i.e 13:00.\",\n  \"questions\": [\n    [\n      \"Was the appointment rescheduled?\",\n      \"true or false\"\n    ],\n    [\n      \"What time was the appointment rescheduled to?\",\n      \"string\"\n    ]\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        880,
        0
      ],
      "id": "79cb7821-da9d-4c2d-a047-65698e22ff99",
      "name": "Analyze Call Contents"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.bland.ai/v1/calls",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "authorization",
              "value": "YOUR_BLAND_API_KEY"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"phone_number\": \"+{{ $json['Phone Numbers'] }}\",\n  \"task\": \"{{ $json.Instructions }}\"\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        0
      ],
      "id": "f20d3dbc-8d1d-4756-90ef-724c972dfc20",
      "name": "Call Customer"
    }
  ],
  "connections": {
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "node": "Call Customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Analyze Call Contents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Customer": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false
}
