8
n8n 中文网amn8n.com

通过 Telegram 使用 AI 语音通话的自动化房产与餐厅预订

高级

这是一个Personal Productivity, AI Chatbot领域的自动化工作流,包含 28 个节点。主要使用 Filter, Switch, Webhook, Telegram, HttpRequest 等节点。 通过 Telegram 使用 AI 语音通话的自动化房产与餐厅预订

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "3378b0d68c3b7ebfc71b79896d94e1a044dec38e99a1160aed4e9c323910fbe2"
  },
  "nodes": [
    {
      "id": "6c5d6cf8-0dfa-48a5-8872-cf5cc69e049b",
      "name": "部分:Webhook和通话后分析",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        2320
      ],
      "parameters": {
        "width": 1080,
        "height": 576,
        "content": "**Webhook和通话后分析**"
      },
      "typeVersion": 1
    },
    {
      "id": "9782dbb6-bae4-4888-8c90-232d1e64c3de",
      "name": "Gemini 2.0 Flash",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -768,
        1616
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Pz5rkKL1ZRGrSYoQ",
          "name": "key studio google"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "996cc320-5576-4751-a5e0-bd8c0f562f4f",
      "name": "Retell创建通话",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -224,
        1408
      ],
      "parameters": {
        "url": "https://api.retellai.com/v2/create-phone-call",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ $json.output }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "GQi0JW5mlXfIppTf",
          "name": "retellai"
        },
        "httpHeaderAuth": {
          "id": "0BDVybffgPLfET7n",
          "name": "retelai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a1aae24d-ec39-4545-b09a-07cc0e5c752e",
      "name": "Retell Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1648,
        2464
      ],
      "webhookId": "retell-webhook-agent",
      "parameters": {
        "path": "retell-webhook-agent",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1.1
    },
    {
      "id": "f65ae764-312f-407e-9666-2b4b6ed93a62",
      "name": "AI代理解析通话",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1232,
        2464
      ],
      "parameters": {
        "text": "=Aquí esta la respuesta de Retellai con los datos y la transcripcion de la llamada analizala: {{ $json.body.call.transcript }} call.status {{ $json.body.call.call_status }} disconection_reason: {{ $json.body.call.disconnection_reason }} ",
        "options": {
          "systemMessage": "=[ROL]\nEres un experto en análisis de transcripciones de llamadas. Tu trabajo es decidir si la cita quedó REALMENTE confirmada y, solo entonces, crear el evento en Google Calendar con tu tool.\n\n[ENTRADAS DISPONIBLES]\n- now: {{ $now }} (fecha/hora actual)\n- transcript: transcripción completa de la llamada (agent/user)\n- disconnection_reason: motivo de fin de llamada (ej.: agent_hangup, user_hangup, inactivity, voicemail_reached, error_*)\n- started_at / ended_at / duration\n- direccion_fallback: direccion (dirección que yo tenía preparada)\n- precio: precio \n\n[CRITERIOS PARA CONSIDERAR “VISITA CONFIRMADA”]\nDebes cumplir TODOS:\n1) Fin de llamada correcto: disconnection_reason ∈ {agent_hangup, user_hangup, call_transfer}. Rechaza voicemail_reached, inactivity, max_duration_reached, dial_*, error_*.\n2) Confirmación explícita del INTERLOCUTOR (no del agente). Acepta frases inequívocas como:\n   - “sí, perfecto”, “de acuerdo”, “ok”, “confirmo”, “queda para …”, “quedamos …”, “nos vemos …”, “me viene bien …”.\n3) Fecha y hora claras:\n   - Convierte lenguaje natural (“jueves”, “mañana”, “a las cinco”) a fecha/hora (YYYY-MM-DD, HH:mm) en zona horaria de España.\n   - La hora debe estar DENTRO de alguna franja de slots_json para ese día (from ≤ hora < to).\n   - Si el usuario propone fuera de franja, NO confirmes; marca fallo.\n4) Dirección:\n   - Si el usuario dijo la dirección, úsala tal cual (normaliza números en dígitos: “sesenta y siete” → “67” y respeta tildes: “López”).\n   - Si no se dijo, usa direccion_fallback.\n5) Coherencia final:\n   - En los últimos turnos debe verse un resumen o aceptación de la cita (del agente o del usuario). Si termina por silencio u omisión, NO confirmes.\n\n[CUANDO NO CONFIRMAR]\n- transcript vacío o casi sin contenido.\n- Falta de confirmación explícita del usuario.\n- Hora fuera de slots_json o sin fecha/hora claras.\n- Cualquier disconnection_reason distinto a los permitidos.\n- Cierre confuso (ej.: solo el agente resume pero el usuario no acepta).\n\n[EXTRACCIÓN DE DATOS]\n- fecha: YYYY-MM-DD\n- hora: HH:mm (24h)\n- direccion: string\n- nombre_contacto y telefono_contacto si aparecen (opcionales)\n- who_hung_up: “agent” / “user” / “other” (según disconnection_reason)\n- resumen_llamada: 1–2 frases objetivas (qué se acordó o por qué falló)\n\n[ACCIÓN DE CALENDARIO]\n- Solo si “Visita confirmada” según las reglas de arriba: crea evento en Google Calendar (usa tu tool) con:\n  - title: \"Visita piso – direccion\"\n  - start: fecha + hora (zona horaria España)\n  - end: start + 30 o 45 min (elige 45 min por defecto si no se indicó duración)\n  - description: incluir nombre_contacto, telefono_contacto (si hay), disconnection_reason, precio (si relevante) y el resumen_llamada.\n- Si NO cumple, NO crees evento.\n\n[FORMATO DE SALIDA – SIEMPRE ASÍ]\n\n- ✅ Visita confirmada!\n  - Si el evento se creó: añade en la segunda línea “✅ Evento creado en tu calendario.”\n  - Si falló al crear por un error técnico: “⚠️ Confirmada pero el evento no se pudo crear: <motivo>”\n- ❌ No se ha podido confirmar la cita.\n- Si fue FALLO, añade “Motivo: <razón>” (p. ej., “hora fuera de disponibilidad”, “sin confirmación explícita”, “voicemail”, etc.)\n- Evaluación final que tal fue la llamada,sono convincente? fue bien?\n\n\n\n[POLÍTICAS DE INTERPRETACIÓN]\n- Fechas relativas: interpreta “jueves” como el próximo jueves posterior a started_at.\n- Horas: normaliza “cinco de la tarde” → 17:00.\n- Nombres y calles: respeta tildes (López, Alcalá). “sesenta y siete” → “67”.\n- Si hay varias fechas/horas en la conversación, usa la ÚLTIMA confirmada por el USUARIO.\n- Si slots_json no tiene ese día/hora, NO confirmes.\n\n[EJEMPLOS RÁPIDOS]\n- Usuario: “El jueves a las 17:00.” (slots_json: solo ≥ 19:00) → ❌ No confirmado (fuera de franja).\n- Usuario: “Quedamos el jueves a las 19:00.” + dirección dicha → ✅ Confirmada y crear evento.\n- Agente: “Queda para el jueves a las 19:00, ¿correcto?” Usuario: (silencio) → ❌ No confirmado.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "e7d4003b-97dc-4839-9886-021ff1f0f3e5",
      "name": "Gemini 2.0 Flash 2",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1232,
        2688
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Pz5rkKL1ZRGrSYoQ",
          "name": "key studio google"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "07d76d6b-97e0-44c3-aa6e-1de1b6be8a76",
      "name": "通知成功",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -944,
        2448
      ],
      "webhookId": "9275ea18-e94f-4a3a-86f4-fb02b92f3fe0",
      "parameters": {
        "text": "=\n{{ $json.output }}",
        "chatId": "=245284777",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "Yz85NEO7PkLjqZYt",
          "name": "agentsocialmediaAIbot"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "0394bc79-5900-43fb-a8f6-f26d6c31a9cb",
      "name": "在Google日历中获取事件",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -672,
        1648
      ],
      "parameters": {
        "eventId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Event_ID', `Ver si hay disponibilidad ese día y hora en el calendario`, 'string') }}",
        "options": {},
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "bfbpki3lq30nv2hs07kdrudmco@group.calendar.google.com",
          "cachedResultName": "alpa y muton"
        },
        "operation": "get"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "YGoukaJSksnL1Jfq",
          "name": "Google Calendar account jc.caverogracia"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "5bb4a072-bfa9-4769-a902-bbadf2e8e179",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -544,
        1552
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"from_number\": \"+34949960018\",\n  \"to_number\": \"complete_llm\",\n  \"retell_llm_dynamic_variables\": {\n    \"direccion\": \"complete_llm\",\n    \"slots_disponibles\": \"complete_llm\"\n  }\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "d2515717-c624-4eec-ab39-4bde25c452e1",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -544,
        1728
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Pz5rkKL1ZRGrSYoQ",
          "name": "key studio google"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c3887391-2f0f-4d7d-8ad1-dbcc6390f312",
      "name": "过滤器",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1424,
        2464
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e970c523-87ca-43f2-8eb8-6cb3a4811b95",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.body.event }}",
              "rightValue": "call_ended"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a9f6708f-7028-4a5f-9dfe-3e188a3b7d20",
      "name": "在Google日历中创建事件",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -1088,
        2704
      ],
      "parameters": {
        "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', ``, 'string') }}",
        "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', ``, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "bfbpki3lq30nv2hs07kdrudmco@group.calendar.google.com",
          "cachedResultName": "alpa y muton"
        },
        "additionalFields": {
          "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Summary', ``, 'string') }}",
          "attendees": [
            "alessiapavone1991@gmail.com",
            "jc.caverogracia@gmail.com"
          ],
          "description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Description', ``, 'string') }}"
        },
        "useDefaultReminders": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Use_Default_Reminders', ``, 'boolean') }}"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "YGoukaJSksnL1Jfq",
          "name": "Google Calendar account jc.caverogracia"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "4e18400a-65d1-4951-91b1-5cf142396ca6",
      "name": "Telegram 触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1696,
        1680
      ],
      "webhookId": "ea1688c0-4e5b-4439-b21e-054c1ceb2aa9",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "Yz85NEO7PkLjqZYt",
          "name": "agentsocialmediaAIbot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ee853319-7d74-44c2-bde1-6d9be7ce3d33",
      "name": "发送文本消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1488,
        1680
      ],
      "webhookId": "0ffac095-d83a-48ff-96e8-9fb3223634d2",
      "parameters": {
        "text": "Comenzando llamada",
        "chatId": "={{ $json.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "Yz85NEO7PkLjqZYt",
          "name": "agentsocialmediaAIbot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "be55dfc4-a7b5-483c-8701-9c8163ffb13f",
      "name": "Gemini 2.0 Flash1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -768,
        2144
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Pz5rkKL1ZRGrSYoQ",
          "name": "key studio google"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8d309cbf-b0b6-4598-a28b-024c5ff7154d",
      "name": "Retell创建通话1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -224,
        1904
      ],
      "parameters": {
        "url": "https://api.retellai.com/v2/create-phone-call",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ $json.output }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "0BDVybffgPLfET7n",
          "name": "retelai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "acaf744a-3e24-4e79-9d12-eb75b8f3eb9f",
      "name": "在Google日历中获取事件1",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -656,
        2176
      ],
      "parameters": {
        "eventId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Event_ID', `Ver si hay disponibilidad ese día y hora en el calendario`, 'string') }}",
        "options": {},
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "bfbpki3lq30nv2hs07kdrudmco@group.calendar.google.com",
          "cachedResultName": "alpa y muton"
        },
        "operation": "get"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "YGoukaJSksnL1Jfq",
          "name": "Google Calendar account jc.caverogracia"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "76c3d2af-9370-4614-8319-b733a0ffedb4",
      "name": "结构化输出解析器1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -544,
        2160
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"from_number\": \"+34949960018\",\n  \"to_number\": \"complete_llm\",\n  \"override_agent_id\": \"agent_6f8860a113d84673ea6e52cfe2\",\n  \"retell_llm_dynamic_variables\": {\n    \"num_personas\": \"complete_llm\",\n    \"hora_deseada\": \"complete_llm\"\n  }\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "7d88c75e-a24c-4d31-9401-8192442e8780",
      "name": "Google Gemini 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -544,
        2272
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Pz5rkKL1ZRGrSYoQ",
          "name": "key studio google"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d3abfa2a-6f9a-4ba6-bbfc-a93ab1b0d4db",
      "name": "AI代理餐厅预订",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -704,
        2016
      ],
      "parameters": {
        "text": "=Eres un asistente experto en reservar mesa en restaurantes\n\n**Comando recibido:** {{ $('Telegram Trigger').item.json.message.text }}\n\n**Tu tarea:**\n1. **Extraer datos del comando** `/cita <telefono> [direccion] [notas]`\n   - Normaliza el teléfono a formato E.164 español (+34XXXXXXXXX)\n   - Valida que sea móvil español (6,7,8,9 + 8 dígitos)\n   - Extrae número de personas y la hora deseada\n\n\n2. **Preparar llamada con Retell AI:**\n   - Teléfono destino: el extraído del comando\n   - Genera un prompt natural para el agente de voz:\n     * Solicitar visita al piso en [dirección]\n     * Proponer los 3 slots disponibles\n     * Confirmar: dirección\n     * Ser breve y profesional\n   - Incluir metadata: chatId, direccion, intentos:0\n\n3. **Devolver JSON** para hacer la llamada:\n```json\n{\n  \"from_number\": \"+34949960018\",\n  \"to_number\": \"complete_llm\",\n  \"override_agent_id\": \"agent_6f8860a113d84673ea6e52cfe2\",\n  \"retell_llm_dynamic_variables\": {\n    \"num_personas\": \"complete_llm\",\n    \"hora_deseada\": \"complete_llm\"\n  }\n}\n```\n\n\n**Timezone:** Europe/Madrid\n**Fecha actual:** {{ $now.toISO() }}",
        "options": {
          "systemMessage": "Eres un asistente de IA experto en scheduling y automatización. Usas herramientas para obtener datos de calendarios y generar llamadas telefónicas. Siempre devuelves JSON válido y bien estructurado."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 1.7
    },
    {
      "id": "e4308412-51fe-4f44-8fe3-5b3f5a0feb2f",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1280,
        1680
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "pisos",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7fafd93a-8ce4-4ddd-a983-4e3934efe1bb",
                    "operator": {
                      "type": "string",
                      "operation": "notStartsWith"
                    },
                    "leftValue": "={{ $('Telegram Trigger').item.json.message.text }}",
                    "rightValue": "/reserva"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Reserva restaurante",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "611dbffc-c663-48c9-9e10-c045f26f4505",
                    "operator": {
                      "type": "string",
                      "operation": "startsWith"
                    },
                    "leftValue": "={{ $('Telegram Trigger').item.json.message.text }}",
                    "rightValue": "/reserva"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "199a1023-342c-48c9-9851-e313a22ac3f6",
      "name": "设置说明1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2464,
        1744
      ],
      "parameters": {
        "width": 608,
        "height": 624,
        "content": "**快速设置:RetellAI、Telegram和Google日历**"
      },
      "typeVersion": 1
    },
    {
      "id": "cd2945c3-53e9-4abe-8e7b-0d2cba4b9037",
      "name": "部分:触发器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1728,
        1584
      ],
      "parameters": {
        "width": 200,
        "height": 288,
        "content": "**触发器**"
      },
      "typeVersion": 1
    },
    {
      "id": "4079fb64-f95c-4227-a886-8e1a2bb7fa33",
      "name": "部分:解析和路由",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        1584
      ],
      "parameters": {
        "width": 420,
        "height": 288,
        "content": "**解析和路由**"
      },
      "typeVersion": 1
    },
    {
      "id": "d5831d91-7d57-45f6-9c2a-13f8f3cf1a09",
      "name": "部分:代理 – 房产查看",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        1264
      ],
      "parameters": {
        "width": 516,
        "height": 608,
        "content": "**代理:房产查看**"
      },
      "typeVersion": 1
    },
    {
      "id": "3d64406e-42e0-4e8f-8380-9475f267234a",
      "name": "AI代理:房产查看",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -768,
        1408
      ],
      "parameters": {
        "text": "=Eres un asistente experto en agendar visitas a pisos.\n\n**Comando recibido:** {{ $('Telegram Trigger').item.json.message.text }}\n\n**Tu tarea:**\n1. **Extraer datos del comando** `/cita <telefono> [direccion] [notas]`\n   - Normaliza el teléfono a formato E.164 español (+34XXXXXXXXX)\n   - Valida que sea móvil español (6,7,8,9 + 8 dígitos)\n   - Extrae dirección y notas\n\n2. **Consultar con tu tool Google Calendar y ver que huecos están ocupados y cuales no** \n   - Usa la herramienta de Google Calendar\n   - Obtén todos los eventos existentes\n\n3. **Generar slots disponibles** según horarios:\n   - Lunes-Jueves: ≥19:00\n   - Viernes: ≥16:00\n   - Sábado-Domingo: 11:00-21:00\n   - Duración: 30 min + 20 min buffer = 50 min bloque\n   - Intervalos: cada 30 minutos\n   - Filtra colisiones con eventos del calendario\n   - Selecciona los mejores 5 slots\n   - las  fechas en slots disponibles pasalas en texto no en números por ejemplo y dale 3 opciones depende del día de hoy, si es más pronto de las 19:00 dile: tengo disponible hoy a partir de las 7 de la tarde, mañana y pasado igual (contando con que no sea viernes o festivo). Si hoy es jueves por ejemplo le dirías tengo disponible hoy a partir de las 7, mañana a partir de las 4  y fin de semana a cualquier hora a partir de las 11\n\n4. **Preparar llamada con Retell AI:**\n   - Teléfono destino: el extraído del comando\n   - Genera un prompt natural para el agente de voz:\n     * Solicitar visita al piso en [dirección]\n     * Proponer los 3 slots disponibles\n     * Confirmar: dirección\n     * Ser breve y profesional\n   - Incluir metadata: chatId, direccion, intentos:0\n\n5. **Devolver JSON** para hacer la llamada:\n```json\n{\n  \"from_number\": \"+34949960018\",\n  \"to_number\": \"complete_llm\",\n  \"retell_llm_dynamic_variables\": {\n    \"direccion\": \"complete_llm\",\n    \"slots_disponibles\": \"complete_llm\"\n  }\n}\n```\n\n\n**Timezone:** Europe/Madrid\n**Fecha actual:** {{ $now.toISO() }}",
        "options": {
          "systemMessage": "Eres un asistente de IA experto en scheduling y automatización. Usas herramientas para obtener datos de calendarios y generar llamadas telefónicas. Siempre devuelves JSON válido y bien estructurado."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 1.7
    },
    {
      "id": "7b44caf1-1760-4b86-ac5c-111414917495",
      "name": "部分:Retell AI通话1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        1264
      ],
      "parameters": {
        "width": 360,
        "height": 800,
        "content": "**Retell AI通话**"
      },
      "typeVersion": 1
    },
    {
      "id": "7b9e4403-19f6-43e2-bb32-8cbb0428578a",
      "name": "部分:代理 – 餐厅预订1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        1872
      ],
      "parameters": {
        "width": 516,
        "height": 528,
        "content": "**代理:餐厅预订**"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Retell Webhook": [
      {
        "body": {
          "call": {
            "call_id": "call_a6151608cedfc832a311902e2d4",
            "latency": {
              "e2e": {
                "max": 5054,
                "min": 278,
                "num": 13,
                "p50": 1733,
                "p90": 3193.8010253906255,
                "p95": 4039.999853515623,
                "p99": 4851.199970703124,
                "values": [
                  574,
                  1733,
                  3363.999755859375,
                  1970,
                  1425.0009765625,
                  5054,
                  1649,
                  2453,
                  1536.001953125,
                  1808,
                  278,
                  2513.006103515625,
                  1702.0048828125
                ]
              },
              "llm": {
                "max": 4103,
                "min": 816,
                "num": 13,
                "p50": 1162,
                "p90": 2499.8000000000006,
                "p95": 3220.399999999998,
                "p99": 3926.4799999999987,
                "values": [
                  1824,
                  1049,
                  2632,
                  1162,
                  865,
                  4103,
                  1128,
                  1653,
                  816,
                  1103,
                  1234,
                  1971,
                  897
                ]
              },
              "tts": {
                "max": 318,
                "min": 243,
                "num": 13,
                "p50": 278,
                "p90": 309.8,
                "p95": 313.8,
                "p99": 317.15999999999997,
                "values": [
                  305,
                  285,
                  273,
                  282,
                  269,
                  243,
                  250,
                  274,
                  266,
                  299,
                  318,
                  278,
                  311
                ]
              }
            },
            "agent_id": "agent_b9373d40edb62df778a7e5846b",
            "call_cost": {
              "combined_cost": 21.65,
              "product_costs": [
                {
                  "cost": 9.9166667,
                  "product": "elevenlabs_tts",
                  "unit_price": 0.1166667
                },
                {
                  "cost": 11.3333333,
                  "product": "gpt_5_high_priority",
                  "unit_price": 0.1333333
                },
                {
                  "cost": 0.4,
                  "product": "gpt_5_mini_text_testing"
                }
              ],
              "total_duration_seconds": 85,
              "total_duration_unit_price": 0.25
            },
            "call_type": "phone_call",
            "direction": "outbound",
            "to_number": "+34612403687",
            "agent_name": "Single-Prompt Agent",
            "transcript": "User: ¿Te vas?\nUser: ¿Qué ¿Le va?\nAgent: No, \nUser: Le va.\nAgent: Buenas, soy Juan \nUser: Dígame.\nAgent: Gracias. Te llamo para agendar una visita al piso en Avenida del Manzanares, 20.\n¿Puedes hablar ahora?\nUser: Hola, ¿diga?\nUser: ¿Me oye?\nAgent: Sí, te oigo. Te llamo para agendar una \nUser: Oyes? Ahora.\nAgent: visita al piso \nAgent: Sí, te oigo.\nUser: Se, es que se corta, \nAgent:  Te llamo para agendar una \nUser: estoy yo metido en un en un sótano trabajando.\nUser: Espera, espera un segundo, espere.\nAgent: Sin problema. ¿Cuándo te viene mejor que te llame? Puedo llamarte \nUser: No, ahora, ahora, ya \nAgent: hoy a las siete de la \nUser: le oigo, que he salido, es que estamos trabajando en unos traseros, dígame.\nAgent: Perfecto. Te llamo para agendar una visita al piso en Avenida del Manzanares, 20. ¿Qué día te viene bien?\nUser: Pues por las tardes, de seis a ocho, ¿es particular o agencia?\nAgent: Es particular. ¿Te viene bien el jueves 9 de octubre a partir de las siete de la tarde?\nUser: Perfecto.\nAgent: Perfecto, queda para el jueves 9 de octubre a las siete de la tarde.\n¿La dirección exacta del \nUser: Perfecto.\nAgent: piso?\nUser: Sí, ahí en el veinte.\nAgent: Perfecto, \nUser: El portal.\nAgent: Perfecto, queda \nAgent: Perfecto, quedamos así muchas gracias. hasta luego\n",
            "call_status": "ended",
            "duration_ms": 84385,
            "from_number": "+34949960018",
            "agent_version": 8,
            "end_timestamp": 1759917188812,
            "recording_url": "https://dxc03zgurdly9.cloudfront.net/3348e2dfc49d2bb52dc090412bc3687d0233a2e8a6c54f0047831702f5975a4c/recording.wav",
            "public_log_url": "https://dxc03zgurdly9.cloudfront.net/3348e2dfc49d2bb52dc090412bc3687d0233a2e8a6c54f0047831702f5975a4c/public.log",
            "llm_token_usage": {
              "values": [
                1160,
                1174,
                1174,
                1188,
                1188,
                1233,
                1240,
                1267,
                1306,
                1318,
                1375,
                1427,
                1458,
                1493,
                1509,
                1522
              ],
              "average": 1314.5,
              "num_requests": 16
            },
            "start_timestamp": 1759917104427,
            "opt_in_signed_url": false,
            "transcript_object": [
              {
                "role": "user",
                "words": [
                  {
                    "end": 1.8519999,
                    "word": "¿Te ",
                    "start": 1.6119999
                  },
                  {
                    "end": 2.092,
                    "word": "vas?",
                    "start": 1.8519999
                  }
                ],
                "content": "¿Te vas?"
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 4.052,
                    "word": "¿Qué ",
                    "start": 3.6519999
                  },
                  {
                    "end": 4.7919997,
                    "word": "¿Le ",
                    "start": 4.4719999999999995
                  },
                  {
                    "end": 5.031999999999999,
                    "word": "va?",
                    "start": 4.7919997
                  }
                ],
                "content": "¿Qué ¿Le va?"
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 5.044,
                    "word": "No, ",
                    "start": 4.8
                  }
                ],
                "content": "No, ",
                "metadata": {
                  "response_id": 1
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 7.342,
                    "word": "Le ",
                    "start": 7.021999999999999
                  },
                  {
                    "end": 7.5020001999999995,
                    "word": "va.",
                    "start": 7.342
                  }
                ],
                "content": "Le va."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 7.276,
                    "word": "Buenas, ",
                    "start": 6.893
                  },
                  {
                    "end": 7.427,
                    "word": "soy ",
                    "start": 7.276
                  },
                  {
                    "end": 7.613,
                    "word": "Juan ",
                    "start": 7.427
                  }
                ],
                "content": "Buenas, soy Juan ",
                "metadata": {
                  "response_id": 3
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 10.962,
                    "word": "Dígame.",
                    "start": 10.481999
                  }
                ],
                "content": "Dígame."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 11.934,
                    "word": "Gracias.",
                    "start": 11.04
                  },
                  {
                    "end": 12.155125,
                    "word": " Te ",
                    "start": 11.980125
                  },
                  {
                    "end": 12.456125,
                    "word": "llamo ",
                    "start": 12.155125
                  },
                  {
                    "end": 12.677125,
                    "word": "para ",
                    "start": 12.456125
                  },
                  {
                    "end": 13.072125,
                    "word": "agendar ",
                    "start": 12.677125
                  },
                  {
                    "end": 13.223125,
                    "word": "una ",
                    "start": 13.072125
                  },
                  {
                    "end": 13.617125,
                    "word": "visita ",
                    "start": 13.223125
                  },
                  {
                    "end": 13.780125,
                    "word": "al ",
                    "start": 13.617125
                  },
                  {
                    "end": 14.093125,
                    "word": "piso ",
                    "start": 13.780125
                  },
                  {
                    "end": 14.198125,
                    "word": "en ",
                    "start": 14.093125
                  },
                  {
                    "end": 14.558125,
                    "word": "Avenida ",
                    "start": 14.198125
                  },
                  {
                    "end": 14.720125,
                    "word": "del ",
                    "start": 14.558125
                  },
                  {
                    "end": 15.301125,
                    "word": "Manzanares, ",
                    "start": 14.720125
                  },
                  {
                    "end": 15.730125,
                    "word": "20.\n",
                    "start": 15.301125
                  },
                  {
                    "end": 16.125125,
                    "word": "¿Puedes ",
                    "start": 15.730125
                  },
                  {
                    "end": 16.392125,
                    "word": "hablar ",
                    "start": 16.125125
                  },
                  {
                    "end": 16.903125,
                    "word": "ahora?",
                    "start": 16.392125
                  }
                ],
                "content": "Gracias. Te llamo para agendar una visita al piso en Avenida del Manzanares, 20.\n¿Puedes hablar ahora?",
                "metadata": {
                  "response_id": 5
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 18.412,
                    "word": "Hola, ",
                    "start": 17.772000000000002
                  },
                  {
                    "end": 18.572,
                    "word": "¿diga?",
                    "start": 18.572
                  }
                ],
                "content": "Hola, ¿diga?"
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 20.881999,
                    "word": "¿Me ",
                    "start": 20.402
                  },
                  {
                    "end": 21.121999,
                    "word": "oye?",
                    "start": 20.881999
                  }
                ],
                "content": "¿Me oye?"
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 22.895,
                    "word": "Sí, ",
                    "start": 22.675
                  },
                  {
                    "end": 23.035,
                    "word": "te ",
                    "start": 22.895
                  },
                  {
                    "end": 23.569,
                    "word": "oigo.",
                    "start": 23.035
                  },
                  {
                    "end": 23.754666748046876,
                    "word": " Te ",
                    "start": 23.591666748046876
                  },
                  {
                    "end": 24.137666748046875,
                    "word": "llamo ",
                    "start": 23.754666748046876
                  },
                  {
                    "end": 24.346666748046875,
                    "word": "para ",
                    "start": 24.137666748046875
                  },
                  {
                    "end": 24.717666748046874,
                    "word": "agendar ",
                    "start": 24.346666748046875
                  },
                  {
                    "end": 24.868666748046873,
                    "word": "una ",
                    "start": 24.717666748046874
                  }
                ],
                "content": "Sí, te oigo. Te llamo para agendar una ",
                "metadata": {
                  "response_id": 7
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 22.942,
                    "word": "Oyes? ",
                    "start": 22.622
                  },
                  {
                    "end": 25.102,
                    "word": "Ahora.",
                    "start": 24.702
                  }
                ],
                "content": "Oyes? Ahora."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 25.205666748046873,
                    "word": "visita ",
                    "start": 24.868666748046873
                  },
                  {
                    "end": 25.321666748046876,
                    "word": "al ",
                    "start": 25.205666748046873
                  },
                  {
                    "end": 25.623666748046876,
                    "word": "piso ",
                    "start": 25.321666748046876
                  }
                ],
                "content": "visita al piso ",
                "metadata": {
                  "response_id": 7
                }
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 30.62,
                    "word": "Sí, ",
                    "start": 30.272
                  },
                  {
                    "end": 30.76,
                    "word": "te ",
                    "start": 30.62
                  },
                  {
                    "end": 31.317,
                    "word": "oigo.",
                    "start": 30.76
                  }
                ],
                "content": "Sí, te oigo.",
                "metadata": {
                  "response_id": 8
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 32.502,
                    "word": "Se, ",
                    "start": 32.102000000000004
                  },
                  {
                    "end": 32.662,
                    "word": "es ",
                    "start": 32.502
                  },
                  {
                    "end": 32.742,
                    "word": "que ",
                    "start": 32.662
                  },
                  {
                    "end": 32.902,
                    "word": "se ",
                    "start": 32.742
                  },
                  {
                    "end": 33.222,
                    "word": "corta, ",
                    "start": 32.902
                  }
                ],
                "content": "Se, es que se corta, "
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 32.229,
                    "word": " Te ",
                    "start": 32.055
                  },
                  {
                    "end": 32.496,
                    "word": "llamo ",
                    "start": 32.229
                  },
                  {
                    "end": 32.717,
                    "word": "para ",
                    "start": 32.496
                  },
                  {
                    "end": 33.112,
                    "word": "agendar ",
                    "start": 32.717
                  },
                  {
                    "end": 33.274,
                    "word": "una ",
                    "start": 33.112
                  }
                ],
                "content": " Te llamo para agendar una ",
                "metadata": {
                  "response_id": 8
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 33.462,
                    "word": "estoy ",
                    "start": 33.222
                  },
                  {
                    "end": 33.622,
                    "word": "yo ",
                    "start": 33.462
                  },
                  {
                    "end": 33.942,
                    "word": "metido ",
                    "start": 33.622
                  },
                  {
                    "end": 34.102000000000004,
                    "word": "en ",
                    "start": 33.942
                  },
                  {
                    "end": 34.342,
                    "word": "un ",
                    "start": 34.102000000000004
                  },
                  {
                    "end": 34.582,
                    "word": "en ",
                    "start": 34.342
                  },
                  {
                    "end": 34.662,
                    "word": "un ",
                    "start": 34.582
                  },
                  {
                    "end": 35.062,
                    "word": "sótano ",
                    "start": 34.662
                  },
                  {
                    "end": 35.462,
                    "word": "trabajando.",
                    "start": 35.062
                  }
                ],
                "content": "estoy yo metido en un en un sótano trabajando."
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 36.642,
                    "word": "Espera, ",
                    "start": 36.162
                  },
                  {
                    "end": 36.802,
                    "word": "espera ",
                    "start": 36.642
                  },
                  {
                    "end": 36.962,
                    "word": "un ",
                    "start": 36.802
                  },
                  {
                    "end": 37.362,
                    "word": "segundo, ",
                    "start": 36.962
                  },
                  {
                    "end": 37.602000000000004,
                    "word": "espere.",
                    "start": 37.362
                  }
                ],
                "content": "Espera, espera un segundo, espere."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 39.623,
                    "word": "Sin ",
                    "start": 39.402
                  },
                  {
                    "end": 40.273,
                    "word": "problema.",
                    "start": 39.623
                  },
                  {
                    "end": 40.64466674804687,
                    "word": " ¿Cuándo ",
                    "start": 40.31866674804687
                  },
                  {
                    "end": 40.725666748046876,
                    "word": "te ",
                    "start": 40.64466674804687
                  },
                  {
                    "end": 40.87666674804687,
                    "word": "viene ",
                    "start": 40.725666748046876
                  },
                  {
                    "end": 41.12066674804687,
                    "word": "mejor ",
                    "start": 40.87666674804687
                  },
                  {
                    "end": 41.23666674804687,
                    "word": "que ",
                    "start": 41.12066674804687
                  },
                  {
                    "end": 41.329666748046876,
                    "word": "te ",
                    "start": 41.23666674804687
                  },
                  {
                    "end": 41.851666748046874,
                    "word": "llame?",
                    "start": 41.329666748046876
                  },
                  {
                    "end": 42.164625,
                    "word": " Puedo ",
                    "start": 41.863625
                  },
                  {
                    "end": 42.629625,
                    "word": "llamarte ",
                    "start": 42.164625
                  }
                ],
                "content": "Sin problema. ¿Cuándo te viene mejor que te llame? Puedo llamarte ",
                "metadata": {
                  "response_id": 10
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 43.432002,
                    "word": "No, ",
                    "start": 43.032000000000004
                  },
                  {
                    "end": 43.672,
                    "word": "ahora, ",
                    "start": 43.432002
                  },
                  {
                    "end": 43.832,
                    "word": "ahora, ",
                    "start": 43.672
                  },
                  {
                    "end": 43.992,
                    "word": "ya ",
                    "start": 43.832
                  }
                ],
                "content": "No, ahora, ahora, ya "
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 43.186625,
                    "word": "hoy ",
                    "start": 42.629625
                  },
                  {
                    "end": 43.349625,
                    "word": "a ",
                    "start": 43.186625
                  },
                  {
                    "end": 43.511625,
                    "word": "las ",
                    "start": 43.349625
                  },
                  {
                    "end": 43.801625,
                    "word": "siete ",
                    "start": 43.511625
                  },
                  {
                    "end": 43.883625,
                    "word": "de ",
                    "start": 43.801625
                  },
                  {
                    "end": 44.010625,
                    "word": "la ",
                    "start": 43.883625
                  }
                ],
                "content": "hoy a las siete de la ",
                "metadata": {
                  "response_id": 10
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 44.072,
                    "word": "le ",
                    "start": 43.992
                  },
                  {
                    "end": 44.392,
                    "word": "oigo, ",
                    "start": 44.072
                  },
                  {
                    "end": 44.472003,
                    "word": "que ",
                    "start": 44.392
                  },
                  {
                    "end": 44.552,
                    "word": "he ",
                    "start": 44.472003
                  },
                  {
                    "end": 44.872,
                    "word": "salido, ",
                    "start": 44.552
                  },
                  {
                    "end": 44.952002,
                    "word": "es ",
                    "start": 44.872
                  },
                  {
                    "end": 45.032000000000004,
                    "word": "que ",
                    "start": 44.952002
                  },
                  {
                    "end": 45.272002,
                    "word": "estamos ",
                    "start": 45.032000000000004
                  },
                  {
                    "end": 45.592,
                    "word": "trabajando ",
                    "start": 45.272002
                  },
                  {
                    "end": 45.672,
                    "word": "en ",
                    "start": 45.592
                  },
                  {
                    "end": 45.832,
                    "word": "unos ",
                    "start": 45.672
                  },
                  {
                    "end": 46.392,
                    "word": "traseros, ",
                    "start": 45.832
                  },
                  {
                    "end": 46.712,
                    "word": "dígame.",
                    "start": 46.392
                  }
                ],
                "content": "le oigo, que he salido, es que estamos trabajando en unos traseros, dígame."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 50.094,
                    "word": "Perfecto.",
                    "start": 49.281
                  },
                  {
                    "end": 50.279791748046875,
                    "word": " Te ",
                    "start": 50.11679174804687
                  },
                  {
                    "end": 50.54679174804688,
                    "word": "llamo ",
                    "start": 50.279791748046875
                  },
                  {
                    "end": 50.743791748046874,
                    "word": "para ",
                    "start": 50.54679174804688
                  },
                  {
                    "end": 51.09179174804687,
                    "word": "agendar ",
                    "start": 50.743791748046874
                  },
                  {
                    "end": 51.231791748046874,
                    "word": "una ",
                    "start": 51.09179174804687
                  },
                  {
                    "end": 51.544791748046876,
                    "word": "visita ",
                    "start": 51.231791748046874
                  },
                  {
                    "end": 51.660791748046876,
                    "word": "al ",
                    "start": 51.544791748046876
                  },
                  {
                    "end": 51.98579174804688,
                    "word": "piso ",
                    "start": 51.660791748046876
                  },
                  {
                    "end": 52.102791748046876,
                    "word": "en ",
                    "start": 51.98579174804688
                  },
                  {
                    "end": 52.450791748046875,
                    "word": "Avenida ",
                    "start": 52.102791748046876
                  },
                  {
                    "end": 52.566791748046874,
                    "word": "del ",
                    "start": 52.450791748046875
                  },
                  {
                    "end": 53.297791748046876,
                    "word": "Manzanares, ",
                    "start": 52.566791748046874
                  },
                  {
                    "end": 53.99479174804687,
                    "word": "20. ",
                    "start": 53.297791748046876
                  },
                  {
                    "end": 54.19175,
                    "word": "¿Qué ",
                    "start": 54.04075
                  },
                  {
                    "end": 54.34275,
                    "word": "día ",
                    "start": 54.19175
                  },
                  {
                    "end": 54.44775,
                    "word": "te ",
                    "start": 54.34275
                  },
                  {
                    "end": 54.67975,
                    "word": "viene ",
                    "start": 54.44775
                  },
                  {
                    "end": 55.15575,
                    "word": "bien?",
                    "start": 54.67975
                  }
                ],
                "content": "Perfecto. Te llamo para agendar una visita al piso en Avenida del Manzanares, 20. ¿Qué día te viene bien?",
                "metadata": {
                  "response_id": 11
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 56.781997,
                    "word": "Pues ",
                    "start": 56.542
                  },
                  {
                    "end": 57.022,
                    "word": "por ",
                    "start": 56.781997
                  },
                  {
                    "end": 57.101996,
                    "word": "las ",
                    "start": 57.022
                  },
                  {
                    "end": 57.422,
                    "word": "tardes, ",
                    "start": 57.101996
                  },
                  {
                    "end": 57.501998,
                    "word": "de ",
                    "start": 57.422
                  },
                  {
                    "end": 57.742,
                    "word": "seis ",
                    "start": 57.501998
                  },
                  {
                    "end": 57.902,
                    "word": "a ",
                    "start": 57.742
                  },
                  {
                    "end": 58.222,
                    "word": "ocho, ",
                    "start": 57.902
                  },
                  {
                    "end": 58.382,
                    "word": "¿es ",
                    "start": 58.222
                  },
                  {
                    "end": 58.941996,
                    "word": "particular ",
                    "start": 58.382
                  },
                  {
                    "end": 59.182,
                    "word": "o ",
                    "start": 58.941996
                  },
                  {
                    "end": 59.501998,
                    "word": "agencia?",
                    "start": 59.182
                  }
                ],
                "content": "Pues por las tardes, de seis a ocho, ¿es particular o agencia?"
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 61.317,
                    "word": "Es ",
                    "start": 61.166
                  },
                  {
                    "end": 61.967,
                    "word": "particular.",
                    "start": 61.317
                  },
                  {
                    "end": 62.175791748046876,
                    "word": " ¿Te ",
                    "start": 62.01279174804687
                  },
                  {
                    "end": 62.407791748046876,
                    "word": "viene ",
                    "start": 62.175791748046876
                  },
                  {
                    "end": 62.605791748046876,
                    "word": "bien ",
                    "start": 62.407791748046876
                  },
                  {
                    "end": 62.67479174804687,
                    "word": "el ",
                    "start": 62.605791748046876
                  },
                  {
                    "end": 62.96479174804688,
                    "word": "jueves ",
                    "start": 62.67479174804687
                  },
                  {
                    "end": 63.185791748046874,
                    "word": "9 ",
                    "start": 62.96479174804688
                  },
                  {
                    "end": 63.26679174804688,
                    "word": "de ",
                    "start": 63.185791748046874
                  },
                  {
                    "end": 63.71979174804687,
                    "word": "octubre ",
                    "start": 63.26679174804688
                  },
                  {
                    "end": 63.81279174804688,
                    "word": "a ",
                    "start": 63.71979174804687
                  },
                  {
                    "end": 64.23079174804687,
                    "word": "partir ",
                    "start": 63.81279174804688
                  },
                  {
                    "end": 64.33479174804687,
                    "word": "de ",
                    "start": 64.23079174804687
                  },
                  {
                    "end": 64.49779174804688,
                    "word": "las ",
                    "start": 64.33479174804687
                  },
                  {
                    "end": 64.83479174804687,
                    "word": "siete ",
                    "start": 64.49779174804688
                  },
                  {
                    "end": 64.91579174804687,
                    "word": "de ",
                    "start": 64.83479174804687
                  },
                  {
                    "end": 65.04379174804687,
                    "word": "la ",
                    "start": 64.91579174804687
                  },
                  {
                    "end": 65.58879174804687,
                    "word": "tarde?",
                    "start": 65.04379174804687
                  }
                ],
                "content": "Es particular. ¿Te viene bien el jueves 9 de octubre a partir de las siete de la tarde?",
                "metadata": {
                  "response_id": 12
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 67.262,
                    "word": "Perfecto.",
                    "start": 66.782004
                  }
                ],
                "content": "Perfecto."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 69.627,
                    "word": "Perfecto, ",
                    "start": 69.186
                  },
                  {
                    "end": 69.848,
                    "word": "queda ",
                    "start": 69.627
                  },
                  {
                    "end": 69.999,
                    "word": "para ",
                    "start": 69.848
                  },
                  {
                    "end": 70.127,
                    "word": "el ",
                    "start": 69.999
                  },
                  {
                    "end": 70.637,
                    "word": "jueves ",
                    "start": 70.127
                  },
                  {
                    "end": 70.87,
                    "word": "9 ",
                    "start": 70.637
                  },
                  {
                    "end": 70.951,
                    "word": "de ",
                    "start": 70.87
                  },
                  {
                    "end": 71.311,
                    "word": "octubre ",
                    "start": 70.951
                  },
                  {
                    "end": 71.369,
                    "word": "a ",
                    "start": 71.311
                  },
                  {
                    "end": 71.496,
                    "word": "las ",
                    "start": 71.369
                  },
                  {
                    "end": 71.74,
                    "word": "siete ",
                    "start": 71.496
                  },
                  {
                    "end": 71.822,
                    "word": "de ",
                    "start": 71.74
                  },
                  {
                    "end": 71.926,
                    "word": "la ",
                    "start": 71.822
                  },
                  {
                    "end": 72.46,
                    "word": "tarde.",
                    "start": 71.926
                  },
                  {
                    "end": 72.669125,
                    "word": "\n¿La ",
                    "start": 72.495125
                  },
                  {
                    "end": 73.029125,
                    "word": "dirección ",
                    "start": 72.669125
                  },
                  {
                    "end": 73.342125,
                    "word": "exacta ",
                    "start": 73.029125
                  },
                  {
                    "end": 73.493125,
                    "word": "del ",
                    "start": 73.342125
                  }
                ],
                "content": "Perfecto, queda para el jueves 9 de octubre a las siete de la tarde.\n¿La dirección exacta del ",
                "metadata": {
                  "response_id": 13
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 73.912,
                    "word": "Perfecto.",
                    "start": 73.512
                  }
                ],
                "content": "Perfecto."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 74.039125,
                    "word": "piso?",
                    "start": 73.493125
                  }
                ],
                "content": "piso?",
                "metadata": {
                  "response_id": 13
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 75.872,
                    "word": "Sí, ",
                    "start": 75.552
                  },
                  {
                    "end": 76.19200000000001,
                    "word": "ahí ",
                    "start": 75.872
                  },
                  {
                    "end": 76.271995,
                    "word": "en ",
                    "start": 76.19200000000001
                  },
                  {
                    "end": 76.432,
                    "word": "el ",
                    "start": 76.271995
                  },
                  {
                    "end": 76.591994,
                    "word": "veinte.",
                    "start": 76.432
                  }
                ],
                "content": "Sí, ahí en el veinte."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 76.594,
                    "word": "Perfecto, ",
                    "start": 76.106
                  }
                ],
                "content": "Perfecto, ",
                "metadata": {
                  "response_id": 14
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 79.201995,
                    "word": "El ",
                    "start": 79.042
                  },
                  {
                    "end": 79.521995,
                    "word": "portal.",
                    "start": 79.201995
                  }
                ],
                "content": "El portal."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 79.674,
                    "word": "Perfecto, ",
                    "start": 79.221
                  },
                  {
                    "end": 79.883,
                    "word": "queda ",
                    "start": 79.674
                  }
                ],
                "content": "Perfecto, queda ",
                "metadata": {
                  "response_id": 15
                }
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 81.886,
                    "word": "Perfecto, ",
                    "start": 81.398
                  },
                  {
                    "end": 82.222,
                    "word": "quedamos ",
                    "start": 81.886
                  },
                  {
                    "end": 82.431,
                    "word": "así ",
                    "start": 82.222
                  },
                  {
                    "end": 82.733,
                    "word": "muchas ",
                    "start": 82.431
                  },
                  {
                    "end": 83.453,
                    "word": "gracias. ",
                    "start": 82.733
                  },
                  {
                    "end": 83.778125,
                    "word": "hasta ",
                    "start": 83.499125
                  },
                  {
                    "end": 84.382125,
                    "word": "luego",
                    "start": 83.778125
                  }
                ],
                "content": "Perfecto, quedamos así muchas gracias. hasta luego",
                "metadata": {
                  "response_id": 16
                }
              }
            ],
            "data_storage_setting": "everything",
            "disconnection_reason": "agent_hangup",
            "telephony_identifier": {
              "twilio_call_sid": "CA6cd82de6747f0f0c58005f88f49622e0"
            },
            "transcript_with_tool_calls": [
              {
                "role": "user",
                "words": [
                  {
                    "end": 1.8519999,
                    "word": "¿Te ",
                    "start": 1.6119999
                  },
                  {
                    "end": 2.092,
                    "word": "vas?",
                    "start": 1.8519999
                  }
                ],
                "content": "¿Te vas?"
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 4.052,
                    "word": "¿Qué ",
                    "start": 3.6519999
                  },
                  {
                    "end": 4.7919997,
                    "word": "¿Le ",
                    "start": 4.4719999999999995
                  },
                  {
                    "end": 5.031999999999999,
                    "word": "va?",
                    "start": 4.7919997
                  }
                ],
                "content": "¿Qué ¿Le va?"
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 5.044,
                    "word": "No, ",
                    "start": 4.8
                  }
                ],
                "content": "No, ",
                "metadata": {
                  "response_id": 1
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 7.342,
                    "word": "Le ",
                    "start": 7.021999999999999
                  },
                  {
                    "end": 7.5020001999999995,
                    "word": "va.",
                    "start": 7.342
                  }
                ],
                "content": "Le va."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 7.276,
                    "word": "Buenas, ",
                    "start": 6.893
                  },
                  {
                    "end": 7.427,
                    "word": "soy ",
                    "start": 7.276
                  },
                  {
                    "end": 7.613,
                    "word": "Juan ",
                    "start": 7.427
                  }
                ],
                "content": "Buenas, soy Juan ",
                "metadata": {
                  "response_id": 3
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 10.962,
                    "word": "Dígame.",
                    "start": 10.481999
                  }
                ],
                "content": "Dígame."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 11.934,
                    "word": "Gracias.",
                    "start": 11.04
                  },
                  {
                    "end": 12.155125,
                    "word": " Te ",
                    "start": 11.980125
                  },
                  {
                    "end": 12.456125,
                    "word": "llamo ",
                    "start": 12.155125
                  },
                  {
                    "end": 12.677125,
                    "word": "para ",
                    "start": 12.456125
                  },
                  {
                    "end": 13.072125,
                    "word": "agendar ",
                    "start": 12.677125
                  },
                  {
                    "end": 13.223125,
                    "word": "una ",
                    "start": 13.072125
                  },
                  {
                    "end": 13.617125,
                    "word": "visita ",
                    "start": 13.223125
                  },
                  {
                    "end": 13.780125,
                    "word": "al ",
                    "start": 13.617125
                  },
                  {
                    "end": 14.093125,
                    "word": "piso ",
                    "start": 13.780125
                  },
                  {
                    "end": 14.198125,
                    "word": "en ",
                    "start": 14.093125
                  },
                  {
                    "end": 14.558125,
                    "word": "Avenida ",
                    "start": 14.198125
                  },
                  {
                    "end": 14.720125,
                    "word": "del ",
                    "start": 14.558125
                  },
                  {
                    "end": 15.301125,
                    "word": "Manzanares, ",
                    "start": 14.720125
                  },
                  {
                    "end": 15.730125,
                    "word": "20.\n",
                    "start": 15.301125
                  },
                  {
                    "end": 16.125125,
                    "word": "¿Puedes ",
                    "start": 15.730125
                  },
                  {
                    "end": 16.392125,
                    "word": "hablar ",
                    "start": 16.125125
                  },
                  {
                    "end": 16.903125,
                    "word": "ahora?",
                    "start": 16.392125
                  }
                ],
                "content": "Gracias. Te llamo para agendar una visita al piso en Avenida del Manzanares, 20.\n¿Puedes hablar ahora?",
                "metadata": {
                  "response_id": 5
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 18.412,
                    "word": "Hola, ",
                    "start": 17.772000000000002
                  },
                  {
                    "end": 18.572,
                    "word": "¿diga?",
                    "start": 18.572
                  }
                ],
                "content": "Hola, ¿diga?"
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 20.881999,
                    "word": "¿Me ",
                    "start": 20.402
                  },
                  {
                    "end": 21.121999,
                    "word": "oye?",
                    "start": 20.881999
                  }
                ],
                "content": "¿Me oye?"
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 22.895,
                    "word": "Sí, ",
                    "start": 22.675
                  },
                  {
                    "end": 23.035,
                    "word": "te ",
                    "start": 22.895
                  },
                  {
                    "end": 23.569,
                    "word": "oigo.",
                    "start": 23.035
                  },
                  {
                    "end": 23.754666748046876,
                    "word": " Te ",
                    "start": 23.591666748046876
                  },
                  {
                    "end": 24.137666748046875,
                    "word": "llamo ",
                    "start": 23.754666748046876
                  },
                  {
                    "end": 24.346666748046875,
                    "word": "para ",
                    "start": 24.137666748046875
                  },
                  {
                    "end": 24.717666748046874,
                    "word": "agendar ",
                    "start": 24.346666748046875
                  },
                  {
                    "end": 24.868666748046873,
                    "word": "una ",
                    "start": 24.717666748046874
                  }
                ],
                "content": "Sí, te oigo. Te llamo para agendar una ",
                "metadata": {
                  "response_id": 7
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 22.942,
                    "word": "Oyes? ",
                    "start": 22.622
                  },
                  {
                    "end": 25.102,
                    "word": "Ahora.",
                    "start": 24.702
                  }
                ],
                "content": "Oyes? Ahora."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 25.205666748046873,
                    "word": "visita ",
                    "start": 24.868666748046873
                  },
                  {
                    "end": 25.321666748046876,
                    "word": "al ",
                    "start": 25.205666748046873
                  },
                  {
                    "end": 25.623666748046876,
                    "word": "piso ",
                    "start": 25.321666748046876
                  }
                ],
                "content": "visita al piso ",
                "metadata": {
                  "response_id": 7
                }
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 30.62,
                    "word": "Sí, ",
                    "start": 30.272
                  },
                  {
                    "end": 30.76,
                    "word": "te ",
                    "start": 30.62
                  },
                  {
                    "end": 31.317,
                    "word": "oigo.",
                    "start": 30.76
                  }
                ],
                "content": "Sí, te oigo.",
                "metadata": {
                  "response_id": 8
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 32.502,
                    "word": "Se, ",
                    "start": 32.102000000000004
                  },
                  {
                    "end": 32.662,
                    "word": "es ",
                    "start": 32.502
                  },
                  {
                    "end": 32.742,
                    "word": "que ",
                    "start": 32.662
                  },
                  {
                    "end": 32.902,
                    "word": "se ",
                    "start": 32.742
                  },
                  {
                    "end": 33.222,
                    "word": "corta, ",
                    "start": 32.902
                  }
                ],
                "content": "Se, es que se corta, "
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 32.229,
                    "word": " Te ",
                    "start": 32.055
                  },
                  {
                    "end": 32.496,
                    "word": "llamo ",
                    "start": 32.229
                  },
                  {
                    "end": 32.717,
                    "word": "para ",
                    "start": 32.496
                  },
                  {
                    "end": 33.112,
                    "word": "agendar ",
                    "start": 32.717
                  },
                  {
                    "end": 33.274,
                    "word": "una ",
                    "start": 33.112
                  }
                ],
                "content": " Te llamo para agendar una ",
                "metadata": {
                  "response_id": 8
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 33.462,
                    "word": "estoy ",
                    "start": 33.222
                  },
                  {
                    "end": 33.622,
                    "word": "yo ",
                    "start": 33.462
                  },
                  {
                    "end": 33.942,
                    "word": "metido ",
                    "start": 33.622
                  },
                  {
                    "end": 34.102000000000004,
                    "word": "en ",
                    "start": 33.942
                  },
                  {
                    "end": 34.342,
                    "word": "un ",
                    "start": 34.102000000000004
                  },
                  {
                    "end": 34.582,
                    "word": "en ",
                    "start": 34.342
                  },
                  {
                    "end": 34.662,
                    "word": "un ",
                    "start": 34.582
                  },
                  {
                    "end": 35.062,
                    "word": "sótano ",
                    "start": 34.662
                  },
                  {
                    "end": 35.462,
                    "word": "trabajando.",
                    "start": 35.062
                  }
                ],
                "content": "estoy yo metido en un en un sótano trabajando."
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 36.642,
                    "word": "Espera, ",
                    "start": 36.162
                  },
                  {
                    "end": 36.802,
                    "word": "espera ",
                    "start": 36.642
                  },
                  {
                    "end": 36.962,
                    "word": "un ",
                    "start": 36.802
                  },
                  {
                    "end": 37.362,
                    "word": "segundo, ",
                    "start": 36.962
                  },
                  {
                    "end": 37.602000000000004,
                    "word": "espere.",
                    "start": 37.362
                  }
                ],
                "content": "Espera, espera un segundo, espere."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 39.623,
                    "word": "Sin ",
                    "start": 39.402
                  },
                  {
                    "end": 40.273,
                    "word": "problema.",
                    "start": 39.623
                  },
                  {
                    "end": 40.64466674804687,
                    "word": " ¿Cuándo ",
                    "start": 40.31866674804687
                  },
                  {
                    "end": 40.725666748046876,
                    "word": "te ",
                    "start": 40.64466674804687
                  },
                  {
                    "end": 40.87666674804687,
                    "word": "viene ",
                    "start": 40.725666748046876
                  },
                  {
                    "end": 41.12066674804687,
                    "word": "mejor ",
                    "start": 40.87666674804687
                  },
                  {
                    "end": 41.23666674804687,
                    "word": "que ",
                    "start": 41.12066674804687
                  },
                  {
                    "end": 41.329666748046876,
                    "word": "te ",
                    "start": 41.23666674804687
                  },
                  {
                    "end": 41.851666748046874,
                    "word": "llame?",
                    "start": 41.329666748046876
                  },
                  {
                    "end": 42.164625,
                    "word": " Puedo ",
                    "start": 41.863625
                  },
                  {
                    "end": 42.629625,
                    "word": "llamarte ",
                    "start": 42.164625
                  }
                ],
                "content": "Sin problema. ¿Cuándo te viene mejor que te llame? Puedo llamarte ",
                "metadata": {
                  "response_id": 10
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 43.432002,
                    "word": "No, ",
                    "start": 43.032000000000004
                  },
                  {
                    "end": 43.672,
                    "word": "ahora, ",
                    "start": 43.432002
                  },
                  {
                    "end": 43.832,
                    "word": "ahora, ",
                    "start": 43.672
                  },
                  {
                    "end": 43.992,
                    "word": "ya ",
                    "start": 43.832
                  }
                ],
                "content": "No, ahora, ahora, ya "
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 43.186625,
                    "word": "hoy ",
                    "start": 42.629625
                  },
                  {
                    "end": 43.349625,
                    "word": "a ",
                    "start": 43.186625
                  },
                  {
                    "end": 43.511625,
                    "word": "las ",
                    "start": 43.349625
                  },
                  {
                    "end": 43.801625,
                    "word": "siete ",
                    "start": 43.511625
                  },
                  {
                    "end": 43.883625,
                    "word": "de ",
                    "start": 43.801625
                  },
                  {
                    "end": 44.010625,
                    "word": "la ",
                    "start": 43.883625
                  }
                ],
                "content": "hoy a las siete de la ",
                "metadata": {
                  "response_id": 10
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 44.072,
                    "word": "le ",
                    "start": 43.992
                  },
                  {
                    "end": 44.392,
                    "word": "oigo, ",
                    "start": 44.072
                  },
                  {
                    "end": 44.472003,
                    "word": "que ",
                    "start": 44.392
                  },
                  {
                    "end": 44.552,
                    "word": "he ",
                    "start": 44.472003
                  },
                  {
                    "end": 44.872,
                    "word": "salido, ",
                    "start": 44.552
                  },
                  {
                    "end": 44.952002,
                    "word": "es ",
                    "start": 44.872
                  },
                  {
                    "end": 45.032000000000004,
                    "word": "que ",
                    "start": 44.952002
                  },
                  {
                    "end": 45.272002,
                    "word": "estamos ",
                    "start": 45.032000000000004
                  },
                  {
                    "end": 45.592,
                    "word": "trabajando ",
                    "start": 45.272002
                  },
                  {
                    "end": 45.672,
                    "word": "en ",
                    "start": 45.592
                  },
                  {
                    "end": 45.832,
                    "word": "unos ",
                    "start": 45.672
                  },
                  {
                    "end": 46.392,
                    "word": "traseros, ",
                    "start": 45.832
                  },
                  {
                    "end": 46.712,
                    "word": "dígame.",
                    "start": 46.392
                  }
                ],
                "content": "le oigo, que he salido, es que estamos trabajando en unos traseros, dígame."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 50.094,
                    "word": "Perfecto.",
                    "start": 49.281
                  },
                  {
                    "end": 50.279791748046875,
                    "word": " Te ",
                    "start": 50.11679174804687
                  },
                  {
                    "end": 50.54679174804688,
                    "word": "llamo ",
                    "start": 50.279791748046875
                  },
                  {
                    "end": 50.743791748046874,
                    "word": "para ",
                    "start": 50.54679174804688
                  },
                  {
                    "end": 51.09179174804687,
                    "word": "agendar ",
                    "start": 50.743791748046874
                  },
                  {
                    "end": 51.231791748046874,
                    "word": "una ",
                    "start": 51.09179174804687
                  },
                  {
                    "end": 51.544791748046876,
                    "word": "visita ",
                    "start": 51.231791748046874
                  },
                  {
                    "end": 51.660791748046876,
                    "word": "al ",
                    "start": 51.544791748046876
                  },
                  {
                    "end": 51.98579174804688,
                    "word": "piso ",
                    "start": 51.660791748046876
                  },
                  {
                    "end": 52.102791748046876,
                    "word": "en ",
                    "start": 51.98579174804688
                  },
                  {
                    "end": 52.450791748046875,
                    "word": "Avenida ",
                    "start": 52.102791748046876
                  },
                  {
                    "end": 52.566791748046874,
                    "word": "del ",
                    "start": 52.450791748046875
                  },
                  {
                    "end": 53.297791748046876,
                    "word": "Manzanares, ",
                    "start": 52.566791748046874
                  },
                  {
                    "end": 53.99479174804687,
                    "word": "20. ",
                    "start": 53.297791748046876
                  },
                  {
                    "end": 54.19175,
                    "word": "¿Qué ",
                    "start": 54.04075
                  },
                  {
                    "end": 54.34275,
                    "word": "día ",
                    "start": 54.19175
                  },
                  {
                    "end": 54.44775,
                    "word": "te ",
                    "start": 54.34275
                  },
                  {
                    "end": 54.67975,
                    "word": "viene ",
                    "start": 54.44775
                  },
                  {
                    "end": 55.15575,
                    "word": "bien?",
                    "start": 54.67975
                  }
                ],
                "content": "Perfecto. Te llamo para agendar una visita al piso en Avenida del Manzanares, 20. ¿Qué día te viene bien?",
                "metadata": {
                  "response_id": 11
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 56.781997,
                    "word": "Pues ",
                    "start": 56.542
                  },
                  {
                    "end": 57.022,
                    "word": "por ",
                    "start": 56.781997
                  },
                  {
                    "end": 57.101996,
                    "word": "las ",
                    "start": 57.022
                  },
                  {
                    "end": 57.422,
                    "word": "tardes, ",
                    "start": 57.101996
                  },
                  {
                    "end": 57.501998,
                    "word": "de ",
                    "start": 57.422
                  },
                  {
                    "end": 57.742,
                    "word": "seis ",
                    "start": 57.501998
                  },
                  {
                    "end": 57.902,
                    "word": "a ",
                    "start": 57.742
                  },
                  {
                    "end": 58.222,
                    "word": "ocho, ",
                    "start": 57.902
                  },
                  {
                    "end": 58.382,
                    "word": "¿es ",
                    "start": 58.222
                  },
                  {
                    "end": 58.941996,
                    "word": "particular ",
                    "start": 58.382
                  },
                  {
                    "end": 59.182,
                    "word": "o ",
                    "start": 58.941996
                  },
                  {
                    "end": 59.501998,
                    "word": "agencia?",
                    "start": 59.182
                  }
                ],
                "content": "Pues por las tardes, de seis a ocho, ¿es particular o agencia?"
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 61.317,
                    "word": "Es ",
                    "start": 61.166
                  },
                  {
                    "end": 61.967,
                    "word": "particular.",
                    "start": 61.317
                  },
                  {
                    "end": 62.175791748046876,
                    "word": " ¿Te ",
                    "start": 62.01279174804687
                  },
                  {
                    "end": 62.407791748046876,
                    "word": "viene ",
                    "start": 62.175791748046876
                  },
                  {
                    "end": 62.605791748046876,
                    "word": "bien ",
                    "start": 62.407791748046876
                  },
                  {
                    "end": 62.67479174804687,
                    "word": "el ",
                    "start": 62.605791748046876
                  },
                  {
                    "end": 62.96479174804688,
                    "word": "jueves ",
                    "start": 62.67479174804687
                  },
                  {
                    "end": 63.185791748046874,
                    "word": "9 ",
                    "start": 62.96479174804688
                  },
                  {
                    "end": 63.26679174804688,
                    "word": "de ",
                    "start": 63.185791748046874
                  },
                  {
                    "end": 63.71979174804687,
                    "word": "octubre ",
                    "start": 63.26679174804688
                  },
                  {
                    "end": 63.81279174804688,
                    "word": "a ",
                    "start": 63.71979174804687
                  },
                  {
                    "end": 64.23079174804687,
                    "word": "partir ",
                    "start": 63.81279174804688
                  },
                  {
                    "end": 64.33479174804687,
                    "word": "de ",
                    "start": 64.23079174804687
                  },
                  {
                    "end": 64.49779174804688,
                    "word": "las ",
                    "start": 64.33479174804687
                  },
                  {
                    "end": 64.83479174804687,
                    "word": "siete ",
                    "start": 64.49779174804688
                  },
                  {
                    "end": 64.91579174804687,
                    "word": "de ",
                    "start": 64.83479174804687
                  },
                  {
                    "end": 65.04379174804687,
                    "word": "la ",
                    "start": 64.91579174804687
                  },
                  {
                    "end": 65.58879174804687,
                    "word": "tarde?",
                    "start": 65.04379174804687
                  }
                ],
                "content": "Es particular. ¿Te viene bien el jueves 9 de octubre a partir de las siete de la tarde?",
                "metadata": {
                  "response_id": 12
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 67.262,
                    "word": "Perfecto.",
                    "start": 66.782004
                  }
                ],
                "content": "Perfecto."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 69.627,
                    "word": "Perfecto, ",
                    "start": 69.186
                  },
                  {
                    "end": 69.848,
                    "word": "queda ",
                    "start": 69.627
                  },
                  {
                    "end": 69.999,
                    "word": "para ",
                    "start": 69.848
                  },
                  {
                    "end": 70.127,
                    "word": "el ",
                    "start": 69.999
                  },
                  {
                    "end": 70.637,
                    "word": "jueves ",
                    "start": 70.127
                  },
                  {
                    "end": 70.87,
                    "word": "9 ",
                    "start": 70.637
                  },
                  {
                    "end": 70.951,
                    "word": "de ",
                    "start": 70.87
                  },
                  {
                    "end": 71.311,
                    "word": "octubre ",
                    "start": 70.951
                  },
                  {
                    "end": 71.369,
                    "word": "a ",
                    "start": 71.311
                  },
                  {
                    "end": 71.496,
                    "word": "las ",
                    "start": 71.369
                  },
                  {
                    "end": 71.74,
                    "word": "siete ",
                    "start": 71.496
                  },
                  {
                    "end": 71.822,
                    "word": "de ",
                    "start": 71.74
                  },
                  {
                    "end": 71.926,
                    "word": "la ",
                    "start": 71.822
                  },
                  {
                    "end": 72.46,
                    "word": "tarde.",
                    "start": 71.926
                  },
                  {
                    "end": 72.669125,
                    "word": "\n¿La ",
                    "start": 72.495125
                  },
                  {
                    "end": 73.029125,
                    "word": "dirección ",
                    "start": 72.669125
                  },
                  {
                    "end": 73.342125,
                    "word": "exacta ",
                    "start": 73.029125
                  },
                  {
                    "end": 73.493125,
                    "word": "del ",
                    "start": 73.342125
                  }
                ],
                "content": "Perfecto, queda para el jueves 9 de octubre a las siete de la tarde.\n¿La dirección exacta del ",
                "metadata": {
                  "response_id": 13
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 73.912,
                    "word": "Perfecto.",
                    "start": 73.512
                  }
                ],
                "content": "Perfecto."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 74.039125,
                    "word": "piso?",
                    "start": 73.493125
                  }
                ],
                "content": "piso?",
                "metadata": {
                  "response_id": 13
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 75.872,
                    "word": "Sí, ",
                    "start": 75.552
                  },
                  {
                    "end": 76.19200000000001,
                    "word": "ahí ",
                    "start": 75.872
                  },
                  {
                    "end": 76.271995,
                    "word": "en ",
                    "start": 76.19200000000001
                  },
                  {
                    "end": 76.432,
                    "word": "el ",
                    "start": 76.271995
                  },
                  {
                    "end": 76.591994,
                    "word": "veinte.",
                    "start": 76.432
                  }
                ],
                "content": "Sí, ahí en el veinte."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 76.594,
                    "word": "Perfecto, ",
                    "start": 76.106
                  }
                ],
                "content": "Perfecto, ",
                "metadata": {
                  "response_id": 14
                }
              },
              {
                "role": "user",
                "words": [
                  {
                    "end": 79.201995,
                    "word": "El ",
                    "start": 79.042
                  },
                  {
                    "end": 79.521995,
                    "word": "portal.",
                    "start": 79.201995
                  }
                ],
                "content": "El portal."
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 79.674,
                    "word": "Perfecto, ",
                    "start": 79.221
                  },
                  {
                    "end": 79.883,
                    "word": "queda ",
                    "start": 79.674
                  }
                ],
                "content": "Perfecto, queda ",
                "metadata": {
                  "response_id": 15
                }
              },
              {
                "role": "agent",
                "words": [
                  {
                    "end": 81.886,
                    "word": "Perfecto, ",
                    "start": 81.398
                  },
                  {
                    "end": 82.222,
                    "word": "quedamos ",
                    "start": 81.886
                  },
                  {
                    "end": 82.431,
                    "word": "así ",
                    "start": 82.222
                  },
                  {
                    "end": 82.733,
                    "word": "muchas ",
                    "start": 82.431
                  },
                  {
                    "end": 83.453,
                    "word": "gracias. ",
                    "start": 82.733
                  },
                  {
                    "end": 83.778125,
                    "word": "hasta ",
                    "start": 83.499125
                  },
                  {
                    "end": 84.382125,
                    "word": "luego",
                    "start": 83.778125
                  }
                ],
                "content": "Perfecto, quedamos así muchas gracias. hasta luego",
                "metadata": {
                  "response_id": 16
                }
              },
              {
                "name": "end_call",
                "role": "tool_call_invocation",
                "type": "end_call",
                "time_sec": 84.382,
                "arguments": "{\"execution_message\":\"Perfecto, quedamos así muchas gracias. hasta luego\"}",
                "tool_call_id": "483288aac56f0ec8"
              }
            ],
            "recording_multi_channel_url": "https://dxc03zgurdly9.cloudfront.net/3348e2dfc49d2bb52dc090412bc3687d0233a2e8a6c54f0047831702f5975a4c/recording_multichannel.wav",
            "retell_llm_dynamic_variables": {
              "direccion": "Avenida del Manzanares, 20",
              "slots_disponibles": "Tengo disponibilidad para la visita: mañana, jueves 9 de octubre, a partir de las 7 de la tarde; el viernes 10 de octubre, a partir de las 4 de la tarde; y el fin de semana, a cualquier hora a partir de las 11 de la mañana."
            },
            "opt_out_sensitive_data_storage": false
          },
          "event": "call_ended"
        },
        "query": {},
        "params": {},
        "headers": {
          "host": "n8n.img2html.com",
          "accept": "application/json, text/plain, */*",
          "cf-ray": "98b4bfe51c85302c-PDX",
          "cdn-loop": "cloudflare; loops=1",
          "x-real-ip": "104.23.160.65",
          "cf-visitor": "{\"scheme\":\"https\"}",
          "user-agent": "axios/1.11.0",
          "cf-ipcountry": "US",
          "content-type": "application/json",
          "content-length": "30337",
          "accept-encoding": "gzip, br",
          "x-forwarded-for": "104.23.160.65",
          "cf-connecting-ip": "100.20.5.228",
          "x-forwarded-host": "n8n.img2html.com",
          "x-forwarded-port": "443",
          "x-forwarded-proto": "https",
          "x-forwarded-server": "b8f473d76b4e",
          "x-retell-signature": "v=1759917189905,d=3e173c516fc615996a9ee9c9418ddef445029378e82c83302436a6ec3ad9632e"
        },
        "webhookUrl": "https://n8n.img2html.com/webhook/retell-webhook-agent",
        "executionMode": "production"
      }
    ],
    "Telegram Trigger": [
      {
        "message": {
          "chat": {
            "id": 245284777,
            "type": "private",
            "username": "Mutonby",
            "first_name": "Juan Carlos 🦴"
          },
          "date": 1760454862,
          "from": {
            "id": 245284777,
            "is_bot": false,
            "username": "Mutonby",
            "first_name": "Juan Carlos 🦴",
            "language_code": "es"
          },
          "text": "919 01 49 71 Piso en venta en calle Antonio Lopez, 67 470.000 € ver a partir del jueves",
          "message_id": 269
        },
        "update_id": 189771673
      }
    ]
  },
  "connections": {
    "Filter": {
      "main": [
        [
          {
            "node": "AI Agent Parse Call",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "AI Agent: Property Viewings",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent Reserva Restaurantes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retell Webhook": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini 2.0 Flash": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Property Viewings",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini 2.0 Flash1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent Reserva Restaurantes",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gemini 2.0 Flash 2": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent Parse Call",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent Parse Call": {
      "main": [
        [
          {
            "node": "Notify Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent: Property Viewings",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent Reserva Restaurantes",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Property Viewings": {
      "main": [
        [
          {
            "node": "Retell Create Call",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent Reserva Restaurantes": {
      "main": [
        [
          {
            "node": "Retell Create Call1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get an event in Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent: Property Viewings",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get an event in Google Calendar1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent Reserva Restaurantes",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create an event in Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent Parse Call",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 个人效率, AI 聊天机器人

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量28
分类2
节点类型11
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Juan Carlos Cavero Gracia

Juan Carlos Cavero Gracia

@carlosgracia

Follow me in linkedin: https://www.linkedin.com/in/juan-carlos-cavero-gracia/

外部链接
在 n8n.io 查看

分享此工作流