This workflow corresponds to n8n.io template #6988 — we link there as the canonical source.
This workflow follows the Execute Workflow Trigger → 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 →
{
"id": "zmuAW16DkWnYc6pe",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Forward messages from evolution api to Chatwoot with media support",
"tags": [],
"nodes": [
{
"id": "e88b542d-551b-47ad-8f93-e55f8a145d3d",
"name": "Convert to File",
"type": "n8n-nodes-base.convertToFile",
"position": [
2416,
320
],
"parameters": {
"options": {
"fileName": "={{ $('CODE - MESSAGE OBJECT').item.json.arquivos[0].nm_Arquivo }}",
"mimeType": "={{ $json.mimetype }}"
},
"operation": "toBinary",
"sourceProperty": "base64",
"binaryPropertyName": "=data"
},
"typeVersion": 1.1
},
{
"id": "056d6ec8-3031-4467-b259-99b7e7390c6a",
"name": "BASE64",
"type": "n8n-nodes-base.code",
"position": [
2160,
320
],
"parameters": {
"jsCode": "return $('EVOLUTION - GET FILE').first().json.data;"
},
"typeVersion": 2
},
{
"id": "96a82a81-c985-406d-b3cd-11b4e4910523",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-4224,
32
],
"parameters": {
"width": 312,
"height": 340,
"content": "## MESSAGE TYPE\n\nChecks if it is a valid message type, text, audio, image and video"
},
"typeVersion": 1
},
{
"id": "81569053-82e9-465f-8bbd-6eef0b461cbd",
"name": "TIPO MENSAGEM V\u00c1LIDO?",
"type": "n8n-nodes-base.if",
"position": [
-4128,
192
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c6900a9d-f55e-446c-8805-66a209796135",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.sn_Mensagem_Valida }}",
"rightValue": "conversation"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "07339125-f5de-4f4d-9f90-39aef7b449c7",
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
-5312,
192
],
"parameters": {
"workflowInputs": {
"values": [
{
"name": "cd_account",
"type": "number"
},
{
"name": "cd_inbox_chatwoot",
"type": "number"
},
{
"name": "ds_msg",
"type": "object"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "f92a7528-bfd9-4c68-9984-3c1a27eb0803",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3472,
192
],
"parameters": {
"color": 4,
"width": 632,
"height": 324,
"content": "## CHECK IF WHATSAPP MESSAGE ID HAS ALREADY BEEN SENT\n\nNode to check if evolution API is sending the same msg ID twice"
},
"typeVersion": 1
},
{
"id": "e44fa6ad-3b6b-4001-8fa4-3329ecce5469",
"name": "REDIS - EVOLUTION MSG - GET",
"type": "n8n-nodes-base.redis",
"position": [
-3408,
336
],
"parameters": {
"key": "=wa_{{ $('PARAMETERS').item.json.cd_account }}_{{ $('PARAMETERS').item.json.cd_inbox_chatwoot }}_{{ $('PARAMETERS').item.json.cd_mensagem_evolution }}",
"options": {
"dotNotation": false
},
"operation": "get",
"propertyName": "cd_mensagem_evolution"
},
"credentials": {
"redis": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "350812dc-a2ad-43eb-aaf5-d9bfef9ae427",
"name": "REDIS - EVOLUTION MSG - SET",
"type": "n8n-nodes-base.redis",
"position": [
-2976,
320
],
"parameters": {
"key": "=wa_{{ $('PARAMETERS').item.json.cd_account }}_{{ $('PARAMETERS').item.json.cd_inbox_chatwoot }}_{{ $('PARAMETERS').item.json.cd_mensagem_evolution }}",
"value": "={{ $('PARAMETERS').item.json.cd_mensagem_evolution }}",
"expire": true,
"keyType": "string",
"operation": "set"
},
"credentials": {
"redis": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "4d5d3ccd-e773-4875-9c72-0dd2146a9f02",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
-5120,
192
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "63b81b6b-8e5e-48f2-bc38-36e950d4cf30",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2720,
32
],
"parameters": {
"color": 3,
"width": 1176,
"height": 644,
"content": "## CONTATO\n\nChecks if there is already a contact registered with the cell phone number provided, if the contact already exists, it returns its contact ID from chatwoot, if the number does not exist, it creates a new contact in chatwoot"
},
"typeVersion": 1
},
{
"id": "315c7d07-5fb7-4bd9-afe3-782b71372d1a",
"name": "EVOLUTION - GET FILE",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
1600,
336
],
"parameters": {
"resource": "chat-api",
"messageId": "={{ $('PARAMETERS').item.json.cd_mensagem_evolution }}",
"operation": "get-media-base64",
"instanceName": "={{ $('PARAMETERS').item.json.nm_instancia }}"
},
"credentials": {
"evolutionApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "4c5150f3-3d1e-4f84-9841-589b59ab1416",
"name": "Get Conversations",
"type": "n8n-nodes-base.postgres",
"position": [
-1104,
352
],
"parameters": {
"sort": {
"values": [
{
"column": "updated_at",
"direction": "DESC"
}
]
},
"limit": 1,
"table": {
"__rl": true,
"mode": "list",
"value": "conversations",
"cachedResultName": "conversations"
},
"where": {
"values": [
{
"value": "={{ $('PARAMETERS').item.json.cd_inbox_chatwoot }}",
"column": "inbox_id"
},
{
"value": "={{ $('CONTACT - ID').item.json.cd_contact }}",
"column": "contact_id"
},
{
"value": "0",
"column": "status"
},
{
"value": "={{ $('PARAMETERS').item.json.cd_account }}",
"column": "account_id"
}
]
},
"schema": {
"__rl": true,
"mode": "list",
"value": "public"
},
"options": {},
"operation": "select"
},
"credentials": {
"postgres": {
"name": "<your credential>"
}
},
"typeVersion": 2.6,
"alwaysOutputData": true
},
{
"id": "56d22f41-107e-4420-a3b6-48c28d5bcfa1",
"name": "SENT FILE?",
"type": "n8n-nodes-base.if",
"position": [
1248,
352
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "196a7287-0988-401c-914a-036bfbadb7b1",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $('CODE - MESSAGE OBJECT').item.json.arquivos.length }}",
"rightValue": 0
}
]
}
},
"typeVersion": 2.2
},
{
"id": "d3d322fa-aa23-40cf-9e65-7a509ac4aacc",
"name": "CHECK FILE TYPE",
"type": "n8n-nodes-base.switch",
"position": [
1888,
336
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "ALLOWED",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b024dbec-d707-4d56-93c3-80dcc443d0ee",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.data.mimetype }}",
"rightValue": "application/x-msdownload"
}
]
},
"renameOutput": true
},
{
"outputKey": ".MSI",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "38feeef2-acbf-4d4c-b390-83f1abecc482",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.data.mimetype }}",
"rightValue": "application/x-msdownload"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "0c1e8e1e-a007-4d6c-a3a4-be88d71e8ca8",
"name": "SEND CHATWOOT FILE",
"type": "n8n-nodes-base.httpRequest",
"position": [
2656,
320
],
"parameters": {
"url": "=https://chatwoot.unimedsulcapixaba.coop.br/api/v1/accounts/{{ $('PARAMETERS').item.json.cd_account }}/conversations/{{ $('CONVERSATION - ID').item.json.cd_conversation }}/messages",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "multipart-form-data",
"authentication": "predefinedCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "attachments[]",
"parameterType": "formBinaryData",
"inputDataFieldName": "data"
},
{
"name": "message_type",
"value": "={{ ($('CODE - MESSAGE OBJECT').item.json.sn_Proprio_Numero ? \"outgoing\" : \"incoming\") }}"
},
{
"name": "private",
"value": "={{ ($('CODE - MESSAGE OBJECT').item.json.sn_Proprio_Numero ? \"true\" : \"false\") }}"
}
]
},
"nodeCredentialType": "chatwootApi"
},
"credentials": {
"chatwootApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "5af4ea4a-9450-4152-b25a-134f9feddcde",
"name": "PARAMETERS",
"type": "n8n-nodes-base.set",
"position": [
-4912,
192
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "62fbd7f8-2927-4823-b302-aab58af6e1e7",
"name": "cd_account",
"type": "number",
"value": "={{ $json.cd_account }}"
},
{
"id": "efa8bda6-4275-4860-92fc-639fd3ab151e",
"name": "cd_inbox_chatwoot",
"type": "number",
"value": "={{ $json.cd_inbox_chatwoot }}"
},
{
"id": "8f7e75a0-fa77-4066-90e4-eb4c0703b7ea",
"name": "ds_msg",
"type": "object",
"value": "={{ $json.ds_msg }}"
},
{
"id": "3ed7584a-86bd-464a-a002-76bd71c200df",
"name": "cd_mensagem_evolution",
"type": "string",
"value": "={{ $json.ds_msg.data.key.id }}"
},
{
"id": "24baeedd-73bc-4477-9b09-be7e0f9feff5",
"name": "nm_instancia",
"type": "string",
"value": "={{ $json.ds_msg.instance }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "1d0a059a-53b0-458f-8518-3b40502cb1dd",
"name": "CODE - MESSAGE OBJECT",
"type": "n8n-nodes-base.code",
"position": [
-4592,
192
],
"parameters": {
"jsCode": "return items.map(item => {\n const message = $input.first().json.ds_msg.data.message;\n\n const tp_Mensagem = $input.first().json.ds_msg.data.messageType;\n \n let objMensagem = {\n nm_Contato : \"\",\n nr_Chave_Contato : \"\",\n ds_Mensagem : \"\",\n sn_Proprio_Numero : false, \n sn_Mensagem_Valida : false,\n arquivos : []\n }\n \n objMensagem.nr_Chave_Contato = $input.first().json.ds_msg.data.key.remoteJid.split('@')[0].split('-')[0]\n objMensagem.sn_Proprio_Numero = $input.first().json.ds_msg.data.key.fromMe;\n \n objMensagem.ds_Mensagem = $input.first().json.ds_msg.data.message.conversation ? $input.first().json.ds_msg.data.message.conversation : $input.first().json.ds_msg.data.message?.reactionMessage?.text;\n \n objMensagem.sn_Mensagem_Valida = [\"conversation\", \"audioMessage\",\"documentMessage\",\"videoMessage\",\"imageMessage\",\"reactionMessage\",\"documentWithCaptionMessage\",\"stickerMessage\",\"contactMessage\"].includes(tp_Mensagem); \n\n objMensagem.nm_Contato = objMensagem.sn_Proprio_Numero ? objMensagem.nr_Chave_Contato : $input.first().json.ds_msg.data.pushName;\n\n\n switch($input.first().json.ds_msg.data.messageType)\n {\n case 'audioMessage':\n case 'imageMessage':\n case 'videoMessage':\n case 'documentMessage':\n case 'reactionMessage':\n case 'stickerMessage':\n if (message[tp_Mensagem] && message[tp_Mensagem].url) \n { \n objMensagem.ds_Mensagem = message[tp_Mensagem].caption;\n objMensagem.arquivos.push({\n nm_Arquivo: message[tp_Mensagem].fileName || \"arquivo\",\n tp_Arquivo: message[tp_Mensagem].mimetype || \"application/octet-stream\",\n ds_Base64: $input.first().json.ds_msg.data.message.base64\n });\n }\n break;\n\n case \"contactMessage\":\n objMensagem.ds_Mensagem = Tratar_VCARD($input.first().json.ds_msg.data.message.contactMessage.vcard);\n break; \n\n case 'documentWithCaptionMessage':\n objMensagem.ds_Mensagem = $input.first().json.ds_msg.data.message.documentWithCaptionMessage.message.documentMessage.caption;\n \n objMensagem.arquivos.push({\n nm_Arquivo: $input.first().json.ds_msg.data.message.documentWithCaptionMessage.message.documentMessage.fileName|| \"arquivo\",\n tp_Arquivo: $input.first().json.ds_msg.data.message.documentWithCaptionMessage.message.documentMessage.mimetype || \"application/octet-stream\",\n ds_Base64: $input.first().json.ds_msg.data.message.base64\n });\n break; \n }\n\n //VERIFICA SE A MENSAGEM VEIO JUNTO COM UM RESPOSTA DE UMA MSG DO WHATSAPP\n if($input.first().json.ds_msg.data.contextInfo?.quotedMessage != null)\n {\n const tipo = Object.keys($input.first().json.ds_msg.data.contextInfo?.quotedMessage)[0];\n var ds_Texto_Citacao = \"\";\n \n switch(tipo)\n {\n case 'conversation':\n ds_Texto_Citacao = $input.first().json.ds_msg.data.contextInfo.quotedMessage.conversation;\n break;\n\n case 'audioMessage': \n case 'stickerMessage': \n case 'documentMessage':\n case 'audioMessage':\n case 'imageMessage': \n //ds_Texto_Citacao = $input.first().json.ds_msg.data.contextInfo.quotedMessage.conversation;\n\n //PARA FAZER IMAGEM E V\u00cdDEO PRECISA DESCRIPTOGRAR O ARQUIVO USANDO A MEDIA KEY\n break;\n }\n \n if(ds_Texto_Citacao != \"\")\n {\n objMensagem.ds_Mensagem = \"> \"+ ds_Texto_Citacao + \"\\n\\n\" + objMensagem.ds_Mensagem;\n }\n }\n\n return objMensagem;\n});\n\n\n\nfunction Tratar_VCARD(ds_Vcard) {\n // Substitui os \"\\n\" por quebras de linha reais\n const vcard = ds_Vcard.replace(/\\\\n/g, '\\n');\n\n const aLinhas = vcard.split('\\n');\n\n let nm_Nome = '';\n let ds_Telefone = '';\n\n for (const line of aLinhas) {\n //Nome\n if (line.startsWith('FN:')) {\n nm_Nome = line.replace('FN:', '').trim();\n }\n\n // WhatsApp Business: telefone + waid\n if (line.includes('waid=')) {\n const waidMatch = line.match(/waid=(\\d+):/);\n const formattedMatch = line.match(/waid=\\d+:(\\+?[0-9\\s\\-]+)/);\n\n if (waidMatch) {\n // output.waid = waidMatch[1];\n }\n \n if (formattedMatch) {\n const phone = formattedMatch[1].replace(/[^\\d+]/g, '');\n if (phone) {\n ds_Telefone = phone;\n }\n }\n }\n\n // WhatsApp normal: apenas TEL sem waid\n if (line.startsWith('TEL') && !line.includes('waid=')) \n {\n const parts = line.split(':');\n if (parts.length > 1)\n {\n const phone = parts[1].replace(/[^\\d+]/g, '');\n if (phone) \n {\n ds_Telefone = phone;\n }\n }\n } \n }\n\n return `\ud83d\udcf1 Contato compartilhado:\\nNome: ${nm_Nome}\\nTelefone: ${ds_Telefone}`;\n}"
},
"typeVersion": 2
},
{
"id": "286c1735-c445-49fd-b98b-24202b3d1e70",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3872,
32
],
"parameters": {
"width": 326,
"height": 340,
"content": "## MESSAGE TYPE\n\nChecks if it is a valid mobile phone number by checking the IDD prefix"
},
"typeVersion": 1
},
{
"id": "05354b1c-96c4-43a0-b618-c08c965f1122",
"name": "IS THE PHONE NUMBER VALID?",
"type": "n8n-nodes-base.if",
"position": [
-3760,
176
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c6900a9d-f55e-446c-8805-66a209796135",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('CODE - MESSAGE OBJECT').item.json.nr_Chave_Contato.split('@')[0].substring(0,2) }}",
"rightValue": "55"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "a634bd07-4044-4938-9719-47190558c2cd",
"name": "MESSAGE SENT?",
"type": "n8n-nodes-base.if",
"position": [
-3200,
336
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d9d19a36-2f9e-4f2d-a352-cb73deadee0f",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $json.cd_mensagem_evolution }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "ef54ed1b-488d-43c9-86a6-28da492cbac9",
"name": "LOAD CONTACT",
"type": "@devlikeapro/n8n-nodes-chatwoot.chatWoot",
"position": [
-2544,
224
],
"parameters": {
"q": "=+{{ $('CODE - MESSAGE OBJECT').item.json.nr_Chave_Contato }}",
"sort": "-phone_number",
"resource": "Contacts",
"operation": "Contact Search",
"account_id": "={{ $('PARAMETERS').item.json.cd_account }}",
"requestOptions": {}
},
"credentials": {
"chatwootApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "65c13eaf-574f-4199-95c2-028567b8ca45",
"name": "IS THERE CONTACT ON CHATWOOT?",
"type": "n8n-nodes-base.if",
"position": [
-2208,
224
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "03883245-e523-453b-8d4e-4e51b1f47b40",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $json.meta.count }}",
"rightValue": 0
}
]
}
},
"typeVersion": 2.2
},
{
"id": "33c12ffa-b867-42d9-a838-5a7978e38fc7",
"name": "CREATE CONTACT",
"type": "@devlikeapro/n8n-nodes-chatwoot.chatWoot",
"position": [
-1984,
480
],
"parameters": {
"name": "={{ $('CODE - MESSAGE OBJECT').item.json.nm_Contato }}",
"email": "={{null}}",
"avatar": "={{null}}",
"inbox_id": "={{ $('PARAMETERS').item.json.cd_inbox }}",
"resource": "Contacts",
"operation": "Contact Create",
"account_id": "={{ $('PARAMETERS').item.json.cd_account }}",
"avatar_url": "={{null}}",
"identifier": "={{null}}",
"phone_number": "=+{{ $('CODE - MESSAGE OBJECT').item.json.nr_Chave_Contato }}",
"requestOptions": {},
"custom_attributes": "={\n \"nm_spark\":\"{{ $('PESSOA').item.json.nm_spark }}\",\n\t\"nr_cpf\" : \"{{ $('PESSOA').item.json.nr_cpf }}\"\n}"
},
"credentials": {
"chatwootApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "a881c1dd-9a63-45c3-8a5e-c8c59b9adc93",
"name": "EXISTING CONTACT CODE",
"type": "n8n-nodes-base.set",
"position": [
-1712,
208
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "fb15aadc-bfdb-481b-9140-c7a309517dc7",
"name": "cd_contact",
"type": "number",
"value": "={{ $json.payload[0].id }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "911b472c-7074-4693-bce7-d1c7285632a5",
"name": "NEW CONTACT CODE",
"type": "n8n-nodes-base.set",
"position": [
-1712,
480
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "fb15aadc-bfdb-481b-9140-c7a309517dc7",
"name": "cd_contact",
"type": "number",
"value": "={{ $json.payload.contact.id }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "5d460e6d-5db8-486f-94ec-ab2a9ffe4098",
"name": "CONTACT - ID",
"type": "n8n-nodes-base.set",
"position": [
-1392,
352
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e6b929b9-b598-4232-9e18-07b6dd08e832",
"name": "cd_contact",
"type": "number",
"value": "={{ $json.cd_contact }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ad575c1c-afe3-422c-95c9-c35922402139",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1136,
32
],
"parameters": {
"color": 6,
"width": 1368,
"height": 644,
"content": "## CONVERSATION\n\nChecks if there is already an open conversation for the contact in that chatwoot account, if it already exists, it returns the same conversation code, otherwise, it creates a new conversation"
},
"typeVersion": 1
},
{
"id": "cb62aef9-d500-40f6-af75-ad10cd2851a3",
"name": "EXISTING CONVERSATION CODE",
"type": "n8n-nodes-base.set",
"position": [
-304,
224
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e4cc3a18-b861-44f9-8926-66abf0d4b62e",
"name": "cd_conversation",
"type": "string",
"value": "={{ $json.display_id }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "988fe0ca-d96b-49e5-a149-c14d5582b54c",
"name": "NEW CONVERSATION CODE",
"type": "n8n-nodes-base.set",
"position": [
-304,
464
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e4cc3a18-b861-44f9-8926-66abf0d4b62e",
"name": "cd_conversation",
"type": "string",
"value": "={{ $json.id }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "09809c62-309e-4eb5-b586-3ff9df2c1431",
"name": "IS THERE CONVERSATION ON CHATWOOT?",
"type": "n8n-nodes-base.if",
"position": [
-800,
352
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c1e82142-3fcc-485e-82f1-afb85bd36d84",
"operator": {
"type": "number",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.id }}",
"rightValue": 0
}
]
}
},
"typeVersion": 2.2
},
{
"id": "6cbf4e8a-d505-483b-ac68-f26343a8a108",
"name": "CONVERSATION - ID",
"type": "n8n-nodes-base.set",
"position": [
80,
352
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ed522e2d-7470-4211-8698-7e25edc19daf",
"name": "cd_conversation",
"type": "number",
"value": "={{ $json.cd_conversation }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "48330528-d85b-4238-b5bc-f9a9f1ead69c",
"name": "WAS IT THE NUMBER ITSELF THAT IS CONNECTED TO EVOLUTION THAT SENT THE MESSAGE?",
"type": "n8n-nodes-base.if",
"position": [
448,
352
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "8431382d-8c91-44d1-a66f-029dc819d0c3",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $('CODE - MESSAGE OBJECT').item.json.sn_Proprio_Numero }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "1669e5b7-230a-4bcc-9e02-ae5b86af45ea",
"name": "SEND OUTGOING MESSAGE",
"type": "@devlikeapro/n8n-nodes-chatwoot.chatWoot",
"position": [
816,
144
],
"parameters": {
"content": "={{ $('CODE - MESSAGE OBJECT').item.json.ds_Mensagem }}",
"resource": "Messages",
"operation": "Create A New Message In A Conversation",
"account_id": "={{ $('PARAMETERS').item.json.cd_account }}",
"content_type": "=text",
"requestOptions": {},
"conversation_id": "={{ $('CONVERSATION - ID').item.json.cd_conversation }}",
"template_params": "{}",
"content_attributes": "={\n}"
},
"credentials": {
"chatwootApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "482eabea-1392-4f9b-b99d-2995a55300aa",
"name": "SEND INCOMING MESSAGE",
"type": "@devlikeapro/n8n-nodes-chatwoot.chatWoot",
"position": [
816,
592
],
"parameters": {
"content": "={{ $('CODE - MESSAGE OBJECT').item.json.ds_Mensagem }}",
"private": false,
"resource": "Messages",
"operation": "Create A New Message In A Conversation",
"account_id": "={{ $('PARAMETERS').item.json.cd_account.toString() }}",
"content_type": "=text",
"message_type": "incoming",
"requestOptions": {},
"conversation_id": "={{ $('CONVERSATION - ID').item.json.cd_conversation }}",
"template_params": "{}",
"content_attributes": "={\n \"cd_mensagem_evolution\" : \"{{ $('PARAMETERS').item.json.cd_mensagem_evolution }}\"\n}"
},
"credentials": {
"chatwootApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "e2844032-7641-44f7-b54c-8cac7c1ec73b",
"name": "SEND OUTGOING MESSAGE EXTENSION NOT ALLOWED",
"type": "@devlikeapro/n8n-nodes-chatwoot.chatWoot",
"position": [
2256,
672
],
"parameters": {
"content": "=\ud83d\udea8 The uploaded file has an unauthorized extension",
"private": false,
"resource": "Messages",
"operation": "Create A New Message In A Conversation",
"account_id": "={{ $('PARAMETERS').item.json.cd_account }}",
"content_type": "=text",
"requestOptions": {},
"conversation_id": "={{ $('CONVERSATION - ID').item.json.cd_conversation }}",
"template_params": "{}"
},
"credentials": {
"chatwootApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "cf0b5b1c-7eba-453a-ba15-94c20e15d32a",
"name": "CREATE CONVERSATION",
"type": "@devlikeapro/n8n-nodes-chatwoot.chatWoot",
"position": [
-512,
464
],
"parameters": {
"inbox_id": "={{ $('PARAMETERS').item.json.cd_inbox_chatwoot }}",
"resource": "Conversations",
"operation": "New Conversation",
"source_id": "={{ null }}",
"account_id": "={{ $('PARAMETERS').item.json.cd_account }}",
"contact_id": "={{ $('CONTACT - ID').item.json.cd_contact }}",
"requestOptions": {}
},
"credentials": {
"chatwootApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "9a9128de-5efe-4667-b33b-8ba0658f3f6f",
"connections": {
"Wait": {
"main": [
[
{
"node": "PARAMETERS",
"type": "main",
"index": 0
}
]
]
},
"BASE64": {
"main": [
[
{
"node": "Convert to File",
"type": "main",
"index": 0
}
]
]
},
"PARAMETERS": {
"main": [
[
{
"node": "CODE - MESSAGE OBJECT",
"type": "main",
"index": 0
}
]
]
},
"SENT FILE?": {
"main": [
[
{
"node": "EVOLUTION - GET FILE",
"type": "main",
"index": 0
}
]
]
},
"CONTACT - ID": {
"main": [
[
{
"node": "Get Conversations",
"type": "main",
"index": 0
}
]
]
},
"LOAD CONTACT": {
"main": [
[
{
"node": "IS THERE CONTACT ON CHATWOOT?",
"type": "main",
"index": 0
}
]
]
},
"MESSAGE SENT?": {
"main": [
[
{
"node": "REDIS - EVOLUTION MSG - SET",
"type": "main",
"index": 0
}
]
]
},
"CREATE CONTACT": {
"main": [
[
{
"node": "NEW CONTACT CODE",
"type": "main",
"index": 0
}
]
]
},
"CHECK FILE TYPE": {
"main": [
[
{
"node": "BASE64",
"type": "main",
"index": 0
}
],
[
{
"node": "SEND OUTGOING MESSAGE EXTENSION NOT ALLOWED",
"type": "main",
"index": 0
}
]
]
},
"Convert to File": {
"main": [
[
{
"node": "SEND CHATWOOT FILE",
"type": "main",
"index": 0
}
]
]
},
"NEW CONTACT CODE": {
"main": [
[
{
"node": "CONTACT - ID",
"type": "main",
"index": 0
}
]
]
},
"CONVERSATION - ID": {
"main": [
[
{
"node": "WAS IT THE NUMBER ITSELF THAT IS CONNECTED TO EVOLUTION THAT SENT THE MESSAGE?",
"type": "main",
"index": 0
}
]
]
},
"Get Conversations": {
"main": [
[
{
"node": "IS THERE CONVERSATION ON CHATWOOT?",
"type": "main",
"index": 0
}
]
]
},
"SEND CHATWOOT FILE": {
"main": [
[]
]
},
"CREATE CONVERSATION": {
"main": [
[
{
"node": "NEW CONVERSATION CODE",
"type": "main",
"index": 0
}
]
]
},
"EVOLUTION - GET FILE": {
"main": [
[
{
"node": "CHECK FILE TYPE",
"type": "main",
"index": 0
}
]
]
},
"CODE - MESSAGE OBJECT": {
"main": [
[
{
"node": "TIPO MENSAGEM V\u00c1LIDO?",
"type": "main",
"index": 0
}
]
]
},
"EXISTING CONTACT CODE": {
"main": [
[
{
"node": "CONTACT - ID",
"type": "main",
"index": 0
}
]
]
},
"NEW CONVERSATION CODE": {
"main": [
[
{
"node": "CONVERSATION - ID",
"type": "main",
"index": 0
}
]
]
},
"SEND INCOMING MESSAGE": {
"main": [
[
{
"node": "SENT FILE?",
"type": "main",
"index": 0
}
]
]
},
"SEND OUTGOING MESSAGE": {
"main": [
[
{
"node": "SENT FILE?",
"type": "main",
"index": 0
}
]
]
},
"TIPO MENSAGEM V\u00c1LIDO?": {
"main": [
[
{
"node": "IS THE PHONE NUMBER VALID?",
"type": "main",
"index": 0
}
]
]
},
"EXISTING CONVERSATION CODE": {
"main": [
[
{
"node": "CONVERSATION - ID",
"type": "main",
"index": 0
}
]
]
},
"IS THE PHONE NUMBER VALID?": {
"main": [
[
{
"node": "REDIS - EVOLUTION MSG - GET",
"type": "main",
"index": 0
}
]
]
},
"REDIS - EVOLUTION MSG - GET": {
"main": [
[
{
"node": "MESSAGE SENT?",
"type": "main",
"index": 0
}
]
]
},
"REDIS - EVOLUTION MSG - SET": {
"main": [
[
{
"node": "LOAD CONTACT",
"type": "main",
"index": 0
}
]
]
},
"IS THERE CONTACT ON CHATWOOT?": {
"main": [
[
{
"node": "EXISTING CONTACT CODE",
"type": "main",
"index": 0
}
],
[
{
"node": "CREATE CONTACT",
"type": "main",
"index": 0
}
]
]
},
"When Executed by Another Workflow": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"IS THERE CONVERSATION ON CHATWOOT?": {
"main": [
[
{
"node": "EXISTING CONVERSATION CODE",
"type": "main",
"index": 0
}
],
[
{
"node": "CREATE CONVERSATION",
"type": "main",
"index": 0
}
]
]
},
"WAS IT THE NUMBER ITSELF THAT IS CONNECTED TO EVOLUTION THAT SENT THE MESSAGE?": {
"main": [
[
{
"node": "SEND OUTGOING MESSAGE",
"type": "main",
"index": 0
}
],
[
{
"node": "SEND INCOMING MESSAGE",
"type": "main",
"index": 0
}
]
]
}
}
}
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.
chatwootApievolutionApipostgresredis
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Automates the forwarding of messages from WhatsApp (via Evolution API) to Chatwoot, enabling seamless integration between external WhatsApp users and internal Chatwoot agents. It supports both text and media messages, ensuring that customer conversations are centralized and…
Source: https://n8n.io/workflows/6988/ — 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.
Template was created in n8n v1.90.2 Execute Sub-workflow Trigger node Chat Trigger node Redis node Postgres node Telegram node HTTP Request node If node, Code node, Edit Fields (Set) Execute Sub-workf
Anyone running support requests through Telegram, Email, Webhooks, and so on who needs a lightweight ticketing system without paying Zendesk prices. Ideal for small teams, freelancers, or businesses t
This workflow detects ticket classification events in Beex where the communication channel was WhatsApp, extracts the messages from the interaction, and logs them as activity in the corresponding HubS
Agendamiento_v2. Uses n8n-nodes-evolution-api, redis, httpRequest, executeWorkflowTrigger. Event-driven trigger; 59 nodes.
Pede Ai. Uses httpRequest, telegram, postgres, telegramTrigger. Event-driven trigger; 53 nodes.