AutomationFlowsAI & RAG › Whatsapp Ia Com Audio

Whatsapp Ia Com Audio

WhatsApp IA com Audio. Uses httpRequest, openAiWhisper, memoryBufferWindow, chatOpenAi. Webhook trigger; 13 nodes.

Webhook trigger★★★★☆ complexityAI-powered13 nodesHTTP RequestOpen Ai WhisperMemory Buffer WindowChat Open AiOpen Ai TtsTwilio
AI & RAG Trigger: Webhook Nodes: 13 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the HTTP Request → Memory Buffer Window 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": "WhatsApp IA com Audio",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "whatsapp-webhook",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        -860,
        400
      ],
      "id": "webhook-whatsapp"
    },
    {
      "parameters": {
        "jsCode": "// Extrair dados do webhook incluindo \u00e1udio\nlet message = \"\";\nlet from = \"\";\nlet profileName = \"\";\nlet waId = \"\";\nlet destinatario = \"\";\nlet mediaUrl = \"\";\nlet mediaType = \"\";\n\nconst body = $input.first().json.body || $input.first().json;\n\nif (body.Body) {\n  message = body.Body || \"\";\n  from = body.From || \"\";\n  profileName = body.ProfileName || \"\";\n  waId = body.WaId || \"\";\n  destinatario = body.To;\n  \n  // Verificar se \u00e9 \u00e1udio\n  if (body.MediaUrl0) {\n    mediaUrl = body.MediaUrl0;\n    mediaType = body.MediaContentType0 || \"\";\n  }\n}\n\nreturn [{\n  json: {\n    message: message,\n    from: from,\n    profileName: profileName,\n    waId: \"+\" + waId,\n    destinatario: destinatario,\n    mediaUrl: mediaUrl,\n    mediaType: mediaType,\n    isAudio: mediaType.includes('audio')\n  }\n}];"
      },
      "name": "Extrair Dados",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -640,
        400
      ],
      "id": "extrair-dados"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "leftValue": "={{$json.isAudio}}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ]
        }
      },
      "name": "\u00c9 \u00c1udio?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        -420,
        400
      ],
      "id": "check-audio"
    },
    {
      "parameters": {
        "method": "GET",
        "url": "={{$json.mediaUrl}}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "name": "Baixar \u00c1udio",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        -200,
        300
      ],
      "id": "download-audio",
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "whisper-1",
        "options": {}
      },
      "name": "Transcrever \u00c1udio",
      "type": "@n8n/n8n-nodes-langchain.openAiWhisper",
      "typeVersion": 1,
      "position": [
        20,
        300
      ],
      "id": "transcribe-audio",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Combinar dados do \u00e1udio transcrito\nconst audioData = $input.first().json;\nconst originalData = $node[\"Extrair Dados\"].json;\n\nreturn [{\n  json: {\n    ...originalData,\n    message: audioData.text,\n    isTranscribed: true\n  }\n}];"
      },
      "name": "Processar Transcri\u00e7\u00e3o",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        240,
        300
      ],
      "id": "process-transcription"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.waId}}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        680,
        400
      ],
      "id": "memory",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatOpenAi",
      "typeVersion": 1,
      "position": [
        900,
        400
      ],
      "id": "chat-openai",
      "name": "Message an assistant",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "leftValue": "={{$node[\"Extrair Dados\"].json.isAudio}}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ]
        }
      },
      "name": "Responder com \u00c1udio?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        1120,
        400
      ],
      "id": "check-audio-response"
    },
    {
      "parameters": {
        "model": "tts-1",
        "input": "={{$node[\"Message an assistant\"].json.output}}",
        "voice": "alloy",
        "options": {}
      },
      "name": "Gerar \u00c1udio",
      "type": "@n8n/n8n-nodes-langchain.openAiTts",
      "typeVersion": 1,
      "position": [
        1340,
        300
      ],
      "id": "generate-audio",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "from": "={{$node[\"Webhook\"].json.body.To.replaceAll('whatsapp:', '')}}",
        "to": "={{$node[\"Extrair Dados\"].json.waId}}",
        "toWhatsapp": true,
        "mediaUrl": "={{$node[\"Gerar \u00c1udio\"].json.url}}",
        "options": {}
      },
      "name": "Enviar \u00c1udio",
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        1560,
        300
      ],
      "id": "send-audio",
      "credentials": {
        "twilioApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "from": "={{$node[\"Webhook\"].json.body.To.replaceAll('whatsapp:', '')}}",
        "to": "={{$node[\"Extrair Dados\"].json.waId}}",
        "toWhatsapp": true,
        "message": "={{$node[\"Message an assistant\"].json.output}}",
        "options": {}
      },
      "name": "Enviar Texto",
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        1560,
        500
      ],
      "id": "send-text",
      "credentials": {
        "twilioApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://supabase-server:3001/api/registrar-mensagem",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "whatsappNumero",
              "value": "={{$node[\"Extrair Dados\"].json.from.replace(\"whatsapp:\", \"\")}}"
            },
            {
              "name": "pergunta",
              "value": "={{$node[\"Extrair Dados\"].json.message}}"
            },
            {
              "name": "resposta",
              "value": "={{$node[\"Message an assistant\"].json.output}}"
            },
            {
              "name": "numeroDestino",
              "value": "={{$node[\"Webhook\"].json.body.To.replaceAll('whatsapp:','')}}"
            },
            {
              "name": "nome",
              "value": "={{$node[\"Extrair Dados\"].json.profileName}}"
            },
            {
              "name": "tipoMensagem",
              "value": "={{$node[\"Extrair Dados\"].json.isAudio ? 'audio' : 'texto'}}"
            }
          ]
        }
      },
      "name": "Registrar Mensagem",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1780,
        400
      ],
      "id": "register-message"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Extrair Dados",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extrair Dados": {
      "main": [
        [
          {
            "node": "\u00c9 \u00c1udio?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u00c9 \u00c1udio?": {
      "main": [
        [
          {
            "node": "Baixar \u00c1udio",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Simple Memory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Baixar \u00c1udio": {
      "main": [
        [
          {
            "node": "Transcrever \u00c1udio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcrever \u00c1udio": {
      "main": [
        [
          {
            "node": "Processar Transcri\u00e7\u00e3o",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Processar Transcri\u00e7\u00e3o": {
      "main": [
        [
          {
            "node": "Simple Memory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "main": [
        [
          {
            "node": "Message an assistant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message an assistant": {
      "main": [
        [
          {
            "node": "Responder com \u00c1udio?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Responder com \u00c1udio?": {
      "main": [
        [
          {
            "node": "Gerar \u00c1udio",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Enviar Texto",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gerar \u00c1udio": {
      "main": [
        [
          {
            "node": "Enviar \u00c1udio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar \u00c1udio": {
      "main": [
        [
          {
            "node": "Registrar Mensagem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar Texto": {
      "main": [
        [
          {
            "node": "Registrar Mensagem",
            "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.

Pro

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

About this workflow

WhatsApp IA com Audio. Uses httpRequest, openAiWhisper, memoryBufferWindow, chatOpenAi. Webhook trigger; 13 nodes.

Source: https://github.com/1thays4/painel-clientes-ia-ts/blob/main/workflows/workflow-audio-whatsapp.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

The Ultimate Scraper for n8n uses Selenium and AI to retrieve any information displayed on a webpage. You can also use session cookies to log in to the targeted webpage for more advanced scraping need

OpenAI Chat, HTTP Request, Information Extractor +1
AI & RAG

z-Api. Uses httpRequest, openAi, redis, postgres. Webhook trigger; 61 nodes.

HTTP Request, OpenAI, Redis +4
AI & RAG

How it works: • Receives WhatsApp messages via webhook from Whapi.Cloud • Routes commands: AI chat (/ai), numeric commands (1-9), or help menu • Sends responses: text, images, documents, videos, conta

HTTP Request, OpenAI
AI & RAG

Whatsapp Lead Agent. Uses httpRequest, hunter, @tavily/n8n-nodes-tavily, @mendable/n8n-nodes-firecrawl. Webhook trigger; 35 nodes.

HTTP Request, Hunter, @Tavily/N8N Nodes Tavily +11
AI & RAG

This workflow will allow you to use OpenAI Assistant API together with a chatting platform. This version is configured to work with Hubspot, however, the Hubspot modules can be replaced by other platf

HTTP Request, Airtable, OpenAI