{
  "id": "fHfvUjCTdLUoCXBH",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Update Airtable CRM with telli Call Event Data and Appointment Status",
  "tags": [],
  "nodes": [
    {
      "id": "ea0c7674-7276-436b-a804-a842e0e258e3",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        0
      ],
      "parameters": {
        "path": "0de7745d-64c8-410b-9d23-f98f4b9c3787",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "60e76c93-b225-432f-ba4f-17cd27e0708a",
      "name": "Update CRM contact with call_status NOT_REACHED",
      "type": "n8n-nodes-base.airtable",
      "position": [
        620,
        80
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appjsUaPrbH6ph7cB",
          "cachedResultUrl": "https://airtable.com/appjsUaPrbH6ph7cB",
          "cachedResultName": "Lead Information Table"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblVXEWTj7dErmNsa",
          "cachedResultUrl": "https://airtable.com/appjsUaPrbH6ph7cB/tblVXEWTj7dErmNsa",
          "cachedResultName": "Leads"
        },
        "columns": {
          "value": {
            "Call Status": "NOT_REACHED",
            "Follow-up required": "true"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created Time",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Full Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Full Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Domain",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Email Domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Primary Language",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Primary Language",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Gender",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Male",
                  "value": "Male"
                },
                {
                  "name": "Female",
                  "value": "Female"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Gender",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Call Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "COMPLETED",
                  "value": "COMPLETED"
                },
                {
                  "name": "NOT_REACHED",
                  "value": "NOT_REACHED"
                },
                {
                  "name": "ANSWERED",
                  "value": "ANSWERED"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Call Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up required",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "true",
                  "value": "true"
                },
                {
                  "name": "false",
                  "value": "false"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up required",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Appointment booked",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Appointment booked",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "upsert"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0d64e5dd-77d9-4726-9440-c373382af3eb",
      "name": "Update CRM contact with call_status COMPLETED",
      "type": "n8n-nodes-base.airtable",
      "position": [
        620,
        -140
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appjsUaPrbH6ph7cB",
          "cachedResultUrl": "https://airtable.com/appjsUaPrbH6ph7cB",
          "cachedResultName": "Lead Information Table"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblVXEWTj7dErmNsa",
          "cachedResultUrl": "https://airtable.com/appjsUaPrbH6ph7cB/tblVXEWTj7dErmNsa",
          "cachedResultName": "Leads"
        },
        "columns": {
          "value": {
            "Call Status": "COMPLETED",
            "Appointment booked": "2025-04-30T13:34:17"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created Time",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Full Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Full Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Domain",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Email Domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Primary Language",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Primary Language",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Gender",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Male",
                  "value": "Male"
                },
                {
                  "name": "Female",
                  "value": "Female"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Gender",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Call Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "COMPLETED",
                  "value": "COMPLETED"
                },
                {
                  "name": "NOT_REACHED",
                  "value": "NOT_REACHED"
                },
                {
                  "name": "ANSWERED",
                  "value": "ANSWERED"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Call Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up required",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "true",
                  "value": "true"
                },
                {
                  "name": "false",
                  "value": "false"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up required",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Appointment booked",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Appointment booked",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "upsert"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "c11f6585-fa19-4fbc-991d-2dfd80b482b8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1480,
        -680
      ],
      "parameters": {
        "width": 1400,
        "height": 2560,
        "content": "# Receive realtime call-event data from telli\n\n### Purpose and Problem Solved\n\nThis template automates the process of receiving and acting upon real-time call event data from telli, an AI-powered voice agent platform. It solves the challenge of manually updating CRM records and initiating follow-up actions based on call outcomes. By leveraging webhooks and n8n's powerful workflow capabilities, this template enables businesses to instantly update their Airtable CRM and trigger appropriate follow-up actions, enhancing efficiency and responsiveness in customer interactions.\n\n### Prerequisites\n\n- An active telli account with API access and webhook capabilities\n- An Airtable base set up as your CRM\n- n8n instance (cloud or self-hosted)\n\n### Airtable Specifications\n\nCreate an Airtable base with the following table and fields:\n\n**Table: Contacts**\n- Fields:\n  - Name (Single line text)\n  - Phone (Phone number)\n  - Email (Email)\n  - Appointment_Booked (Checkbox)\n  - Interest (Single select: High, Medium, Low)\n  - Last_Call_Date (Date)\n  - Notes (Long text)\n\n### Step-by-Step Setup Instructions\n\n1. **Webhook Configuration in telli:**\n   - Log into your telli dashboard\n   - Navigate to the webhook settings\n   - Set the endpoint URL to your n8n Webhook node URL\n   - Select the \"call_ended\" event to trigger the webhook\n\n2. **n8n Workflow Setup:**\n   - Create a new workflow in n8n\n   - Add a Webhook node as the trigger\n   - Configure the Webhook node to receive POST requests\n\n3. **Parse Webhook Data:**\n   - Add a Set node to extract relevant information from the webhook payload\n   - Map fields such as call_outcome, appointment_booked, and interest\n\n4. **Decision Logic:**\n   - Add a Switch node to create different paths based on the call outcome\n   - Create branches for scenarios like \"Appointment Booked\", \"Interested\", and \"Not Interested\"\n\n5. **Airtable Integration:**\n   - Add Airtable nodes for each outcome to update the Contacts table\n   - Configure the nodes to update fields like Appointment_Booked, Interest, and Last_Call_Date\n\n6. **Follow-up Actions:**\n   - For \"Interested\" but not booked outcomes, add an Email node to trigger a follow-up email campaign\n   - For \"Appointment Booked\", add a node to create a calendar event or task\n\n7. **Testing and Activation:**\n   - Use the n8n testing feature to simulate webhook calls and verify each path\n   - Once satisfied, activate the workflow\n\n### Example Workflow\n\n1. Webhook receives a \"call_ended\" event from telli\n2. Set node extracts call_outcome: appointment_booked = true, interest = true\n3. Switch node directs to the \"Appointment Booked\" path\n4. Airtable node updates the contact record:\n   - Set Appointment_Booked to true\n   - Set Interest to \"High\"\n   - Update Last_Call_Date\n5. Calendar node creates an appointment for the booked slot\n\n### Example Payload\n\nBelow is an example of the payload you might receive from telli when a call ends:\n```json\n{\n  \"event\": \"call_ended\",\n  \"call\": {\n    \"call_id\": \"b4a05730-2abc-4eb0-8066-2e4d23b53ba9\",\n    \"attempt\": 1,\n    \"from_number\": \"+17755719467\",\n    \"to_number\": \"+16506794960\",\n    \"external_contact_id\": \"external-123\",\n    \"contact_id\": \"6bd1e7e0-6d00-4c0b-ad5b-daa72457a27d\",\n    \"agent_id\": \"d8931604-92ad-45cf-9071-d9cd2afbad0c\",\n    \"triggered_at\": 1731956924302,\n    \"started_at\": 1731956932264,\n    \"booked_slot_for\": \"2025-02-24T15:30:00Z\",\n    \"ended_at\": 1731957002078,\n    \"call_length_min\": 2,\n    \"call_status\": \"COMPLETED\",\n    \"transcript\": \"Agent: Hello...\",\n    \"transcriptObject\": [\n      {\n        \"role\": \"agent\",\n        \"content\": \"Hello...\"\n      }\n    ],\n    \"call_analysis\": {\n      \"summary\": {\n        \"value\": true,\n        \"details\": \"A call between an agent and a customer talking about buying an ice cream machine\"\n      },\n      \"appointment\": {\n        \"value\": true,\n        \"details\": \"2025-02-18T15:30:00Z\"\n      },\n      \"interest\": {\n        \"value\": true,\n        \"details\": \"The customer is interested in buying an ice cream machine\"\n      }\n    }\n  }\n}\n```\n\nIn this example, you can see that the call resulted in a booked appointment and showed customer interest. Your n8n workflow would process this data, updating the Airtable CRM and triggering any necessary follow-up actions.\n\nBy implementing this template, businesses can automate their post-call processes, ensuring timely follow-ups and accurate CRM updates. This real-time integration between telli's AI voice agents and your Airtable CRM streamlines operations, improves customer engagement, and increases the efficiency of your sales and support teams."
      },
      "typeVersion": 1
    },
    {
      "id": "7b59fb15-efda-4221-a519-17fb9f9c67ba",
      "name": "Route based on call_status",
      "type": "n8n-nodes-base.switch",
      "position": [
        220,
        0
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "4d9daf3c-31d5-4c7c-b3de-c07c35c7b0df",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.call.call_status }}",
                    "rightValue": "=\"COMPLETED\""
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d7cca0af-b19b-4a96-ad06-d190c3da756f",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.call.call_status }}",
                    "rightValue": "\"NOT_REACHED\""
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "bb5c2392-cb1a-4162-adf0-76b84d615186",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -140
      ],
      "parameters": {
        "width": 200,
        "height": 120,
        "content": "### Different paths\nBased on the call_status outcome, we can set different actions to follow."
      },
      "typeVersion": 1
    },
    {
      "id": "59f6049a-3cbd-4da4-bec9-0e98eeaa2808",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        -320
      ],
      "parameters": {
        "width": 200,
        "content": "### call_status COMPLETED\n\nHere we update the CRM with the booked appointment from the completed call."
      },
      "typeVersion": 1
    },
    {
      "id": "61c03cd8-7760-4244-9be5-72cfceea6cdc",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        280
      ],
      "parameters": {
        "width": 200,
        "height": 140,
        "content": "### call_status NOT_REACHED\n\nHere we set a required follow_up because we did not reach the contact."
      },
      "typeVersion": 1
    },
    {
      "id": "f640f563-7f55-4933-9b5f-f44c468781d9",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        160
      ],
      "parameters": {
        "width": 220,
        "content": "### Set Webhook to receive the call data\nHere we enable n8n to receive data from the telli API once a call ends through a call_ended event."
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "eee420d7-73aa-438a-8a97-011791cb7f69",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Route based on call_status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route based on call_status": {
      "main": [
        [
          {
            "node": "Update CRM contact with call_status COMPLETED",
            "type": "main",
            "index": 0
          },
          {
            "node": "Update CRM contact with call_status NOT_REACHED",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  }
}