Mein Workflow 19
Dies ist ein Support Chatbot-Bereich Automatisierungsworkflow mit 22 Nodes. Hauptsächlich werden If, Code, Switch, SplitInBatches, EvolutionApi und andere Nodes verwendet. Weiterleitung von Chatwoot-Nachrichten an WhatsApp via Evolution API mit Mediadatei-Unterstützung
- •Keine besonderen Voraussetzungen, sofort nach Import nutzbar
Verwendete Nodes (22)
Kategorie
{
"id": "Qh4rHuzaTQXDAaEI",
"meta": {
"instanceId": "9701ac1bcc28a7bbd58ce846fc70e46821a295729f112af5fc2c583b18299aa9"
},
"name": "My workflow 19",
"tags": [],
"nodes": [
{
"id": "b4822297-d783-40cd-bf18-1a6f0e6810ff",
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
-3040,
880
],
"parameters": {
"workflowInputs": {
"values": [
{
"name": "nm_instancia_evolution"
},
{
"name": "ds_msg",
"type": "object"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "312e21b2-e354-4e7f-89ae-09e2275b551f",
"name": "Keine Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"position": [
-2128,
896
],
"parameters": {},
"typeVersion": 1
},
{
"id": "6dda1da0-0a6b-437a-8b1a-dbd3741c2b7b",
"name": "Gateway",
"type": "n8n-nodes-base.switch",
"position": [
-1872,
608
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Incoming message",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e1f0b76c-0729-4bfa-9320-51c0212d4052",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Object message').item.json.message_type }}",
"rightValue": "incoming"
}
]
},
"renameOutput": true
},
{
"outputKey": "Outgoing message",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "588062af-c938-4fee-821f-8d2b6fba48cf",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Object message').item.json.message_type }}",
"rightValue": "outgoing"
}
]
},
"renameOutput": true
},
{
"outputKey": "Satisfaction Survey Message",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2b0e5dd4-f690-4e2d-99ec-d583380e4d6a",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Object message').item.json.content_type }}",
"rightValue": "=input_csat"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "d18c977e-b2ac-44a7-b549-e688ee194e89",
"name": "Possui texto?",
"type": "n8n-nodes-base.if",
"position": [
-592,
1216
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f85eee76-5371-44a1-a19f-4741beb1cf30",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $('Object message').first().json.content }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "0f353380-8619-4afe-aaf2-7e8086fe82a4",
"name": "Schalter",
"type": "n8n-nodes-base.switch",
"position": [
-2832,
880
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "NOVA MENSAGEM",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9bf3e1ce-3c66-45b2-900f-187fa3cc41b9",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.ds_msg?.event }}",
"rightValue": "message_created"
}
]
},
"renameOutput": true
},
{
"outputKey": "AGENTE ATRIBUÍDO",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "dae8c81d-0230-47eb-bdf0-6d53551fc648",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.ds_msg?.event }}",
"rightValue": "assignee_changed"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "6ab998d5-482d-4aee-af87-db414f313936",
"name": "Haftnotiz",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1504,
336
],
"parameters": {
"width": 384,
"height": 208,
"content": "## DOES THE MESSAGE CONTAIN A FILE?\n\nChecks if the user is sending any type of file in the message.\n"
},
"typeVersion": 1
},
{
"id": "6424524a-5001-4a8a-994f-697ec1567ef6",
"name": "Haftnotiz1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1984,
400
],
"parameters": {
"width": 336,
"content": "## MESSAGE TYPE\n\nChecks whether the message is an incoming message, outgoing message, or a Chatwoot survey submission.\n"
},
"typeVersion": 1
},
{
"id": "8acb8387-0ba2-403a-aa0d-c8c3ac76362e",
"name": "Haftnotiz2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2432,
400
],
"parameters": {
"width": 336,
"content": "## CHECK IF MESSAGE IS PRIVATE\n\nIf the user is sending a private message, it will not be forwarded to the recipient's WhatsApp.\n"
},
"typeVersion": 1
},
{
"id": "432312be-45da-4166-a231-af60a2e4a9ad",
"name": "Haftnotiz3",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
0
],
"parameters": {
"width": 384,
"height": 208,
"content": "## FILES LOOP\n\nChecks the media type attached to the message received in Chatwoot to ensure the content is correctly sent to WhatsApp using the compatible type in the Evolution API (image, video, document, etc.).\n"
},
"typeVersion": 1
},
{
"id": "78293e7e-5a6f-4922-be9d-73850538d957",
"name": "Haftnotiz4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3120,
672
],
"parameters": {
"width": 336,
"content": "## INPUT\n\nTo use this function, you must provide the Evolution API instance and the JSON body of the message sent by Chatwoot.\n"
},
"typeVersion": 1
},
{
"id": "e7f3356b-89d0-4a41-bab6-11b3f1eb3a56",
"name": "Check if message is private",
"type": "n8n-nodes-base.if",
"position": [
-2336,
640
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f32d9376-a128-42d9-b8e4-15e8b85565f6",
"operator": {
"type": "boolean",
"operation": "false",
"singleValue": true
},
"leftValue": "={{ $json.private }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "ee05ff9e-32ba-44f5-a635-0507571eb359",
"name": "Has attachment?",
"type": "n8n-nodes-base.if",
"position": [
-1456,
624
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c7745c75-0d6a-4339-b756-bed41144bf27",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $json.attachments.length }}",
"rightValue": 0
}
]
}
},
"typeVersion": 2.2
},
{
"id": "eed49873-5ff8-4864-be1e-0c1dbbdb7935",
"name": "Array of attachments",
"type": "n8n-nodes-base.code",
"position": [
-576,
240
],
"parameters": {
"jsCode": "return $input.first().json.attachments;"
},
"typeVersion": 2
},
{
"id": "5e81b55f-631c-4d88-9123-5d2da8672063",
"name": "Send message text",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
880,
1216
],
"parameters": {
"resource": "messages-api",
"remoteJid": "={{ $('Object message').first().json.conversation.meta.sender.phone_number }}",
"messageText": "={{ $('Object message').first().json.content }}",
"instanceName": "={{ $('When Executed by Another Workflow').first().json.nm_instancia_evolution }}",
"options_message": {
"delay": 5000,
"quoted": {
"messageQuoted": {
"messageId": "={{ $('Object message').item.json.content_attributes.in_reply_to_external_id.split(':')[1] }}"
}
}
}
},
"typeVersion": 1
},
{
"id": "31b9f881-e48e-4ba1-8594-f4461cf7059a",
"name": "Send video message",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
880,
960
],
"parameters": {
"media": "={{ $json.data_url }}",
"resource": "messages-api",
"operation": "send-video",
"remoteJid": "={{ $('Object message').first().json.conversation.meta.sender.phone_number }}",
"instanceName": "={{ $('When Executed by Another Workflow').first().json.nm_instancia_evolution }}",
"options_message": {
"quoted": {
"messageQuoted": {
"messageId": "={{ $('Object message').item.json.content_attributes.in_reply_to_external_id.split(':')[1] }}"
}
}
}
},
"typeVersion": 1
},
{
"id": "45454744-a936-4992-b656-fabb4e96e085",
"name": "Send audio message",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
896,
736
],
"parameters": {
"media": "={{ $json.data_url }}",
"resource": "messages-api",
"operation": "send-audio",
"remoteJid": "={{ $('Object message').first().json.conversation.meta.sender.phone_number }}",
"instanceName": "={{ $('When Executed by Another Workflow').first().json.nm_instancia_evolution }}",
"options_message": {
"delay": 1200
}
},
"typeVersion": 1
},
{
"id": "c90e33a2-de5e-4bbb-ae44-30040f94ecc6",
"name": "Send image message",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
896,
528
],
"parameters": {
"media": "={{ $json.data_url }}",
"caption": "={{ $('Object message').first().json.content }}",
"resource": "messages-api",
"operation": "send-image",
"remoteJid": "={{ $('Object message').first().json.conversation.meta.sender.phone_number }}",
"instanceName": "={{ $('When Executed by Another Workflow').first().json.nm_instancia_evolution }}",
"options_message": {
"quoted": {
"messageQuoted": {
"messageId": "={{ $('Object message').item.json.content_attributes.in_reply_to_external_id.split(':')[1] }}"
}
}
}
},
"typeVersion": 1
},
{
"id": "df9cb908-9b6e-42f3-b5ed-3fc5e416580d",
"name": "Send document message",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
896,
304
],
"parameters": {
"media": "={{ $json.data_url }}",
"caption": "={{ $('Object message').first().json.content }}",
"fileName": "={{ decodeURIComponent($json.data_url.split('/').pop()) }}",
"resource": "messages-api",
"operation": "send-document",
"remoteJid": "={{ $('Object message').first().json.conversation.meta.sender.phone_number }}",
"instanceName": "={{ $('When Executed by Another Workflow').first().json.nm_instancia_evolution }}",
"options_message": {
"quoted": {
"messageQuoted": {
"messageId": "={{ $('Object message').item.json.content_attributes.in_reply_to_external_id.split(':')[1] }}"
}
}
}
},
"typeVersion": 1
},
{
"id": "9dd6f7a1-dd6f-4095-95a3-dbeb46c65d18",
"name": "Check attachment file type",
"type": "n8n-nodes-base.switch",
"position": [
208,
256
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "File (PDF, Word, Excel and etc...)",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "af3b3471-982c-4903-a340-80657b66d4cc",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.file_type }}",
"rightValue": "file"
}
]
},
"renameOutput": true
},
{
"outputKey": "Image ",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "0e5902d4-1cb0-4334-9abf-29397a078c73",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.file_type }}",
"rightValue": "image"
}
]
},
"renameOutput": true
},
{
"outputKey": "Audio",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c23ed758-1739-4595-ba8b-b1b0af3c00c1",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "=FixedExpression{{ $json.file_type }}FixedExpressionRename Output FixedExpressionOutput Name FixedExpression{{ $json.file_type }}",
"rightValue": "audio"
}
]
},
"renameOutput": true
},
{
"outputKey": "Video",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "6e3b2557-0b88-432b-a9ec-1f0adb83b790",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.file_type }}",
"rightValue": "video"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "d304f7ca-685d-4c20-a400-c9e62e6c2850",
"name": "Loop array of attachments",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-16,
240
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "5acb48f5-17e2-46ad-b42a-ad456629039e",
"name": "Object message",
"type": "n8n-nodes-base.code",
"position": [
-2560,
640
],
"parameters": {
"jsCode": "let res = $('When Executed by Another Workflow').first().json.ds_msg;\n\nreturn res;"
},
"typeVersion": 2
},
{
"id": "dbd8e3fe-deb9-4677-88df-3f076bfe078f",
"name": "Send text - Satisfaction Survey (Link chatwoot)",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
-1568,
1056
],
"parameters": {
"resource": "messages-api",
"remoteJid": "={{ $('Object message').first().json.conversation.meta.sender.phone_number }}",
"messageText": "={{ $('Object message').first().json.content }}",
"instanceName": "={{ $('When Executed by Another Workflow').first().json.nm_instancia_evolution }}",
"options_message": {}
},
"credentials": {
"evolutionApi": {
"id": "KO9PVs8kvAt2hWOa",
"name": "Evolution account 2"
}
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "7726f27a-9101-465e-9610-d3d11a4b0787",
"connections": {
"Switch": {
"main": [
[
{
"node": "5acb48f5-17e2-46ad-b42a-ad456629039e",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"6dda1da0-0a6b-437a-8b1a-dbd3741c2b7b": {
"main": [
[],
[
{
"node": "ee05ff9e-32ba-44f5-a635-0507571eb359",
"type": "main",
"index": 0
}
],
[
{
"node": "dbd8e3fe-deb9-4677-88df-3f076bfe078f",
"type": "main",
"index": 0
}
]
]
},
"d18c977e-b2ac-44a7-b549-e688ee194e89": {
"main": [
[
{
"node": "5e81b55f-631c-4d88-9123-5d2da8672063",
"type": "main",
"index": 0
}
]
]
},
"5acb48f5-17e2-46ad-b42a-ad456629039e": {
"main": [
[
{
"node": "e7f3356b-89d0-4a41-bab6-11b3f1eb3a56",
"type": "main",
"index": 0
}
]
]
},
"ee05ff9e-32ba-44f5-a635-0507571eb359": {
"main": [
[
{
"node": "eed49873-5ff8-4864-be1e-0c1dbbdb7935",
"type": "main",
"index": 0
}
],
[
{
"node": "d18c977e-b2ac-44a7-b549-e688ee194e89",
"type": "main",
"index": 0
}
]
]
},
"45454744-a936-4992-b656-fabb4e96e085": {
"main": [
[
{
"node": "d304f7ca-685d-4c20-a400-c9e62e6c2850",
"type": "main",
"index": 0
}
]
]
},
"c90e33a2-de5e-4bbb-ae44-30040f94ecc6": {
"main": [
[
{
"node": "d304f7ca-685d-4c20-a400-c9e62e6c2850",
"type": "main",
"index": 0
}
]
]
},
"31b9f881-e48e-4ba1-8594-f4461cf7059a": {
"main": [
[
{
"node": "d304f7ca-685d-4c20-a400-c9e62e6c2850",
"type": "main",
"index": 0
}
]
]
},
"eed49873-5ff8-4864-be1e-0c1dbbdb7935": {
"main": [
[
{
"node": "d304f7ca-685d-4c20-a400-c9e62e6c2850",
"type": "main",
"index": 0
}
]
]
},
"df9cb908-9b6e-42f3-b5ed-3fc5e416580d": {
"main": [
[
{
"node": "d304f7ca-685d-4c20-a400-c9e62e6c2850",
"type": "main",
"index": 0
}
]
]
},
"d304f7ca-685d-4c20-a400-c9e62e6c2850": {
"main": [
[],
[
{
"node": "9dd6f7a1-dd6f-4095-95a3-dbeb46c65d18",
"type": "main",
"index": 0
}
]
]
},
"9dd6f7a1-dd6f-4095-95a3-dbeb46c65d18": {
"main": [
[
{
"node": "df9cb908-9b6e-42f3-b5ed-3fc5e416580d",
"type": "main",
"index": 0
}
],
[
{
"node": "c90e33a2-de5e-4bbb-ae44-30040f94ecc6",
"type": "main",
"index": 0
}
],
[
{
"node": "45454744-a936-4992-b656-fabb4e96e085",
"type": "main",
"index": 0
}
],
[
{
"node": "31b9f881-e48e-4ba1-8594-f4461cf7059a",
"type": "main",
"index": 0
}
]
]
},
"e7f3356b-89d0-4a41-bab6-11b3f1eb3a56": {
"main": [
[
{
"node": "6dda1da0-0a6b-437a-8b1a-dbd3741c2b7b",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"b4822297-d783-40cd-bf18-1a6f0e6810ff": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
}
}
}Wie verwende ich diesen Workflow?
Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.
Für welche Szenarien ist dieser Workflow geeignet?
Experte - Support-Chatbot
Ist es kostenpflichtig?
Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.
Verwandte Workflows
Thiago Vazzoler Loureiro
@thiagovazzolerBuilding Custom Automations with n8n | Node.js Developer | Integration Specialist | Open Source Contributor If you need help with n8n workflows, API integrations, or custom nodes, feel free to connect on LinkedIn: http://linkedin.com/in/thiago-vazzoler-loureiro-24056227
Diesen Workflow teilen