The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "vapi-disponibilidad",
"nodes": [
{
"id": "a1a1a1a1-0001-0001-0001-a1a1a1a1a101",
"name": "Webhook Vapi Disponibilidad",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
240,
300
],
"parameters": {
"httpMethod": "POST",
"path": "vapi-disponibilidad",
"responseMode": "responseNode",
"options": {}
}
},
{
"id": "a1a1a1a1-0001-0001-0001-a1a1a1a1a102",
"name": "Extraer Fecha y ID",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
460,
300
],
"parameters": {
"jsCode": "const toolCall = $input.first().json.body.message.toolCalls[0];\nconst fecha = toolCall.function.arguments.fecha;\nconst toolCallId = toolCall.id;\nreturn [{ json: { fecha, toolCallId } }];"
}
},
{
"id": "a1a1a1a1-0001-0001-0001-a1a1a1a1a103",
"name": "Leer Turnos",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.4,
"position": [
680,
300
],
"alwaysOutputData": true,
"parameters": {
"operation": "read",
"documentId": {
"__rl": true,
"value": "1vK8h8c8prheB8_KE7nwl6e4SblGoeALs_jE-vkgv5ho",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Turnos",
"mode": "name"
},
"options": {}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"id": "a1a1a1a1-0001-0001-0001-a1a1a1a1a104",
"name": "Calcular Slots Libres",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
900,
300
],
"parameters": {
"mode": "runOnceForAllItems",
"jsCode": "const fecha = $('Extraer Fecha y ID').first().json.fecha;\nconst toolCallId = $('Extraer Fecha y ID').first().json.toolCallId;\n\nconst [year, month, day] = fecha.split('-').map(Number);\nconst dateObj = new Date(year, month - 1, day);\nconst dow = dateObj.getDay(); // 0=domingo, 6=sabado\n\nif (dow === 0) {\n return [{ json: { results: [{ toolCallId, result: 'El consultorio no atiende los domingos. Pod\u00e9s llamar de lunes a s\u00e1bado.' }] } }];\n}\n\n// endMin: sabado=13:00=780, semana=21:00=1260\nconst endMin = dow === 6 ? 780 : 1260;\nconst allSlots = [];\nfor (let m = 480; m + 45 <= endMin; m += 45) {\n allSlots.push(\n String(Math.floor(m / 60)).padStart(2, '0') + ':' + String(m % 60).padStart(2, '0')\n );\n}\n\nconst busyStates = ['PENDIENTE', 'CONFIRMADO', 'RECORDATORIO_ENVIADO'];\nconst occupied = $input.all()\n .filter(i => i.json.fecha === fecha && busyStates.includes(i.json.estado_turno))\n .map(i => i.json.hora);\n\nconst free = allSlots.filter(s => !occupied.includes(s));\n\nconst result = free.length === 0\n ? 'No hay turnos disponibles para el ' + fecha + '. \u00bfQuer\u00e9s que verifique otro d\u00eda?'\n : 'Los horarios disponibles para el ' + fecha + ' son: ' + free.join(', ') + '. \u00bfCu\u00e1l prefer\u00eds?';\n\nreturn [{ json: { results: [{ toolCallId, result }] } }];"
}
},
{
"id": "a1a1a1a1-0001-0001-0001-a1a1a1a1a105",
"name": "Responder a Vapi",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
1120,
300
],
"parameters": {
"respondWith": "json",
"responseBody": "={{ $json }}",
"options": {
"responseCode": 200
}
}
}
],
"connections": {
"Webhook Vapi Disponibilidad": {
"main": [
[
{
"node": "Extraer Fecha y ID",
"type": "main",
"index": 0
}
]
]
},
"Extraer Fecha y ID": {
"main": [
[
{
"node": "Leer Turnos",
"type": "main",
"index": 0
}
]
]
},
"Leer Turnos": {
"main": [
[
{
"node": "Calcular Slots Libres",
"type": "main",
"index": 0
}
]
]
},
"Calcular Slots Libres": {
"main": [
[
{
"node": "Responder a Vapi",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleSheetsOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
vapi-disponibilidad. Uses googleSheets. Webhook trigger; 5 nodes.
Source: https://github.com/SMsimarco/RecepIA---n8n/blob/main/n8n-flows/vapi/flow_vapi_disponibilidad.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Resume Screening & Behavioral Interviews with Gemini, Elevenlabs, & Notion ATS copy. Uses googleDrive, httpRequest, notion, formTrigger. Webhook trigger; 67 nodes.
[SANTOBET] FLUXO TODO - BACKUP. Uses googleSheets, httpRequest, googleSheetsTrigger. Webhook trigger; 57 nodes.
This workflow sends post-purchase review request emails for WooCommerce orders, stores expiring form links in Google Sheets, optionally shortens links with Dub.co and delays delivery, serves a hosted
FLUXO DISPARO DATA E HORA. Uses itemLists, googleSheets, httpRequest. Webhook trigger; 48 nodes.
This workflow allows you to accept online payments via YooKassa and log both orders and transactions in Google Sheets — all without writing a single line of code. It supports full payment flow: produc