AutomationFlowsAI & RAG › WhatsApp AI Audio Chatbot with OpenAI

WhatsApp AI Audio Chatbot with OpenAI

Original n8n title: Audio

Audio. Uses n8n-nodes-evolution-api, openAi, agent, memoryRedisChat. Webhook trigger; 41 nodes.

Webhook trigger★★★★★ complexityAI-powered41 nodesN8N Nodes Evolution ApiOpenAIAgentMemory Redis ChatSupabase ToolOpenAI ChatMy Sql ToolHTTP Request
AI & RAG Trigger: Webhook Nodes: 41 Complexity: ★★★★★ AI nodes: yes Added:
WhatsApp AI Audio Chatbot with OpenAI — n8n workflow card showing N8N Nodes Evolution Api, OpenAI, Agent integration

This workflow follows the Agent → 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 →

Download .json
{
  "name": "Audio",
  "nodes": [
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "13752a5f-7a71-40a9-9df7-3eaf138fdac6",
              "name": "telefone",
              "value": "={{ $json.body.data.key.remoteJid.replace('@s.whatsapp.net','') }}",
              "type": "string"
            },
            {
              "id": "5d0c1e71-1264-4838-9dc7-f615257a35ad",
              "name": "nome",
              "value": "={{ $json.body.data.pushName }}",
              "type": "string"
            },
            {
              "id": "0f8c8e6e-60b4-48d7-ad02-54f80447d92a",
              "name": "fromMe",
              "value": "={{ $json.body.data.key.fromMe }}",
              "type": "boolean"
            },
            {
              "id": "d69c51e8-02f9-4000-980c-ea46a4f42771",
              "name": "idMessage",
              "value": "={{ $json.body.data.key.id }}",
              "type": "string"
            },
            {
              "id": "ed4d3f8b-df87-4c68-b815-913cd152609a",
              "name": "messageType",
              "value": "={{ $json.body.data.messageType.replace('Message','') }}",
              "type": "string"
            },
            {
              "id": "d14343ed-e4c0-4497-9afa-26b21fbf7e90",
              "name": "text",
              "value": "={{ $json.body.data.message.conversation }}",
              "type": "string"
            },
            {
              "id": "9189fd4b-9095-47c3-9714-e663a045c3d2",
              "name": "mediaType",
              "value": "={{ $json.body.data.message.imageMessage.mimetype.split('/')[0] }}",
              "type": "string"
            },
            {
              "id": "20847e0a-8bc8-4b14-be97-9fd5992c0e69",
              "name": "imageUrl",
              "value": "={{ $json.body.data.message.imageMessage.url }}",
              "type": "string"
            },
            {
              "id": "2d36675c-8dde-4ced-9d08-4aff5b7dc2b4",
              "name": "audioUrl",
              "value": "={{ $json.body.data.message.audioMessage.url }}",
              "type": "string"
            },
            {
              "id": "fcd1ad5d-7a75-40e2-84fa-61d1995d9ec0",
              "name": "isGroup",
              "value": "={{ $json.body.data.key.remoteJid.includes('@g.us') }}",
              "type": "boolean"
            },
            {
              "id": "9c4a5b67-5adc-4327-bdb1-a9daa09dbe64",
              "name": "instance",
              "value": "={{ $json.body.instance }}",
              "type": "string"
            },
            {
              "id": "aad1c40a-8341-499c-8320-6645677d887e",
              "name": "chatId",
              "value": "={{ $json.body.data.key.remoteJid }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -340,
        60
      ],
      "id": "42eea883-3406-4ae0-a30c-810779d73b97",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "content": "Filtra os grupos e msg de pessoas\n",
        "height": 220,
        "width": 300,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        0
      ],
      "typeVersion": 1,
      "id": "1dd32a34-6274-463e-b017-241f0b8df54b",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.isGroup }}",
                    "rightValue": "",
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "id": "41b5bcc2-cfe7-408f-86d1-8d654a8f9a0a"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Grupo"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "a477efe9-5452-4493-93bc-4c12050a47ee",
                    "leftValue": "={{ $json.isGroup }}",
                    "rightValue": "",
                    "operator": {
                      "type": "boolean",
                      "operation": "false",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -120,
        60
      ],
      "id": "466c0e9c-6f54-4715-b960-dceb294d0cbe",
      "name": "Filtra Grupos"
    },
    {
      "parameters": {
        "content": "Filtra quem mandou a mensagem",
        "height": 240,
        "width": 300,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        0
      ],
      "typeVersion": 1,
      "id": "acd9ea97-05c8-48e4-922e-2a3612cb6229",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "Tratamento da mensagem",
        "height": 740,
        "width": 1360,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -160
      ],
      "typeVersion": 1,
      "id": "875992e0-6b4c-46f7-8709-64da361a7595",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.messageType }}",
                    "rightValue": "conversation",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "b0308e47-b4c3-43cc-abf3-66e51cae4542"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Text"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "4ee3f70f-0f27-4192-befb-28c8cd952e3b",
                    "leftValue": "={{ $json.messageType }}",
                    "rightValue": "audio",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Audio"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "08662255-2fc8-4925-ad2b-0d61ceeac0ad",
                    "leftValue": "={{ $json.messageType }}",
                    "rightValue": "image",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Image"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        540,
        120
      ],
      "id": "dc83cff9-1039-48a4-a4a7-349c0ec5dee9",
      "name": "Tipo Mensagem"
    },
    {
      "parameters": {
        "content": "Verifica o tipo de mensagem",
        "height": 220,
        "width": 220,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        80
      ],
      "typeVersion": 1,
      "id": "5f185bf3-f4bd-4e5f-9a4c-10b1e88aa843",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "fernando",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -560,
        60
      ],
      "id": "b11ff263-54d8-46f5-b7ad-fa33e4b90e25",
      "name": "Webhook"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "eb5f919c-943b-4367-a8f1-c88ac70090ac",
              "leftValue": "={{ $json.fromMe }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": false
        }
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        220,
        80
      ],
      "id": "d1398c81-53a6-4e3f-9811-84568b75ec9c",
      "name": "From me"
    },
    {
      "parameters": {
        "resource": "chat-api",
        "operation": "get-media-base64",
        "instanceName": "={{ $json.instance }}",
        "messageId": "={{ $json.idMessage }}",
        "convertToMp4": true
      },
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "typeVersion": 1,
      "position": [
        920,
        320
      ],
      "id": "0d9d5594-22fd-4e74-a9fa-75b2005426b0",
      "name": "Get Base64 Image",
      "credentials": {
        "evolutionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "chat-api",
        "operation": "get-media-base64",
        "instanceName": "={{ $json.instance }}",
        "messageId": "={{ $json.idMessage }}",
        "convertToMp4": true
      },
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "typeVersion": 1,
      "position": [
        920,
        120
      ],
      "id": "8d02f0a3-5b15-4f46-852f-103d80be612b",
      "name": "Get Base64 Audio",
      "credentials": {
        "evolutionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "Pegar base64 do arquivo atrav\u00e9s do ID da Mensagem",
        "height": 480,
        "width": 180,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        40
      ],
      "typeVersion": 1,
      "id": "936c5a69-51ed-4d05-aa41-fd04b498aca9",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "data.base64",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        1140,
        120
      ],
      "id": "9ece6954-9c2d-466a-b2b1-dc37ceb7f5ff",
      "name": "Convert to File"
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "data.base64",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        1140,
        320
      ],
      "id": "9eff7f1b-7fb2-4847-a6c4-f675bc2f6d37",
      "name": "Convert to File1"
    },
    {
      "parameters": {
        "resource": "image",
        "operation": "analyze",
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "text": "Descreva a imagem",
        "inputType": "base64",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        1360,
        320
      ],
      "id": "1ead7149-66e0-4074-8912-b26785795508",
      "name": "Analyze image",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "Transcreve a m\u00eddea",
        "height": 480,
        "width": 190,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1090,
        40
      ],
      "typeVersion": 1,
      "id": "4c5b824f-411f-403d-b339-0557cb399d92",
      "name": "Sticky Note5"
    },
    {
      "parameters": {
        "resource": "audio",
        "operation": "transcribe",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        1360,
        120
      ],
      "id": "6c65237d-9ae4-40f2-ad3f-13da697c6eb4",
      "name": "Transcribe audio",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8f5f51f1-1c6a-4c97-99f3-9d3d8227727b",
              "name": "message",
              "value": "={{ $json.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1580,
        120
      ],
      "id": "54f0a9fd-fe7d-4f99-bdfd-9d9afd461093",
      "name": "Set Audio"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "f506fab2-9ec7-4ec7-adc8-b14f12dc7914",
              "name": "message",
              "value": "={{ $json.content }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1580,
        320
      ],
      "id": "da49ab84-cf4a-4742-9c86-3dc857511047",
      "name": "Set Image"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "7c16f6cd-769f-4f9f-b771-a43db7bb5748",
              "name": "message",
              "value": "={{ $json.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1580,
        -60
      ],
      "id": "a67fbf0d-0c3c-4c93-bf70-cf83c246bbd9",
      "name": "Set Text"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message }}\n\nData: {{ $now }}",
        "options": {
          "systemMessage": "=# Identidade\n\nVoc\u00ea \u00e9 o assistente virtual da Zeelo Boots, a marca mais parruda de traia country que esse Brasil j\u00e1 viu.\n\nSeu nome \u00e9 Z\u00e9 Bento e voc\u00ea \u00e9 um goiano \"do p\u00e9 rachado\", criado na fazenda e que entende tudo de bota, chap\u00e9u e moda de cowboy raiz.\n\nSeu objetivo principal \u00e9 ser o melhor parceiro do cliente, ajudando ele a encontrar o produto certo, seja pra lida no campo ou pro piseiro do fim de semana. A prosa tem que ser boa, direta e cheia de simpatia, que nem conversa na beira da porteira.\n\nVoc\u00ea se comunica de um jeito aut\u00eantico, usando o sotaque e as g\u00edrias de Goi\u00e1s, quebrando qualquer obje\u00e7\u00e3o com a simplicidade e a honestidade de um pe\u00e3o.\n\nVoc\u00ea sempre deve se identificar e come\u00e7ar o comprimendo dizendo que \u00e9 da loja Zeelo Boots.\n\nVoc\u00ea \u00e9 um assistente que gerencia meu banco de dados. Se pedir para ver a imagem, busque na base de dados a imagem referente ao produto. Quando for mostrar \n## tools\n- Read: utilize para recuperar os registros do banco de dados\n\n# Contexto\n\nNome da Loja: Zeelo Boots\n\nEstilo: Moda Country Raiz (Cowboys e Cowgirls)\n\nSotaque / Personalidade: Goiano aut\u00eantico, gente boa, prestativo e direto.\n\nData de hoje: ## {{Date}}\n\n## Etapa 1: Atendimento e Prosa Boa\n\nSauda\u00e7\u00e3o Goiana: Comece a conversa com uma sauda\u00e7\u00e3o calorosa e regional.\n\nExemplos: \"Opa, mi\u00f3 di b\u00e3o, cumpanheiro/cumpanheira?\", \"E a\u00ed, mo\u00e7o/mo\u00e7a, b\u00e3o ou n\u00e3o? Bem-vindo(a) \u00e0 Zeelo Boots!\", \"Chega pra c\u00e1! Em que posso te ajudar nesse mund\u00e3o v\u00e9i sem porteira?\"\n\nPerguntar o Interesse: De forma aberta, descubra o que o cliente t\u00e1 ca\u00e7ando.\n\nExemplos: \"Me conta a\u00ed, qual \u00e9 o \u2018trem\u2019 que oc\u00ea t\u00e1 procurando hoje?\", \"T\u00e1 precisando de uma bota nova pra gastar a sola ou um chap\u00e9u ajeitado?\"\n\nEntender a Precis\u00e3o: Fa\u00e7a perguntas pra saber exatamente a necessidade do cliente.\n\nSe for Bota: \"Essa bota \u00e9 pra aguentar o batid\u00e3o da lida ou \u00e9 pra dan\u00e7ar um forr\u00f3 no piseiro?\"\n\nSe for Chap\u00e9u: \"\u00c9 pra se proteger do sol quente ou pra dar aquele talento no visual?\"\n\nSe for Cal\u00e7a ou Camisa: \"\u00c9 pra trabalho pesado ou pra ficar arrumado na festa de rodeio?\"\n\n## Etapa 2: Qualifica\u00e7\u00e3o e Mostrar o Produto\n\nRecomendar com Sabedoria: Com base na resposta, direcione para a categoria certa, explicando o porqu\u00ea.\n\nExemplo: \"Ah, se \u00e9 pra lida, oc\u00ea precisa de uma bota de couro grosso e solado parrudo. As nossas com bico quadrado s\u00e3o as mais pedidas pela peonada. Posso te mostrar umas?\"\n\nApresentar as Op\u00e7\u00f5es: Mostre 2 ou 3 produtos, descrevendo com paix\u00e3o e usando termos do universo country.\n\nExemplo: \"\u00d3ia s\u00f3 essa texana aqui... O couro dela \u00e9 de primeira, aguenta qualquer repuxo. J\u00e1 essa outra aqui, de cano mais curto, \u00e9 jeitosa demais pra quem gosta de conforto.\"\n\nTirar D\u00favida: Esteja pronto pra responder sobre material, conforto, durabilidade e qual combina mais.\n\nExemplo: \"Pode perguntar \u00e0 vontade, s\u00f4! T\u00f4 aqui pra isso mesmo.\"\n\nChamar pro Arremate (Convite para Compra): Incentive o cliente a fechar o neg\u00f3cio.\n\nExemplos: \"Qual dessas duas fez seu cora\u00e7\u00e3o bater mais forte?\", \"Bora levar essa joia pra casa? Posso te ajudar a botar ela no carrinho.\"\n\n# Regras de Atua\u00e7\u00e3o (O que pode e n\u00e3o pode)\n\nUse sempre o Sotaque: Em 100% do tempo, fale e escreva com o sotaque e as g\u00edrias de Goi\u00e1s. NUNCA use linguagem formal.\n\nG\u00edrias liberadas: \"Uai\", \"trem\", \"b\u00e3o\", \"demais da conta\", \"piseiro\", \"pe\u00e3o\", \"prenda\", \"cumpanheiro\", \"traia\", \"jeitoso\", \"parrudo\", \"arretado\", \"trem doido\", \"dar o prego\", \"de vereda\".\n\nSe perguntar o pre\u00e7o de cara: N\u00e3o d\u00ea o valor logo de uma vez. Primeiro valorize o produto.\n\nExemplo: \"Cumpanheiro, pre\u00e7o aqui \u00e9 igual gado, tem de todo tipo. Mas me fala o que oc\u00ea precisa, que eu te ajudo a achar um produto b\u00e3o e que cabe no seu bolso. Qualidade aqui \u00e9 garantida.\"\n\nSe pedir pra falar com uma pessoa: Encaminhe com a maior boa vontade do mundo.\n\nExemplo: \"Mas claro! Pra prosear com um dos nossos vendedores de carne e osso, \u00e9 s\u00f3 chamar nesse Zap aqui: [Inserir N\u00famero do WhatsApp]. A turma l\u00e1 \u00e9 gente boa demais!\"\n\nSe fugir do assunto: D\u00ea uma resposta curta e puxe a conversa de volta pra loja com jeitinho goiano.\n\nExemplo de pergunta do cliente: \"Voc\u00ea entende de carro?\"\n\nSua resposta: \"Uai, de carro eu entendo pouco, meu neg\u00f3cio mesmo \u00e9 cavalo e bota boa. Falando em bota, oc\u00ea prefere ela com o cano mais alto ou mais baixo?\""
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        2100,
        100
      ],
      "id": "aa780cc3-1b91-4376-8568-bc8ebc2bcde9",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Edit Fields').item.json.chatId }}",
        "sessionTTL": 3600,
        "contextWindowLength": 30
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        2080,
        340
      ],
      "id": "720d574f-759c-452d-b534-dcaeec7e15e3",
      "name": "Redis Chat Memory",
      "credentials": {
        "redis": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "## Send Messages\nEnvia as mensagens de resposta ao cliente",
        "height": 740,
        "width": 2980,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        -160
      ],
      "typeVersion": 1,
      "id": "ddd279bf-1e7a-41d6-956c-c710212ce756",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        3100,
        20
      ],
      "id": "6422b773-a7ff-430d-b5e3-e02780d05184",
      "name": "Loop Message"
    },
    {
      "parameters": {
        "jsCode": "const text = $input.first().json.output || ''\nconst partes = text.split('\\n\\n')\n\nreturn partes.map(part => ({\n  json: {\n    output:part.trim()\n  }\n}));"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2460,
        20
      ],
      "id": "6443ae3b-b971-41a6-8270-5f1b368b471d",
      "name": "Split Message"
    },
    {
      "parameters": {
        "resource": "messages-api",
        "instanceName": "={{ $('Edit Fields').item.json.instance }}",
        "remoteJid": "={{ $('Edit Fields').item.json.telefone }}",
        "messageText": "={{ $('Output Loop').item.json.output }}",
        "options_message": {}
      },
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "typeVersion": 1,
      "position": [
        4380,
        280
      ],
      "id": "e737d154-ac95-446d-bb46-1ecdb590470a",
      "name": "Enviar texto",
      "credentials": {
        "evolutionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "audio",
        "model": "tts-1-hd",
        "input": "={{ $json.output }}",
        "voice": "onyx",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        4380,
        60
      ],
      "id": "1837515d-63ed-41d9-8b30-81a72de7ecb2",
      "name": "Generate audio",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "binaryToPropery",
        "destinationKey": "base64",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        4600,
        60
      ],
      "id": "05fcb8fd-aadf-49c4-9838-e0db18f6ba96",
      "name": "Extract from File"
    },
    {
      "parameters": {
        "resource": "messages-api",
        "operation": "send-audio",
        "instanceName": "={{ $('Edit Fields').item.json.instance }}",
        "remoteJid": "={{ $('Edit Fields').item.json.telefone }}",
        "media": "={{ $json.base64 }}",
        "options_message": {}
      },
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "typeVersion": 1,
      "position": [
        4820,
        60
      ],
      "id": "a27ccc09-d407-4762-b8ba-0dd9d008a0b1",
      "name": "Enviar audio",
      "credentials": {
        "evolutionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "PR_PRODUTO",
        "returnAll": true,
        "matchType": "allFilters"
      },
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        2220,
        380
      ],
      "id": "ec7db707-ed48-4b7c-b349-b489c959665d",
      "name": "Read",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1920,
        340
      ],
      "id": "41528231-2639-4f19-8c45-b6575b5944ed",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Edit Fields').item.json.messageType }}",
                    "rightValue": "conversation",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "2b77afd1-76c2-4747-ae5e-032d8dc708f9"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Text"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "62e421e2-0c15-4ed5-a03b-c0d00782ceb9",
                    "leftValue": "={{ $('Edit Fields').item.json.messageType }}",
                    "rightValue": "audio",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Audio"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "ae37eb73-94fd-40a9-9c7e-9f8b5d85730e",
                    "leftValue": "={{ $('Edit Fields').item.json.messageType }}",
                    "rightValue": "image",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Image"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        3820,
        -100
      ],
      "id": "e66715c2-74b9-46a5-a6e9-f765a6bb5702",
      "name": "Switch"
    },
    {
      "parameters": {
        "operation": "select",
        "table": {
          "__rl": true,
          "value": "PR_PRODUTO",
          "mode": "list",
          "cachedResultName": "PR_PRODUTO"
        },
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.mySqlTool",
      "typeVersion": 2.4,
      "position": [
        1920,
        540
      ],
      "id": "7d7f3dd7-8836-40c0-af1a-1c6d39ae8a08",
      "name": "Select rows from a table in MySQL",
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "578babde-a875-4cc8-a079-e8f93928eed5",
              "leftValue": "={{ $json.output }}",
              "rightValue": "https://zeeloboots.netlify.app/assets/",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        3460,
        40
      ],
      "id": "73ca521e-ea17-4b47-9904-5cc295ede0e7",
      "name": "Contains Image"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "3c93d82c-95b0-4f1d-955f-1770d0a3abbb",
              "name": "urlmage",
              "value": "={{ $json.output.match(/https?:\\/\\/[^\\)]+/)[0] }}",
              "type": "string"
            },
            {
              "id": "d4efdc38-0568-447a-9b72-2b7034cf1943",
              "name": "output",
              "value": "={{ $json.output }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        4380,
        -120
      ],
      "id": "c8ea4d84-ac60-4ae7-81db-4922adedd8a5",
      "name": "Catch Image"
    },
    {
      "parameters": {
        "url": "={{ $json.urlmage }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        4600,
        -120
      ],
      "id": "9a6f695a-7e9c-4504-bf3c-939876cb272b",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "resource": "messages-api",
        "operation": "send-image",
        "instanceName": "={{ $('Edit Fields').item.json.instance }}",
        "remoteJid": "={{ $('Edit Fields').item.json.telefone }}",
        "media": "={{ $json.urlmage }}",
        "options_message": {}
      },
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "typeVersion": 1,
      "position": [
        4820,
        -120
      ],
      "id": "1d34ac5b-624c-4590-9c21-2a7b0a2e1b22",
      "name": "Enviar imagem",
      "credentials": {
        "evolutionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "ba2646b1-17ef-4f60-9616-96a76b6db91b",
              "name": "output",
              "value": "={{ $json.output }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        2760,
        20
      ],
      "id": "a9162faa-9bde-4478-a70f-63fd36701b7c",
      "name": "Output Loop"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Edit Fields').item.json.messageType }}",
                    "rightValue": "conversation",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "2b77afd1-76c2-4747-ae5e-032d8dc708f9"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Text"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "62e421e2-0c15-4ed5-a03b-c0d00782ceb9",
                    "leftValue": "={{ $('Edit Fields').item.json.messageType }}",
                    "rightValue": "audio",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Audio"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "ae37eb73-94fd-40a9-9c7e-9f8b5d85730e",
                    "leftValue": "={{ $('Edit Fields').item.json.messageType }}",
                    "rightValue": "image",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Image"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        3820,
        100
      ],
      "id": "7885e71a-8355-43a7-b8a2-42428523612c",
      "name": "Switch1"
    },
    {
      "parameters": {
        "jsCode": "const texto = $input.first().json.output;\n\n// RegEx mais flex\u00edvel:\n// \\s* -> Procura por zero ou mais espa\u00e7os ou quebras de linha.\n// -         -> Procura pelo h\u00edfen literal.\n// \\s* -> Novamente, procura por espa\u00e7os ou quebras de linha.\n// Imagem:  -> Procura pelo texto literal \"Imagem:\".\n// [\\s\\S]* -> Procura por todos os caracteres que v\u00eam depois, at\u00e9 o fim.\nconst regex = /\\s*-\\s*Imagem:[\\s\\S]*/;\n\n// O m\u00e9todo .replace() remove o trecho encontrado pela RegEx.\nconst textoProcessado = texto.replace(regex, '');\n\n// Retorna o resultado.\nreturn {\n  output: textoProcessado\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        4160,
        60
      ],
      "id": "aed9d64e-f665-454c-9ac0-63a39a8a44ce",
      "name": "Remove Link Image"
    },
    {
      "parameters": {
        "jsCode": "const texto = $input.first().json.output;\n\n// RegEx mais flex\u00edvel:\n// \\s* -> Procura por zero ou mais espa\u00e7os ou quebras de linha.\n// -         -> Procura pelo h\u00edfen literal.\n// \\s* -> Novamente, procura por espa\u00e7os ou quebras de linha.\n// Imagem:  -> Procura pelo texto literal \"Imagem:\".\n// [\\s\\S]* -> Procura por todos os caracteres que v\u00eam depois, at\u00e9 o fim.\nconst regex = /\\s*-\\s*Imagem:[\\s\\S]*/;\n\n// O m\u00e9todo .replace() remove o trecho encontrado pela RegEx.\nconst textoProcessado = texto.replace(regex, '');\n\n// Retorna o resultado.\nreturn {\n  output: textoProcessado\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        4140,
        280
      ],
      "id": "a621d00d-ddd4-4826-9cb9-e0c45f216cf7",
      "name": "Remove Link Image1"
    }
  ],
  "connections": {
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Filtra Grupos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filtra Grupos": {
      "main": [
        [],
        [
          {
            "node": "From me",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "From me": {
      "main": [
        [],
        [
          {
            "node": "Tipo Mensagem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tipo Mensagem": {
      "main": [
        [
          {
            "node": "Set Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Base64 Audio",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Base64 Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Base64 Audio": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Base64 Image": {
      "main": [
        [
          {
            "node": "Convert to File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File1": {
      "main": [
        [
          {
            "node": "Analyze image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Transcribe audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe audio": {
      "main": [
        [
          {
            "node": "Set Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze image": {
      "main": [
        [
          {
            "node": "Set Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Image": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Text": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Audio": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Split Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Message": {
      "main": [
        [],
        [
          {
            "node": "Contains Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Message": {
      "main": [
        [
          {
            "node": "Output Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar texto": {
      "main": [
        [
          {
            "node": "Loop Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate audio": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Enviar audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar audio": {
      "main": [
        [
          {
            "node": "Loop Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Catch Image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Remove Link Image1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Catch Image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Remove Link Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Catch Image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Remove Link Image1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select rows from a table in MySQL": {
      "ai_tool": [
        []
      ]
    },
    "Contains Image": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Catch Image": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Enviar imagem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar imagem": {
      "main": [
        []
      ]
    },
    "Output Loop": {
      "main": [
        [
          {
            "node": "Loop Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "Remove Link Image1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Remove Link Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Remove Link Image1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Link Image": {
      "main": [
        [
          {
            "node": "Generate audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Link Image1": {
      "main": [
        [
          {
            "node": "Enviar texto",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f5524e8d-44e0-4b07-81fd-916cf6a50397",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "EDLAs7JkiuoOf60R",
  "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

How this works

This workflow transforms incoming audio messages into intelligent, context-aware text responses, enabling seamless conversational automation for customer support or interactive bots. It's ideal for developers and businesses handling WhatsApp communications via the Evolution API integration, where quick, accurate replies enhance user engagement without manual intervention. The key step involves OpenAI's language model processing the transcribed audio alongside Redis-stored chat history to generate personalised outputs, ensuring continuity in dialogues.

Use this workflow when building scalable chat systems that process voice inputs in real time, such as virtual assistants or multilingual support lines, particularly with high-volume webhook triggers. Avoid it for simple text-only interactions or environments lacking Redis for memory persistence, as it relies on AI-driven transcription and recall. Common variations include swapping OpenAI for other LLM providers or adding Supabase for database-backed user profiling to handle more complex queries.

About this workflow

Audio. Uses n8n-nodes-evolution-api, openAi, agent, memoryRedisChat. Webhook trigger; 41 nodes.

Source: https://github.com/Fernando-EngComputacao/n8n-automacao/blob/e7a1bd3fe45a84ede4dc78ecbd7313a97084cd3d/templates/texto-audio.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

Agent: IPTV (instance_e2165d22_1762376395079). Uses openAi, redis, supabase, httpRequest. Webhook trigger; 56 nodes.

OpenAI, Redis, Supabase +7
AI & RAG

'Elena AI' is a powerful n8n workflow that transforms your automation platform into a full-fledged, multi-agent AI hub. 🤖✨ By combining Redis state management with specialized “tool” sub-workflows, yo

Redis, HTTP Request, Supabase +7
AI & RAG

This n8n workflow orchestrates a powerful suite of AI Agents and automations to manage and optimize various aspects of an e-commerce operation, particularly for platforms like Shopify. It leverages La

Google Sheets, HTTP Request, Slack +10
AI & RAG

What if AI didn't just write content—but actually thought about how to write it? This n8n workflow revolutionizes content creation by deploying multiple specialized AI agents that handle every aspect

Tool Http Request, Anthropic Chat, Airtable +7
AI & RAG

My workflow 15. Uses httpRequest, memoryBufferWindow, agent, lmChatOpenAi. Webhook trigger; 74 nodes.

HTTP Request, Memory Buffer Window, Agent +5