@lionchat/mcp-server 0.5.9 → 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/instructions.md +3 -2
- package/dist/docs/prompts/create_flow_brainstorm.json +1 -1
- package/dist/docs/resources/api-conventions.md +12 -0
- package/dist/docs/resources/best-practices.md +7 -1
- package/dist/docs/resources/data-model.md +45 -5
- package/dist/docs/resources/flowbuilder-design-guide.md +126 -10
- package/dist/docs/resources/kanban-deep-dive.md +72 -17
- package/dist/tools.js +27 -8
- package/dist/tools.js.map +1 -1
- package/endpoints.json +107 -10
- package/package.json +1 -1
|
@@ -129,7 +129,7 @@ Antes de criar um `custom_attribute`, cheque se a feature já tem campo NATIVO:
|
|
|
129
129
|
|---|---|---|
|
|
130
130
|
| Motivos de Ganho/Perda | `kanban_config.win_reasons` / `loss_reasons` | ❌ |
|
|
131
131
|
| Checklist reusável | `kanban_config.checklist_templates` | ❌ |
|
|
132
|
-
| Automação ganho→outro funil | `funnel.settings.automations` action `
|
|
132
|
+
| Automação ganho→outro funil | `funnel.settings.automations` action `duplicate_item` | ❌ |
|
|
133
133
|
| Tag transversal | `Label` | ❌ |
|
|
134
134
|
|
|
135
135
|
Mais em `lionchat://docs/glossary` → "Quando usar campo nativo vs custom_attribute".
|
|
@@ -277,7 +277,7 @@ Antes de escolher a ferramenta, cheque se a intenção bate com a coluna da dire
|
|
|
277
277
|
| Anexar arquivo a uma mensagem | `lionchat_upload_create` primeiro, depois usar o retorno em `lionchat_conversations_messages_create` | Confira `lionchat_upload_limits` se o arquivo for grande |
|
|
278
278
|
| Marcar conversa como **lida** | `lionchat_conversations_update_last_seen` | NÃO use `unread` (esse marca como NÃO-lida) |
|
|
279
279
|
| Criar/gerenciar **campanha** (disparo WhatsApp/SMS) | `lionchat_campaigns_*` (criar, estatísticas) | SEMPRE rode `campaigns_estimate_audience` antes de criar e mostre a contagem. Disparo em massa = confirmação obrigatória (seção 7b) |
|
|
280
|
-
| Criar **flow normal** (responde mensagens na caixa) | `lionchat_flows_create` | Ler design-guide antes (seção 11) |
|
|
280
|
+
| Criar **flow normal** (responde mensagens na caixa) | `lionchat_flows_create` | Ler design-guide antes (seção 11). Escolha `conversation_mode`: `individual` (1-a-1, default) ou `group` (grupo WhatsApp — só aqui existe o node `update_group`; sem LionTrack). Imutável após criar |
|
|
281
281
|
| Criar **ferramenta da IA** (flow que o AI Agente invoca) | `lionchat_flow_tools_create` + vincular com `flow_tools` → assistants | NÃO use `flows_create` pra ai_tool. Nó `end` obrigatório. Teste com `flow_tools_run` antes de vincular |
|
|
282
282
|
| Ver **ligações de voz do WhatsApp** (histórico, transcrição) | `lionchat_whatsapp_calls_*` | NÃO confundir com `voip_*` (telefonia Zenvia — ramais/saldo). "Ligação no WhatsApp" = whatsapp_calls |
|
|
283
283
|
| **Jornada do Lead** (por onde o lead navegou no site) | `lionchat_journey_funnel_reports` + fases em `lionchat_liontrack_journey_stages_*` | Janela máx 30 dias; exige feature liontrack |
|
|
@@ -291,6 +291,7 @@ Antes de escolher a ferramenta, cheque se a intenção bate com a coluna da dire
|
|
|
291
291
|
| Saber se a IA deve TOCAR a ligação WP (Wavoip) / marcar recusada | `lionchat_wavoip_should_ring` / `lionchat_wavoip_flag_rejected` | Controle fino do toque de chamada na caixa QR Code |
|
|
292
292
|
| Restringir agendas que a IA oferece | `lionchat_captain_assistants_update` (`config.booking_event_type_ids: [Int]`) | binding de agenda por cenário NÃO é settable via API |
|
|
293
293
|
| Configurar o Copiloto (modelo/temperatura/prompt base) | `lionchat_copilot_settings_update` | admin-only; copiloto tem motor próprio (padrão temp 0.3) |
|
|
294
|
+
| **Resetar/testar do zero a IA** numa conversa | `lionchat_conversations_captain_history_reset` (POST, sem body) | Cria pílula de marco na conversa; a partir dali TODA leitura autônoma da IA (respostas, resumo, follow-up) considera só mensagens pós-marco. Não apaga nada; o atendente segue vendo tudo. Enterprise-only |
|
|
294
295
|
|
|
295
296
|
## 9. Quando NÃO chamar nenhuma ferramenta
|
|
296
297
|
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
"arguments": [
|
|
6
6
|
{ "name": "goal_hint", "description": "O que o cliente ja disse que quer (ex: 'fluxo de captura de lead')", "required": false }
|
|
7
7
|
],
|
|
8
|
-
"template": "Cliente quer criar um fluxo no FlowBuilder do LionChat.\n\nObjetivo declarado: {{goal_hint|Nao informado}}\n\nINSTRUCAO: avalie o que o cliente JA disse e o que ainda falta saber. Pergunte SO o que falta. Nao force checklist. Em fluxo simples, 2-3 perguntas bastam. Em fluxo complexo, aprofunde.\n\nABAIXO esta o BANCO de perguntas sugeridas por categoria. ESCOLHA SO AS RELEVANTES.\n\n## Categoria A — Proposito e gatilho (quase sempre necessario)\n- Qual o objetivo do fluxo? (saudacao, qualificacao, captura, suporte, pos-venda, CSAT, agendamento, re-engajamento, outro)\n- Quando dispara? (mensagem recebida com palavra-chave, conversa criada, conversa resolvida, label aplicada, cron, webhook externo)\n- Se palavra-chave: quais palavras? Match exact ou contains?\n\n## Categoria B — Canal e escopo\n- Em qual canal vai rodar? (WAHA, WhatsApp Cloud, Webwidget, Telegram, Email, Twitter, Facebook, Instagram, Line, SMS, API, Voz, WhatsApp Business)\n- Em qual(is) inbox(es) especifica(s)? (peca o ID via inboxes_list se nao soube)\n- Tem filtro de quem entra? (so leads novos, so clientes existentes, so quem tem label X)\n\n## Categoria C — Conteudo da conversa\n- Vai mandar quais mensagens? Texto livre, templates WhatsApp aprovados, midia (imagem/audio/video), lista de botoes interativos?\n- Vai fazer perguntas pro cliente? Quantas? Quais?\n- Para cada pergunta: aceita qualquer resposta livre, opcoes fixas (ex: 1/2/3), ou regex (ex: CPF, email, telefone)?\n- Quanto tempo espera por cada resposta? (default sensato: 30-60 min)\n- O que mandar se nao responder no tempo? (mensagem de timeout, encerrar, escalar pra humano)\n\n## Categoria D — Captura, ramificacao e logica\n- Onde salva as respostas? Em variavel temporaria do flow, atributo da conversa, atributo do contato, custom_attributes\n- Tem ramificacao por condicao? Quais criterios? (ex: 'se valor > 1000 vai pra time premium')\n- Vai chamar API externa? (URL, metodo, headers, body, autenticacao)\n- Vai usar IA (Captain Assistant)? Em que momento? Pra que?\n * generate = gerar resposta natural\n * intent = classificar intencao da mensagem\n * sentiment = analisar sentimento\n * extract = extrair info estruturada (CPF, valor, etc)\n- Tem teste A/B? (randomizer)\n\n## Categoria E — Acoes finais\n- No fim do fluxo: criar card no Kanban? (em qual funil/etapa?) Atribuir agente/time? (ID) Adicionar/remover label? Mudar status/prioridade? Disparar webhook externo?\n- Tem criterio pra encerrar antes? (exit_conditions: ex: 'conversa marcada como resolvida' ou 'label X aplicada')\n\n## Antes de chamar flows_create\n1. Se faltou info CRITICA (ex: canal, gatilho, conteudo basico): pergunte agora\n2. Se a info que falta e mero detalhe: assuma defaults sensatos\n - maxRetries: 3\n - waitTime: 60min para resposta, 30min para timeouts\n - sem ramificacao se cliente nao mencionou\n3. Apresente um RESUMO em linguagem natural do fluxo. Exemplo: 'Beleza, vou criar um fluxo assim: quando alguem mandar oi no WhatsApp, manda saudacao, pergunta se quer vendas/suporte, se vendas atribui ao time 1, se suporte ao time 2. Confirma?'\n4. Espere o cliente confirmar OU pedir ajustes\n5. So depois da confirmacao, chame flows_create\n6. ANTES de gerar o JSON: consulte lionchat://docs/flowbuilder-design-guide pra schema/handles/layout e lionchat://docs/flowbuilder-patterns pra ver se algum template ja resolve\n7. Apos gerar JSON, valide pelo checklist da secao 6 do design guide\n8. NUNCA crie node sem position. NUNCA invente sourceHandle.\n\nDEFAULTS SENSATOS quando cliente nao especificar:\n- channel_type: pergunte sempre, nao chute\n- inbox_ids: pergunte sempre\n- waitTime: 60 minutes\n- maxRetries: 3\n- waitUnit: minutes\n- saveTo: '
|
|
8
|
+
"template": "Cliente quer criar um fluxo no FlowBuilder do LionChat.\n\nObjetivo declarado: {{goal_hint|Nao informado}}\n\nINSTRUCAO: avalie o que o cliente JA disse e o que ainda falta saber. Pergunte SO o que falta. Nao force checklist. Em fluxo simples, 2-3 perguntas bastam. Em fluxo complexo, aprofunde.\n\nABAIXO esta o BANCO de perguntas sugeridas por categoria. ESCOLHA SO AS RELEVANTES.\n\n## Categoria A — Proposito e gatilho (quase sempre necessario)\n- Qual o objetivo do fluxo? (saudacao, qualificacao, captura, suporte, pos-venda, CSAT, agendamento, re-engajamento, outro)\n- Quando dispara? (mensagem recebida com palavra-chave, conversa criada, conversa resolvida, label aplicada, cron, webhook externo)\n- Se palavra-chave: quais palavras? Match exact ou contains?\n\n## Categoria B — Canal e escopo\n- Em qual canal vai rodar? (WAHA, WhatsApp Cloud, Webwidget, Telegram, Email, Twitter, Facebook, Instagram, Line, SMS, API, Voz, WhatsApp Business)\n- Em qual(is) inbox(es) especifica(s)? (peca o ID via inboxes_list se nao soube)\n- Tem filtro de quem entra? (so leads novos, so clientes existentes, so quem tem label X)\n\n## Categoria C — Conteudo da conversa\n- Vai mandar quais mensagens? Texto livre, templates WhatsApp aprovados, midia (imagem/audio/video), lista de botoes interativos?\n- Vai fazer perguntas pro cliente? Quantas? Quais?\n- Para cada pergunta: aceita qualquer resposta livre, opcoes fixas (ex: 1/2/3), ou regex (ex: CPF, email, telefone)?\n- Quanto tempo espera por cada resposta? (default sensato: 30-60 min)\n- O que mandar se nao responder no tempo? (mensagem de timeout, encerrar, escalar pra humano)\n\n## Categoria D — Captura, ramificacao e logica\n- Onde salva as respostas? Em variavel temporaria do flow, atributo da conversa, atributo do contato, custom_attributes\n- Tem ramificacao por condicao? Quais criterios? (ex: 'se valor > 1000 vai pra time premium')\n- Vai chamar API externa? (URL, metodo, headers, body, autenticacao)\n- Vai usar IA (Captain Assistant)? Em que momento? Pra que?\n * generate = gerar resposta natural\n * intent = classificar intencao da mensagem\n * sentiment = analisar sentimento\n * extract = extrair info estruturada (CPF, valor, etc)\n- Tem teste A/B? (randomizer)\n\n## Categoria E — Acoes finais\n- No fim do fluxo: criar card no Kanban? (em qual funil/etapa?) Atribuir agente/time? (ID) Adicionar/remover label? Mudar status/prioridade? Disparar webhook externo?\n- Tem criterio pra encerrar antes? (exit_conditions: ex: 'conversa marcada como resolvida' ou 'label X aplicada')\n\n## Antes de chamar flows_create\n1. Se faltou info CRITICA (ex: canal, gatilho, conteudo basico): pergunte agora\n2. Se a info que falta e mero detalhe: assuma defaults sensatos\n - maxRetries: 3\n - waitTime: 60min para resposta, 30min para timeouts\n - sem ramificacao se cliente nao mencionou\n3. Apresente um RESUMO em linguagem natural do fluxo. Exemplo: 'Beleza, vou criar um fluxo assim: quando alguem mandar oi no WhatsApp, manda saudacao, pergunta se quer vendas/suporte, se vendas atribui ao time 1, se suporte ao time 2. Confirma?'\n4. Espere o cliente confirmar OU pedir ajustes\n5. So depois da confirmacao, chame flows_create\n6. ANTES de gerar o JSON: consulte lionchat://docs/flowbuilder-design-guide pra schema/handles/layout e lionchat://docs/flowbuilder-patterns pra ver se algum template ja resolve\n7. Apos gerar JSON, valide pelo checklist da secao 6 do design guide\n8. NUNCA crie node sem position. NUNCA invente sourceHandle.\n\nDEFAULTS SENSATOS quando cliente nao especificar:\n- channel_type: pergunte sempre, nao chute\n- inbox_ids: pergunte sempre\n- waitTime: 60 minutes\n- maxRetries: 3\n- waitUnit: minutes\n- saveTo: 'conversation_attr' (atributo da conversa) na duvida — NUNCA use 'attribute' (valor inexistente, nao salva nada)\n- match_mode: 'contains' pra keywords"
|
|
9
9
|
}
|
|
@@ -222,6 +222,18 @@ Ou para listas grandes (cursors):
|
|
|
222
222
|
- Conta pode ter `locale` próprio mas timezone segue config do servidor
|
|
223
223
|
- Pra evitar bugs, sempre passe timezone explícito
|
|
224
224
|
|
|
225
|
+
### Custom attributes de data/hora — formato canônico (2026-07-06)
|
|
226
|
+
|
|
227
|
+
- Atributo tipo `date`: valor canônico é **data pura ISO** `"YYYY-MM-DD"` (sem hora/fuso).
|
|
228
|
+
Os atributos de integrações (`lt_first_visit_at`/`lt_last_visit_at`, `ca_invoice_created_at`/
|
|
229
|
+
`ca_invoice_updated_at`, os 6 `omie_*` de data, `booking_date`, `eclinica_*_data`) passaram a
|
|
230
|
+
gravar nesse formato — comparações `greater_than`/`less_than` em filtro/condição funcionam.
|
|
231
|
+
Registros gravados ANTES de 06/07/2026 podem estar no formato antigo (timestamp completo ou
|
|
232
|
+
`DD/MM/AAAA`) até os rakes de backfill rodarem.
|
|
233
|
+
- Atributo tipo `time` (**Hora, novo**): valor canônico é `"HH:MM"` **24h** (ex: `"14:30"`),
|
|
234
|
+
SEM data e SEM fuso embutido — o fuso mora na definição do atributo (`attribute_timezone`,
|
|
235
|
+
escolhido na criação, default `America/Sao_Paulo`).
|
|
236
|
+
|
|
225
237
|
## Códigos HTTP
|
|
226
238
|
|
|
227
239
|
### Sucesso
|
|
@@ -354,6 +354,12 @@ Fontes/campos disponíveis (`source` / `field`):
|
|
|
354
354
|
Lembrete: todo template recém-criado pelo MCP só mostra o texto na tela depois de **sincronizar**
|
|
355
355
|
(o MCP cria na Meta, mas o "puxar de volta" o conteúdo é o que a tela faz com o botão Sincronizar).
|
|
356
356
|
|
|
357
|
+
## FlowBuilder — notas de editor (2026-07)
|
|
358
|
+
|
|
359
|
+
- **Tipo de atributo `time` (Hora 24h):** ao criar custom attribute com `attribute_display_type: "time"`, o valor canônico é `"HH:MM"` 24h e o fuso mora na definição (`attribute_timezone`, IANA, default `America/Sao_Paulo`). Uso principal: alimentar o campo Horário do node `wait` (modo date, `waitTimeMode: "variable"`).
|
|
360
|
+
- **Timeout de flow `ai_tool` com node `api`:** sobe sozinho de 20s pro teto de 45s quando ainda está no padrão — não precisa configurar nada; só evite setar `execution_timeout_ms` custom se quiser manter o auto-ajuste.
|
|
361
|
+
- **Teste do node `api`:** o resultado do último teste fica salvo no servidor (pin, TTL 30 dias) — sobrevive a trocar de navegador/máquina. Isso é recurso do editor humano; não há tool MCP pra isso.
|
|
362
|
+
|
|
357
363
|
## Status codes a respeitar
|
|
358
364
|
|
|
359
365
|
| Code | O que fazer |
|
|
@@ -488,7 +494,7 @@ LionChat tem vários conceitos com modelos próprios na plataforma. Custom attri
|
|
|
488
494
|
|---|---|---|
|
|
489
495
|
| Motivo de Ganho/Perda do card | criar custom_attribute "Motivo de Ganho" | popular `kanban_config.win_reasons` |
|
|
490
496
|
| Checklist reusável em vários cards | criar custom_attribute lista | popular `kanban_config.checklist_templates` + automação `apply_checklist_template` |
|
|
491
|
-
| Automação "ao Ganhar → criar card noutro funil" | regra AutomationRule complexa | popular `funnel.settings.automations` com `action:
|
|
497
|
+
| Automação "ao Ganhar → criar card noutro funil" | regra AutomationRule complexa | popular `funnel.settings.automations` com `action: duplicate_item` |
|
|
492
498
|
| Atributo em todo card | criar 1 custom_attribute pra cada funil | popular `kanban_config.global_custom_attributes` (vale pra todos) |
|
|
493
499
|
| Cadastrar CPF do contato | usar campo do funil | criar `custom_attribute_definitions` model=contact_attribute |
|
|
494
500
|
| Tag "cliente residencial" | criar custom_attribute | criar `Label` |
|
|
@@ -214,16 +214,18 @@ KanbanItem
|
|
|
214
214
|
├── custom_attributes (jsonb)
|
|
215
215
|
├── assigned_agents (jsonb array)
|
|
216
216
|
├── linked_conversations (jsonb array de { display_id })
|
|
217
|
-
├── checklist (jsonb)
|
|
217
|
+
├── checklist (jsonb array de itens — NAO e tabela separada; ver abaixo)
|
|
218
218
|
├── activities (jsonb)
|
|
219
219
|
├── timer_started_at / timer_duration
|
|
220
220
|
└── created_at
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
├──
|
|
224
|
-
├──
|
|
222
|
+
Item do checklist (elemento do array jsonb `checklist`)
|
|
223
|
+
├── id (uuid string)
|
|
224
|
+
├── text
|
|
225
225
|
├── completed (bool)
|
|
226
|
-
|
|
226
|
+
├── position
|
|
227
|
+
├── group_id (opcional — itens com o mesmo group_id formam um grupo; ausente = avulso)
|
|
228
|
+
└── group_name (opcional — nome do grupo, snapshot do modelo aplicado)
|
|
227
229
|
|
|
228
230
|
KanbanNote
|
|
229
231
|
├── kanban_item_id (FK)
|
|
@@ -361,6 +363,44 @@ Booking (agendamento confirmado)
|
|
|
361
363
|
└── meeting_url (Google Calendar / Zoom / etc)
|
|
362
364
|
```
|
|
363
365
|
|
|
366
|
+
**Atributos de sistema do Booking no CONTATO (novo 2026-07-06):** ao confirmar um agendamento,
|
|
367
|
+
8 custom attributes protegidos são gravados no contato — usáveis como variável
|
|
368
|
+
(`{{contact.custom_attribute.booking_date}}` etc.) em mensagem/flow/automação:
|
|
369
|
+
|
|
370
|
+
| Chave | Tipo | Conteúdo |
|
|
371
|
+
|---|---|---|
|
|
372
|
+
| `booking_title` | text | Título do tipo de evento (ex: "Consultoria 45min") |
|
|
373
|
+
| `booking_date` | date | Data do agendamento, ISO `YYYY-MM-DD` |
|
|
374
|
+
| `booking_time` | **time** | Hora 24h `"HH:MM"` (tipo novo — encaixa direto no campo Horário do node `wait`) |
|
|
375
|
+
| `booking_datetime` | text | ISO 8601 completo com fuso (referência; prefira date/time como variável) |
|
|
376
|
+
| `booking_duration` | text | Ex: "45 min" |
|
|
377
|
+
| `booking_type` | text | "Call / Meet" ou "Agendamento" |
|
|
378
|
+
| `booking_agent` | text | Nome do agente responsável |
|
|
379
|
+
| `booking_description` | text | Observação do cliente ao agendar |
|
|
380
|
+
|
|
381
|
+
## e-Clínicas (Efficient) — integração de clínicas
|
|
382
|
+
|
|
383
|
+
9 eventos de webhook, cada um mapeável a automação OU flow na tela Integrações > e-Clínica:
|
|
384
|
+
`cliente_novo`, `agendamento_novo`, `falta`, `pagamento` (os 4 da doc oficial) +
|
|
385
|
+
`agendamento_atendido`, `agendamento_alterado`, `agendamento_desmarcado`,
|
|
386
|
+
`agendamento_transferido`, `cliente_baixa_pagamento` (capturados ao vivo, não documentados
|
|
387
|
+
pelo e-Clínica).
|
|
388
|
+
|
|
389
|
+
Atributos de sistema no CONTATO (prefixo `eclinica_`, protegidos, usáveis como variável):
|
|
390
|
+
|
|
391
|
+
| Chave | Tipo | Conteúdo |
|
|
392
|
+
|---|---|---|
|
|
393
|
+
| `eclinica_cliente_id` | text | ID do paciente no e-Clínica (chave de matching) |
|
|
394
|
+
| `eclinica_unit_id` / `eclinica_unit_name` | text | Unidade/filial que originou o evento |
|
|
395
|
+
| `eclinica_idagenda` | text | ID do último agendamento |
|
|
396
|
+
| `eclinica_data_consulta` | date | Data da consulta, ISO |
|
|
397
|
+
| `eclinica_hora_consulta` | **time** | Hora da consulta 24h `"HH:MM"` (novo 2026-07-06) |
|
|
398
|
+
| `eclinica_status_agendamento` | text | agendado / no_show / atendido / desmarcado |
|
|
399
|
+
| `eclinica_compromisso` | text | Tipo da consulta (ex: Consulta, Retorno, Exame) |
|
|
400
|
+
| `eclinica_ultimo_pagamento` | text | Valor do último pagamento |
|
|
401
|
+
| `eclinica_ultimo_pagamento_data` | date | Data do último pagamento/baixa (novo 2026-07-06) |
|
|
402
|
+
| `eclinica_ultimo_pagamento_descricao` | text | Descrição da baixa (ex: CONSULTA INICIAL) |
|
|
403
|
+
|
|
364
404
|
## Relatórios e Métricas
|
|
365
405
|
|
|
366
406
|
```
|
|
@@ -118,7 +118,23 @@ Webhooks embutidos NÃO aparecem na listagem de integrações standalone; exclui
|
|
|
118
118
|
```
|
|
119
119
|
→ edges: `sourceHandle: "button_sim"`, `sourceHandle: "button_nao"`, e opcionalmente `"no_response"`.
|
|
120
120
|
|
|
121
|
-
**Handles que SAEM:** `success` (sem botões); com botões → `button_<value>` (um por botão) + `no_response`
|
|
121
|
+
**Handles que SAEM:** `success` (sem botões); com botões → `button_<value>` (um por botão) + `no_response` + `error`.
|
|
122
|
+
|
|
123
|
+
**Timeout dos botões (opcional, no MESMO item de botões):**
|
|
124
|
+
- `buttons_timeout` (número) + `buttons_timeout_unit` (`"minutes"` | `"hours"` | `"days"`) → tempo de espera sem resposta. Só com `buttons_timeout > 0` existe o handle `no_reply_timeout`.
|
|
125
|
+
- `buttons_timeout_action`: `"advance"` (padrão) | `"remind"`.
|
|
126
|
+
- `"advance"`: ao esgotar o tempo, segue o handle `no_reply_timeout` (ex: manda pro atendimento humano).
|
|
127
|
+
- `"remind"`: manda UM lembrete (`buttons_reminder_text`) e CONTINUA aguardando o clique no MESMO menu; se ainda não responder, segue o `no_reply_timeout`. O clique (no menu original OU no lembrete) continua o flow normalmente.
|
|
128
|
+
- `buttons_reminder_text` (string) → texto do lembrete (só no modo `remind`; vazio = reenvia o conteúdo original).
|
|
129
|
+
- **REGRA do modo `remind`:** `buttons_timeout_unit` NÃO pode ser `"days"` e horas ≤ 23 — o lembrete precisa caber na janela de 24h do WhatsApp oficial. No modo `"advance"`, qualquer unidade/valor é permitido.
|
|
130
|
+
|
|
131
|
+
> ⚠️ **SAÍDAS CONDICIONAIS — NUNCA ligue edge nelas sem ativar a condição.** Estas saídas SÓ existem
|
|
132
|
+
> quando a config abaixo está presente. Ligar edge nelas sem isso cria uma **aresta fantasma** (linha
|
|
133
|
+
> que sai do nada no canvas, não roteia nada):
|
|
134
|
+
> - **`no_reply_timeout`** → só existe se o item de botões tiver **`buttons_timeout` > 0** (tempo de espera configurado).
|
|
135
|
+
> - **`window_closed`** → só existe em **flow de WhatsApp API oficial** com item sujeito à janela de 24h (texto/áudio/anexo/resposta pronta).
|
|
136
|
+
>
|
|
137
|
+
> Regra: se você NÃO configurou o timeout, **NÃO** crie edge `no_reply_timeout`. Se não é API oficial, **NÃO** crie edge `window_closed`.
|
|
122
138
|
|
|
123
139
|
### 2.3 `wait_response`
|
|
124
140
|
|
|
@@ -243,7 +259,7 @@ No editor visual esses destinos só aparecem quando a validação bate (computed
|
|
|
243
259
|
| `is_number` / `is_letter` / `is_email` / `is_phone` | validação de formato |
|
|
244
260
|
| `regex` | padrão regex em `value` |
|
|
245
261
|
| `equal_any` / `not_equal_any` / `contains_any` | multi-valor (usa `values` array) |
|
|
246
|
-
| `business_hours` / `outside_business_hours` | horário comercial |
|
|
262
|
+
| `business_hours` / `outside_business_hours` | horário comercial (par: dentro/fora). `business_hours` aceita `start_hour`/`end_hour` (0-23), `days` (array 0=Dom..6=Sab, ausente=todos) e **`timezone`** (IANA, ex.: `America/Sao_Paulo` — default se ausente). **REGRA:** a saída `outside_business_hours` HERDA `start_hour`/`end_hour`/`days`/`timezone` da `business_hours` ANTERIOR no array — pode deixá-los ausentes na "fora" (o backend preenche). O horário é avaliado no `timezone` (não em UTC) |
|
|
247
263
|
| `can_reply` / `can_reply_closed` | janela 24h aberta/fechada |
|
|
248
264
|
| `conversation_has_agent` / `conversation_no_agent` / `conversation_not_agent` | agente atribuído |
|
|
249
265
|
| `contact_has_label` / `contact_no_label` / `conversation_has_label` / `conversation_no_label` | labels |
|
|
@@ -256,6 +272,7 @@ No editor visual esses destinos só aparecem quando a validação bate (computed
|
|
|
256
272
|
- **Texto/string:** `equal`, `not_equal`, `contains`, `not_contains`, `starts_with`, `ends_with`, `is_empty`, `is_not_empty`
|
|
257
273
|
- **Número:** `equal`, `not_equal`, `greater_than`, `less_than`, `number_range`, `is_empty`, `is_not_empty`
|
|
258
274
|
- **Lista/Data:** `equal`, `not_equal`, `contains`, `not_contains`
|
|
275
|
+
- **Hora (`time`, novo 2026-07-06):** tratado como texto nas condições (`equal`, `not_equal`, `is_empty`, `is_not_empty`); valor canônico `"HH:MM"` 24h. Comparação maior/menor NÃO é suportada pra Hora — o uso principal desse tipo é alimentar o campo Horário do node `wait` (modo date, `waitTimeMode: "variable"`).
|
|
259
276
|
|
|
260
277
|
Use operador numérico (`greater_than`, `less_than`, `number_range`) SÓ em atributo de tipo número.
|
|
261
278
|
|
|
@@ -318,6 +335,7 @@ Ex.: `{ "operator": "sla_check", "value": "frt_breached" }`. "Estourado" = o mon
|
|
|
318
335
|
| `set_lost` | `{ reason? }` | Atalho pra perdido |
|
|
319
336
|
| `assign_agent_card` | `{ agent_id }` | Atribui agente ao card |
|
|
320
337
|
| `add_card_note` | `{ content }` | Nota no card |
|
|
338
|
+
| `add_card_checklist` | `{ template_id, funnel_id?, card_source? }` | Aplica um MODELO de checklist ao card (vira um grupo). `template_id` de `kanban_config.checklist_templates`. Um modelo por bloco (repita o bloco pra mais de um) |
|
|
321
339
|
| `send_webhook` | `{ url, headers?, body? }` | Dispara webhook externo |
|
|
322
340
|
| `start_flow` | `{ flow_id }` | Inicia outro fluxo |
|
|
323
341
|
| `deactivate_flow` ou `disable_flow` | `{}` | Encerra fluxo atual |
|
|
@@ -327,7 +345,7 @@ Ex.: `{ "operator": "sla_check", "value": "frt_breached" }`. "Estourado" = o mon
|
|
|
327
345
|
|
|
328
346
|
**Handles que SAEM:** `success`. Não tem handle `error` — falhas viram warning silencioso e o flow continua.
|
|
329
347
|
|
|
330
|
-
**`card_source` (blocos de card) — opcional:** as ações de card aceitam `card_source`: `'funnel'` (default — procura o card pelo `funnel_id`) ou `'trigger'` (usa o card que DISPAROU o flow, em flows iniciados por `card_created`/`card_moved`/`card_won`/`card_lost`). Com `'trigger'`, `funnel_id` deixa de ser obrigatório — EXCETO em `move_kanban_stage`/`create_kanban_item`, cujo funil/etapa são o DESTINO. Sem card-gatilho disponível, a ação é pulada (não cai no fallback de funil). Aplica-se a `move_kanban_stage`, `set_won`/`set_lost`/`set_open`, `assign_agent_card`, `add_card_note`, `update_attribute` (com `attr_source: 'card'`) e às condições `card_attr_equals`/`card_attr_contains` (gravando `card_source` na própria regra).
|
|
348
|
+
**`card_source` (blocos de card) — opcional:** as ações de card aceitam `card_source`: `'funnel'` (default — procura o card pelo `funnel_id`) ou `'trigger'` (usa o card que DISPAROU o flow, em flows iniciados por `card_created`/`card_moved`/`card_won`/`card_lost`). Com `'trigger'`, `funnel_id` deixa de ser obrigatório — EXCETO em `move_kanban_stage`/`create_kanban_item`, cujo funil/etapa são o DESTINO. Sem card-gatilho disponível, a ação é pulada (não cai no fallback de funil). Aplica-se a `move_kanban_stage`, `set_won`/`set_lost`/`set_open`, `assign_agent_card`, `add_card_note`, `add_card_checklist`, `update_attribute` (com `attr_source: 'card'`) e às condições `card_attr_equals`/`card_attr_contains` (gravando `card_source` na própria regra).
|
|
331
349
|
|
|
332
350
|
**`update_attribute` — campos EXATOS:** `attr_source` (`'contact'`, `'conversation'` ou `'card'`), `attr_key` (nome do atributo), `attr_value` (valor). NÃO existem `entity`/`key`/`value` — esses são ignorados e não salvam nada.
|
|
333
351
|
|
|
@@ -403,6 +421,10 @@ Lembre: o atributo lido é SINGULAR (`custom_attribute`).
|
|
|
403
421
|
|
|
404
422
|
### 2.8 `wait`
|
|
405
423
|
|
|
424
|
+
O campo raiz é **`waitMode`**: `"duration"` (default), `"date"` ou `"weekday"`.
|
|
425
|
+
|
|
426
|
+
**Modo `duration` (esperar um tempo):**
|
|
427
|
+
|
|
406
428
|
```json
|
|
407
429
|
{
|
|
408
430
|
"id": "node-wait-time-1",
|
|
@@ -410,17 +432,58 @@ Lembre: o atributo lido é SINGULAR (`custom_attribute`).
|
|
|
410
432
|
"position": { "x": 690, "y": 300 },
|
|
411
433
|
"data": {
|
|
412
434
|
"label": "Espera 10 min",
|
|
413
|
-
"
|
|
435
|
+
"waitMode": "duration",
|
|
436
|
+
"waitDuration": 10,
|
|
414
437
|
"waitUnit": "minutes"
|
|
415
438
|
}
|
|
416
439
|
}
|
|
417
440
|
```
|
|
418
441
|
|
|
419
|
-
|
|
442
|
+
`waitUnit` válidos: `seconds`, `minutes`, `hours`, `days`. (NÃO existe `waitUnit: "weekday"` — dia da semana é um `waitMode` próprio, ver abaixo.)
|
|
420
443
|
|
|
421
|
-
|
|
444
|
+
**Modo `date` (esperar até uma data e hora):**
|
|
422
445
|
|
|
423
|
-
|
|
446
|
+
```json
|
|
447
|
+
{
|
|
448
|
+
"id": "node-wait-date-1",
|
|
449
|
+
"type": "wait",
|
|
450
|
+
"position": { "x": 690, "y": 300 },
|
|
451
|
+
"data": {
|
|
452
|
+
"label": "Espera ate a consulta",
|
|
453
|
+
"waitMode": "date",
|
|
454
|
+
"waitDate": "2026-12-31",
|
|
455
|
+
"waitTime": "09:00",
|
|
456
|
+
"waitTimezone": "America/Sao_Paulo",
|
|
457
|
+
"waitDateMode": "fixed",
|
|
458
|
+
"waitTimeMode": "fixed"
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
- `waitDate` = `"YYYY-MM-DD"` · `waitTime` = `"HH:MM"` 24h · `waitTimezone` = fuso IANA (default `America/Sao_Paulo` se ausente).
|
|
464
|
+
- **Variável nos campos (novo 2026-07-06):** `waitDateMode`/`waitTimeMode` aceitam `"fixed"` (default) ou `"variable"`. Em `"variable"`, o campo correspondente contém uma variável `{{ }}` em vez do valor fixo — ex.: `"waitDate": "{{contact.custom_attribute.data_consulta}}"`. O campo Data SÓ aceita variável de atributo tipo `date`; o campo Horário SÓ tipo `time` (Hora 24h). A variável é resolvida UMA única vez, na entrada do node (quem já está esperando mantém o valor capturado). Variável que não resolve pra data/hora válida → o flow sai pela saída `error` (payload `invalid_variable_datetime`). Data válida no PASSADO → espera 0 e segue por `success` (não é erro).
|
|
465
|
+
|
|
466
|
+
**Modo `weekday` (esperar até um dia da semana):**
|
|
467
|
+
|
|
468
|
+
```json
|
|
469
|
+
{
|
|
470
|
+
"id": "node-wait-weekday-1",
|
|
471
|
+
"type": "wait",
|
|
472
|
+
"position": { "x": 690, "y": 300 },
|
|
473
|
+
"data": {
|
|
474
|
+
"label": "Espera ate segunda 09h",
|
|
475
|
+
"waitMode": "weekday",
|
|
476
|
+
"waitWeekday": 1,
|
|
477
|
+
"waitWeekdayTime": "09:00",
|
|
478
|
+
"waitTimezone": "America/Sao_Paulo"
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
- `waitWeekday`: 0=domingo, 1=segunda... 6=sábado. `waitWeekdayTime` = `"HH:MM"` 24h, **SEMPRE fixo** (este campo NÃO aceita variável — decisão de produto). `waitTimezone` = mesmo campo do modo date.
|
|
484
|
+
- (Os nomes `targetWeekday`/`targetHour` NÃO existem — eram um erro de documentação antiga.)
|
|
485
|
+
|
|
486
|
+
**Handles que SAEM:** `success` (+ `error`, emitido apenas quando um campo em modo `variable` resolve pra valor inválido no modo `date`).
|
|
424
487
|
|
|
425
488
|
### 2.9 `set_variable`
|
|
426
489
|
|
|
@@ -490,12 +553,30 @@ Node terminal, sem handles de saída. Em flow `conversation` apenas encerra aque
|
|
|
490
553
|
{ "id": "node-end", "type": "end", "position": { "x": 1330, "y": 300 }, "data": { "label": "Retorno", "mode": "structured" } }
|
|
491
554
|
```
|
|
492
555
|
|
|
493
|
-
### 2.14 `note` (anotação visual)
|
|
556
|
+
### 2.14 `note` (anotação visual / sticky note colorido)
|
|
557
|
+
|
|
558
|
+
Sticky note no canvas (aquele bloco colorido riscado na tela pra rotular/agrupar). Puramente visual: sem handles, NUNCA executado (não ligue edges nele). Disponível nos DOIS tipos de flow (`conversation` e `ai_tool`).
|
|
559
|
+
|
|
560
|
+
Campos do `data`:
|
|
561
|
+
|
|
562
|
+
| Campo | Valores | Default |
|
|
563
|
+
|---|---|---|
|
|
564
|
+
| `title` | texto do cabeçalho da nota | vazio |
|
|
565
|
+
| `body` | texto do corpo | vazio |
|
|
566
|
+
| `color` | `yellow`, `teal`, `blue`, `violet`, `pink`, `orange`, `slate` | `yellow` |
|
|
567
|
+
| `width` | largura em px (mín. 200) | 320 |
|
|
568
|
+
| `height` | altura em px (mín. 80) | 200 |
|
|
569
|
+
|
|
570
|
+
**ATENÇÃO:** o texto vai em `title` + `body`, NÃO em `content`. Usar `content` num node `note` grava
|
|
571
|
+
uma nota VAZIA na tela (a interface ignora a chave). `content` só é chave de OUTRAS coisas (item `text`
|
|
572
|
+
do `send_message`, ação `add_private_note`, ação `add_card_note`) — nunca do sticky note.
|
|
494
573
|
|
|
495
|
-
|
|
574
|
+
`position` é o canto superior esquerdo da nota; como ela é maior que um node comum, posicione-a ATRÁS
|
|
575
|
+
do grupo de nodes que ela rotula (ex.: um pouco acima e à esquerda do primeiro node do trecho).
|
|
496
576
|
|
|
497
577
|
```json
|
|
498
|
-
{ "id": "note-1", "type": "note", "position": { "x":
|
|
578
|
+
{ "id": "note-1", "type": "note", "position": { "x": 40, "y": 40 },
|
|
579
|
+
"data": { "title": "Qualificação", "body": "Revisar mensagens antes de publicar", "color": "violet", "width": 360, "height": 180 } }
|
|
499
580
|
```
|
|
500
581
|
|
|
501
582
|
---
|
|
@@ -524,6 +605,29 @@ das abas Conversas / Contatos / Kanban (ex: `add_label`, `change_status`, `updat
|
|
|
524
605
|
outro flow (cadeia entre motores), cada hand-off incrementa um contador interno (`_activation_depth`).
|
|
525
606
|
No 5º hand-off (`MAX_CHAIN_DEPTH = 5`) a cadeia é cortada silenciosamente. Se um flow "não disparou"
|
|
526
607
|
no fim de uma cadeia automação→flow→automação, suspeite desse limite — é proteção, não bug.
|
|
608
|
+
|
|
609
|
+
## 2-C. Flow `conversation`: individual vs grupo (`conversation_mode`)
|
|
610
|
+
|
|
611
|
+
Todo flow `conversation` tem um `conversation_mode`: `individual` (default — conversa 1-a-1) ou `group`
|
|
612
|
+
(grupo de WhatsApp). Definido na CRIAÇÃO e **IMUTÁVEL depois** (não dá pra converter um no outro; pra trocar,
|
|
613
|
+
crie outro flow). Não confundir com `flow_type` — um flow `ai_tool` não tem `conversation_mode`.
|
|
614
|
+
|
|
615
|
+
Na tela o usuário vê isso como TRÊS opções ao criar: "Mensagem" (= `conversation` + `individual`),
|
|
616
|
+
"Grupo" (= `conversation` + `group`) e "IA Agente" (= `ai_tool`).
|
|
617
|
+
|
|
618
|
+
**A diferença entre individual e grupo é quais nodes/abas ficam disponíveis:**
|
|
619
|
+
|
|
620
|
+
| | individual (Mensagem) | group (Grupo) |
|
|
621
|
+
|---|---|---|
|
|
622
|
+
| Node `update_group` (Configurar Grupo: nome, foto, permissões — WAHA) | NÃO existe | **SÓ aqui** |
|
|
623
|
+
| Gatilhos e condições de **LionTrack** (visita de página / evento do site) | disponíveis | **NÃO** (grupo não tem um contato único navegando) |
|
|
624
|
+
| Todos os outros nodes (`send_message`, `wait_response`, `condition`, `action`, `api`, `ai`, `set_variable`, `wait`, `randomizer`, `note`, `end`) | iguais | iguais |
|
|
625
|
+
|
|
626
|
+
Regras práticas ao montar via API:
|
|
627
|
+
- Só use o node `update_group` se o flow foi criado com `conversation_mode: "group"`. Colocá-lo num flow
|
|
628
|
+
individual é rejeitado pela validação.
|
|
629
|
+
- Não use gatilho/condição de LionTrack (pagetrack) em flow de grupo.
|
|
630
|
+
- Na dúvida entre os dois, é `individual` (o default).
|
|
527
631
|
Não tente contornar criando flows intermediários.
|
|
528
632
|
|
|
529
633
|
---
|
|
@@ -573,6 +677,15 @@ Variáveis salvas em atributo (`saveTo: 'contact_attr'`/`'conversation_attr'`, o
|
|
|
573
677
|
- `out`, `output`, `next` (use o nome real do handle)
|
|
574
678
|
- `option1` sem underscore (use `option_1`)
|
|
575
679
|
|
|
680
|
+
**Handles CONDICIONAIS — só existem sob a config certa. Não ligue edge sem ativar a condição:**
|
|
681
|
+
- `no_reply_timeout` → só com `buttons_timeout > 0` no item de botões.
|
|
682
|
+
- `window_closed` → só em flow WhatsApp API oficial com item de janela.
|
|
683
|
+
- `button_<value>` → um por botão que EXISTE; se remover o botão, remova o edge.
|
|
684
|
+
- `option_<x>` → um por opção em `acceptedOptions`; idem.
|
|
685
|
+
- `cond_0..N` → um por condição no array; se tirar uma condição, o `cond_N` do fim some.
|
|
686
|
+
- `intent_<name>` → um por intent no `ai` mode intent.
|
|
687
|
+
Ligar edge num handle condicional inexistente = **aresta fantasma** (sai do nada no canvas, não roteia).
|
|
688
|
+
|
|
576
689
|
---
|
|
577
690
|
|
|
578
691
|
## 4. Layout e positioning
|
|
@@ -627,6 +740,8 @@ Nodes nunca devem ficar com a mesma coordenada `(x, y)`. Se dois nodes têm posi
|
|
|
627
740
|
| Node `condition` depois de `wait_response` com options | Redundante e atrapalha | Ligue `option_X` direto no próximo node |
|
|
628
741
|
| Edge sem `sourceHandle` | Frontend não consegue rotear | Sempre informe |
|
|
629
742
|
| Edge com `target` apontando pra ID que não existe | Quebra o grafo | Confira que `target` está em `nodes[]` |
|
|
743
|
+
| Edge `sourceHandle: "no_reply_timeout"` sem `buttons_timeout > 0` | Handle não existe sem timeout → aresta fantasma (linha saindo do nada no canvas) | Só crie esse edge se configurar o timeout no item de botões |
|
|
744
|
+
| Edge `sourceHandle: "window_closed"` fora de flow WhatsApp API oficial | Handle só existe na API oficial → aresta fantasma | Só crie em flow oficial com item de janela |
|
|
630
745
|
| `channel_type: "WhatsApp"` | Precisa do nome de classe Rails | `"Channel::Whatsapp"`, `"Channel::Waha"`, `"Channel::WebWidget"` |
|
|
631
746
|
| `validation: "option"` (singular) | Não existe | `"options"` (plural) |
|
|
632
747
|
| `varied_options` com `acceptedOptions` | Modo errado de config | `optionGroups: [{ id, terms, matchType }]` |
|
|
@@ -660,6 +775,7 @@ Antes de chamar `flows_create` ou `flows_update`, valide mentalmente:
|
|
|
660
775
|
- [ ] Nenhum par de nodes tem a mesma posição `(x, y)`
|
|
661
776
|
- [ ] Todo node tem `data` com campos do schema do tipo
|
|
662
777
|
- [ ] Todo node não-start tem pelo menos 1 edge chegando (`edge.target = node.id`)
|
|
778
|
+
- [ ] Todo `edge.sourceHandle` é um handle que o node source EXPÕE NAQUELA config (sem handle condicional inexistente: `no_reply_timeout` só com timeout, `window_closed` só API oficial, `button_<value>`/`option_<x>`/`cond_N`/`intent_<name>` só se o botão/opção/condição/intent existir)
|
|
663
779
|
- [ ] Todo edge tem `source`, `target` e `sourceHandle`
|
|
664
780
|
- [ ] Todo `sourceHandle` é um handle real exposto pelo node source (seção 2)
|
|
665
781
|
- [ ] `channel_type` é classe Rails (`Channel::Waha` etc)
|
|
@@ -121,7 +121,7 @@ Um card individual dentro de uma etapa.
|
|
|
121
121
|
| `custom_attributes` | jsonb — campos custom (igual contatos) |
|
|
122
122
|
| `assigned_agents` | jsonb array de agentes responsáveis |
|
|
123
123
|
| `activities` | jsonb array — log de atividades |
|
|
124
|
-
| `checklist` | jsonb array de tarefas dentro do card |
|
|
124
|
+
| `checklist` | jsonb array de tarefas dentro do card (item: `text`/`completed`/`position` + `group_id`/`group_name` opcionais para agrupar) |
|
|
125
125
|
| `timer_started_at`, `timer_duration` | Timer interno do card |
|
|
126
126
|
|
|
127
127
|
### item_details (detalhes do card)
|
|
@@ -224,23 +224,52 @@ Tipos comuns: `created`, `stage_changed`, `agent_assigned`, `agent_removed`, `no
|
|
|
224
224
|
|
|
225
225
|
## Checklist (tarefas dentro do card)
|
|
226
226
|
|
|
227
|
+
Array plano de itens. Cada item pode (opcionalmente) pertencer a um grupo via `group_id` +
|
|
228
|
+
`group_name`. Item SEM `group_id` = avulso (solto, fora de qualquer grupo).
|
|
229
|
+
|
|
227
230
|
```json
|
|
228
231
|
[
|
|
229
232
|
{
|
|
230
233
|
"id": "abc-123",
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
"
|
|
234
|
-
"
|
|
234
|
+
"text": "Enviar proposta por email",
|
|
235
|
+
"completed": true,
|
|
236
|
+
"position": 0,
|
|
237
|
+
"group_id": "grp-uuid-1",
|
|
238
|
+
"group_name": "Modelo Comercial"
|
|
235
239
|
},
|
|
236
240
|
{
|
|
237
241
|
"id": "abc-124",
|
|
238
|
-
"
|
|
239
|
-
"
|
|
242
|
+
"text": "Agendar follow-up",
|
|
243
|
+
"completed": false,
|
|
244
|
+
"position": 1,
|
|
245
|
+
"group_id": "grp-uuid-1",
|
|
246
|
+
"group_name": "Modelo Comercial"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"id": "abc-125",
|
|
250
|
+
"text": "Ligar amanhã",
|
|
251
|
+
"completed": false,
|
|
252
|
+
"position": 2
|
|
240
253
|
}
|
|
241
254
|
]
|
|
242
255
|
```
|
|
243
256
|
|
|
257
|
+
Campos: `text` (não `title`), `completed` (não `checked`), `position` (ordem), e o par opcional
|
|
258
|
+
`group_id`/`group_name`. `group_name` é um snapshot (não muda se o modelo for renomeado depois).
|
|
259
|
+
|
|
260
|
+
### Checklist por grupo (importante pro MCP)
|
|
261
|
+
|
|
262
|
+
- Cada **modelo de checklist aplicado** vira um **grupo independente**: todos os itens do modelo
|
|
263
|
+
recebem o mesmo `group_id` + `group_name`. Aplicar o mesmo modelo duas vezes = dois grupos.
|
|
264
|
+
- **Aplicar um modelo como grupo via MCP:** gere um `group_id` único (ex.: um UUID) e chame
|
|
265
|
+
`lionchat_kanban_items_kanban_checklist_create` uma vez por item, passando o MESMO `group_id`
|
|
266
|
+
e `group_name` em todos. (Não existe uma tool de "aplicar modelo inteiro de uma vez" — é o loop.)
|
|
267
|
+
- **Marcar/desmarcar** item: `lionchat_kanban_items_kanban_checklist_create_1` (toggle).
|
|
268
|
+
- **Remover um grupo inteiro** de uma vez: `lionchat_kanban_items_kanban_checklist_group_destroy`
|
|
269
|
+
(body `group_id`). Remover um item só: `..._checklist_destroy`.
|
|
270
|
+
- No card do quadro, cada grupo mostra sua própria barra de progresso (com 3+ grupos, o card fica
|
|
271
|
+
enxuto por padrão e expande sob demanda).
|
|
272
|
+
|
|
244
273
|
Útil pra workflows internos. Não confundir com `tasks` (que é módulo separado de tarefas globais).
|
|
245
274
|
|
|
246
275
|
## Pipeline (visão por valor)
|
|
@@ -350,7 +379,7 @@ Existem **dois sistemas paralelos** de automação. Não confundir.
|
|
|
350
379
|
|
|
351
380
|
### Sistema 1: `funnel.settings.automations` — DENTRO de um funil específico
|
|
352
381
|
|
|
353
|
-
Automações que rodam ao
|
|
382
|
+
Automações que rodam ao criar um card, mover de etapa ou mudar o STATUS (Ganho/Perdido). Atuam sobre o card e podem mover/duplicar entre funis. **Configurado por funil**, dentro de `funnel.settings.automations`.
|
|
354
383
|
|
|
355
384
|
```json
|
|
356
385
|
PUT /api/v1/accounts/43/funnels/43
|
|
@@ -361,22 +390,23 @@ PUT /api/v1/accounts/43/funnels/43
|
|
|
361
390
|
{
|
|
362
391
|
"id": "automation_1776517249424",
|
|
363
392
|
"enabled": true,
|
|
364
|
-
"trigger_type": "
|
|
393
|
+
"trigger_type": "status_change",
|
|
365
394
|
"trigger_value": "won",
|
|
366
|
-
"action": "
|
|
395
|
+
"action": "duplicate_item",
|
|
367
396
|
"action_config": {
|
|
368
|
-
"
|
|
369
|
-
"
|
|
397
|
+
"funnel_id": 44,
|
|
398
|
+
"stage": "agendar_instalacao"
|
|
370
399
|
}
|
|
371
400
|
},
|
|
372
401
|
{
|
|
402
|
+
"id": "automation_1776517249425",
|
|
403
|
+
"enabled": true,
|
|
373
404
|
"trigger_type": "card_created",
|
|
374
405
|
"trigger_value": "card_created",
|
|
375
406
|
"action": "apply_checklist_template",
|
|
376
407
|
"action_config": {
|
|
377
408
|
"template_id": "ct-onboarding-001"
|
|
378
|
-
}
|
|
379
|
-
"enabled": true
|
|
409
|
+
}
|
|
380
410
|
}
|
|
381
411
|
]
|
|
382
412
|
}
|
|
@@ -384,10 +414,35 @@ PUT /api/v1/accounts/43/funnels/43
|
|
|
384
414
|
}
|
|
385
415
|
```
|
|
386
416
|
|
|
387
|
-
**Triggers
|
|
388
|
-
|
|
417
|
+
**Triggers (`trigger_type` + `trigger_value` — SEMPRE preencher os dois):**
|
|
418
|
+
|
|
419
|
+
| trigger_type | trigger_value |
|
|
420
|
+
|---|---|
|
|
421
|
+
| `card_created` | `"card_created"` (literal — NUNCA vazio) |
|
|
422
|
+
| `status_change` | `"won"` ou `"lost"` |
|
|
423
|
+
| `stage_moved` | chave da etapa de DESTINO no hash `funnel.stages` (ex. `"agendar_instalacao"` — a chave, NÃO o campo `id` interno) |
|
|
424
|
+
|
|
425
|
+
**Ações (`action` + `action_config`):**
|
|
389
426
|
|
|
390
|
-
|
|
427
|
+
| action | action_config | Observação |
|
|
428
|
+
|---|---|---|
|
|
429
|
+
| `move_to_stage` | `{stage}` | NUNCA executa com trigger `stage_moved` (anti-loop do backend) |
|
|
430
|
+
| `assign_agent` | `{agent_id}` | Agente precisa ter acesso ao funil, senão é ignorado |
|
|
431
|
+
| `create_note` | `{note_text}` | Cria nota no card com autor "Sistema" |
|
|
432
|
+
| `notify_team` | `{message}` | HOJE só registra em log interno — não notifica ninguém de verdade |
|
|
433
|
+
| `duplicate_item` | `{funnel_id, stage}` | Cria cópia noutro funil/etapa; título ganha sufixo "(cópia)" |
|
|
434
|
+
| `send_webhook` | `{webhook_url}` | POST com payload completo do card (fire-and-forget) |
|
|
435
|
+
| `apply_checklist_template` | `{template_id}` | Template de `kanban_config.checklist_templates`; aditivo (appenda) — cada aplicação vira um grupo (carimba `group_id`/`group_name` nos itens) |
|
|
436
|
+
| `update_checklist` | `{checklist_updates: [{checklist_item_id, completed, text}]}` | Não aparece na UI — só via API |
|
|
437
|
+
|
|
438
|
+
**Regras críticas (gravar diferente disso = automação perdida ou morta):**
|
|
439
|
+
|
|
440
|
+
- `trigger_value` vazio ou `enabled: false` → a UI DESCARTA a automação no próximo "Salvar" do usuário. Nunca grave automação desabilitada "pra ativar depois".
|
|
441
|
+
- Nomes de trigger/action fora das tabelas acima (ex.: `status_changed`, `duplicate_to_funnel`, `send_message`, `set_priority` — NÃO existem) são salvos mas NUNCA disparam, sem erro nenhum.
|
|
442
|
+
- `id` no formato `automation_<timestamp_ms>` — a UI usa pra editar/remover a automação.
|
|
443
|
+
- Trigger `card_created` + ação `duplicate_item` funciona (backend tem anti-loop), mas a UI esconde essa combinação.
|
|
444
|
+
|
|
445
|
+
Use para: "ao ganhar um card de Vendas → criar automaticamente em Pós-Venda na etapa Agendar Instalação" (`status_change`/`won` + `duplicate_item`).
|
|
391
446
|
|
|
392
447
|
### Sistema 2: AutomationRule global — eventos da conta
|
|
393
448
|
|
package/dist/tools.js
CHANGED
|
@@ -283,12 +283,15 @@ function registerListCategoriesTool(server, allEndpoints) {
|
|
|
283
283
|
// Helps LLMs build correct flow_data without hitting trial-and-error on
|
|
284
284
|
// node types, action keys, source handles, etc.
|
|
285
285
|
function registerFlowsSchemaReferenceTool(server) {
|
|
286
|
-
const reference = `LIONCHAT FLOW BUILDER — SCHEMA REFERENCE (atualizado 2026-
|
|
286
|
+
const reference = `LIONCHAT FLOW BUILDER — SCHEMA REFERENCE (atualizado 2026-07-03)
|
|
287
287
|
|
|
288
288
|
flow_data tem o formato Vue Flow: { nodes: [...], edges: [...] }.
|
|
289
289
|
|
|
290
|
-
═══ DOIS TIPOS DE FLOW ═══
|
|
290
|
+
═══ DOIS TIPOS DE FLOW (e o modo do conversation) ═══
|
|
291
291
|
- conversation (default): dispara por evento de inbox. Criar via lionchat_flows_create.
|
|
292
|
+
conversation_mode: 'individual' (1-a-1, default) ou 'group' (grupo WhatsApp). IMUTAVEL apos criar.
|
|
293
|
+
So 'group' aceita o node update_group (Configurar Grupo: nome/foto/permissoes). 'group' NAO tem
|
|
294
|
+
gatilhos/condicoes de LionTrack (pagetrack). Na UI aparecem como 3 opcoes: Mensagem / Grupo / IA Agente.
|
|
292
295
|
- ai_tool: ferramenta que o AI Agente invoca. Criar via lionchat_flow_tools_create (NAO flows_create!),
|
|
293
296
|
com tool_name (snake_case, max 50) + tool_description (max 500). SEM inbox_ids. No 'end' OBRIGATORIO.
|
|
294
297
|
Nodes permitidos em ai_tool: start, end, api, condition, set_variable, ai, randomizer, action,
|
|
@@ -327,6 +330,10 @@ flow_data tem o formato Vue Flow: { nodes: [...], edges: [...] }.
|
|
|
327
330
|
ATENCAO: messageItems (NAO items).
|
|
328
331
|
Botoes: item text com buttons_enabled=true + buttons:[{title,value}] gera handle "button_{value}"
|
|
329
332
|
por botao + "no_response" (texto livre em vez de clique) + "no_reply_timeout" (se timeout).
|
|
333
|
+
Timeout (opcional, mesmo item): buttons_timeout + buttons_timeout_unit (minutes|hours|days).
|
|
334
|
+
buttons_timeout_action: "advance" (padrao, segue no_reply_timeout ao esgotar) | "remind" (manda 1
|
|
335
|
+
lembrete buttons_reminder_text e CONTINUA esperando; depois segue no_reply_timeout). No modo remind
|
|
336
|
+
a unidade NAO pode ser days e horas <= 23 (janela 24h do WhatsApp).
|
|
330
337
|
Handles sem botoes: "success", "error".
|
|
331
338
|
|
|
332
339
|
▸ wait_response
|
|
@@ -373,7 +380,9 @@ flow_data tem o formato Vue Flow: { nodes: [...], edges: [...] }.
|
|
|
373
380
|
Operadores: equal/not_equal, contains/not_contains, starts_with/ends_with,
|
|
374
381
|
is_empty/is_not_empty (NAO existe is_present/is_blank), greater_than/less_than,
|
|
375
382
|
number_range ("min-max"), regex, equal_any/contains_any (values[]),
|
|
376
|
-
business_hours/outside_business_hours (campos opcionais days[0=dom..6=sab]/start_hour/end_hour
|
|
383
|
+
business_hours/outside_business_hours (campos opcionais days[0=dom..6=sab]/start_hour/end_hour/timezone
|
|
384
|
+
IANA ex. America/Sao_Paulo; outside_business_hours HERDA days/start_hour/end_hour/timezone da
|
|
385
|
+
business_hours ANTERIOR no array — pode deixar ausentes que o backend preenche),
|
|
377
386
|
can_reply/can_reply_closed, conversation_has_agent/no_agent,
|
|
378
387
|
contact_has_label/conversation_has_label,
|
|
379
388
|
kanban_exists/kanban_in_stage/kanban_won/kanban_lost, pagetrack_visited/pagetrack_event,
|
|
@@ -397,7 +406,8 @@ flow_data tem o formato Vue Flow: { nodes: [...], edges: [...] }.
|
|
|
397
406
|
Kanban: create_kanban_item({funnel_id, funnel_stage, title?, description?})
|
|
398
407
|
— funnel_id e funnel_stage OBRIGATORIOS; title/description aceitam {{ }},
|
|
399
408
|
move_kanban_stage({funnel_id,funnel_stage}), set_kanban_item_status({status:won|lost|active}),
|
|
400
|
-
set_won({}), set_lost({reason?}), assign_agent_card({agent_id}), add_card_note({content})
|
|
409
|
+
set_won({}), set_lost({reason?}), assign_agent_card({agent_id}), add_card_note({content}),
|
|
410
|
+
add_card_checklist({template_id}) — aplica um modelo de checklist ao card (vira grupo)
|
|
401
411
|
Sistema (SO flow conversation): send_webhook({url,headers?,body?}), start_flow({flow_id}),
|
|
402
412
|
deactivate_flow({})
|
|
403
413
|
Handles: "success" (sem handle error — falha vira warning e o flow continua).
|
|
@@ -420,9 +430,15 @@ flow_data tem o formato Vue Flow: { nodes: [...], edges: [...] }.
|
|
|
420
430
|
Handle: "success"
|
|
421
431
|
|
|
422
432
|
▸ wait
|
|
423
|
-
data:
|
|
424
|
-
|
|
425
|
-
|
|
433
|
+
data.waitMode: "duration" (default) | "date" | "weekday"
|
|
434
|
+
duration: waitDuration + waitUnit (seconds|minutes|hours|days)
|
|
435
|
+
date: waitDate ("YYYY-MM-DD") + waitTime ("HH:MM" 24h) + waitTimezone (IANA, default America/Sao_Paulo)
|
|
436
|
+
+ waitDateMode/waitTimeMode ("fixed"|"variable"). Em "variable" o campo contem {{contact.custom_attribute.X}}
|
|
437
|
+
(Data SO aceita atributo tipo date; Horario SO tipo time). Resolve UMA vez na entrada do node.
|
|
438
|
+
Variavel invalida -> saida "error" (invalid_variable_datetime). Data no passado -> segue por "success".
|
|
439
|
+
weekday: waitWeekday (0=dom..6=sab) + waitWeekdayTime ("HH:MM", SEMPRE fixo, sem variavel) + waitTimezone
|
|
440
|
+
(NAO existem waitUnit:"weekday", targetWeekday nem targetHour — erro de doc antiga)
|
|
441
|
+
Handles: "success" (+ "error" so com variavel invalida no modo date)
|
|
426
442
|
|
|
427
443
|
▸ randomizer
|
|
428
444
|
data: { label, mode:"branches", branches:[{id,label,weight}] }
|
|
@@ -436,7 +452,10 @@ flow_data tem o formato Vue Flow: { nodes: [...], edges: [...] }.
|
|
|
436
452
|
data define o retorno estruturado pro LLM (suporta saida Liquid com {{ }}).
|
|
437
453
|
|
|
438
454
|
▸ note
|
|
439
|
-
Sticky note visual. Sem handles, nunca executa, nao ligue edges.
|
|
455
|
+
Sticky note visual (bloco colorido de anotacao). Sem handles, nunca executa, nao ligue edges.
|
|
456
|
+
data: title (cabecalho), body (corpo), color (yellow|teal|blue|violet|pink|orange|slate, default yellow),
|
|
457
|
+
width (px, default 320, min 200), height (px, default 200, min 80). ATENCAO: texto vai em title+body,
|
|
458
|
+
NUNCA em 'content' (usar content grava nota vazia). Disponivel nos 2 tipos de flow.
|
|
440
459
|
|
|
441
460
|
═══ VARIAVEIS {{ }} ═══
|
|
442
461
|
contact.name, contact.email, contact.phone, contact.custom_attribute.X (SINGULAR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,QAAQ,EAAE,CAAC;QAChC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;IAED,wEAAwE;IACxE,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,0BAA0B,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC9C,gCAAgC,CAAC,MAAM,CAAC,CAAC;IAEzC,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,uDAAuD;AACrF,CAAC"}
|
package/endpoints.json
CHANGED
|
@@ -2381,7 +2381,7 @@
|
|
|
2381
2381
|
"type": "object",
|
|
2382
2382
|
"location": "body",
|
|
2383
2383
|
"required": false,
|
|
2384
|
-
"description": "Objeto de configuracoes do funil. Chaves: goals[], agents[] e automations[] (automacoes do funil). Cada automacao: {id, enabled, trigger_type: 'card_created'|'stage_moved'|'status_change', trigger_value (
|
|
2384
|
+
"description": "Objeto de configuracoes do funil. Chaves: goals[], agents[] e automations[] (automacoes do funil). Cada automacao: {id (formato 'automation_<timestamp_ms>'), enabled: true, trigger_type: 'card_created'|'stage_moved'|'status_change', trigger_value SEMPRE preenchido ('card_created' literal p/ card_created; chave da etapa de destino no hash funnel.stages p/ stage_moved; 'won'|'lost' p/ status_change), action: 'move_to_stage'|'assign_agent'|'create_note'|'update_checklist'|'apply_checklist_template'|'notify_team'|'duplicate_item'|'send_webhook', action_config: {} (move_to_stage->{stage}; assign_agent->{agent_id}; create_note->{note_text}; update_checklist->{checklist_updates:[{checklist_item_id,completed,text}]}; apply_checklist_template->{template_id}; notify_team->{message}; send_webhook->{webhook_url}; duplicate_item->{funnel_id,stage})}. Regras: trigger_value vazio ou enabled=false fazem a UI descartar a automacao no proximo salvar do usuario; stage_moved + move_to_stage nunca executa (anti-loop); notify_team hoje so registra em log (nao notifica ninguem); update_checklist nao aparece na UI (so via API). ATENCAO: gravar settings SUBSTITUI o objeto inteiro — leia o funil (show) e reenvie settings completo (goals+agents+automations)."
|
|
2385
2385
|
}
|
|
2386
2386
|
],
|
|
2387
2387
|
"returns": "funil atualizado",
|
|
@@ -9120,7 +9120,7 @@
|
|
|
9120
9120
|
"method": "POST",
|
|
9121
9121
|
"path": "/api/v1/accounts/{account_id}/flows",
|
|
9122
9122
|
"title": "Criar Flow",
|
|
9123
|
-
"description": "Cria um flow (FlowBuilder) na conta. Requer Admin. flow_data segue formato Vue Flow {nodes:[], edges:[]}. NODE SCHEMA — start: {label}. send_message: {label, messageItems:[{id, type:'text', content}]} handles: success/no_response/error. wait_response: {label, waitTime, waitUnit:'minutes'|'seconds', validation:'any'|'options'|'regex', acceptedOptions:['1','2'] (se options), regexPattern (se regex), invalidMessage, maxRetries:3, saveTo:'variable'|'contact_name'|'contact_email'|'contact_phone'|'contact_attr'|'conversation_attr'|'', saveVariable, saveAttrKey} — quando validation='options' os handles ficam 'option_{val}' + 'timeout'; senão 'success' + 'timeout' — NUNCA precisa de condition node depois. condition: {label, conditions:[{id, label, field, operator, value}]} handles = 'cond_0','cond_1',... (INDICE no array, NAO o id) + 'default'. action: {label, items:[{key, config:{...}}]} keys comuns assign_team({team_id}), assign_agent({agent_id}), add_label({labels:['slug',...]}), remove_label({labels}), change_status({status}), change_priority({priority}), mute_conversation({}), add_private_note({content}), create_kanban_item({funnel_id, funnel_stage,...}), move_kanban_stage({funnel_id, funnel_stage}), deactivate_flow({}), assign_captain({assistant_id}). api: {label, method, url, headers:[{key,value}], body, apiResponseVar}. set_variable: {label, variables:[{name, value}]}. wait: {label, waitTime, waitUnit}. EDGE SCHEMA: {id, source, target, sourceHandle (opcional, OBRIGATORIO casar com handle exposto pelo node source), type:'deletable', animated:true}. ERROS COMUNS QUE DEVEM SER EVITADOS: (1) action usa items[].config NAO items[].params; (2) send_message usa messageItems NAO items; (3) wait_response com validation='options' NAO precisa de condition node — use sourceHandle='option_X' diretamente; (4) sourceHandle inventado tipo 'c1','c2' nao funciona — sempre usar o handle real; (5) inbox_ids precisa vir aninhado em {flow:{inbox_ids:[]}} no PUT bruto, mas no MCP basta inbox_ids no nivel raiz. Cria novo flow. Obrigatórios: name, channel_type. Valida unicidade quando aplicável. Retorna o flow criado com ID atribuído. POSITIONING (CRITICO): cada node DEVE ter position:{x,y}. Sem isso, todos empilham no canvas no (0,0). Regra basica de layout: start em {x:50,y:300}, espaco horizontal +320 entre nodes sequenciais, ramificacoes em +/-150 vertical. ANTES DE GERAR JSON consulte o resource lionchat://docs/flowbuilder-design-guide (schema completo de cada tipo de node, handles expostos, erros comuns, checklist) e lionchat://docs/flowbuilder-patterns (10 templates prontos pra adaptar). BRAINSTORMING: se faltou info critica (canal, gatilho, conteudo), use o prompt create_flow_brainstorm como banco de perguntas sugeridas — pergunte SO o que falta, sem checklist forcado. APOS GERAR: rode o checklist da secao 6 do design guide antes de submeter (1 node start, todo node com id unico + position + data, todo edge com sourceHandle valido). NUNCA invente sourceHandle (no condition use cond_0/cond_1/default, no wait_response options use option_X, no AI intent use intent_<opcao>). IMPORTANTE: chame lionchat_flows_schema_reference antes pra ver o schema COMPLETO e atualizado (nodes end/ai/note, etiqueta conversa vs contato, webhook embutido, timeout, anti-loop). Pra ferramentas da IA (ai_tool) use lionchat_flow_tools_create.",
|
|
9123
|
+
"description": "Cria um flow (FlowBuilder) na conta. Requer Admin. flow_data segue formato Vue Flow {nodes:[], edges:[]}. NODE SCHEMA — start: {label}. send_message: {label, messageItems:[{id, type:'text', content}]} handles: success/no_response/error. wait_response: {label, waitTime, waitUnit:'minutes'|'seconds', validation:'any'|'options'|'regex', acceptedOptions:['1','2'] (se options), regexPattern (se regex), invalidMessage, maxRetries:3, saveTo:'variable'|'contact_name'|'contact_email'|'contact_phone'|'contact_attr'|'conversation_attr'|'', saveVariable, saveAttrKey} — quando validation='options' os handles ficam 'option_{val}' + 'timeout'; senão 'success' + 'timeout' — NUNCA precisa de condition node depois. condition: {label, conditions:[{id, label, field, operator, value}]} handles = 'cond_0','cond_1',... (INDICE no array, NAO o id) + 'default'. action: {label, items:[{key, config:{...}}]} keys comuns assign_team({team_id}), assign_agent({agent_id}), add_label({labels:['slug',...]}), remove_label({labels}), change_status({status}), change_priority({priority}), mute_conversation({}), add_private_note({content}), create_kanban_item({funnel_id, funnel_stage,...}), move_kanban_stage({funnel_id, funnel_stage}), deactivate_flow({}), assign_captain({assistant_id}). api: {label, method, url, headers:[{key,value}], body, apiResponseVar}. set_variable: {label, variables:[{name, value}]}. wait: {label, waitTime, waitUnit}. EDGE SCHEMA: {id, source, target, sourceHandle (opcional, OBRIGATORIO casar com handle exposto pelo node source), type:'deletable', animated:true}. ERROS COMUNS QUE DEVEM SER EVITADOS: (1) action usa items[].config NAO items[].params; (2) send_message usa messageItems NAO items; (3) wait_response com validation='options' NAO precisa de condition node — use sourceHandle='option_X' diretamente; (4) sourceHandle inventado tipo 'c1','c2' nao funciona — sempre usar o handle real; (5) inbox_ids precisa vir aninhado em {flow:{inbox_ids:[]}} no PUT bruto, mas no MCP basta inbox_ids no nivel raiz. Cria novo flow. Obrigatórios: name, channel_type. Valida unicidade quando aplicável. Retorna o flow criado com ID atribuído. POSITIONING (CRITICO): cada node DEVE ter position:{x,y}. Sem isso, todos empilham no canvas no (0,0). Regra basica de layout: start em {x:50,y:300}, espaco horizontal +320 entre nodes sequenciais, ramificacoes em +/-150 vertical. ANTES DE GERAR JSON consulte o resource lionchat://docs/flowbuilder-design-guide (schema completo de cada tipo de node, handles expostos, erros comuns, checklist) e lionchat://docs/flowbuilder-patterns (10 templates prontos pra adaptar). BRAINSTORMING: se faltou info critica (canal, gatilho, conteudo), use o prompt create_flow_brainstorm como banco de perguntas sugeridas — pergunte SO o que falta, sem checklist forcado. APOS GERAR: rode o checklist da secao 6 do design guide antes de submeter (1 node start, todo node com id unico + position + data, todo edge com sourceHandle valido). NUNCA invente sourceHandle (no condition use cond_0/cond_1/default, no wait_response options use option_X, no AI intent use intent_<opcao>). IMPORTANTE: chame lionchat_flows_schema_reference antes pra ver o schema COMPLETO e atualizado (nodes end/ai/note, etiqueta conversa vs contato, webhook embutido, timeout, anti-loop). Pra ferramentas da IA (ai_tool) use lionchat_flow_tools_create. conversation_mode: 'individual' (default) | 'group'. Sticky note (type 'note'): data usa title+body+color(yellow|teal|blue|violet|pink|orange|slate)+width+height — NUNCA 'content'.",
|
|
9124
9124
|
"category": "Flows",
|
|
9125
9125
|
"params": [
|
|
9126
9126
|
{
|
|
@@ -9144,6 +9144,13 @@
|
|
|
9144
9144
|
"required": true,
|
|
9145
9145
|
"description": "Tipo de canal (ex: Channel::Waha, Channel::WebWidget, Channel::Whatsapp)"
|
|
9146
9146
|
},
|
|
9147
|
+
{
|
|
9148
|
+
"name": "conversation_mode",
|
|
9149
|
+
"type": "string",
|
|
9150
|
+
"location": "body",
|
|
9151
|
+
"required": false,
|
|
9152
|
+
"description": "Modo do flow conversation: 'individual' (1-a-1, default) ou 'group' (grupo de WhatsApp). IMUTAVEL apos criar. So flow 'group' aceita o node 'update_group' (Configurar Grupo: nome/foto/permissoes, WAHA); flow 'group' NAO tem gatilhos/condicoes de LionTrack (pagetrack). Nao aplica a ai_tool."
|
|
9153
|
+
},
|
|
9147
9154
|
{
|
|
9148
9155
|
"name": "inbox_ids",
|
|
9149
9156
|
"type": "array",
|
|
@@ -11761,7 +11768,7 @@
|
|
|
11761
11768
|
"method": "POST",
|
|
11762
11769
|
"path": "/api/v1/accounts/{account_id}/kanban_items/{id}/create_checklist_item",
|
|
11763
11770
|
"title": "Criar Checklist",
|
|
11764
|
-
"description": "Adiciona item ao checklist
|
|
11771
|
+
"description": "Adiciona um item ao checklist do card. Obrigatórios: id (card), text. Opcionais: group_id + group_name para colocar o item dentro de um grupo (ex.: um modelo de checklist). Sem group_id o item entra como AVULSO. Para montar/aplicar um grupo, envie o MESMO group_id (e group_name) em todos os itens daquele grupo. Retorna o card completo.",
|
|
11765
11772
|
"category": "Checklist",
|
|
11766
11773
|
"params": [
|
|
11767
11774
|
{
|
|
@@ -11777,10 +11784,25 @@
|
|
|
11777
11784
|
"location": "body",
|
|
11778
11785
|
"required": true,
|
|
11779
11786
|
"description": "Texto"
|
|
11787
|
+
},
|
|
11788
|
+
{
|
|
11789
|
+
"name": "group_id",
|
|
11790
|
+
"type": "string",
|
|
11791
|
+
"location": "body",
|
|
11792
|
+
"required": false,
|
|
11793
|
+
"description": "Opcional. ID do grupo (string única por grupo, ex.: um UUID). Itens com o mesmo group_id formam um grupo. Ausente = item avulso."
|
|
11794
|
+
},
|
|
11795
|
+
{
|
|
11796
|
+
"name": "group_name",
|
|
11797
|
+
"type": "string",
|
|
11798
|
+
"location": "body",
|
|
11799
|
+
"required": false,
|
|
11800
|
+
"description": "Opcional. Nome do grupo exibido no card (ex.: nome do modelo de checklist). Enviar junto com group_id."
|
|
11780
11801
|
}
|
|
11781
11802
|
],
|
|
11782
11803
|
"returns": "card completo (com o item de checklist)",
|
|
11783
11804
|
"common_use_cases": [
|
|
11805
|
+
"Aplicar um modelo de checklist como grupo (mesmo group_id/group_name em todos os itens)",
|
|
11784
11806
|
"Cadastro inicial de item de checklist",
|
|
11785
11807
|
"Automação a partir de evento externo",
|
|
11786
11808
|
"Importação manual via API"
|
|
@@ -11823,8 +11845,8 @@
|
|
|
11823
11845
|
"id": "lionchat_kanban_items_kanban_checklist_create_1",
|
|
11824
11846
|
"method": "POST",
|
|
11825
11847
|
"path": "/api/v1/accounts/{account_id}/kanban_items/{id}/toggle_checklist_item",
|
|
11826
|
-
"title": "
|
|
11827
|
-
"description": "Marca
|
|
11848
|
+
"title": "Marcar/Desmarcar Item",
|
|
11849
|
+
"description": "Marca ou desmarca (alterna) um item do checklist como concluído. Obrigatórios: id (card), checklist_item_id. Retorna o card com o item alternado.",
|
|
11828
11850
|
"category": "Checklist",
|
|
11829
11851
|
"params": [
|
|
11830
11852
|
{
|
|
@@ -11844,9 +11866,9 @@
|
|
|
11844
11866
|
],
|
|
11845
11867
|
"returns": "card completo (item de checklist alternado)",
|
|
11846
11868
|
"common_use_cases": [
|
|
11847
|
-
"
|
|
11848
|
-
"
|
|
11849
|
-
"
|
|
11869
|
+
"Marcar uma tarefa do checklist como concluída",
|
|
11870
|
+
"Desmarcar uma tarefa concluída por engano",
|
|
11871
|
+
"Automação a partir de evento externo"
|
|
11850
11872
|
],
|
|
11851
11873
|
"related_tools": [
|
|
11852
11874
|
"lionchat_kanban_items_list",
|
|
@@ -11931,6 +11953,41 @@
|
|
|
11931
11953
|
"lionchat_kanban_items_show"
|
|
11932
11954
|
]
|
|
11933
11955
|
},
|
|
11956
|
+
{
|
|
11957
|
+
"id": "lionchat_kanban_items_kanban_checklist_group_destroy",
|
|
11958
|
+
"method": "DELETE",
|
|
11959
|
+
"path": "/api/v1/accounts/{account_id}/kanban_items/{id}/delete_checklist_group",
|
|
11960
|
+
"title": "Remover Grupo de Checklist",
|
|
11961
|
+
"description": "Remove de uma vez TODOS os itens de um grupo de checklist do card. Obrigatórios: id (card), group_id. Os itens avulsos e os demais grupos permanecem intactos. CUIDADO: irreversível.",
|
|
11962
|
+
"category": "Checklist",
|
|
11963
|
+
"params": [
|
|
11964
|
+
{
|
|
11965
|
+
"name": "id",
|
|
11966
|
+
"type": "integer",
|
|
11967
|
+
"location": "path",
|
|
11968
|
+
"required": true,
|
|
11969
|
+
"description": "ID do card (kanban_item)"
|
|
11970
|
+
},
|
|
11971
|
+
{
|
|
11972
|
+
"name": "group_id",
|
|
11973
|
+
"type": "string",
|
|
11974
|
+
"location": "body",
|
|
11975
|
+
"required": true,
|
|
11976
|
+
"description": "ID do grupo (o group_id compartilhado pelos itens) a remover"
|
|
11977
|
+
}
|
|
11978
|
+
],
|
|
11979
|
+
"returns": "card completo (sem o grupo)",
|
|
11980
|
+
"common_use_cases": [
|
|
11981
|
+
"Remover um modelo de checklist aplicado por engano",
|
|
11982
|
+
"Limpar um grupo de tarefas inteiro de uma vez",
|
|
11983
|
+
"Trocar um grupo por outro"
|
|
11984
|
+
],
|
|
11985
|
+
"related_tools": [
|
|
11986
|
+
"lionchat_kanban_items_kanban_checklist_create",
|
|
11987
|
+
"lionchat_kanban_items_kanban_checklist_list",
|
|
11988
|
+
"lionchat_kanban_items_show"
|
|
11989
|
+
]
|
|
11990
|
+
},
|
|
11934
11991
|
{
|
|
11935
11992
|
"id": "lionchat_conversations_flow_sessions_list",
|
|
11936
11993
|
"method": "GET",
|
|
@@ -20169,7 +20226,14 @@
|
|
|
20169
20226
|
"type": "string",
|
|
20170
20227
|
"location": "body",
|
|
20171
20228
|
"required": true,
|
|
20172
|
-
"description": "Tipo de exibicao: text, number, link, date, list, checkbox, currency, percent ou secret"
|
|
20229
|
+
"description": "Tipo de exibicao: text, number, link, date, time (Hora 24h — valor canonico HH:MM; fuso mora em attribute_timezone), list, checkbox, currency, percent ou secret"
|
|
20230
|
+
},
|
|
20231
|
+
{
|
|
20232
|
+
"name": "attribute_timezone",
|
|
20233
|
+
"type": "string",
|
|
20234
|
+
"location": "body",
|
|
20235
|
+
"required": false,
|
|
20236
|
+
"description": "Fuso horario IANA da definicao (so faz sentido pro tipo time/Hora; default America/Sao_Paulo). O VALOR do atributo time e sempre HH:MM 24h sem fuso embutido — o fuso mora aqui."
|
|
20173
20237
|
},
|
|
20174
20238
|
{
|
|
20175
20239
|
"name": "attribute_key",
|
|
@@ -20282,7 +20346,14 @@
|
|
|
20282
20346
|
"type": "string",
|
|
20283
20347
|
"location": "body",
|
|
20284
20348
|
"required": false,
|
|
20285
|
-
"description": "Tipo de exibicao: text, number, link, date, list, checkbox, currency, percent ou secret"
|
|
20349
|
+
"description": "Tipo de exibicao: text, number, link, date, time (Hora 24h — valor canonico HH:MM; fuso mora em attribute_timezone), list, checkbox, currency, percent ou secret"
|
|
20350
|
+
},
|
|
20351
|
+
{
|
|
20352
|
+
"name": "attribute_timezone",
|
|
20353
|
+
"type": "string",
|
|
20354
|
+
"location": "body",
|
|
20355
|
+
"required": false,
|
|
20356
|
+
"description": "Fuso horario IANA da definicao (so faz sentido pro tipo time/Hora; default America/Sao_Paulo). O VALOR do atributo time e sempre HH:MM 24h sem fuso embutido — o fuso mora aqui."
|
|
20286
20357
|
},
|
|
20287
20358
|
{
|
|
20288
20359
|
"name": "attribute_key",
|
|
@@ -24701,6 +24772,32 @@
|
|
|
24701
24772
|
"lionchat_contacts_update"
|
|
24702
24773
|
]
|
|
24703
24774
|
},
|
|
24775
|
+
{
|
|
24776
|
+
"id": "lionchat_conversations_captain_history_reset",
|
|
24777
|
+
"method": "POST",
|
|
24778
|
+
"path": "/api/v1/accounts/{account_id}/conversations/{conversation_id}/captain_history_reset",
|
|
24779
|
+
"title": "Resetar Historico da IA na Conversa",
|
|
24780
|
+
"description": "Cria um marco de reset na conversa: a partir dele, TODA leitura autonoma da IA (respostas do AI Agente, resumos automaticos, follow-up, nos de IA do FlowBuilder) considera apenas mensagens posteriores ao marco. Nao apaga nada — o atendente continua vendo a conversa inteira. Uso tipico: testar um prompt/cenario novo do zero na mesma conversa. Enterprise-only. Sem body.",
|
|
24781
|
+
"category": "IA / Captain",
|
|
24782
|
+
"params": [
|
|
24783
|
+
{
|
|
24784
|
+
"name": "conversation_id",
|
|
24785
|
+
"type": "integer",
|
|
24786
|
+
"location": "path",
|
|
24787
|
+
"required": true,
|
|
24788
|
+
"description": "ID de exibicao da conversa (display_id)"
|
|
24789
|
+
}
|
|
24790
|
+
],
|
|
24791
|
+
"returns": "{ message_id } da pilula de marco criada",
|
|
24792
|
+
"common_use_cases": [
|
|
24793
|
+
"Testar como a IA responde do zero apos mudar prompt/cenario, sem criar outra conversa",
|
|
24794
|
+
"Fazer a IA esquecer contexto antigo ja superado numa conversa longa"
|
|
24795
|
+
],
|
|
24796
|
+
"related_tools": [
|
|
24797
|
+
"lionchat_captain_assistants_update",
|
|
24798
|
+
"lionchat_conversations_show"
|
|
24799
|
+
]
|
|
24800
|
+
},
|
|
24704
24801
|
{
|
|
24705
24802
|
"id": "lionchat_wavoip_should_ring",
|
|
24706
24803
|
"method": "GET",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lionchat/mcp-server",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"description": "MCP server for LionChat API — 547 tools + 10 resources + 9 prompts. Audit-log aware, completion API, progress notifications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|