Le aziende di oggi utilizzano ampiamente l'IA per l'automazione dell'assistenza clienti. Tuttavia, l'IA non è infallibile — ci saranno sempre scenari che richiedono supervisione umana.
In questo articolo esploreremo come creare un flusso di lavoro robusto in n8n che sfrutti Wassenger per l'automazione WhatsApp, i modelli Chat di OpenAI, e che effettui senza soluzione di continuità l'escalation ad assistenza umana tramite Slack quando necessario.
👉 Scopri la nostra nuova funzionalità flows per trasformare il tuo servizio clienti oggi! ⚡
⚙️ Cosa imparerai:
- Configurare Wassenger con n8n
- Integrare il modello Chat di OpenAI nel tuo workflow n8n
- Creare messaggi di sistema dinamici per l'agente IA per definire comportamenti specifici
- Progettare un percorso di escalation verso agenti umani usando Slack
🚀 Strumenti che useremo:
- Wassenger: piattaforma di automazione per WhatsApp (Flows)
- OpenAI: API per chat completion basata su IA
- Slack: strumento di comunicazione di team per l'escalation umana
👉 Inizia la tua prova gratuita di 7 giorni su Wassenger e sfrutta i nostri potenti WhatsApp automation flows per trasformare il tuo servizio clienti oggi! ⚡
🔧 Guida passo per passo:
✅ Passo 1: Configurare il trigger di Wassenger
- Collega il tuo account Wassenger a n8n.
- Configura un nodo Wassenger trigger per avviare i workflow alla ricezione di messaggi WhatsApp.
✅ Passo 2: Aggiungere il modello Chat di OpenAI
- Integra il nodo OpenAI in n8n.
- Imposta le credenziali OpenAI.
- Configura il nodo IA per ricevere i messaggi da Wassenger e generare risposte.
✅ Passo 3: Configurare l'agente IA (Comportamento personalizzato)
- Crea un prompt di sistema chiaro e preciso che definisca i compiti che l'agente IA può e non può svolgere (come fornito di seguito).
- Configura il nodo agente IA in n8n per utilizzare questo prompt di sistema per interazioni precise e pertinenti.
Qui trovi un messaggio di esempio che abbiamo usato e che puoi modificare con le informazioni della tua azienda
You are an AI-powered Wassenger Customer Support Agent. Your primary role is to assist users by clearly, precisely, and politely answering questions related to the Wassenger platform, its API, integrations, configurations, usage instructions, and best practices.
Your tone must always be friendly, helpful, and professional.
🚩 Tasks you CAN perform: ✅ General Information:
Explain Wassenger features and functionalities clearly.
Assist users navigating through the Wassenger interface and options.
Provide clear guidance on how to use Wassenger’s API endpoints, with examples.
✅ Integrations:
Explain how Wassenger integrates with other services such as n8n, Zapier, Make, Google Sheets, CRMs, etc.
Guide users on creating automated workflows and custom integrations.
✅ Troubleshooting:
Provide solutions for common usage issues, such as connection or session problems.
Guide on best practices for avoiding common issues, such as WhatsApp number bans.
✅ Documentation and Tutorials:
Direct users to specific help-center articles and documentation.
Provide code snippets and configuration examples as documented officially.
✅ Platform Configuration:
Explain features such as chat assignment, labels, quick replies, automatic responses, etc.
Help users set up and manage departments, roles, permissions, and team settings.
🚫 Tasks you CANNOT perform (Always escalate to human agents): If users ask questions in these categories, kindly inform them clearly and politely that their request needs to be escalated to a human agent:
⚠️ Billing and Payments:
Issues with payments, invoices, refunds, cancellations, payment method changes, upgrades, downgrades, or subscription modifications.
Example reply:
"I see your query relates to billing and payments. I'm unable to access or handle payment information for security reasons. I'll escalate your request to our human support team who will assist you shortly."
⚠️ Account Ownership and Personal Data:
Changes to account ownership or sensitive data (emails, passwords, phone number transfers).
Personal data removal, export requests (GDPR-related), or account deletion.
Example reply:
"For privacy and security reasons, I can't manage personal data or account ownership requests. Let me forward your request to our support team who will help you further."
⚠️ Legal & Compliance:
GDPR and compliance-related questions or data privacy queries.
Requests related to terms of service, legal contracts, NDAs, or compliance documentation.
Example reply:
"Your question about legal or compliance topics requires specialized attention. I will escalate your request to our compliance team to assist you better."
⚠️ Advanced Technical Issues (that exceed documented knowledge):
Complex system issues, recurring API errors unexplained by standard troubleshooting steps.
Example reply:
"Your issue seems to require an in-depth technical investigation. I'll escalate this to our technical team so they can thoroughly review and assist you."
⚠️ Urgent and Business-critical Issues:
Issues that are identified by users as critical to their business operations.
Example reply:
"Given the urgency and importance of your issue, I will forward your query immediately to our dedicated support team who will reach out to you shortly."
🎯 Procedura generale di escalation: Dichiara chiaramente il motivo per cui non puoi assistere.
Assicura cortesemente l'utente che la sua richiesta sarà gestita prontamente da un umano.
Esegui immediatamente l'escalation del problema dell'utente al team o alla coda di supporto Wassenger appropriata.
- Quando esegui l'escalation del messaggio prendi le informazioni dal contenuto {{ $('Wassenger Trigger').item.json.data.body }}
✅ Passo 4: Aggiungere “Simple Memory”
- Includi il nodo “Simple Memory” per memorizzare e recuperare il contesto della conversazione, garantendo interazioni coerenti.
✅ Passo 5: Escalation umana usando il workflow di Custom Tool
- Se l'IA non è sicura sulla richiesta dell'utente, attiviamo un sub-workflow.
- Imposta un nodo di logica condizionale per determinare se i dettagli dell'utente (per esempio l'email) sono forniti.
✅ Passo 6: Integrazione Slack per assistenza umana
- Usa un nodo Slack per notificare i team di supporto umano con i dettagli critici (domanda dell'utente, informazioni di contatto).
- Richiedi all'utente di fornire il proprio indirizzo email se non è già stato fornito.
👉 Inizia la tua prova gratuita di 7 giorni su Wassenger e sfrutta i nostri potenti WhatsApp automation flows per trasformare il tuo servizio clienti oggi! ⚡
📐 Spiegazione dettagliata del sub-workflow
Spiega chiaramente come funziona il tuo sub-workflow, includendo:
- Verificare se è stata fornita un'email.
- Inviare richieste agli utenti se l'email manca.
- Allertare gli agenti umani in Slack in modo chiaro e informativo.
- Confermare i messaggi di escalation e le notifiche all'utente.
📷 Workflow (JSON incluso)
{
"name": "Ask a human for help when the AI doesn't know the answer",
"nodes": [
{
"parameters": {
"content": "### Main workflow: AI agent using custom tool",
"height": 486.5625,
"width": 927.5,
"color": 7
},
"id": "48f18cda-7baf-4c63-9c48-b27236ec009d",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [0, 0],
"typeVersion": 1
},
{
"parameters": {
"content": "**This tool calls the sub-workflow below**",
"height": 179,
"width": 297,
"color": 5
},
"id": "8102f76d-9d93-4754-9eb2-73a87f24204e",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [560, 240],
"typeVersion": 1
},
{
"parameters": {
"content": "**Set your credentials**",
"height": 213.44323866265472,
"width": 150,
"color": 2
},
"id": "1e3fbc3a-c7fc-4046-8b31-bc1e2880b522",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [200, 220],
"typeVersion": 1
},
{
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"id": "6a39707e-db29-4590-b1c8-ca2e18c7c61b",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [240, 300],
"typeVersion": 1.2,
"credentials": {
"openAiApi": {
"id": "id_number",
"name": "OpenAi account 13"
}
}
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $('Wassenger Trigger') }}",
"contextWindowLength": 20
},
"id": "c63f495c-ec2a-4ccc-92db-89f2649fad26",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [420, 300],
"typeVersion": 1.3
},
{
"parameters": {
"name": "dont_know_tool",
"description": "Use this tool if you don't know the answer to the user's question, or if you're not very confident about your answer.",
"workflowId": {
"__rl": true,
"value": "CotpNRS12t1hzys2",
"mode": "list",
"cachedResultName": "My Sub-Workflow 1"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {},
"matchingColumns": [],
"schema": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"id": "4ef494b9-439b-4857-9a90-96e9a542af86",
"name": "Not sure?",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [620, 260],
"typeVersion": 2
},
{
"parameters": {
"promptType": "define",
"text": "={{ $('Wassenger Trigger') }}",
"options": {
"systemMessage": "=You are an AI-powered Wassenger Customer Support Agent.Your primary role is to assist users by clearly, precisely, and politely answering questions related to the Wassenger platform, its API, integrations, configurations, usage instructions, and best practices.\n\nYour tone must always be friendly, helpful, and professional.\n\n🚩 Tasks you CAN perform:\n✅ General Information:\n\nExplain Wassenger features and functionalities clearly.\n\nAssist users navigating through the Wassenger interface and options.\n\nProvide clear guidance on how to use Wassenger’s API endpoints, with examples.\n\n✅ Integrations:\n\nExplain how Wassenger integrates with other services such as n8n, Zapier, Make, Google Sheets, CRMs, etc.\n\nGuide users on creating automated workflows and custom integrations.\n\n✅ Troubleshooting:\n\nProvide solutions for common usage issues, such as connection or session problems.\n\nGuide on best practices for avoiding common issues, such as WhatsApp number bans.\n\n✅ Documentation and Tutorials:\n\nDirect users to specific help-center articles and documentation.\n\nProvide code snippets and configuration examples as documented officially.\n\n✅ Platform Configuration:\n\nExplain features such as chat assignment, labels, quick replies, automatic responses, etc.\n\nHelp users set up and manage departments, roles, permissions, and team settings.\n\n🚫 Tasks you CANNOT perform(Always escalate to human agents):\nIf users ask questions in these categories, kindly inform them clearly and politely that their request needs to be escalated to a human agent:\n\n⚠️ Billing and Payments:\n\nIssues with payments, invoices, refunds, cancellations, payment method changes, upgrades, downgrades, or subscription modifications.\n\nExample reply:\n\n\"I see your query relates to billing and payments.I'm unable to access or handle payment information for security reasons.I'll escalate your request to our human support team who will assist you shortly.\"\n\n⚠️ Account Ownership and Personal Data:\n\nChanges to account ownership or sensitive data(emails, passwords, phone number transfers).\n\nPersonal data removal, export requests(GDPR-related), or account deletion.\n\nExample reply:\n\n\"For privacy and security reasons, I can't manage personal data or account ownership requests.Let me forward your request to our support team who will help you further.\"\n\n⚠️ Legal & Compliance:\n\nGDPR and compliance-related questions or data privacy queries.\n\nRequests related to terms of service, legal contracts, NDAs, or compliance documentation.\n\nExample reply:\n\n\"Your question about legal or compliance topics requires specialized attention.I will escalate your request to our compliance team to assist you better.\"\n\n⚠️ Advanced Technical Issues(that exceed documented knowledge):\n\nComplex system issues, recurring API errors unexplained by standard troubleshooting steps.\n\nExample reply:\n\n\"Your issue seems to require an in-depth technical investigation.I'll escalate this to our technical team so they can thoroughly review and assist you.\"\n\n⚠️ Urgent and Business-critical Issues:\n\nIssues that are identified by users as critical to their business operations.\n\nExample reply:\n\n\"Given the urgency and importance of your issue, I will forward your query immediately to our dedicated support team who will reach out to you shortly.\"\n\n🎯 General Escalation Procedure:\nClearly state why you cannot assist.\n\nPolitely assure the user that their query will be addressed promptly by a human.\n\nImmediately escalate the user's issue to the appropriate Wassenger team or support queue.\n\n- When scalating the message take the info from {{ $('Wassenger Trigger').item.json.data.body }} content\n\n"
}
},
"id": "0cf88611-4e6f-4b7e-b7f2-0d121b6a12b0",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [300, 60],
"typeVersion": 1.8
},
{
"parameters": {
"device": "device_id",
"events": ["message:in:new"],
"sampleEvent": "inbound-text"
},
"type": "n8n-nodes-wassenger.wassengerTrigger",
"typeVersion": 1,
"position": [80, 60],
"id": "b35532e3-7e3b-443b-bb37-9e06dba415c7",
"name": "Wassenger Trigger",
"webhookId": "3ab2aa49-81f1-40b8-942d-151861217f5b",
"credentials": {
"wassengerApiKey": {
"id": "api_key",
"name": "Wassenger Key account 9"
}
}
},
{
"parameters": {
"content": "### Sub-workflow: Custom tool\nThe agent above can call this workflow.It checks if the user has supplied an email address.If they haven't it prompts them to provide one.If they have, it messages a customer support channel for help.",
"height": 775.3931210698682,
"width": 1118.3459011229047,
"color": 7
},
"id": "b40a664b-0b76-4201-9b52-b35d7608063a",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [0, 500],
"typeVersion": 1
},
{
"parameters": {
"content": "**Set your credentials and Slack details**",
"height": 250.57252651663197,
"width": 178.0499248677781,
"color": 2
},
"id": "d6901508-7d25-4a79-a569-94dd1a0ca064",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [520, 700],
"typeVersion": 1
},
{
"parameters": {
"content": "## Next steps\n\nLearn more about [Advanced AI in n8n](https://docs.n8n.io/advanced-ai/)",
"height": 145
},
"id": "bcf8c374-c209-40ab-b5cc-5b73fbc27eaa",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [820, 1060],
"typeVersion": 1
},
{
"parameters": {
"workflowInputs": {
"values": [
{
"name": "chatInput"
}
]
}
},
"id": "be94ed3b-5f7c-4693-a1c2-152a8128d576",
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [100, 900],
"typeVersion": 1.1
},
{
"parameters": {
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e6dce436-5e85-4722-a7e4-0ceb940a5477",
"operator": {
"type": "string",
"operation": "regex"
},
"leftValue": "={{ $('When Executed by Another Workflow').item.json.chatInput }}",
"rightValue": "=/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+)/gi"
}
]
},
"options": {}
},
"id": "f5f4bf5f-0553-4077-9009-35358352bd07",
"name": "Check if user has provided email",
"type": "n8n-nodes-base.if",
"position": [280, 900],
"typeVersion": 2.2
},
{
"parameters": {
"select": "channel",
"channelId": {
"__rl": true,
"mode": "name",
"value": "#general"
},
"text": "={{ \"A user had a question the bot couldn't answer.Here's their message: \" + $('When Executed by Another Workflow').first().json.chatInput }}",
"otherOptions": {}
},
"id": "933b12ce-69c0-4a2d-87a7-b13ca1c21a9d",
"name": "Message Slack for help",
"type": "n8n-nodes-base.slack",
"position": [560, 780],
"webhookId": "c54bea4c-bdb6-4f42-9f82-525857df5a9a",
"typeVersion": 2.3
},
{
"parameters": {
"jsCode": "const response = {\"response\": \"Thank you for getting in touch.I've messaged a human to help.\"}\nreturn response;"
},
"id": "2e1e9918-584f-4787-b723-5d1756461811",
"name": "Confirm that we've messaged a human",
"type": "n8n-nodes-base.code",
"position": [780, 780],
"typeVersion": 2
},
{
"parameters": {
"jsCode": "const response = {\"response\":\"I'm sorry I don't know the answer.Please repeat your question and include your email address so I can request help.\"};\nreturn response;"
},
"id": "b1cc9ce5-5c68-4476-a6a2-471ea6e75455",
"name": "Prompt the user to provide an email",
"type": "n8n-nodes-base.code",
"position": [560, 1020],
"typeVersion": 2
},
{
"parameters": {
"phone": "={{ $('Wassenger Trigger').item.json.data.fromNumber }}",
"message": "={{ $json.output }}",
"options": {}
},
"type": "n8n-nodes-wassenger.wassenger",
"typeVersion": 1,
"position": [660, 60],
"id": "483fb22a-1259-4b99-b0b0-909efb61a624",
"name": "Wassenger",
"credentials": {
"wassengerApiKey": {
"id": "9du3UAbFSzEaTSQE",
"name": "WhatsApp API key"
}
}
}
],
"pinData": {},
"connections": {
"Not sure?": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Wassenger Trigger": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"When Executed by Another Workflow": {
"main": [
[
{
"node": "Check if user has provided email",
"type": "main",
"index": 0
}
]
]
},
"Check if user has provided email": {
"main": [
[
{
"node": "Message Slack for help",
"type": "main",
"index": 0
}
],
[
{
"node": "Prompt the user to provide an email",
"type": "main",
"index": 0
}
]
]
},
"Message Slack for help": {
"main": [
[
{
"node": "Confirm that we've messaged a human",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Wassenger",
"type": "main",
"index": 0
}
]
]
}
}
}
🚨 Best practice
- Definisci chiaramente i confini dell'IA e le regole di escalation.
- Fornisci sempre feedback agli utenti durante le escalation.
- Aggiorna regolarmente i prompt dell'IA per migliorare l'accuratezza.
- Monitora attentamente le escalation umane per adattare i workflow IA quando necessario.
💡 Conclusione
Integrando capacità IA e umane, garantisci un'automazione efficace, robusta e user-friendly. Questa potente combinazione di Wassenger, n8n, OpenAI e Slack crea una soluzione di assistenza clienti automatizzata ma supportata da operatori umani, adattabile e affidabile.
📚 Letture e risorse aggiuntive
Prova a creare i tuoi workflow assistiti dall'IA e condividi le tue esperienze e intuizioni con la community! Se hai domande o suggerimenti, commenta qui sotto — siamo qui per aiutarci a crescere insieme.
👉 Inizia la tua prova gratuita di 7 giorni su Wassenger e sfrutta i nostri potenti WhatsApp automation flows per trasformare il tuo servizio clienti oggi! ⚡







