Erro no evento "MESSAGE_UPSERT" ao utilizar o webhook da instância
Welcome!
- [x] Yes, I have searched for similar issues on GitHub and found none.
What did you do?
Estou tentando configurar um Webhook no n8n que escute o evento "MESSAGE_UPSERT" de uma instância conectada em uma conta do WhatsApp Business.
What did you expect?
Receber um POST no fluxo do n8n e um log de sucesso no container do Evolution
What did you observe instead of what you expected?
Ao realizar o teste com o envio de uma mensagem recebi um erro no log do Evolution ( apresentado mais abaixo )
Screenshots/Videos
No response
Which version of the API are you using?
Versão 2.3.2
What is your environment?
Windows
Other environment specifications
Docker
If applicable, paste the log output
PrismaClientValidationError:
Invalid `this.cache.delete()` invocation in
/evolution/dist/main.js:227:33183
224 `),n.url&&(i+=`URL:${n.url}
225 `),n.wuid||(n.wuid=J(n.phoneNumber)),i+=`item1.TEL;waid=${n.wuid}:${n.phoneNumber}
226 item1.X-ABLabel:Celular
→ 227 END:VCARD`,i};return e.contact.length===1?t.contact={displayName:e.contact[0].fullName,vcard:o(e.contact[0])}:t.contactsArrayMessage={displayName:`${e.contact.length} contacts`,contacts:e.contact.map(n=>({displayName:n.fullName,vcard:o(n)}))},await this.sendMessageWithTyping(e.number,{contacts:e.contact.map(n=>({name:{formatted_name:n.fullName,first_name:n.fullName},phones:[{phone:n.phoneNumber}],urls:[{url:n.url}],emails:[{email:n.email}],org:{company:n.organization}})),message:t},{delay:e?.delay,presence:"composing",quoted:e?.quoted,linkPreview:e?.linkPreview,mentionsEveryOne:e?.mentionsEveryOne,mentioned:e?.mentioned})}async reactionMessage(e){return await this.sendMessageWithTyping(e.key.remoteJid,{reactionMessage:{key:e.key,text:e.reaction}})}async getBase64FromMediaMessage(e){try{let t=e.message,o=t.messageType.includes("Message")?t.messageType:t.messageType+"Message",n=t.message[o];return{mediaType:t.messageType,fileName:n?.fileName,caption:n?.caption,size:{fileLength:n?.fileLength,height:n?.fileLength,width:n?.width},mimetype:n?.mime_type,base64:t.message.base64}}catch(t){throw this.logger.error(t),new f(t.toString())}}async deleteMessage(){throw new f("Method not available on WhatsApp Business API")}async mediaSticker(){throw new f("Method not available on WhatsApp Business API")}async pollMessage(){throw new f("Method not available on WhatsApp Business API")}async statusMessage(){throw new f("Method not available on WhatsApp Business API")}async reloadConnection(){throw new f("Method not available on WhatsApp Business API")}async whatsappNumber(){throw new f("Method not available on WhatsApp Business API")}async markMessageAsRead(){throw new f("Method not available on WhatsApp Business API")}async archiveChat(){throw new f("Method not available on WhatsApp Business API")}async markChatUnread(){throw new f("Method not available on WhatsApp Business API")}async fetchProfile(){throw new f("Method not available on WhatsApp Business API")}async offerCall(){throw new f("Method not available on WhatsApp Business API")}async sendPresence(){throw new f("Method not available on WhatsApp Business API")}async setPresence(){throw new f("Method not available on WhatsApp Business API")}async fetchPrivacySettings(){throw new f("Method not available on WhatsApp Business API")}async updatePrivacySettings(){throw new f("Method not available on WhatsApp Business API")}async fetchBusinessProfile(){throw new f("Method not available on WhatsApp Business API")}async updateProfileName(){throw new f("Method not available on WhatsApp Business API")}async updateProfileStatus(){throw new f("Method not available on WhatsApp Business API")}async updateProfilePicture(){throw new f("Method not available on WhatsApp Business API")}async removeProfilePicture(){throw new f("Method not available on WhatsApp Business API")}async blockUser(){throw new f("Method not available on WhatsApp Business API")}async updateMessage(){throw new f("Method not available on WhatsApp Business API")}async createGroup(){throw new f("Method not available on WhatsApp Business API")}async updateGroupPicture(){throw new f("Method not available on WhatsApp Business API")}async updateGroupSubject(){throw new f("Method not available on WhatsApp Business API")}async updateGroupDescription(){throw new f("Method not available on WhatsApp Business API")}async findGroup(){throw new f("Method not available on WhatsApp Business API")}async fetchAllGroups(){throw new f("Method not available on WhatsApp Business API")}async inviteCode(){throw new f("Method not available on WhatsApp Business API")}async inviteInfo(){throw new f("Method not available on WhatsApp Business API")}async sendInvite(){throw new f("Method not available on WhatsApp Business API")}async acceptInviteCode(){throw new f("Method not available on WhatsApp Business API")}async revokeInviteCode(){throw new f("Method not available on WhatsApp Business API")}async findParticipants(){throw new f("Method not available on WhatsApp Business API")}async updateGParticipant(){throw new f("Method not available on WhatsApp Business API")}async updateGSetting(){throw new f("Method not available on WhatsApp Business API")}async toggleEphemeral(){throw new f("Method not available on WhatsApp Business API")}async leaveGroup(){throw new f("Method not available on WhatsApp Business API")}async fetchLabels(){throw new f("Method not available on WhatsApp Business API")}async handleLabel(){throw new f("Method not available on WhatsApp Business API")}async receiveMobileCode(){throw new f("Method not available on WhatsApp Business API")}async fakeCall(){throw new f("Method not available on WhatsApp Business API")}};var Je=class{constructor(s,e,t,o,n){this.jid=s;this.exists=e;this.number=t;this.name=o;this.lid=n}},Is=class{},Cs=class{},Ye=class{};var vs=class{},As=class{},St=class{};var Ms=class{};var Rs=class{},Ns=class{},Ds=class{},Ps=class{};var wn=class{},_s=class extends wn{},Os=class extends _s{},xs=class extends _s{},ks=class{};var bn=require("baileys"),Oe=class{constructor(s){this.cache=s;this.logger=new M("CacheService");s?this.logger.verbose(`cacheservice created using cache engine: ${s.constructor?.name}`):this.logger.verbose("cacheservice disabled")}async get(s){if(this.cache)return this.cache.get(s)}async hGet(s,e){if(!this.cache)return null;try{let t=await this.cache.hGet(s,e);return t?JSON.parse(t,bn.BufferJSON.reviver):null}catch(t){return this.logger.error(t),null}}async set(s,e,t){this.cache&&this.cache.set(s,e,t)}async hSet(s,e,t){if(this.cache)try{let o=JSON.stringify(t,bn.BufferJSON.replacer);await this.cache.hSet(s,e,o)}catch(o){this.logger.error(o)}}async has(s){if(this.cache)return this.cache.has(s)}async delete(s){if(this.cache)return this.cache.delete({
data: {
keyId: "7FF668A0BED51D7FCB",
remoteJid: "557391639625:[email protected]",
fromMe: true,
participant: "557391639625:[email protected]",
status: "READ",
pollUpdates: undefined,
instanceId: "92a12f92-06ad-481b-858e-611a0c6f35c6",
+ Message: {
+ create: MessageCreateWithoutMessageUpdateInput | MessageUncheckedCreateWithoutMessageUpdateInput,
+ connectOrCreate: MessageCreateOrConnectWithoutMessageUpdateInput,
+ connect: MessageWhereUniqueInput
+ }
}
})
Argument `Message` is missing.
at kn (/evolution/node_modules/@prisma/client/runtime/library.js:29:1363)
at Xn.handleRequestError (/evolution/node_modules/@prisma/client/runtime/library.js:121:7102)
at Xn.handleAndLogRequestError (/evolution/node_modules/@prisma/client/runtime/library.js:121:6784)
at Xn.request (/evolution/node_modules/@prisma/client/runtime/library.js:121:6491)
at async l (/evolution/node_modules/@prisma/client/runtime/library.js:130:9812)
at async messages.update (/evolution/dist/main.js:227:33141) {
clientVersion: '6.11.1'
}
Additional Notes
- A conta do WA Business está conectada no Manychat e utiliza elementos da api oficial do Whatsapp como botões e listas;
- Testei com outros eventos de "MESSAGE_" e recebi normalmente as requisições no n8n.
também estou tendo esse problema, e a mensage não foi enviada pro webhook por causa desse erro
Alguém conseguiu corrigir? Não recebo os dados do webhook também
Ainda não consegui. Só não recebo esse evento no webhook.
@Phristyle @vitoramaral10 Uma dúvida, vocês também estão utilizando a nova função de coexistência do WhatsApp Business?
Estou com o mesmo problema usando a 2.3.4, conseguiram resolver?
Estou com o mesmo problema na versao 2.3.1. Tiveram algum sucesso?
eu tambem to com esse problema
Resumo dos Erros nos Logs da Evolution API
🔴 Erro Principal: PrismaClientValidationError
Problema Identificado
A Evolution API v2.3.4 está falhando ao tentar criar registros de atualização de mensagens no banco de dados.
Detalhes Técnicos
Erro: PrismaClientValidationError
Localização: /evolution/dist/main.js:247:1169
Operação: this.prismaRepository.messageUpdate.create()
Mensagem: Argument 'Message' is missing
O que está acontecendo:
Quando a API tenta salvar atualizações de mensagens (status de leitura, entrega, etc.) no banco de dados, o Prisma ORM exige um relacionamento com a tabela Message, mas esse argumento obrigatório não está sendo fornecido.
A operação está tentando criar um messageUpdate com os seguintes dados:
- ✅
keyId(ID da mensagem) - ✅
remoteJid(número do contato) - ✅
fromMe(direção da mensagem) - ✅
participant(participante) - ✅
status(READ, DELIVERY_ACK, DELETED, etc.) - ✅
instanceId(ID da instância) - ❌
Message← FALTANDO
Tipos de Atualizações Afetadas:
- Status de leitura (READ - status 4)
- Confirmação de entrega (DELIVERY_ACK - status 3)
- Mensagens deletadas (DELETED)
Frequência:
O erro ocorre repetidamente durante todo o período dos logs, afetando múltiplas mensagens de diferentes contatos.
📋 Outros Logs Relevantes
- ✅ Redis salvando dados normalmente
- ✅ PostgreSQL executando checkpoints
- ℹ️ Mensagens duplicadas sendo ignoradas para evitar deadlock (comportamento normal)
- ✅ Processamento de lotes de mensagens funcionando
💡 Recomendações
- Correção do Schema: Verificar o schema do Prisma e ajustar a relação entre
MessageUpdateeMessage - Atualização: Considerar atualizar para uma versão mais recente da Evolution API
- Workaround: Desabilitar temporariamente
MESSAGE_UPDATEemDATABASE.SAVE_DATAse não for essencial
O problema parece ser uma incompatibilidade ou erro no código/schema da API relacionado ao salvamento de atualizações de mensagens.
Olá! Estamos fazendo uma triagem do backlog para focar nos bugs reproduzíveis nas versões atuais.
Esta issue foi reportada em uma versão anterior do Evolution API, sem atividade recente. Nesse intervalo lançamos várias versões com correções e mudanças significativas no Baileys, na camada de webhooks e na integração com Cloud API.
Versões atuais:
- Latest stable:
v2.3.7(Dezembro/2025) - Pre-release:
2.4.0-rc2(Maio/2026) — recomendada para testar fixes mais recentes
Vamos fechar esta issue por inatividade. Se você ainda reproduz o problema na 2.3.7 ou na 2.4.0-rc2, por favor:
- Abra uma nova issue usando o template Bug Report
- Inclua: versão exata testada, passos para reproduzir, logs do servidor, payload de exemplo
- Linke esta issue na nova para preservar o histórico
Obrigado pela contribuição original e pela paciência!