AutomationFlowsAI & RAG › EvolutionAPI Live Message Handler

EvolutionAPI Live Message Handler

Original n8n title: Evolutionapi Live

EvolutionAPI Live. Uses httpRequest, openAi. Webhook trigger; 12 nodes.

Webhook trigger★★★☆☆ complexityAI-powered12 nodesHTTP RequestOpenAI
AI & RAG Trigger: Webhook Nodes: 12 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow follows the HTTP Request → OpenAI 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 →

Download .json
{
  "name": "EvolutionAPI Live",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "id": "a88cacc3-970b-44f1-b381-d74ec724fb1e",
      "name": "MENSAGEM DE TEXTO",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        820,
        160
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "2eb4085c-e5d5-4b0b-9d32-79c9e0a88a62",
      "name": "IMAGEM SEM LEGENDA",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        820,
        340
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "2e5084dc-889d-4c74-8012-72ac9b24bb66",
      "name": "IMAGEM COM LEGENDA",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        820,
        520
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "evolution-live",
        "options": {}
      },
      "id": "57341b5a-318c-4210-8888-f6621f6a3c27",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        480,
        460
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "e42874ed-46eb-4add-8e38-9d6c1126b508",
      "name": "AUDIO",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        820,
        720
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8f16b1bf-1a3e-4029-8d7a-1bccb919ee43",
              "name": "message.message_id",
              "value": "={{ $json.body?.data?.key?.id || '' }}",
              "type": "string"
            },
            {
              "id": "11800d83-ecca-4f9c-a878-a2419db0c8e9",
              "name": "message.chat_id",
              "value": "={{ $json.body.data.key.remoteJid || '' }}",
              "type": "string"
            },
            {
              "id": "c33f9527-e661-49e5-8e5e-64f3b430928a",
              "name": "message.content_type",
              "value": "={{ $json.body.data.message.extendedTextMessage ? 'text' : '' }}{{ $json.body.data.message.conversation ? 'text' : '' }}{{ $json.body.data.message.audioMessage ? 'audio' : '' }}{{ $json.body.data.message.imageMessage ? 'image' : '' }}",
              "type": "string"
            },
            {
              "id": "06eba1c9-cff0-4f68-b6da-6bb0092466b7",
              "name": "message.content",
              "value": "={{ $json.body.data.message.extendedTextMessage?.text || '' }}{{ $json.body.data.message.imageMessage?.caption || '' }}{{ $json.body.data.message.conversation || '' }}",
              "type": "string"
            },
            {
              "id": "b97f1af3-5361-46fc-9303-d644921231d8",
              "name": "message.timestamp",
              "value": "={{ $json.body.data.messageTimestamp.toDateTime('s').toISO() }}",
              "type": "string"
            },
            {
              "id": "dc3dc59c-90a3-4a45-bea2-de092c91083b",
              "name": "message.content_url",
              "value": "={{ $json.body.data.message.audioMessage?.url || '' }}{{ $json.body.data.message.imageMessage?.url || '' }}",
              "type": "string"
            },
            {
              "id": "8b01a818-a456-476e-bace-adefe2f04eb4",
              "name": "message.event",
              "value": "={{ $json.body.data.key.fromMe ? 'outcoming' : 'incoming' }}",
              "type": "string"
            },
            {
              "id": "b2f1f6b5-292f-4695-9e41-be200c6d7053",
              "name": "instance.name",
              "value": "={{ $json.body.instance }}",
              "type": "string"
            },
            {
              "id": "572fcce5-8a26-4e8f-a48a-ef0bee569dcd",
              "name": "instance.apikey",
              "value": "={{ $json.body.apikey }}",
              "type": "string"
            },
            {
              "id": "e90043db-657b-461c-b040-2d6089abfbdb",
              "name": "instance.server_url",
              "value": "={{ $json.body.server_url }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "eb3b97f5-cdac-43f5-82b7-e87cdf98d292",
      "name": "normalizacao",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1120,
        440
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('normalizacao').item.json.instance.server_url }}/chat/getBase64FromMediaMessage/{{ $('normalizacao').item.json.instance.name }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "apikey",
              "value": "={{ $('normalizacao').item.json.instance.apikey }}"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "message.key.id",
              "value": "={{ $json.message.message_id }}"
            },
            {
              "name": "convertToMp4",
              "value": "={{ Boolean(false) }}"
            }
          ]
        },
        "options": {}
      },
      "id": "57eacc0c-0c1c-4152-a732-f5795ad704eb",
      "name": "Get audio base64 EvolutionAPI",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1700,
        740
      ]
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict"
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.message.content_type }}",
                    "rightValue": "audio",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "audio"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict"
                },
                "conditions": [
                  {
                    "id": "a1dfeee8-7927-4419-b091-e5b1930c011e",
                    "leftValue": "={{ $json.message.content_type }}",
                    "rightValue": "text",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "text"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict"
                },
                "conditions": [
                  {
                    "id": "ab4d4cfb-b90f-4fda-96e2-9397e0fbd4c2",
                    "leftValue": "={{ $json.message.content_type }}",
                    "rightValue": "image",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "image"
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "other"
        }
      },
      "id": "76ea90cb-25fc-4847-ac6d-775500ab5b45",
      "name": "Switch Content Type",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3,
      "position": [
        1380,
        440
      ]
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "base64",
        "options": {
          "fileName": "imagem",
          "mimeType": "={{ $json.mimetype }}"
        }
      },
      "id": "d6c3c596-fa3c-4012-8a72-131346127cef",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        1920,
        740
      ]
    },
    {
      "parameters": {
        "resource": "image",
        "operation": "analyze",
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "inputType": "base64",
        "options": {}
      },
      "id": "e2518570-4f7b-41ff-8b83-061e221ab1f1",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.4,
      "position": [
        2120,
        740
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "Alguns tipos de mensagens\n",
        "height": 894.6046511627903,
        "width": 265.88372093023236
      },
      "id": "c3bf99df-6ecb-4da3-9ef3-850c2a50e4eb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        740,
        80
      ]
    },
    {
      "parameters": {
        "content": "Audio para texto\n",
        "height": 336.2558139534884,
        "width": 672.6279069767438
      },
      "id": "37dff657-a2d7-4b2b-8385-df46697e5074",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1640,
        600
      ]
    }
  ],
  "connections": {
    "normalizacao": {
      "main": [
        [
          {
            "node": "Switch Content Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IMAGEM COM LEGENDA": {
      "main": [
        [
          {
            "node": "normalizacao",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get audio base64 EvolutionAPI": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "08975c92-b09a-4dcc-94f6-8d607a6b8cd2",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "lLJPWiYlBv6zE0nd",
  "tags": []
}

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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

EvolutionAPI Live. Uses httpRequest, openAi. Webhook trigger; 12 nodes.

Source: https://github.com/caioross/n8n_Workflows/blob/1686b66af0462dfce267af508b0a487aa5f41e18/workflows/EvolutionAPI_Live.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Lead-Qualifier with BANT+I and Pipedrive (Multi-Provider). Uses stickyNote, n8n-nodes-studiomeyer-memory, openAi, anthropic. Webhook trigger; 28 nodes.

N8N Nodes Studiomeyer Memory, OpenAI, Anthropic +1
AI & RAG

Meeting-Bot Cross-Meeting Continuity (Multi-Provider). Uses stickyNote, n8n-nodes-studiomeyer-memory, openAi, anthropic. Webhook trigger; 28 nodes.

N8N Nodes Studiomeyer Memory, OpenAI, Anthropic +1
AI & RAG

LU. Uses telegram, openAi, httpRequest. Webhook trigger; 28 nodes.

Telegram, OpenAI, HTTP Request
AI & RAG

AI-Powered Fake Review Detection Workflow Using n8n & Airtable. Uses httpRequest, airtable, openAi, slack. Webhook trigger; 27 nodes.

HTTP Request, Airtable, OpenAI +1
AI & RAG

This workflow automates the creation of Journal Entries in SAP Business One (SAP B1). Depending on the source of the input data, it dynamically transforms and sends accounting records in the appropria

HTTP Request, Google Sheets, OpenAI