Typebot integration sends lid and not jid
Welcome!
- [x] Yes, I have searched for similar issues on GitHub and found none.
What did you do?
When a user sends a message from a Linked Device (Web/Desktop), the remoteJid variable passed to Typebot contains the @lid identifier (e.g., 123456@lid) instead of the standard phone number JID (@s.whatsapp.net).
Since the Typebot integration currently hardcodes the prefilledVariables (as seen in the Documentation), it does not pass the senderPn or remoteJidAlt.
those are the values that the documentation is stating that are being sent to typebot from Evolution-api
const prefilledVariables = { remoteJid: "JID of the contact", pushName: "Contact's name", instanceName: "Name of the instance", serverUrl: "API server URL", apiKey: "Evolution API key", ownerJid: "JID of the number connected to the instance" };
Impact: This renders the native integration unusable for any workflow that requires the user's actual phone number (e.g., looking up a customer in a CRM, sending data to n8n/Webhooks, or authenticating users). There is currently no way to retrieve the actual phone number inside Typebot when the incoming message is from an @lid source.
What did you expect?
Please add senderPn (or remoteJidAlt) to the prefilledVariables object sent to Typebot. This would allow us to access the actual phone number regardless of whether the user is on a phone or a linked device.
What did you observe instead of what you expected?
I observed that when a message when the remoteJid variable passed to Typebot contains the internal @lid identifier (e.g., user_id@lid) instead of the standard phone number JID ([email protected]).
Because the native integration does not pass the senderPn variable (or remoteJidAlt), I am left with no way to retrieve the user's actual phone number inside the Typebot flow.
I expected the integration to either:
Normalize the remoteJid to the standard phone number format, OR
Pass the senderPn variable to Typebot so we can manually retrieve the correct number from Typebot.
Screenshots/Videos
No response
Which version of the API are you using?
Environment:
Version: 2.3.6
Integration: Typebot (Native)
What is your environment?
Linux
Other environment specifications
No response
If applicable, paste the log output
No response
Additional Notes
No response
I'm having this problem too
Mesmo problema aqui
Mesma coisa aqui!
PT: Eu resolvi com uma expressão no N8N, nela identifico se o remoteJid vem com @lid, se vier, utiliza o campo remoteJidAlt, se não vier e for @whatsapp.net ele passa o nó pra frente.
EN: I solve this using an expression in N8N. In it, I identify if the remoteJid comes with @lid. If it does, I use the remoteJidAlt field; if it doesn't and is @whatsapp.net, I pass the node to the next page.
code:
{{ ( $('Webhook EVO').item.json.body.data.key.remoteJid.endsWith('@lid') ? $('Webhook EVO').item.json.body.data.key.remoteJidAlt : $('Webhook EVO').item.json.body.data.key.remoteJid ) .toString() .replace(/[\n\r\t ]+/g, '') }}
Eu resolvi com uma expressão, nela identifico se o remoteJid vem com @lid, se vier, utiliza o campo remoteJidAlt, se não vier e for @whatsapp.net ele passa o nó pra frente.
Segue ccódigo:
{{ ( $('Webhook EVO').item.json.body.data.key.remoteJid.endsWith('@lid') ? $('Webhook EVO').item.json.body.data.key.remoteJidAlt : $('Webhook EVO').item.json.body.data.key.remoteJid ) .toString() .replace(/[\n\r\t ]+/g, '') }}
this is possible with n8n, but here the problem is with typebot, it is not possible to do it since typebot only receives this data currently const prefilledVariables = { remoteJid: "JID of the contact", pushName: "Contact's name", instanceName: "Name of the instance", serverUrl: "API server URL", apiKey: "Evolution API key", ownerJid: "JID of the number connected to the instance" };
Estou com o mesmo problema
mesmo problema aqui
mesmo problema aqui
Mesmo problema aqui
Também… mesmo problema aqui!
Mesmo problema.
Estou com o mesmo problema, inicialmente utilizando o o typebot as mensagens do robô não iam por conta do @lid consegui corrigir isso porém com o "Stop bot from me" marcado, quando interajo com o cliente a sessão não muda para pausada, fica aberta e o robô continua atuando, alguém passou por isso e conseguiu resolver?
I'm having the same problem. Initially, using TypeBot, the bot's messages weren't going through because of the @lid attribute. I managed to fix that, but with "Stop bot from me" checked, when I interact with the client, the session doesn't change to paused; it stays open and the bot continues to act. Has anyone else experienced this and managed to solve it?
Estou com o mesmo problema, inicialmente utilizando o o typebot as mensagens do robô não iam por conta do @lid consegui corrigir isso porém com o "Stop bot from me" marcado, quando interajo com o cliente a sessão não muda para pausada, fica aberta e o robô continua atuando, alguém passou por isso e conseguiu resolver?
I'm having the same problem. Initially, using TypeBot, the bot's messages weren't going through because of the @lid attribute. I managed to fix that, but with "Stop bot from me" checked, when I interact with the client, the session doesn't change to paused; it stays open and the bot continues to act. Has anyone else experienced this and managed to solve it?
Como você fez para resolver?
Estou com o mesmo problema, inicialmente utilizando o o typebot as mensagens do robô não iam por conta do @lid consegui corrigir isso porém com o "Stop bot from me" marcado, quando interajo com o cliente a sessão não muda para pausada, fica aberta e o robô continua atuando, alguém passou por isso e conseguiu resolver? I'm having the same problem. Initially, using TypeBot, the bot's messages weren't going through because of the @lid attribute. I managed to fix that, but with "Stop bot from me" checked, when I interact with the client, the session doesn't change to paused; it stays open and the bot continues to act. Has anyone else experienced this and managed to solve it?
Como você fez para resolver?
Fiz alteração no arquivo: src/api/integrations/chatbot/base-chatbot.service.ts
ANTES: number: remoteJid.split('@')[0]
DEPOIS: number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0]
Com isso o typebot passou a responder normalmente.
Lembra de rebuildar e reiniciar o EvolutionAPI depois.
Estou com o mesmo problema, inicialmente utilizando o o typebot as mensagens do robô não iam por conta do @lid consegui corrigir isso porém com o "Stop bot from me" marcado, quando interajo com o cliente a sessão não muda para pausada, fica aberta e o robô continua atuando, alguém passou por isso e conseguiu resolver? I'm having the same problem. Initially, using TypeBot, the bot's messages weren't going through because of the @lid attribute. I managed to fix that, but with "Stop bot from me" checked, when I interact with the client, the session doesn't change to paused; it stays open and the bot continues to act. Has anyone else experienced this and managed to solve it?
Como você fez para resolver?
Fiz alteração no arquivo: src/api/integrations/chatbot/base-chatbot.service.ts
ANTES: number: remoteJid.split('@')[0]
DEPOIS: number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0]
Com isso o typebot passou a responder normalmente.
Lembra de rebuildar e reiniciar o EvolutionAPI depois.
Amigo, estou lutando com este erros a semanas. Fiquei um pouco confuso onde está este arquivo src/api/integrations/chatbot/base-chatbot.service.ts? Via docker eu consigo acessar ele?
Estou com o mesmo problema, inicialmente utilizando o o typebot as mensagens do robô não iam por conta do @lid consegui corrigir isso porém com o "Stop bot from me" marcado, quando interajo com o cliente a sessão não muda para pausada, fica aberta e o robô continua atuando, alguém passou por isso e conseguiu resolver? I'm having the same problem. Initially, using TypeBot, the bot's messages weren't going through because of the @lid attribute. I managed to fix that, but with "Stop bot from me" checked, when I interact with the client, the session doesn't change to paused; it stays open and the bot continues to act. Has anyone else experienced this and managed to solve it?
Como você fez para resolver?
Fiz alteração no arquivo: src/api/integrations/chatbot/base-chatbot.service.ts ANTES: number: remoteJid.split('@')[0] DEPOIS: number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0] Com isso o typebot passou a responder normalmente. Lembra de rebuildar e reiniciar o EvolutionAPI depois.
Amigo, estou lutando com este erros a semanas. Fiquei um pouco confuso onde está este arquivo src/api/integrations/chatbot/base-chatbot.service.ts? Via docker eu consigo acessar ele?
Consegue, só entrar no container e ir dentro da pasta do evolution, depois disso procurar o arquivo no caminho que passei.
remoteJidAlt
Same problem here
I had the same issue. I downgraded to version v2.3.4 and the problem stopped happening.
I had the same issue. I downgraded to version v2.3.4 and the problem stopped happening.
Funcionou! maravilha. Obrigado. Tanks
I had the same issue. I downgraded to version v2.3.4 and the problem stopped happening.
What happened? You received jid for everyone? What do you mean the problem stopped happening
Obrigado @GustavoCPrado !
Aqui funcionou também!
no meu conteiner não tem esse arquivo, o mais perto que achei foi evolution/dist/api/integrations/chatbot dentro dessa pasta tem varios arquivos mas nao tem esse base-chatbot.service.ts
@srvelososantos, Dependendo da sua instalação... provavelmente no diretório /evolution/dist/api/integrations/chatbot do seu container, vai ver que tem alguns arquivos, semelhantes a este da imagem anexada.
Esse arquivo não aparece no container porque o build remove o código-fonte TypeScript. O .ts original está no repositório, não dentro do dist. No container só existe o resultado compilado/minificado, que vira vários bundles .js dentro de evolution/dist/api/integrations/chatbot. O base-chatbot.service.ts é transformado e incorporado nesses bundles, então ele deixa de existir como arquivo separado.
Você até consegue editar na mão o arquivo base-chatbot.service.js que seria o .js minificado do base-chatbot.service.ts, porém, isso não é recomendado e nada prático (Mas resolve, por um tempo). Melhor solução, na minha opinião, é tratar direto na imagem e depois subir para o hub e usar ela, para se caso, precisar parar ou recriar o container não ter que ficar editando esse arquivo novamente.
Eu só não entendi por onde que eu edito esse arquivo .ts, eu preciso clonar o repositório do evolution-api ?
Mesmo problema aqui! Quando o contato é @LID, simplesmente não identifica a resposta do cliente.
@GustavoCPrado Fiz a edição do parâmetro em todas as linhas que encontrei no base-chatbot.ts. Um exemplo ficou assim:
await new Promise
Rebuildei a imagem, subi pro HUB e fiz um novo Deploy.
Estou esquecendo de algo?
@willDullius eu fiz a mesma coisa, agr o numero pode aparecer ou na variável remoteJid ou remoteJidAlt do webhook, só tratar no seu código. Comigo ta dando certo agora.
Mesmo problema aqui! Quando o contato é @lid, simplesmente não identifica a resposta do cliente.
@GustavoCPrado Fiz a edição do parâmetro em todas as linhas que encontrei no base-chatbot.ts. Um exemplo ficou assim:
await new Promise((resolve) => { setTimeout(async () => { await instance.textMessage( { number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0], delay: settings?.delayMessage || 1000, text: message, linkPreview, }, false, ); resolve(); }, delay); });
Rebuildei a imagem, subi pro HUB e fiz um novo Deploy.
Estou esquecendo de algo?
Lembrou de rebuildar e reiniciar o EvolutionAPI?
Pessoal, consegui corrigir também o problema do EvolutionAPI com TypeBot que não estava identificando o stop from me.
Quando a conversa caia no typebot ele identificava o @lid nas sessões, mas a conversa não considerava o @lid, ai mesmo um humano interagindo o robô não parava de atual.
I saw a new version is released, with a suggested fix, hope the fix will work
I saw a new version is released, with a suggested fix, hope the fix will work
Have you used it before? If so, can you say if the @lid problems were resolved in Typebot?
- Typebot not responding to @lid numbers
- Typebot's StopFromMe doesn't work for @lid