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": "LeadsFlow - Chat Assistant",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "chat-message",
"responseMode": "responseNode",
"options": {}
},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json.message.toLowerCase()}}",
"operation": "contains",
"value2": "lead"
}
]
}
},
"name": "Is About Leads?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
450,
300
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "response",
"value": "Para adicionar leads, voc\u00ea pode:\n\n1. **Importar de CSV/Excel**\n2. **Adicionar manualmente** no dashboard\n3. **Conectar via WhatsApp** (Evolution API)\n4. **Integrar com Facebook/Google Ads**\n\nQual m\u00e9todo voc\u00ea prefere?"
}
],
"array": [
{
"name": "quickReplies",
"value": "=[{\"text\": \"\u2795 Adicionar manualmente\", \"action\": \"navigate:/leads\"}, {\"text\": \"\ud83d\udce4 Importar CSV\", \"action\": \"import_csv\"}, {\"text\": \"\ud83d\udcac WhatsApp\", \"action\": \"whatsapp_integration\"}]"
}
],
"boolean": [
{
"name": "showSatisfaction",
"value": false
}
]
}
},
"name": "Response - Leads",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
650,
200
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json.message.toLowerCase()}}",
"operation": "contains",
"value2": "plano"
}
]
}
},
"name": "Is About Plans?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
650,
400
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "response",
"value": "Nossos planos:\n\n\u2022 **Gratuito**: 30 leads/m\u00eas\n\u2022 **Professional**: 500 leads/m\u00eas - R$97\n\u2022 **Unlimited**: Leads ilimitados - R$197\n\nTodos os planos incluem 30 dias de acesso."
}
],
"array": [
{
"name": "quickReplies",
"value": "=[{\"text\": \"\ud83d\udcb3 Ver Planos\", \"action\": \"navigate:/plans\"}, {\"text\": \"\ud83d\udcca Meu Plano Atual\", \"action\": \"current_plan\"}]"
}
],
"boolean": [
{
"name": "showSatisfaction",
"value": false
}
]
}
},
"name": "Response - Plans",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
850,
300
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json.message.toLowerCase()}}",
"operation": "contains",
"value2": "suporte"
}
]
}
},
"name": "Is About Support?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
850,
500
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "response",
"value": "Vou transferir voc\u00ea para nossa equipe de suporte. Um atendente humano responder\u00e1 em breve.\n\nEnquanto isso, voc\u00ea pode:\n\u2022 Enviar email: suporte@leadsflow.com\n\u2022 WhatsApp: +55 11 98765-4321"
}
],
"array": [
{
"name": "quickReplies",
"value": "=[{\"text\": \"\ud83d\udce7 Enviar Email\", \"action\": \"email_support\"}, {\"text\": \"\ud83d\udcac WhatsApp\", \"action\": \"whatsapp_support\"}]"
}
],
"boolean": [
{
"name": "showSatisfaction",
"value": true
}
]
}
},
"name": "Response - Support",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1050,
400
]
},
{
"parameters": {
"model": "gpt-4",
"messages": {
"values": [
{
"role": "system",
"message": "Voc\u00ea \u00e9 o assistente virtual do LeadsFlow, um CRM de gest\u00e3o de leads. Responda de forma profissional, objetiva e em portugu\u00eas do Brasil. Use formata\u00e7\u00e3o markdown quando apropriado. Seja \u00fatil e direto ao ponto."
},
{
"role": "user",
"message": "={{$json.message}}\n\nContexto:\n- P\u00e1gina atual: {{$json.context.currentPage}}\n- Plano do usu\u00e1rio: {{$json.context.userPlan}}"
}
]
},
"options": {
"temperature": 0.7,
"maxTokens": 500
}
},
"name": "OpenAI GPT-4",
"type": "n8n-nodes-base.openAi",
"typeVersion": 1,
"position": [
1050,
600
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"values": {
"string": [
{
"name": "response",
"value": "={{$json.choices[0].message.content}}"
}
],
"array": [
{
"name": "quickReplies",
"value": "=[{\"text\": \"\ud83d\udcca Dashboard\", \"action\": \"navigate:/dashboard\"}, {\"text\": \"\u2699\ufe0f Configura\u00e7\u00f5es\", \"action\": \"navigate:/settings\"}, {\"text\": \"\ud83d\udcac Falar com humano\", \"action\": \"contact_support\"}]"
}
],
"boolean": [
{
"name": "showSatisfaction",
"value": false
}
]
}
},
"name": "Format AI Response",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1250,
600
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{$json}}"
},
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1450,
400
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Is About Leads?",
"type": "main",
"index": 0
}
]
]
},
"Is About Leads?": {
"main": [
[
{
"node": "Response - Leads",
"type": "main",
"index": 0
}
],
[
{
"node": "Is About Plans?",
"type": "main",
"index": 0
}
]
]
},
"Is About Plans?": {
"main": [
[
{
"node": "Response - Plans",
"type": "main",
"index": 0
}
],
[
{
"node": "Is About Support?",
"type": "main",
"index": 0
}
]
]
},
"Is About Support?": {
"main": [
[
{
"node": "Response - Support",
"type": "main",
"index": 0
}
],
[
{
"node": "OpenAI GPT-4",
"type": "main",
"index": 0
}
]
]
},
"Response - Leads": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Response - Plans": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Response - Support": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"OpenAI GPT-4": {
"main": [
[
{
"node": "Format AI Response",
"type": "main",
"index": 0
}
]
]
},
"Format AI Response": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {},
"staticData": null
}
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.
openAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
LeadsFlow - Chat Assistant. Uses openAi. Webhook trigger; 10 nodes.
Source: https://github.com/Personalcreativelda/NEWVERSION-LEADSFLOWAPI/blob/main/src/app/components/chat/n8n-workflow-example.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.
The Ultimate Scraper for n8n uses Selenium and AI to retrieve any information displayed on a webpage. You can also use session cookies to log in to the targeted webpage for more advanced scraping need
z-Api. Uses httpRequest, openAi, redis, postgres. Webhook trigger; 61 nodes.
How it works: • Receives WhatsApp messages via webhook from Whapi.Cloud • Routes commands: AI chat (/ai), numeric commands (1-9), or help menu • Sends responses: text, images, documents, videos, conta
This workflow will allow you to use OpenAI Assistant API together with a chatting platform. This version is configured to work with Hubspot, however, the Hubspot modules can be replaced by other platf
Chatbot. Uses openAi, httpRequest. Webhook trigger; 25 nodes.