This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.
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": "Whatsapp v1.1",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "wa-incoming",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2.1,
"position": [
-2704,
-32
],
"id": "b34528fb-a0a9-451d-907f-9778f2c20cbd",
"name": "Webhook"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "263475a2-ecda-4f08-b3ae-d1b6b103aa82",
"name": "session",
"value": "={{ $json.body.session }}",
"type": "string"
},
{
"id": "2badd492-5014-4a4c-96dd-805e1caef1e2",
"name": "chatId",
"value": "={{ $json.body.payload.from }}",
"type": "string"
},
{
"id": "50c1e2cf-5ad8-4963-a7c5-f89dc37ac94c",
"name": "pushName",
"value": "={{ $json.body.payload._data.Info.PushName }}",
"type": "string"
},
{
"id": "4e6a3de6-bed1-4cc3-83c7-c6209fa112de",
"name": "payload_id",
"value": "={{ $json.body.payload.id }}",
"type": "string"
},
{
"id": "f112b63e-8f46-4a2f-a9bd-e28a37edec98",
"name": "event",
"value": "={{ $json.body.event }}",
"type": "string"
},
{
"id": "aaeabb47-904a-4cd9-a6d2-3f96af173d20",
"name": "message",
"value": "={{ $json.body.payload.body }}",
"type": "string"
},
{
"id": "7481ded0-b65c-4a98-a73f-c0e301cfd42f",
"name": "fromMe",
"value": "={{ $json.body.payload.fromMe }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-2560,
-32
],
"id": "4506b6aa-7ba1-4501-831e-03686a7a3ef6",
"name": "Dados"
},
{
"parameters": {
"modelName": "models/gemini-2.5-pro",
"options": {
"temperature": 0.4
}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
-2192,
192
],
"id": "5e95c554-bcd4-42b1-8c77-08575d7c043a",
"name": "Google Gemini Chat Model",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "Chatting",
"operation": "Send Text",
"session": "={{ $('Dados').item.json.session }}",
"chatId": "={{ $('Dados').item.json.chatId }}",
"text": "={{ $('AI Agent').item.json.output }}",
"requestOptions": {}
},
"type": "n8n-nodes-waha.WAHA",
"typeVersion": 202411,
"position": [
-1456,
-48
],
"id": "9996e7c7-36f6-4b4d-8244-5a2aeeb5095a",
"name": "Send a text message",
"credentials": {
"wahaApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "Chatting",
"operation": "Send Seen",
"session": "={{ $('Dados').item.json.session }}",
"chatId": "={{ $('Dados').item.json.chatId }}",
"messageId": "={{ $('Dados').item.json.payload_id }}",
"participant": "",
"requestOptions": {}
},
"type": "n8n-nodes-waha.WAHA",
"typeVersion": 202411,
"position": [
-1776,
-48
],
"id": "26f561e7-010e-466a-a786-eae1157c7fc0",
"name": "Send Seen1",
"credentials": {
"wahaApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"promptType": "define",
"text": "={{ $('Dados').item.json.message }}",
"options": {
"systemMessage": "Voc\u00ea \u00e9 o agente de agendamentos do BarberBook (barbearia). Seu objetivo \u00e9 levar o cliente a um agendamento confirmado ou a um cancelamento, pedindo apenas a informa\u00e7\u00e3o que falta em cada passo.\n\nO idioma \u00e9 portugu\u00eas do Brasil. O tom deve ser profissional, cordial e direto. As mensagens devem ser curtas (1\u20133 linhas) e conter somente uma pergunta por vez. N\u00e3o use Markdown, emojis ou listas longas. Apresente-se como \u201cBarberBook\u201d. Nunca diga que \u00e9 um modelo de linguagem, IA gen\u00e9rica ou que n\u00e3o pode agendar. Se perguntarem \u201cquem \u00e9 voc\u00ea?\u201d, responda: \u201cSou o assistente de agendamentos da BarberBook.\u201d\n\nPara agendar, os dados m\u00ednimos s\u00e3o: servi\u00e7o, data e hor\u00e1rio. Utilize apenas os servi\u00e7os existentes no sistema; se n\u00e3o reconhecer o pedido do cliente, pe\u00e7a que ele escolha entre os servi\u00e7os dispon\u00edveis. Aceite datas e hor\u00e1rios em linguagem natural (por exemplo, \u201camanh\u00e3\u201d, \u201cter\u00e7a\u201d, \u201cdia 20\u201d) e hor\u00e1rios em formato 24h (como \u201c14:00\u201d), considerando o fuso America/Sao_Paulo. N\u00e3o prometa hor\u00e1rio. Aguarde a lista numerada enviada pelo sistema e instrua: \u201cResponda com o n\u00famero do hor\u00e1rio desejado ou 0 para cancelar.\u201d Se a data for inv\u00e1lida ou indefinida, pe\u00e7a novamente a data de forma objetiva. Quando o sistema enviar a lista de hor\u00e1rios, n\u00e3o replique a lista; apenas pe\u00e7a o n\u00famero. Ap\u00f3s o cliente enviar o n\u00famero, aguarde a confirma\u00e7\u00e3o do sistema e n\u00e3o confirme por conta pr\u00f3pria. Se vier a confirma\u00e7\u00e3o com ID, responda quando necess\u00e1rio: \u201cAgendado: {servi\u00e7o} \u00e0s {hora} do dia {data}. ID: {id}. Para cancelar, responda: cancelar {id}.\u201d\n\nPara cancelamento: quando o cliente escrever \u201ccancelar 123\u201d, encaminhe para cancelamento. Se ele escrever apenas \u201ccancelar\u201d, pe\u00e7a o ID do agendamento.\n\nEm caso de d\u00favidas ou erros, pe\u00e7a apenas o que falta, como \u201cQual servi\u00e7o?\u201d, \u201cPara qual data?\u201d ou \u201cQual hor\u00e1rio?\u201d. Se o hor\u00e1rio escolhido esgotar, informe o cliente e ofere\u00e7a ver outras op\u00e7\u00f5es. Forne\u00e7a pre\u00e7o e dura\u00e7\u00e3o apenas se o cliente pedir e se a informa\u00e7\u00e3o estiver dispon\u00edvel. N\u00e3o solicite dados sens\u00edveis, como CPF ou cart\u00e3o. Se a conversa ficar confusa, fa\u00e7a um resumo: \u201cTenho: servi\u00e7o X e data Y. Falta o hor\u00e1rio.\u201d\n\nComandos aceitos do cliente: \u201cagendar <servi\u00e7o> <data> <hora>\u201d, \u201ccancelar <id>\u201d e \u201cver hor\u00e1rios <data> <servi\u00e7o>\u201d."
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 2.2,
"position": [
-2192,
-48
],
"id": "ee3e7468-4571-4abc-96b3-85c58e5f1cbb",
"name": "AI Agent"
},
{
"parameters": {
"amount": 2
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
-1936,
-48
],
"id": "ec83c23c-1e77-43b4-8054-c357248ab83b",
"name": "Wait"
},
{
"parameters": {
"amount": 2
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
-1616,
-48
],
"id": "c8d5fa6e-63b0-4126-9f4c-9e618b292f9b",
"name": "Wait1"
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $('Dados').item.json.chatId }}",
"sessionTTL": 3600,
"contextWindowLength": 10
},
"type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
"typeVersion": 1.5,
"position": [
-2096,
192
],
"id": "0ad18f6f-3f3e-497e-b7a3-1804e5ae74be",
"name": "Redis Chat Memory1",
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "0c6d8332-df0f-4c8a-b310-1ca14c2aaafb",
"leftValue": "={{ $json.chatId }}",
"rightValue": "558299198887",
"operator": {
"type": "string",
"operation": "notContains"
}
}
],
"combinator": "or"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-2416,
-32
],
"id": "248096fc-b9bc-480c-9674-9020ec7c46c7",
"name": "If"
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $('Dados').item.json.message && $('Dados').item.json.message.toString().toLowerCase() }}",
"operation": "contains",
"value2": "servi"
}
]
},
"combineOperation": "any"
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-2416,
-224
],
"id": "f88a0e27-8a14-4b0f-9e0a-6c0c9a7d4b12",
"name": "If Servi\u00e7os?"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "apiBase-1",
"name": "apiBase",
"value": "http://barberbook-api:8080",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-2240,
-224
],
"id": "6b1d6d5f-1e83-4e9f-8df7-4b18a8e9480a",
"name": "Set API Base"
},
{
"parameters": {
"url": "={{ $json.apiBase || 'http://barberbook-api:8080' }}/api/services",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 5,
"position": [
-2080,
-224
],
"id": "1d8be1a3-37aa-4a1d-9e9e-5b37a27b589b",
"name": "Get Services"
},
{
"parameters": {
"functionCode": "const list = Array.isArray(items[0].json) ? items[0].json : (items[0].json.data ?? items[0].json);\nconst names = (list || []).map((s, i) => `${i+1}) ${s.name}`).join('\\n');\nreturn [{ json: { text: `Servi\u00e7os dispon\u00edveis:\n${names}\n` } }];"
},
"type": "n8n-nodes-base.function",
"typeVersion": 2,
"position": [
-1904,
-224
],
"id": "98e4ac7e-2dba-4f89-8c3f-0ce76b6c0b58",
"name": "Format Services"
},
{
"parameters": {
"resource": "Chatting",
"operation": "Send Text",
"session": "={{ $('Dados').item.json.session }}",
"chatId": "={{ $('Dados').item.json.chatId }}",
"text": "={{ $('Format Services').item.json.text }}",
"requestOptions": {}
},
"type": "n8n-nodes-waha.WAHA",
"typeVersion": 202411,
"position": [
-1728,
-224
],
"id": "0f2bfc26-b3f9-46f3-8a6a-9f763f34f48a",
"name": "Send Services List",
"credentials": {
"wahaApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Dados",
"type": "main",
"index": 0
}
]
]
},
"Dados": {
"main": [
[
{
"node": "If Servi\u00e7os?",
"type": "main",
"index": 0
}
]
]
},
"Send Seen1": {
"main": [
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Send Seen1",
"type": "main",
"index": 0
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "Send a text message",
"type": "main",
"index": 0
}
]
]
},
"If Servi\u00e7os?": {
"main": [
[
{
"node": "Set API Base",
"type": "main",
"index": 0
}
],
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Set API Base": {
"main": [
[
{
"node": "Get Services",
"type": "main",
"index": 0
}
]
]
},
"Get Services": {
"main": [
[
{
"node": "Format Services",
"type": "main",
"index": 0
}
]
]
},
"Format Services": {
"main": [
[
{
"node": "Send Services List",
"type": "main",
"index": 0
}
]
]
},
"Redis Chat Memory1": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"If": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "913f8c11-0d67-43ac-8b13-519ec6468b72-v1.1",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "EpLVBNYyy494x8jp",
"tags": [
{
"createdAt": "2025-09-14T18:52:41.541Z",
"updatedAt": "2025-09-14T18:52:41.541Z",
"id": "HShgCAp90lWr4iVI",
"name": "Whatsapp"
}
]
}
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.
googlePalmApirediswahaApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Whatsapp v1.1. Uses lmChatGoogleGemini, n8n-nodes-waha, agent, memoryRedisChat. Webhook trigger; 15 nodes.
Source: https://github.com/JohnOmena/barberbook/blob/142d51cd78664fd55c197b652d1effb728f04a38/automation/automation.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.
ÁncorA v5 — WhatsApp Completo (Texto + Voz + Foto + Disparo). Uses agent, lmChatGoogleGemini, memoryRedisChat, httpRequest. Webhook trigger; 35 nodes.
Agent: IPTV (instance_e2165d22_1762376395079). Uses openAi, redis, supabase, httpRequest. Webhook trigger; 56 nodes.
Fluxo Nia App - Agendamento Multi-tenant. Uses redis, httpRequest, openAi, whatsApp. Webhook trigger; 52 nodes.
whats. Uses agent, lmChatGoogleGemini, memoryRedisChat, n8n-nodes-waha. Webhook trigger; 8 nodes.
WhatsApp. Uses agent, lmChatGoogleGemini, memoryRedisChat, n8n-nodes-waha. Webhook trigger; 8 nodes.