📄 SKILL.md

← Vault

name: chatwoot-painel-kanban-sync

description: Chatwoot + Painel do Corretor (Trindade) + Kanban board sync — architecture, auth, table schema, workflow, and debug commands

triggers:

- chatwoot painel kanban integration

- chatwoot-painel-map sync

- n8n chatwoot painel workflow


Chatwoot + Painel do Corretor + Kanban Sync

Context

Sistema de integração entre:

Debug

`bash

Ver logs n8n

docker logs n8n-postgres --tail 50

Query direta na tabela

docker exec n8n-postgres psql -U n8n -d n8n -c "SELECT id, etapa, chatwoot_conversation_id FROM chatwoot_painel_map LIMIT 10"

Testar API Chatwoot

curl -H "api_access_token: 2AfB8VhS79FTmxG1dL8774RJ" \

https://chat.rochasalesseguros.com.br/api/v1/accounts/1/conversations?filter=open

Build Kanban

cd /var/www/chatwoot-kanban && npm run build

`

Problemas Conhecidos

1. Aguardando Pagamento count=0: Kanban mostra 0 mas existem 2 registros na tabela — mismatch no valor de etapa

2. Chatwoot não guarda email: 0 contatos com email, match por telefone é crítico

3. Telefone em texto livre: Telefone do lead está dentro de anotacoes[].mensagem, não como campo estruturado

4. HTTP 401 Invalid API key no Supabase: Anon key pode ser regerada invalidando a atual. Buscar chave atual no VPS: grep -i "SUPABASE" /var/www/comercialrs/.env. O Kanban também tem a chave em /var/www/chatwoot-kanban/src/services/api.ts.

5. chatwoot_contact_phone NOT NULL: Não pode ser null. Quando GraphQL não retorna telefones, usar placeholder SEMFONE-[:8] (ex: SEMFONE-78cad48e).

6. Cloudflare AUTH_NOT_AUTHORIZED: IP do servidor bloqueado. Userscript Tampermonkey no browser do usuário é a única solução viável.