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": "Somar.IA SaaS - Orquestrador AI WhatsApp",
"nodes": [
{
"parameters": {
"path": "whatsapp-webhook",
"responseMode": "lastNode",
"options": {}
},
"name": "Recebe Msg WhatsApp",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
100,
300
]
},
{
"parameters": {
"method": "POST",
"url": "https://api.openai.com/v1/chat/completions",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer SUA_CHAVE_OPENAI"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "model",
"value": "gpt-4"
},
{
"name": "messages",
"value": "[{\"role\": \"system\", \"content\": \"Voc\u00ea \u00e9 um classificador de inten\u00e7\u00e3o de uma cl\u00ednica. As inten\u00e7\u00f5es s\u00e3o: AGENDAR, CANCELAR, REMARCAR, DUVIDA, OUTROS. Responda apenas com a inten\u00e7\u00e3o e poss\u00edveis datas/hor\u00e1rios mencionados em JSON.\"}, {\"role\": \"user\", \"content\": \"{{ $json.message }}\"}]"
}
]
},
"options": {}
},
"name": "Classificar Inten\u00e7\u00e3o (OpenAI)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
350,
300
]
},
{
"parameters": {
"dataType": "string",
"value1": "={{ JSON.parse($json.choices[0].message.content).intent }}",
"rules": {
"rules": [
{
"value2": "AGENDAR",
"output": 0
},
{
"value2": "CANCELAR",
"output": 1
},
{
"value2": "DUVIDA",
"output": 2
}
]
}
},
"name": "Roteador (Switch)",
"type": "n8n-nodes-base.switch",
"typeVersion": 1,
"position": [
600,
300
]
},
{
"parameters": {
"url": "https://api.somar.ia.br/api/bot/availability?date={{ new Date().toISOString().split('T')[0] }}&tenantId=clinica_id",
"options": {}
},
"name": "Consultar Disponibilidade API",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
850,
150
]
},
{
"parameters": {
"method": "POST",
"url": "https://sua-api-whatsapp.com.br/message/sendText/clinica_ID",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "number",
"value": "={{ $('Recebe Msg WhatsApp').item.json.sender_number }}"
},
{
"name": "textMessage.text",
"value": "Temos os seguintes hor\u00e1rios livres hoje: {{ $json.availableSlots.join(', ') }}. Qual voc\u00ea prefere?"
}
]
},
"options": {}
},
"name": "Enviar Hor\u00e1rios (WhatsApp)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1100,
150
]
},
{
"parameters": {
"method": "POST",
"url": "https://api.somar.ia.br/api/bot/appointments?action=cancel",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "pacienteTelefone",
"value": "={{ $('Recebe Msg WhatsApp').item.json.sender_number }}"
},
{
"name": "tenantId",
"value": "clinica_id"
}
]
},
"options": {}
},
"name": "Cancelar API",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
850,
350
]
},
{
"parameters": {
"method": "POST",
"url": "https://sua-api-whatsapp.com.br/message/sendText/clinica_ID",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "number",
"value": "={{ $('Recebe Msg WhatsApp').item.json.sender_number }}"
},
{
"name": "textMessage.text",
"value": "Pronto! Sua consulta foi cancelada conforme solicitado. Se quiser remarcar, \u00e9 s\u00f3 falar."
}
]
},
"options": {}
},
"name": "Confirmar Cancelamento (WA)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1100,
350
]
}
],
"connections": {
"Recebe Msg WhatsApp": {
"main": [
[
{
"node": "Classificar Inten\u00e7\u00e3o (OpenAI)",
"type": "main",
"index": 0
}
]
]
},
"Classificar Inten\u00e7\u00e3o (OpenAI)": {
"main": [
[
{
"node": "Roteador (Switch)",
"type": "main",
"index": 0
}
]
]
},
"Roteador (Switch)": {
"main": [
[
{
"node": "Consultar Disponibilidade API",
"type": "main",
"index": 0
}
],
[
{
"node": "Cancelar API",
"type": "main",
"index": 0
}
],
[]
]
},
"Consultar Disponibilidade API": {
"main": [
[
{
"node": "Enviar Hor\u00e1rios (WhatsApp)",
"type": "main",
"index": 0
}
]
]
},
"Cancelar API": {
"main": [
[
{
"node": "Confirmar Cancelamento (WA)",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Somar.IA SaaS - Orquestrador AI WhatsApp. Uses httpRequest. Webhook trigger; 7 nodes.
Source: https://github.com/graphwell/synka/blob/fa9ef705b296a7543b69196a5a5abf2334d6306a/n8n/ai-whatsapp-flow.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.
Flujowhatsapp. Uses @aldinokemal2104/n8n-nodes-gowa, postgres, httpRequest. Webhook trigger; 65 nodes.
HR teams, IT Operations, and System Administrators managing employee onboarding at scale. It’s perfect if you use Odoo 18 to trigger account requests and need Redmine + GitLab accounts created instant
This workflow is a complete, production-ready solution for recovering abandoned carts in Shopify stores using a multi-channel, multi-touch approach. It automates personalized follow-ups via Email, SMS
WF_UNIFIED_LEGAL_AUTOMATION. Uses googleSheets, httpRequest, telegram, telegramTrigger. Webhook trigger; 53 nodes.
Backbrief: transcripts (Zoom webhook -> Slack + vault). Uses httpRequest, slack. Webhook trigger; 52 nodes.